Class Constraint

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.orgpolicy.v2.Constraint
All Implemented Interfaces:
ConstraintOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Constraint extends com.google.protobuf.GeneratedMessage 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, see
 [`Policy`][google.cloud.orgpolicy.v2.Policy].

 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
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • DISPLAY_NAME_FIELD_NUMBER

      public static final int DISPLAY_NAME_FIELD_NUMBER
      See Also:
    • DESCRIPTION_FIELD_NUMBER

      public static final int DESCRIPTION_FIELD_NUMBER
      See Also:
    • CONSTRAINT_DEFAULT_FIELD_NUMBER

      public static final int CONSTRAINT_DEFAULT_FIELD_NUMBER
      See Also:
    • LIST_CONSTRAINT_FIELD_NUMBER

      public static final int LIST_CONSTRAINT_FIELD_NUMBER
      See Also:
    • BOOLEAN_CONSTRAINT_FIELD_NUMBER

      public static final int BOOLEAN_CONSTRAINT_FIELD_NUMBER
      See Also:
    • SUPPORTS_DRY_RUN_FIELD_NUMBER

      public static final int SUPPORTS_DRY_RUN_FIELD_NUMBER
      See Also:
    • EQUIVALENT_CONSTRAINT_FIELD_NUMBER

      public static final int EQUIVALENT_CONSTRAINT_FIELD_NUMBER
      See Also:
    • SUPPORTS_SIMULATION_FIELD_NUMBER

      public static final int SUPPORTS_SIMULATION_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getConstraintTypeCase

      public Constraint.ConstraintTypeCase getConstraintTypeCase()
      Specified by:
      getConstraintTypeCase in interface ConstraintOrBuilder
    • getName

      public String 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];
      Specified by:
      getName in interface ConstraintOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.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];
      Specified by:
      getNameBytes in interface ConstraintOrBuilder
      Returns:
      The bytes for name.
    • getDisplayName

      public String getDisplayName()
       The human readable name.
      
       Mutable.
       
      string display_name = 2;
      Specified by:
      getDisplayName in interface ConstraintOrBuilder
      Returns:
      The displayName.
    • getDisplayNameBytes

      public com.google.protobuf.ByteString getDisplayNameBytes()
       The human readable name.
      
       Mutable.
       
      string display_name = 2;
      Specified by:
      getDisplayNameBytes in interface ConstraintOrBuilder
      Returns:
      The bytes for displayName.
    • getDescription

      public String getDescription()
       Detailed description of what this constraint controls as well as how and
       where it is enforced.
      
       Mutable.
       
      string description = 3;
      Specified by:
      getDescription in interface ConstraintOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Detailed description of what this constraint controls as well as how and
       where it is enforced.
      
       Mutable.
       
      string description = 3;
      Specified by:
      getDescriptionBytes in interface ConstraintOrBuilder
      Returns:
      The bytes for description.
    • 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;
      Specified by:
      getConstraintDefaultValue in interface ConstraintOrBuilder
      Returns:
      The enum numeric value on the wire for constraintDefault.
    • 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;
      Specified by:
      getConstraintDefault in interface ConstraintOrBuilder
      Returns:
      The constraintDefault.
    • hasListConstraint

      public boolean hasListConstraint()
       Defines this constraint as being a list constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
      Specified by:
      hasListConstraint in interface ConstraintOrBuilder
      Returns:
      Whether the listConstraint field is set.
    • getListConstraint

      public Constraint.ListConstraint getListConstraint()
       Defines this constraint as being a list constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
      Specified by:
      getListConstraint in interface ConstraintOrBuilder
      Returns:
      The listConstraint.
    • getListConstraintOrBuilder

      public Constraint.ListConstraintOrBuilder getListConstraintOrBuilder()
       Defines this constraint as being a list constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;
      Specified by:
      getListConstraintOrBuilder in interface ConstraintOrBuilder
    • hasBooleanConstraint

      public boolean hasBooleanConstraint()
       Defines this constraint as being a boolean constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
      Specified by:
      hasBooleanConstraint in interface ConstraintOrBuilder
      Returns:
      Whether the booleanConstraint field is set.
    • getBooleanConstraint

      public Constraint.BooleanConstraint getBooleanConstraint()
       Defines this constraint as being a boolean constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
      Specified by:
      getBooleanConstraint in interface ConstraintOrBuilder
      Returns:
      The booleanConstraint.
    • getBooleanConstraintOrBuilder

      public Constraint.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()
       Defines this constraint as being a boolean constraint.
       
      .google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;
      Specified by:
      getBooleanConstraintOrBuilder in interface ConstraintOrBuilder
    • getSupportsDryRun

      public boolean getSupportsDryRun()
       Shows if dry run is supported for this constraint or not.
       
      bool supports_dry_run = 7;
      Specified by:
      getSupportsDryRun in interface ConstraintOrBuilder
      Returns:
      The supportsDryRun.
    • getEquivalentConstraint

      public String getEquivalentConstraint()
       Managed constraint and canned constraint sometimes can have
       equivalents. This field is used to store the equivalent constraint name.
       
      string equivalent_constraint = 8;
      Specified by:
      getEquivalentConstraint in interface ConstraintOrBuilder
      Returns:
      The equivalentConstraint.
    • getEquivalentConstraintBytes

      public com.google.protobuf.ByteString getEquivalentConstraintBytes()
       Managed constraint and canned constraint sometimes can have
       equivalents. This field is used to store the equivalent constraint name.
       
      string equivalent_constraint = 8;
      Specified by:
      getEquivalentConstraintBytes in interface ConstraintOrBuilder
      Returns:
      The bytes for equivalentConstraint.
    • getSupportsSimulation

      public boolean getSupportsSimulation()
       Shows if simulation is supported for this constraint or not.
       
      bool supports_simulation = 9;
      Specified by:
      getSupportsSimulation in interface ConstraintOrBuilder
      Returns:
      The supportsSimulation.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Constraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Constraint parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Constraint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Constraint parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Constraint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Constraint parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Constraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Constraint.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Constraint.Builder newBuilder()
    • newBuilder

      public static Constraint.Builder newBuilder(Constraint prototype)
    • toBuilder

      public Constraint.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Constraint.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static Constraint getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Constraint> parser()
    • getParserForType

      public com.google.protobuf.Parser<Constraint> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public Constraint getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder