Class Policy.Builder (2.3.7-SNAPSHOT)

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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Policy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Policy.Builder
Overrides

build()

public Policy build()
Returns
TypeDescription
Policy

buildPartial()

public Policy buildPartial()
Returns
TypeDescription
Policy

clear()

public Policy.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
Policy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Policy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
Policy.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Policy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Policy.Builder
Overrides

clearPolicyType()

public Policy.Builder clearPolicyType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Policy.Builder

clearVersion()

public Policy.Builder clearVersion()

Version of the Policy. Default version is 0;

int32 version = 1;

Returns
TypeDescription
Policy.Builder

This builder for chaining.

clone()

public Policy.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for constraint.

getDefaultInstanceForType()

public Policy getDefaultInstanceForType()
Returns
TypeDescription
Policy

getDescriptorForType()

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

getPolicyTypeCase()

public Policy.PolicyTypeCase getPolicyTypeCase()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
TimestampOrBuilder

getVersion()

public int getVersion()

Version of the Policy. Default version is 0;

int32 version = 1;

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

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
NameDescription
valuePolicy.BooleanPolicy
Returns
TypeDescription
Policy.Builder

mergeFrom(Policy other)

public Policy.Builder mergeFrom(Policy other)
Parameter
NameDescription
otherPolicy
Returns
TypeDescription
Policy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Policy.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valuePolicy.ListPolicy
Returns
TypeDescription
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
NameDescription
valuePolicy.RestoreDefault
Returns
TypeDescription
Policy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

The constraint to set.

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

The bytes for constraint to set.

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

The etag to set.

Returns
TypeDescription
Policy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public Policy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valuePolicy.RestoreDefault
Returns
TypeDescription
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
NameDescription
builderForValuePolicy.RestoreDefault.Builder
Returns
TypeDescription
Policy.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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

setVersion(int value)

public Policy.Builder setVersion(int value)

Version of the Policy. Default version is 0;

int32 version = 1;

Parameter
NameDescription
valueint

The version to set.

Returns
TypeDescription
Policy.Builder

This builder for chaining.