Class Policy (2.46.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
Type Description
int

CONSTRAINT_FIELD_NUMBER

public static final int CONSTRAINT_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

LIST_POLICY_FIELD_NUMBER

public static final int LIST_POLICY_FIELD_NUMBER
Field Value
Type Description
int

RESTORE_DEFAULT_FIELD_NUMBER

public static final int RESTORE_DEFAULT_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

VERSION_FIELD_NUMBER

public static final int VERSION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Policy getDefaultInstance()
Returns
Type Description
Policy

getDescriptor()

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

newBuilder()

public static Policy.Builder newBuilder()
Returns
Type Description
Policy.Builder

newBuilder(Policy prototype)

public static Policy.Builder newBuilder(Policy prototype)
Parameter
Name Description
prototype Policy
Returns
Type Description
Policy.Builder

parseDelimitedFrom(InputStream input)

public static Policy parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Policy parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Policy parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Policy parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Policy parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Policy parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Policy> parser()
Returns
Type Description
Parser<Policy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
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
Type Description
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
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

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.

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

getParserForType()

public Parser<Policy> getParserForType()
Returns
Type Description
Parser<Policy>
Overrides

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.

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

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
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
Type Description
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
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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Policy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Policy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException