Class Policy.Builder (2.44.0)

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

Defines a Cloud Organization Policy which is used to specify Constraints for configurations of Cloud Platform resources.

Protobuf type google.cloud.orgpolicy.v1.Policy

Implements

PolicyOrBuilder

Static Methods

getDescriptor()

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

Methods

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

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

clearBooleanPolicy()

public Policy.Builder clearBooleanPolicy()

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Returns
Type Description
Policy.Builder

clearConstraint()

public Policy.Builder clearConstraint()

The name of the Constraint the Policy is configuring, for example, constraints/serviceuser.services.

Immutable after creation.

string constraint = 2;

Returns
Type Description
Policy.Builder

This builder for chaining.

clearEtag()

public Policy.Builder clearEtag()

An opaque tag indicating the current version of the Policy, used for concurrency control.

When the Policy is returned from either a GetPolicy or a ListOrgPolicy request, this etag indicates the version of the current Policy to use when executing a read-modify-write loop.

When the Policy is returned from a GetEffectivePolicy request, the etag will be unset.

When the Policy is used in a SetOrgPolicy method, use the etag value that was returned from a GetOrgPolicy request as part of a read-modify-write loop for concurrency control. Not setting the etagin a SetOrgPolicy request will result in an unconditional write of the Policy.

bytes etag = 3;

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

clearListPolicy()

public Policy.Builder clearListPolicy()

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Returns
Type Description
Policy.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPolicyType()

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

clearRestoreDefault()

public Policy.Builder clearRestoreDefault()

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Returns
Type Description
Policy.Builder

clearUpdateTime()

public Policy.Builder clearUpdateTime()

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Returns
Type Description
Policy.Builder

clearVersion()

public Policy.Builder clearVersion()

Version of the Policy. Default version is 0;

int32 version = 1;

Returns
Type Description
Policy.Builder

This builder for chaining.

clone()

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

getBooleanPolicy()

public Policy.BooleanPolicy getBooleanPolicy()

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Returns
Type Description
Policy.BooleanPolicy

The booleanPolicy.

getBooleanPolicyBuilder()

public Policy.BooleanPolicy.Builder getBooleanPolicyBuilder()

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Returns
Type Description
Policy.BooleanPolicy.Builder

getBooleanPolicyOrBuilder()

public Policy.BooleanPolicyOrBuilder getBooleanPolicyOrBuilder()

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Returns
Type Description
Policy.BooleanPolicyOrBuilder

getConstraint()

public String getConstraint()

The name of the Constraint the Policy is configuring, for example, constraints/serviceuser.services.

Immutable after creation.

string constraint = 2;

Returns
Type Description
String

The constraint.

getConstraintBytes()

public ByteString getConstraintBytes()

The name of the Constraint the Policy is configuring, for example, constraints/serviceuser.services.

Immutable after creation.

string constraint = 2;

Returns
Type Description
ByteString

The bytes for constraint.

getDefaultInstanceForType()

public Policy getDefaultInstanceForType()
Returns
Type Description
Policy

getDescriptorForType()

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

getEtag()

public ByteString getEtag()

An opaque tag indicating the current version of the Policy, used for concurrency control.

When the Policy is returned from either a GetPolicy or a ListOrgPolicy request, this etag indicates the version of the current Policy to use when executing a read-modify-write loop.

When the Policy is returned from a GetEffectivePolicy request, the etag will be unset.

When the Policy is used in a SetOrgPolicy method, use the etag value that was returned from a GetOrgPolicy request as part of a read-modify-write loop for concurrency control. Not setting the etagin a SetOrgPolicy request will result in an unconditional write of the Policy.

bytes etag = 3;

Returns
Type Description
ByteString

The etag.

getListPolicy()

public Policy.ListPolicy getListPolicy()

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Returns
Type Description
Policy.ListPolicy

The listPolicy.

getListPolicyBuilder()

public Policy.ListPolicy.Builder getListPolicyBuilder()

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Returns
Type Description
Policy.ListPolicy.Builder

getListPolicyOrBuilder()

public Policy.ListPolicyOrBuilder getListPolicyOrBuilder()

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Returns
Type Description
Policy.ListPolicyOrBuilder

getPolicyTypeCase()

public Policy.PolicyTypeCase getPolicyTypeCase()
Returns
Type Description
Policy.PolicyTypeCase

getRestoreDefault()

public Policy.RestoreDefault getRestoreDefault()

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Returns
Type Description
Policy.RestoreDefault

The restoreDefault.

getRestoreDefaultBuilder()

public Policy.RestoreDefault.Builder getRestoreDefaultBuilder()

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Returns
Type Description
Policy.RestoreDefault.Builder

getRestoreDefaultOrBuilder()

public Policy.RestoreDefaultOrBuilder getRestoreDefaultOrBuilder()

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Returns
Type Description
Policy.RestoreDefaultOrBuilder

