{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "environment_type": {
      "enum": [
        "preview",
        "staging",
        "production"
      ],
      "type": "string"
    },
    "handle_mode": {
      "enum": [
        "capability",
        "injected"
      ],
      "type": "string"
    },
    "kind": {
      "enum": [
        "kv"
      ],
      "type": "string"
    },
    "product_id": {
      "pattern": "^prod_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
      "type": "string"
    },
    "provision_model": {
      "enum": [
        "platform_pool",
        "provider_backed"
      ],
      "type": "string"
    },
    "resource_id": {
      "pattern": "^mres_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
      "type": "string"
    },
    "state": {
      "enum": [
        "requested",
        "provisioning",
        "ready",
        "failed",
        "detached",
        "deleted"
      ],
      "type": "string"
    },
    "workspace_id": {
      "anyOf": [
        {
          "pattern": "^ws_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "const": "ws_platform",
          "type": "string"
        }
      ]
    }
  },
  "required": [
    "resource_id",
    "workspace_id",
    "product_id",
    "environment_type",
    "kind",
    "provision_model",
    "handle_mode",
    "state"
  ],
  "type": "object"
}
