{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fwozen-com/json-schema/fwozen-com-enforcement-detail-view-schema.json",
  "title": "EnforcementDetailView",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fwozen-com-openapi.yml#/components/schemas/EnforcementDetailView",
  "type": "object",
  "properties": {
    "checkedAt": {
      "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))$"
    },
    "probedAt": {
      "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))$"
    },
    "verifiedAt": {
      "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"
        }
      ]
    },
    "probeStatus": {
      "type": "string",
      "enum": [
        "ok",
        "forbidden",
        "not_found",
        "error"
      ]
    },
    "configuration": {
      "type": "string",
      "enum": [
        "verified",
        "needs_attention",
        "missing",
        "unknown"
      ]
    },
    "bypassAssurance": {
      "type": "string",
      "enum": [
        "present",
        "known_none",
        "unknown"
      ]
    },
    "required": {
      "type": "boolean"
    },
    "pinnedIntegrationId": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "ourAppId": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "contextName": {
      "type": "string"
    },
    "requiredChecks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "context": {
            "type": "string"
          },
          "integrationId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "Repository",
              "Organization",
              "Enterprise",
              "ClassicBranchProtection"
            ]
          },
          "rulesetId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "context",
          "integrationId",
          "sourceType",
          "rulesetId"
        ],
        "additionalProperties": false
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Repository",
              "Organization",
              "Enterprise",
              "ClassicBranchProtection"
            ]
          },
          "rulesetId": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "rulesetName": {
            "type": "string"
          },
          "enforcement": {
            "type": "string",
            "enum": [
              "active",
              "evaluate",
              "disabled"
            ]
          },
          "contributesRequirement": {
            "type": "boolean"
          },
          "detailProbe": {
            "type": "string",
            "enum": [
              "ok",
              "forbidden",
              "failed",
              "not_attempted"
            ]
          },
          "bypassField": {
            "type": "string",
            "enum": [
              "present",
              "absent"
            ]
          },
          "bypassActorCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "type",
          "contributesRequirement",
          "detailProbe",
          "bypassField",
          "bypassActorCount"
        ],
        "additionalProperties": false
      }
    },
    "evidence": {
      "type": "object",
      "properties": {
        "pagesRead": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "complete": {
          "type": "boolean"
        },
        "truncated": {
          "type": "boolean"
        },
        "rulesetPathObserved": {
          "type": "boolean"
        },
        "setupKind": {
          "type": "string",
          "enum": [
            "unknown",
            "organization_ruleset",
            "repository_ruleset",
            "classic",
            "unavailable"
          ]
        },
        "stale": {
          "type": "boolean"
        }
      },
      "required": [
        "pagesRead",
        "complete",
        "truncated",
        "rulesetPathObserved",
        "setupKind",
        "stale"
      ],
      "additionalProperties": false
    },
    "bypassActors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "actorId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "actorType": {
            "type": "string"
          },
          "actorName": {
            "type": "string"
          },
          "bypassMode": {
            "type": "string"
          }
        },
        "required": [
          "actorId",
          "actorType",
          "actorName",
          "bypassMode"
        ],
        "additionalProperties": false
      }
    },
    "enforceAdmins": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "strictPolicy": {
      "type": "boolean"
    },
    "mergeQueue": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "checkResponseTimeoutMinutes": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "groupingStrategy": {
              "type": "string"
            }
          },
          "required": [
            "enabled",
            "checkResponseTimeoutMinutes",
            "groupingStrategy"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "not_required",
          "not_pinned",
          "bypass_actors_present",
          "enforce_admins_disabled",
          "classic_and_ruleset_conflict",
          "status_and_check_same_name",
          "strict_policy_enabled",
          "ruleset_evaluate_mode",
          "merge_queue_timeout_low",
          "probe_forbidden",
          "pinned_wrong_app",
          "conflicting_required_entries",
          "evidence_truncated",
          "evidence_stale",
          "classic_guidance_only",
          "bypass_unknown",
          "bypass_evidence_incomplete",
          "no_rules_observed",
          "probe_not_found",
          "probe_failed"
        ]
      }
    },
    "branchId": {
      "type": "string",
      "pattern": "^wbr_[1-9A-HJ-NP-Za-km-z]{16}$"
    },
    "repoFullName": {
      "type": "string"
    },
    "branch": {
      "type": "string"
    },
    "level": {
      "type": "string",
      "enum": [
        "green",
        "yellow",
        "red",
        "unknown"
      ]
    },
    "display": {
      "type": "string",
      "enum": [
        "enforced",
        "advisory_unpinned",
        "advisory_bypass",
        "advisory_classic_conflict",
        "advisory_other",
        "unenforced",
        "unknown"
      ]
    },
    "problems": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EnforcementProblem"
      }
    }
  },
  "required": [
    "checkedAt",
    "probedAt",
    "verifiedAt",
    "probeStatus",
    "configuration",
    "bypassAssurance",
    "required",
    "pinnedIntegrationId",
    "ourAppId",
    "contextName",
    "requiredChecks",
    "sources",
    "evidence",
    "bypassActors",
    "enforceAdmins",
    "strictPolicy",
    "mergeQueue",
    "warnings",
    "branchId",
    "repoFullName",
    "branch",
    "level",
    "display",
    "problems"
  ],
  "additionalProperties": false,
  "$defs": {
    "EnforcementProblem": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warn",
            "info"
          ]
        },
        "message": {
          "type": "string"
        },
        "fix": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "auto",
                "manual",
                "iac"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "code",
        "severity",
        "message",
        "fix"
      ],
      "additionalProperties": false
    }
  }
}