getUpdateTime()

public Timestamp getUpdateTime()

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Returns
Type Description
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Returns
Type Description
TimestampOrBuilder

getVersion()

public int getVersion()

Version of the Policy. Default version is 0;

int32 version = 1;

Returns
Type Description
int

The version.

hasBooleanPolicy()

public boolean hasBooleanPolicy()

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Returns
Type Description
boolean

Whether the booleanPolicy field is set.

hasListPolicy()

public boolean hasListPolicy()

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Returns
Type Description
boolean

Whether the listPolicy field is set.

hasRestoreDefault()

public boolean hasRestoreDefault()

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Returns
Type Description
boolean

Whether the restoreDefault field is set.

hasUpdateTime()

public boolean hasUpdateTime()

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

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

mergeBooleanPolicy(Policy.BooleanPolicy value)

public Policy.Builder mergeBooleanPolicy(Policy.BooleanPolicy value)

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Parameter
Name Description
value Policy.BooleanPolicy
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

mergeListPolicy(Policy.ListPolicy value)

public Policy.Builder mergeListPolicy(Policy.ListPolicy value)

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Parameter
Name Description
value Policy.ListPolicy
Returns
Type Description
Policy.Builder

mergeRestoreDefault(Policy.RestoreDefault value)

public Policy.Builder mergeRestoreDefault(Policy.RestoreDefault value)

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Parameter
Name Description
value Policy.RestoreDefault
Returns
Type Description
Policy.Builder

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)

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

setBooleanPolicy(Policy.BooleanPolicy value)

public Policy.Builder setBooleanPolicy(Policy.BooleanPolicy value)

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

Parameter
Name Description
value Policy.BooleanPolicy
Returns
Type Description
Policy.Builder

setBooleanPolicy(Policy.BooleanPolicy.Builder builderForValue)

public Policy.Builder setBooleanPolicy(Policy.BooleanPolicy.Builder builderForValue)

For boolean Constraints, whether to enforce the Constraint or not.

.google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;

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

setConstraint(String value)

public Policy.Builder setConstraint(String value)

The name of the Constraint the Policy is configuring, for example, constraints/serviceuser.services.

Immutable after creation.

string constraint = 2;

Parameter
Name Description
value String

The constraint to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setConstraintBytes(ByteString value)

public Policy.Builder setConstraintBytes(ByteString value)

The name of the Constraint the Policy is configuring, for example, constraints/serviceuser.services.

Immutable after creation.

string constraint = 2;

Parameter
Name Description
value ByteString

The bytes for constraint to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setEtag(ByteString value)

public Policy.Builder setEtag(ByteString value)

An opaque tag indicating the current version of the Policy, used for concurrency control.

When the Policy is returned from either a GetPolicy or a ListOrgPolicy request, this etag indicates the version of the current Policy to use when executing a read-modify-write loop.

When the Policy is returned from a GetEffectivePolicy request, the etag will be unset.

When the Policy is used in a SetOrgPolicy method, use the etag value that was returned from a GetOrgPolicy request as part of a read-modify-write loop for concurrency control. Not setting the etagin a SetOrgPolicy request will result in an unconditional write of the Policy.

bytes etag = 3;

Parameter
Name Description
value ByteString

The 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

setListPolicy(Policy.ListPolicy value)

public Policy.Builder setListPolicy(Policy.ListPolicy value)

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

Parameter
Name Description
value Policy.ListPolicy
Returns
Type Description
Policy.Builder

setListPolicy(Policy.ListPolicy.Builder builderForValue)

public Policy.Builder setListPolicy(Policy.ListPolicy.Builder builderForValue)

List of values either allowed or disallowed.

.google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;

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

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

setRestoreDefault(Policy.RestoreDefault value)

public Policy.Builder setRestoreDefault(Policy.RestoreDefault value)

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

Parameter
Name Description
value Policy.RestoreDefault
Returns
Type Description
Policy.Builder

setRestoreDefault(Policy.RestoreDefault.Builder builderForValue)

public Policy.Builder setRestoreDefault(Policy.RestoreDefault.Builder builderForValue)

Restores the default behavior of the constraint; independent of Constraint type.

.google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;

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

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)

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public Policy.Builder setUpdateTime(Timestamp.Builder builderForValue)

The time stamp the Policy was previously updated. This is set by the server, not specified by the caller, and represents the last time a call to SetOrgPolicy was made for that Policy. Any value set by the client will be ignored.

.google.protobuf.Timestamp update_time = 4;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Policy.Builder

setVersion(int value)

public Policy.Builder setVersion(int value)

Version of the Policy. Default version is 0;

int32 version = 1;

Parameter
Name Description
value int

The version to set.

Returns
Type Description
Policy.Builder

This builder for chaining.