{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fwozen-com/json-schema/fwozen-com-freeze-schema.json",
  "title": "Freeze",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fwozen-com-openapi.yml#/components/schemas/Freeze",
  "type": "object",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^frz_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "dryRun": {
      "default": false,
      "type": "boolean"
    },
    "state": {
      "type": "string",
      "enum": [
        "active",
        "ended",
        "superseded"
      ]
    },
    "endReason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "lifted",
            "expired",
            "superseded",
            "installation_removed",
            "schedule_window_closed"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "polarity": {
      "type": "string",
      "enum": [
        "freeze",
        "thaw"
      ]
    },
    "suppressesFreezeId": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^frz_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "scope": {
      "$ref": "#/$defs/FreezeScope"
    },
    "reason": {
      "type": "string"
    },
    "incidentRef": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source": {
      "type": "string",
      "enum": [
        "ui",
        "api",
        "slack",
        "schedule",
        "incident",
        "system",
        "github",
        "compat"
      ]
    },
    "actor": {
      "$ref": "#/$defs/Actor"
    },
    "scheduleId": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^sch_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "startedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "endsAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "endedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "endedBy": {
      "anyOf": [
        {
          "$ref": "#/$defs/Actor"
        },
        {
          "type": "null"
        }
      ]
    },
    "liftReason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "allowExceptions": {
      "type": "boolean"
    },
    "blocksDeploys": {
      "type": "boolean"
    },
    "blocksMergeQueue": {
      "type": "boolean"
    },
    "fanoutState": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "done",
        "failed"
      ]
    },
    "targetCount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "appliedTargetCount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "blockedPrCount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "exceptionCount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "targets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FreezeTarget"
      }
    },
    "bands": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FreezeBand"
      }
    },
    "slackMessageUrl": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "dryRun",
    "state",
    "endReason",
    "polarity",
    "suppressesFreezeId",
    "scope",
    "reason",
    "incidentRef",
    "source",
    "actor",
    "scheduleId",
    "startedAt",
    "endsAt",
    "endedAt",
    "endedBy",
    "liftReason",
    "allowExceptions",
    "blocksDeploys",
    "blocksMergeQueue",
    "fanoutState",
    "targetCount",
    "appliedTargetCount",
    "blockedPrCount",
    "exceptionCount",
    "slackMessageUrl",
    "warnings"
  ],
  "additionalProperties": false,
  "$defs": {
    "Actor": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "user",
            "api_key",
            "slack_user",
            "scheduler",
            "system",
            "github_user"
          ]
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "displayName": {
          "type": "string"
        },
        "githubLogin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "slackUserId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "impersonatorId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "apiKeyKind": {
          "default": null,
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "human",
                "agent"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "id",
        "displayName",
        "githubLogin",
        "slackUserId",
        "impersonatorId",
        "apiKeyKind"
      ],
      "additionalProperties": false
    },
    "FreezeBand": {
      "type": "object",
      "properties": {
        "band": {
          "type": "string",
          "enum": [
            "merge_queue",
            "auto_merge",
            "approved_green",
            "other"
          ]
        },
        "open": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "blocked": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "band",
        "open",
        "blocked"
      ],
      "additionalProperties": false
    },
    "FreezeScope": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "org"
            },
            "branches": {
              "default": [
                "~DEFAULT_BRANCH"
              ],
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          },
          "required": [
            "kind",
            "branches"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "repos"
            },
            "repoIds": {
              "minItems": 1,
              "maxItems": 500,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^repo_[1-9A-HJ-NP-Za-km-z]{16}$"
              }
            },
            "branches": {
              "default": [
                "~DEFAULT_BRANCH"
              ],
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          },
          "required": [
            "kind",
            "repoIds",
            "branches"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "branches"
            },
            "branchIds": {
              "minItems": 1,
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^wbr_[1-9A-HJ-NP-Za-km-z]{16}$"
              }
            }
          },
          "required": [
            "kind",
            "branchIds"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "glob"
            },
            "patterns": {
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "excludePatterns": {
              "default": [],
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "branches": {
              "default": [
                "~DEFAULT_BRANCH"
              ],
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "includeArchived": {
              "default": false,
              "type": "boolean"
            }
          },
          "required": [
            "kind",
            "patterns",
            "excludePatterns",
            "branches",
            "includeArchived"
          ],
          "additionalProperties": false
        }
      ]
    },
    "FreezeTarget": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^fzt_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        "branchId": {
          "type": "string",
          "pattern": "^wbr_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        "repoId": {
          "type": "string",
          "pattern": "^repo_[1-9A-HJ-NP-Za-km-z]{16}$"
        },
        "repoFullName": {
          "type": "string"
        },
        "branch": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "applying",
            "applied",
            "partial",
            "failed",
            "released",
            "reconciled"
          ]
        },
        "blockedPrCount": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "appliedPrCount": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "targetsTotal": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "targetsWritten": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "failedPrCount": {
          "default": 0,
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "firstFailureAt": {
          "default": null,
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "repairedAt": {
          "default": null,
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "enforcement": {
          "type": "string",
          "enum": [
            "green",
            "yellow",
            "red",
            "unknown"
          ]
        },
        "appliedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "branchId",
        "repoId",
        "repoFullName",
        "branch",
        "state",
        "blockedPrCount",
        "appliedPrCount",
        "targetsTotal",
        "targetsWritten",
        "failedPrCount",
        "firstFailureAt",
        "repairedAt",
        "enforcement",
        "appliedAt",
        "error"
      ],
      "additionalProperties": false
    }
  }
}