Class CustomConstraint

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

@Generated public final class CustomConstraint extends com.google.protobuf.GeneratedMessage implements CustomConstraintOrBuilder
 A custom constraint defined by customers which can *only* be applied to the
 given resource types and organization.

 By creating a custom constraint, customers can apply policies of this
 custom constraint. *Creating a custom constraint itself does NOT apply any
 policy enforcement*.
 
Protobuf type google.cloud.orgpolicy.v2.CustomConstraint
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • RESOURCE_TYPES_FIELD_NUMBER

      public static final int RESOURCE_TYPES_FIELD_NUMBER
      See Also:
    • METHOD_TYPES_FIELD_NUMBER

      public static final int METHOD_TYPES_FIELD_NUMBER
      See Also:
    • CONDITION_FIELD_NUMBER

      public static final int CONDITION_FIELD_NUMBER
      See Also:
    • ACTION_TYPE_FIELD_NUMBER

      public static final int ACTION_TYPE_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:
    • UPDATE_TIME_FIELD_NUMBER

      public static final int UPDATE_TIME_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
    • getName

      public String getName()
       Immutable. Name of the constraint. This is unique within the organization.
       Format of the name should be
      
       * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
      
       Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
      
       The max length is 70 characters and the minimum length is 1. Note that the
       prefix `organizations/{organization_id}/customConstraints/` is not counted.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getName in interface CustomConstraintOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Immutable. Name of the constraint. This is unique within the organization.
       Format of the name should be
      
       * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
      
       Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
      
       The max length is 70 characters and the minimum length is 1. Note that the
       prefix `organizations/{organization_id}/customConstraints/` is not counted.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getNameBytes in interface CustomConstraintOrBuilder
      Returns:
      The bytes for name.
    • getResourceTypesList

      public com.google.protobuf.ProtocolStringList getResourceTypesList()
       Immutable. The resource instance type on which this policy applies. Format
       will be of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getResourceTypesList in interface CustomConstraintOrBuilder
      Returns:
      A list containing the resourceTypes.
    • getResourceTypesCount

      public int getResourceTypesCount()
       Immutable. The resource instance type on which this policy applies. Format
       will be of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getResourceTypesCount in interface CustomConstraintOrBuilder
      Returns:
      The count of resourceTypes.
    • getResourceTypes

      public String getResourceTypes(int index)
       Immutable. The resource instance type on which this policy applies. Format
       will be of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getResourceTypes in interface CustomConstraintOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The resourceTypes at the given index.
    • getResourceTypesBytes

      public com.google.protobuf.ByteString getResourceTypesBytes(int index)
       Immutable. The resource instance type on which this policy applies. Format
       will be of the form : `<service name>/<type>` Example:
      
       * `compute.googleapis.com/Instance`.
       
      repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getResourceTypesBytes in interface CustomConstraintOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the resourceTypes at the given index.
    • getMethodTypesList

      public List<CustomConstraint.MethodType> getMethodTypesList()
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;
      Specified by:
      getMethodTypesList in interface CustomConstraintOrBuilder
      Returns:
      A list containing the methodTypes.
    • getMethodTypesCount

      public int getMethodTypesCount()
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;
      Specified by:
      getMethodTypesCount in interface CustomConstraintOrBuilder
      Returns:
      The count of methodTypes.
    • getMethodTypes

      public CustomConstraint.MethodType getMethodTypes(int index)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;
      Specified by:
      getMethodTypes in interface CustomConstraintOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The methodTypes at the given index.
    • getMethodTypesValueList

      public List<Integer> getMethodTypesValueList()
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;
      Specified by:
      getMethodTypesValueList in interface CustomConstraintOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for methodTypes.
    • getMethodTypesValue

      public int getMethodTypesValue(int index)
       All the operations being applied for this constraint.
       
      repeated .google.cloud.orgpolicy.v2.CustomConstraint.MethodType method_types = 3;
      Specified by:
      getMethodTypesValue in interface CustomConstraintOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The enum numeric value on the wire of methodTypes at the given index.
    • getCondition

      public String getCondition()
       A Common Expression Language (CEL) condition which is used in the
       evaluation of the constraint. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 4;
      Specified by:
      getCondition in interface CustomConstraintOrBuilder
      Returns:
      The condition.
    • getConditionBytes

      public com.google.protobuf.ByteString getConditionBytes()
       A Common Expression Language (CEL) condition which is used in the
       evaluation of the constraint. For example:
       `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
       `resource.management.auto_upgrade == true`
      
       The max length of the condition is 1000 characters.
       
      string condition = 4;
      Specified by:
      getConditionBytes in interface CustomConstraintOrBuilder
      Returns:
      The bytes for condition.
    • getActionTypeValue

      public int getActionTypeValue()
       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.CustomConstraint.ActionType action_type = 5;
      Specified by:
      getActionTypeValue in interface CustomConstraintOrBuilder
      Returns:
      The enum numeric value on the wire for actionType.
    • getActionType

      public CustomConstraint.ActionType getActionType()
       Allow or deny type.
       
      .google.cloud.orgpolicy.v2.CustomConstraint.ActionType action_type = 5;
      Specified by:
      getActionType in interface CustomConstraintOrBuilder
      Returns:
      The actionType.
    • getDisplayName

      public String getDisplayName()
       One line display name for the UI.
       The max length of the display_name is 200 characters.
       
      string display_name = 6;
      Specified by:
      getDisplayName in interface CustomConstraintOrBuilder
      Returns:
      The displayName.
    • getDisplayNameBytes

      public com.google.protobuf.ByteString getDisplayNameBytes()
       One line display name for the UI.
       The max length of the display_name is 200 characters.
       
      string display_name = 6;
      Specified by:
      getDisplayNameBytes in interface CustomConstraintOrBuilder
      Returns:
      The bytes for displayName.
    • getDescription

      public String getDescription()
       Detailed information about this custom policy constraint.
       The max length of the description is 2000 characters.
       
      string description = 7;
      Specified by:
      getDescription in interface CustomConstraintOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Detailed information about this custom policy constraint.
       The max length of the description is 2000 characters.
       
      string description = 7;
      Specified by:
      getDescriptionBytes in interface CustomConstraintOrBuilder
      Returns:
      The bytes for description.
    • hasUpdateTime

      public boolean hasUpdateTime()
       Output only. The last time this custom constraint was updated. This
       represents the last time that the `CreateCustomConstraint` or
       `UpdateCustomConstraint` methods were called.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasUpdateTime in interface CustomConstraintOrBuilder
      Returns:
      Whether the updateTime field is set.
    • getUpdateTime

      public com.google.protobuf.Timestamp getUpdateTime()
       Output only. The last time this custom constraint was updated. This
       represents the last time that the `CreateCustomConstraint` or
       `UpdateCustomConstraint` methods were called.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTime in interface CustomConstraintOrBuilder
      Returns:
      The updateTime.
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       Output only. The last time this custom constraint was updated. This
       represents the last time that the `CreateCustomConstraint` or
       `UpdateCustomConstraint` methods were called.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTimeOrBuilder in interface CustomConstraintOrBuilder
    • 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 CustomConstraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

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

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

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

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

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

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

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

      public static CustomConstraint.Builder newBuilder()
    • newBuilder

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

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

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

      public static CustomConstraint getDefaultInstance()
    • parser

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

      public com.google.protobuf.Parser<CustomConstraint> 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 CustomConstraint getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder