{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hackforddata-com/json-schema/hackforddata-com-firm-permissions-response-schema.json",
  "title": "FirmPermissionsResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hackforddata-com-openapi.yml#/components/schemas/FirmPermissionsResponse",
  "type": "object",
  "properties": {
    "firm": {
      "$ref": "#/$defs/FirmPermissionFirm"
    },
    "count": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "page_size": {
      "type": "integer"
    },
    "next": {
      "type": [
        "string",
        "null"
      ]
    },
    "previous": {
      "type": [
        "string",
        "null"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FirmPermissionRow"
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": {}
    },
    "limitations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "count",
    "firm",
    "limitations",
    "next",
    "page",
    "page_size",
    "previous",
    "results",
    "source"
  ],
  "$defs": {
    "FirmIdentifiers": {
      "type": "object",
      "properties": {
        "fca_frn": {
          "type": [
            "string",
            "null"
          ]
        },
        "sec_crd": {
          "type": [
            "string",
            "null"
          ]
        },
        "sec_file": {
          "type": [
            "string",
            "null"
          ]
        },
        "cik": {
          "type": [
            "string",
            "null"
          ]
        },
        "companies_house": {
          "type": [
            "string",
            "null"
          ]
        },
        "lei": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FirmPermissionFirm": {
      "type": "object",
      "properties": {
        "hackford_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "canonical_url": {
          "type": "string"
        },
        "identifiers": {
          "$ref": "#/$defs/FirmIdentifiers"
        }
      },
      "required": [
        "canonical_url",
        "display_name",
        "hackford_id",
        "identifiers"
      ]
    },
    "FirmPermissionRow": {
      "type": "object",
      "properties": {
        "source_authority": {
          "type": "string"
        },
        "permission": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": [
            "string",
            "null"
          ]
        },
        "regulated_activity": {
          "type": [
            "string",
            "null"
          ]
        },
        "permission_group": {
          "type": [
            "string",
            "null"
          ]
        },
        "investment_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "limitation_requirement_text": {
          "type": [
            "string",
            "null"
          ]
        },
        "effective_from": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "effective_to": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "is_current": {
          "type": "boolean"
        },
        "raw_source_text": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_last_refreshed": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "as_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      },
      "required": [
        "as_at",
        "customer_type",
        "effective_from",
        "effective_to",
        "investment_type",
        "is_current",
        "limitation_requirement_text",
        "permission",
        "permission_group",
        "raw_source_text",
        "regulated_activity",
        "source_authority",
        "source_last_refreshed",
        "status"
      ]
    }
  }
}