{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-platform/json-schema/google-cloud-platform-google-cloud-orgpolicy-v2-custom-constraint-schema.json",
  "title": "GoogleCloudOrgpolicyV2CustomConstraint",
  "description": "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*.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-platform-orgpolicy-organizations-api-openapi.yml#/components/schemas/GoogleCloudOrgpolicyV2CustomConstraint",
  "type": "object",
  "properties": {
    "condition": {
      "type": "string",
      "description": "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."
    },
    "methodTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "METHOD_TYPE_UNSPECIFIED",
          "CREATE",
          "UPDATE",
          "DELETE",
          "REMOVE_GRANT",
          "GOVERN_TAGS"
        ]
      },
      "description": "All the operations being applied for this constraint."
    },
    "updateTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The last time this custom constraint was updated. This represents the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint` methods were called.",
      "format": "google-datetime"
    },
    "actionType": {
      "description": "Allow or deny type.",
      "type": "string",
      "enum": [
        "ACTION_TYPE_UNSPECIFIED",
        "ALLOW",
        "DENY"
      ]
    },
    "displayName": {
      "description": "One line display name for the UI. The max length of the display_name is 200 characters.",
      "type": "string"
    },
    "name": {
      "type": "string",
      "description": "Immutable. Name of the constraint. This is unique within the organization. The name must be of the form: * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` The max length is 71 characters and the minimum length is 1. Note that the prefix `organizations/{organization_id}/customConstraints/custom.` is not counted."
    },
    "resourceTypes": {
      "type": "array",
      "description": "Immutable. The resource instance type on which this policy applies. Format will be of the form : `/` Example: * `compute.googleapis.com/Instance`.",
      "items": {
        "type": "string"
      }
    },
    "description": {
      "description": "Detailed information about this custom policy constraint. The max length of the description is 2000 characters.",
      "type": "string"
    }
  }
}