Class AccessPolicy.Builder (1.44.0)

public static final class AccessPolicy.Builder extends GeneratedMessageV3.Builder<AccessPolicy.Builder> implements AccessPolicyOrBuilder

AccessPolicy is a container for AccessLevels (which define the necessary attributes to use Google Cloud services) and ServicePerimeters (which define regions of services able to freely pass data within a perimeter). An access policy is globally visible within an organization, and the restrictions it specifies apply to all projects within an organization.

Protobuf type google.identity.accesscontextmanager.v1.AccessPolicy

Static Methods

getDescriptor()

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

Methods

addAllScopes(Iterable<String> values)

public AccessPolicy.Builder addAllScopes(Iterable<String> values)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameter
Name Description
values Iterable<String>

The scopes to add.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addScopes(String value)

public AccessPolicy.Builder addScopes(String value)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameter
Name Description
value String

The scopes to add.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

addScopesBytes(ByteString value)

public AccessPolicy.Builder addScopesBytes(ByteString value)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameter
Name Description
value ByteString

The bytes of the scopes to add.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

build()

public AccessPolicy build()
Returns
Type Description
AccessPolicy

buildPartial()

public AccessPolicy buildPartial()
Returns
Type Description
AccessPolicy

clear()

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

clearCreateTime()

public AccessPolicy.Builder clearCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
Type Description
AccessPolicy.Builder

clearEtag()

public AccessPolicy.Builder clearEtag()

Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.

string etag = 6;

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public AccessPolicy.Builder clearName()

Output only. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}

string name = 1;

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearParent()

public AccessPolicy.Builder clearParent()

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}

string parent = 2;

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

clearScopes()

public AccessPolicy.Builder clearScopes()

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

clearTitle()

public AccessPolicy.Builder clearTitle()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

clearUpdateTime()

public AccessPolicy.Builder clearUpdateTime()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
Type Description
AccessPolicy.Builder

clone()

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

getCreateTime()

public Timestamp getCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
Type Description
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
Type Description
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public AccessPolicy getDefaultInstanceForType()
Returns
Type Description
AccessPolicy

getDescriptorForType()

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

getEtag()

public String getEtag()

Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.

string etag = 6;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.

string etag = 6;

Returns
Type Description
ByteString

The bytes for etag.

getName()

public String getName()

Output only. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParent()

public String getParent()

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}

string parent = 2;

Returns
Type Description
String

The parent.

getParentBytes()

public ByteString getParentBytes()

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}

string parent = 2;

Returns
Type Description
ByteString

The bytes for parent.

getScopes(int index)

public String getScopes(int index)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The scopes at the given index.

getScopesBytes(int index)

public ByteString getScopesBytes(int index)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the scopes at the given index.

getScopesCount()

public int getScopesCount()

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Returns
Type Description
int

The count of scopes.

getScopesList()

public ProtocolStringList getScopesList()

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Returns
Type Description
ProtocolStringList

A list containing the scopes.

getTitle()

public String getTitle()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
Type Description
String

The title.

getTitleBytes()

public ByteString getTitleBytes()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
Type Description
ByteString

The bytes for title.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
Type Description
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
Type Description
boolean

Whether the createTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
Type Description
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCreateTime(Timestamp value)

public AccessPolicy.Builder mergeCreateTime(Timestamp value)

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Parameter
Name Description
value Timestamp
Returns
Type Description
AccessPolicy.Builder

mergeFrom(AccessPolicy other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

mergeUpdateTime(Timestamp value)

public AccessPolicy.Builder mergeUpdateTime(Timestamp value)

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Parameter
Name Description
value Timestamp
Returns
Type Description
AccessPolicy.Builder

setCreateTime(Timestamp value)

public AccessPolicy.Builder setCreateTime(Timestamp value)

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Parameter
Name Description
value Timestamp
Returns
Type Description
AccessPolicy.Builder

setCreateTime(Timestamp.Builder builderForValue)

public AccessPolicy.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
AccessPolicy.Builder

setEtag(String value)

public AccessPolicy.Builder setEtag(String value)

Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.

string etag = 6;

Parameter
Name Description
value String

The etag to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public AccessPolicy.Builder setEtagBytes(ByteString value)

Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.

string etag = 6;

Parameter
Name Description
value ByteString

The bytes for etag to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public AccessPolicy.Builder setName(String value)

Output only. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setNameBytes(ByteString value)

public AccessPolicy.Builder setNameBytes(ByteString value)

Output only. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setParent(String value)

public AccessPolicy.Builder setParent(String value)

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}

string parent = 2;

Parameter
Name Description
value String

The parent to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setParentBytes(ByteString value)

public AccessPolicy.Builder setParentBytes(ByteString value)

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}

string parent = 2;

Parameter
Name Description
value ByteString

The bytes for parent to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

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

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

setScopes(int index, String value)

public AccessPolicy.Builder setScopes(int index, String value)

The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior:

  • vpcsc perimeters can only restrict projects within folders/123
  • access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}

repeated string scopes = 7;

Parameters
Name Description
index int

The index to set the value at.

value String

The scopes to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setTitle(String value)

public AccessPolicy.Builder setTitle(String value)

Required. Human readable title. Does not affect behavior.

string title = 3;

Parameter
Name Description
value String

The title to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setTitleBytes(ByteString value)

public AccessPolicy.Builder setTitleBytes(ByteString value)

Required. Human readable title. Does not affect behavior.

string title = 3;

Parameter
Name Description
value ByteString

The bytes for title to set.

Returns
Type Description
AccessPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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

setUpdateTime(Timestamp value)

public AccessPolicy.Builder setUpdateTime(Timestamp value)

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Parameter
Name Description
value Timestamp
Returns
Type Description
AccessPolicy.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public AccessPolicy.Builder setUpdateTime(Timestamp.Builder builderForValue)

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
AccessPolicy.Builder