{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "cancelled_by": {
      "anyOf": [
        {
          "pattern": "^usr_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "deployment_id": {
      "anyOf": [
        {
          "pattern": "^dep_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mainline_run_id": {
      "pattern": "^mrun_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
      "type": "string"
    },
    "product_id": {
      "pattern": "^prod_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
      "type": "string"
    },
    "reason_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "release_id": {
      "anyOf": [
        {
          "pattern": "^rel_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "pattern": "^rev_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sequence": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "state": {
      "enum": [
        "running",
        "stopped",
        "completed",
        "superseded",
        "cancelled"
      ],
      "type": "string"
    },
    "step": {
      "enum": [
        "descriptor",
        "qualification",
        "release",
        "deployment",
        "surface"
      ],
      "type": "string"
    },
    "step_status": {
      "type": "string"
    },
    "superseded_by_run_id": {
      "anyOf": [
        {
          "pattern": "^mrun_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "surface_id": {
      "anyOf": [
        {
          "pattern": "^srf_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "workspace_id": {
      "pattern": "^ws_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$",
      "type": "string"
    }
  },
  "required": [
    "mainline_run_id",
    "workspace_id",
    "product_id",
    "step",
    "state",
    "step_status",
    "reason_code",
    "revision_id",
    "release_id",
    "deployment_id",
    "surface_id",
    "superseded_by_run_id",
    "cancelled_by",
    "sequence"
  ],
  "type": "object"
}
