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.v2.Policy
Static Fields
ALTERNATE_FIELD_NUMBER
public static final int ALTERNATE_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
SPEC_FIELD_NUMBER
public static final int SPEC_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Policy getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Policy.Builder newBuilder()
Returns
newBuilder(Policy prototype)
public static Policy.Builder newBuilder(Policy prototype)
Parameter
Name | Description |
prototype | Policy
|
Returns
public static Policy parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Policy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Policy parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Policy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Policy parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Policy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Policy parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Policy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Policy parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Policy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Policy parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Policy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Policy> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getAlternate() (deprecated)
public AlternatePolicySpec getAlternate()
Deprecated. google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See
google/cloud/orgpolicy/v2/orgpolicy.proto;l=217
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Returns
getAlternateOrBuilder()
public AlternatePolicySpecOrBuilder getAlternateOrBuilder()
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Returns
getDefaultInstanceForType()
public Policy getDefaultInstanceForType()
Returns
getName()
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns
Type | Description |
String | The name.
|
getNameBytes()
public ByteString getNameBytes()
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns
getParserForType()
public Parser<Policy> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getSpec()
public PolicySpec getSpec()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
getSpecOrBuilder()
public PolicySpecOrBuilder getSpecOrBuilder()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hasAlternate() (deprecated)
public boolean hasAlternate()
Deprecated. google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See
google/cloud/orgpolicy/v2/orgpolicy.proto;l=217
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Returns
Type | Description |
boolean | Whether the alternate field is set.
|
hasSpec()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
Type | Description |
boolean | Whether the spec field is set.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Policy.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Policy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Policy.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions