Send feedback
Class Policy (2.7.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.7.0 keyboard_arrow_down
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
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-22 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-22 UTC."],[],[]]