Class AccessPolicy.Builder (1.13.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
TypeDescription
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
NameDescription
valuesIterable<String>

The scopes to add.

Returns
TypeDescription
AccessPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AccessPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The scopes to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the scopes to add.

Returns
TypeDescription
AccessPolicy.Builder

This builder for chaining.

build()

public AccessPolicy build()
Returns
TypeDescription
AccessPolicy

buildPartial()

public AccessPolicy buildPartial()
Returns
TypeDescription
AccessPolicy

clear()

public AccessPolicy.Builder clear()
Returns
TypeDescription
AccessPolicy.Builder
Overrides

clearCreateTime()

public AccessPolicy.Builder clearCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
TypeDescription
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
TypeDescription
AccessPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AccessPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AccessPolicy.Builder
Overrides

clearName()

public AccessPolicy.Builder clearName()

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

string name = 1;

Returns
TypeDescription
AccessPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AccessPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
AccessPolicy.Builder

This builder for chaining.

clearTitle()

public AccessPolicy.Builder clearTitle()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
TypeDescription
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
TypeDescription
AccessPolicy.Builder

clone()

public AccessPolicy.Builder clone()
Returns
TypeDescription
AccessPolicy.Builder
Overrides

getCreateTime()

public Timestamp getCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
TypeDescription
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public AccessPolicy getDefaultInstanceForType()
Returns
TypeDescription
AccessPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for etag.

getName()

public String getName()

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

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 1;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProtocolStringList

A list containing the scopes.

getTitle()

public String getTitle()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
TypeDescription
String

The title.

getTitleBytes()

public ByteString getTitleBytes()

Required. Human readable title. Does not affect behavior.

string title = 3;

Returns
TypeDescription
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
TypeDescription
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
TypeDescription
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Time the AccessPolicy was updated in UTC.

.google.protobuf.Timestamp update_time = 5;

Returns
TypeDescription
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. Time the AccessPolicy was created in UTC.

.google.protobuf.Timestamp create_time = 4;

Returns
TypeDescription
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
TypeDescription
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
AccessPolicy.Builder

mergeFrom(AccessPolicy other)

public AccessPolicy.Builder mergeFrom(AccessPolicy other)
Parameter
NameDescription
otherAccessPolicy
Returns
TypeDescription
AccessPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AccessPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AccessPolicy.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public AccessPolicy.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
AccessPolicy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AccessPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
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
NameDescription
valueString

The etag to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for etag to set.

Returns
TypeDescription
AccessPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AccessPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
valueString

The parent to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for parent to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The scopes to set.

Returns
TypeDescription
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
NameDescription
valueString

The title to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for title to set.

Returns
TypeDescription
AccessPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AccessPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
AccessPolicy.Builder