Send feedback
Class Constraint (2.41.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.41.0 keyboard_arrow_down
public final class Constraint extends GeneratedMessageV3 implements ConstraintOrBuilder
A constraint describes a way to restrict resource's configuration. For
example, you could enforce a constraint that controls which Google Cloud
services can be activated across an organization, or whether a Compute Engine
instance can have serial port connections established. Constraints can be
configured by the organization policy administrator to fit the needs of the
organization by setting a policy that includes constraints at different
locations in the organization's resource hierarchy. Policies are inherited
down the resource hierarchy from higher levels, but can also be overridden.
For details about the inheritance rules please read about
policies
.
Constraints have a default behavior determined by the constraint_default
field, which is the enforcement behavior that is used in the absence of a
policy being defined or inherited for the resource in question.
Protobuf type google.cloud.orgpolicy.v2.Constraint
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
BOOLEAN_CONSTRAINT_FIELD_NUMBER
public static final int BOOLEAN_CONSTRAINT_FIELD_NUMBER
Field Value Type Description int
CONSTRAINT_DEFAULT_FIELD_NUMBER
public static final int CONSTRAINT_DEFAULT_FIELD_NUMBER
Field Value Type Description int
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
Field Value Type Description int
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value Type Description int
LIST_CONSTRAINT_FIELD_NUMBER
public static final int LIST_CONSTRAINT_FIELD_NUMBER
Field Value Type Description int
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value Type Description int
SUPPORTS_DRY_RUN_FIELD_NUMBER
public static final int SUPPORTS_DRY_RUN_FIELD_NUMBER
Field Value Type Description int
Static Methods
getDefaultInstance()
public static Constraint getDefaultInstance ()
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
newBuilder()
public static Constraint . Builder newBuilder ()
newBuilder(Constraint prototype)
public static Constraint . Builder newBuilder ( Constraint prototype )
public static Constraint parseDelimitedFrom ( InputStream input )
public static Constraint parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(byte[] data)
public static Constraint parseFrom ( byte [] data )
Parameter Name Description data
byte []
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Constraint parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteString data)
public static Constraint parseFrom ( ByteString data )
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Constraint parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
public static Constraint parseFrom ( CodedInputStream input )
public static Constraint parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
public static Constraint parseFrom ( InputStream input )
public static Constraint parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteBuffer data)
public static Constraint parseFrom ( ByteBuffer data )
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Constraint parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
parser()
public static Parser<Constraint> parser ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter Name Description obj
Object
Overrides
getBooleanConstraint()
public Constraint . BooleanConstraint getBooleanConstraint ()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
getBooleanConstraintOrBuilder()
public Constraint . BooleanConstraintOrBuilder getBooleanConstraintOrBuilder ()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
getConstraintDefault()
public Constraint . ConstraintDefault getConstraintDefault ()
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;
getConstraintDefaultValue()
public int getConstraintDefaultValue ()
The evaluation behavior of this constraint in the absence of a policy.
.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;
Returns Type Description int
The enum numeric value on the wire for constraintDefault.
getConstraintTypeCase()
public Constraint . ConstraintTypeCase getConstraintTypeCase ()
getDefaultInstanceForType()
public Constraint getDefaultInstanceForType ()
getDescription()
public String getDescription ()
Detailed description of what this constraint controls as well as how and
where it is enforced.
Mutable.
string description = 3;
Returns Type Description String
The description.
getDescriptionBytes()
public ByteString getDescriptionBytes ()
Detailed description of what this constraint controls as well as how and
where it is enforced.
Mutable.
string description = 3;
Returns Type Description ByteString
The bytes for description.
getDisplayName()
public String getDisplayName ()
The human readable name.
Mutable.
string display_name = 2;
Returns Type Description String
The displayName.
getDisplayNameBytes()
public ByteString getDisplayNameBytes ()
The human readable name.
Mutable.
string display_name = 2;
Returns Type Description ByteString
The bytes for displayName.
getListConstraint()
public Constraint . ListConstraint getListConstraint ()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
getListConstraintOrBuilder()
public Constraint . ListConstraintOrBuilder getListConstraintOrBuilder ()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
getName()
Immutable. The resource name of the constraint. Must be in one of
the following forms:
projects/{project_number}/constraints/{constraint_name}
folders/{folder_id}/constraints/{constraint_name}
organizations/{organization_id}/constraints/{constraint_name}
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns Type Description String
The name.
getNameBytes()
public ByteString getNameBytes ()
Immutable. The resource name of the constraint. Must be in one of
the following forms:
projects/{project_number}/constraints/{constraint_name}
folders/{folder_id}/constraints/{constraint_name}
organizations/{organization_id}/constraints/{constraint_name}
For example, "/projects/123/constraints/compute.disableSerialPortAccess".
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns Type Description ByteString
The bytes for name.
getParserForType()
public Parser<Constraint> getParserForType ()
Overrides
getSerializedSize()
public int getSerializedSize ()
Returns Type Description int
Overrides
getSupportsDryRun()
public boolean getSupportsDryRun ()
Shows if dry run is supported for this constraint or not.
bool supports_dry_run = 7;
Returns Type Description boolean
The supportsDryRun.
hasBooleanConstraint()
public boolean hasBooleanConstraint ()
Defines this constraint as being a BooleanConstraint.
.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
Returns Type Description boolean
Whether the booleanConstraint field is set.
hasListConstraint()
public boolean hasListConstraint ()
Defines this constraint as being a ListConstraint.
.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
Returns Type Description boolean
Whether the listConstraint field is set.
hashCode()
Returns Type Description int
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
newBuilderForType()
public Constraint . Builder newBuilderForType ()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Constraint . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Overrides
toBuilder()
public Constraint . Builder toBuilder ()
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Overrides
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-01-27 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-01-27 UTC."],[],[]]