Class Policy (2.4.0)

public final class Policy extends GeneratedMessageV3 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 Fields

BOOLEAN_POLICY_FIELD_NUMBER

public static final int BOOLEAN_POLICY_FIELD_NUMBER
Field Value
TypeDescription
int

CONSTRAINT_FIELD_NUMBER

public static final int CONSTRAINT_FIELD_NUMBER
Field Value
TypeDescription
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
TypeDescription
int

LIST_POLICY_FIELD_NUMBER

public static final int LIST_POLICY_FIELD_NUMBER
Field Value
TypeDescription
int

RESTORE_DEFAULT_FIELD_NUMBER

public static final int RESTORE_DEFAULT_FIELD_NUMBER
Field Value
TypeDescription
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

VERSION_FIELD_NUMBER

public static final int VERSION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Policy getDefaultInstance()
Returns
TypeDescription
Policy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Policy.Builder newBuilder()
Returns
TypeDescription
Policy.Builder

newBuilder(Policy prototype)

public static Policy.Builder newBuilder(Policy prototype)
Parameter
NameDescription
prototypePolicy
Returns
TypeDescription
Policy.Builder

parseDelimitedFrom(InputStream input)

public static Policy parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Policy parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Policy parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Policy parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Policy parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Policy parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Policy
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Policy> parser()
Returns
TypeDescription
Parser<Policy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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.

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

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.

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

getParserForType()

public Parser<Policy> getParserForType()
Returns
TypeDescription
Parser<Policy>
Overrides

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.

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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.

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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Policy.Builder newBuilderForType()
Returns
TypeDescription
Policy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Policy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Policy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Policy.Builder toBuilder()
Returns
TypeDescription
Policy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException