{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/krimskrams-xyz/json-schema/krimskrams-xyz-company-response-schema.json",
  "title": "CompanyResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fcc-license-search_krimskrams_xyz_openapi.json#/components/schemas/CompanyResponse",
  "properties": {
    "answer_status": {
      "type": "string",
      "title": "Answer Status"
    },
    "complete": {
      "type": "boolean",
      "title": "Complete"
    },
    "message": {
      "type": "string",
      "title": "Message"
    },
    "query": {
      "additionalProperties": true,
      "type": "object",
      "title": "Query"
    },
    "as_of": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "As Of"
    },
    "coverage_window": {
      "additionalProperties": true,
      "type": "object",
      "title": "Coverage Window"
    },
    "coverage": {
      "additionalProperties": true,
      "type": "object",
      "title": "Coverage"
    },
    "searched": {
      "additionalProperties": true,
      "type": "object",
      "title": "Searched"
    },
    "matched_entity_count": {
      "type": "integer",
      "title": "Matched Entity Count"
    },
    "matched_licence_count": {
      "type": "integer",
      "title": "Matched Licence Count"
    },
    "returned_licence_count": {
      "type": "integer",
      "title": "Returned Licence Count"
    },
    "truncated": {
      "type": "boolean",
      "title": "Truncated"
    },
    "entities": {
      "items": {
        "$ref": "#/$defs/CompanyEntity"
      },
      "type": "array",
      "title": "Entities"
    },
    "summary": {
      "anyOf": [
        {
          "$ref": "#/$defs/CompanySummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "licences": {
      "items": {
        "$ref": "#/$defs/CompanyLicence"
      },
      "type": "array",
      "title": "Licences"
    },
    "soonest_upcoming_expiry": {
      "anyOf": [
        {
          "$ref": "#/$defs/UpcomingExpiry"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "answer_status",
    "complete",
    "message",
    "query",
    "coverage_window",
    "coverage",
    "searched",
    "matched_entity_count",
    "matched_licence_count",
    "returned_licence_count",
    "truncated",
    "entities",
    "licences"
  ],
  "$defs": {
    "CompanyEntity": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "frn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Frn"
        },
        "entity_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Entity Type"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State"
        },
        "identifiers": {
          "additionalProperties": {
            "items": {},
            "type": "array"
          },
          "type": "object",
          "title": "Identifiers"
        },
        "matched_licence_count": {
          "type": "integer",
          "title": "Matched Licence Count",
          "default": 0
        },
        "identifiers_truncated": {
          "type": "boolean",
          "title": "Identifiers Truncated",
          "default": false
        },
        "provenance": {
          "items": {
            "$ref": "#/$defs/Provenance"
          },
          "type": "array",
          "title": "Provenance"
        }
      },
      "type": "object",
      "required": [
        "identifiers",
        "provenance"
      ],
      "title": "CompanyEntity"
    },
    "CompanyLicence": {
      "properties": {
        "usi": {
          "type": "integer",
          "title": "Usi"
        },
        "uls_file_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uls File Number"
        },
        "callsign": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Callsign"
        },
        "service": {
          "type": "string",
          "title": "Service"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "grant_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Grant Date"
        },
        "expiry_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expiry Date"
        },
        "cancellation_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cancellation Date"
        },
        "provenance": {
          "$ref": "#/$defs/Provenance"
        }
      },
      "type": "object",
      "required": [
        "usi",
        "service",
        "status",
        "provenance"
      ],
      "title": "CompanyLicence"
    },
    "CompanySummary": {
      "properties": {
        "total": {
          "type": "integer",
          "title": "Total"
        },
        "by_service": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "By Service"
        },
        "by_status": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "By Status"
        },
        "provenance": {
          "items": {
            "$ref": "#/$defs/Provenance"
          },
          "type": "array",
          "title": "Provenance"
        }
      },
      "type": "object",
      "required": [
        "total",
        "by_service",
        "by_status",
        "provenance"
      ],
      "title": "CompanySummary"
    },
    "Provenance": {
      "properties": {
        "available": {
          "type": "boolean",
          "title": "Available",
          "default": true
        },
        "source_file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source File"
        },
        "ingest_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ingest Date"
        },
        "archive_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Archive Url"
        }
      },
      "type": "object",
      "title": "Provenance"
    },
    "UpcomingExpiry": {
      "properties": {
        "usi": {
          "type": "integer",
          "title": "Usi"
        },
        "callsign": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Callsign"
        },
        "expiry_date": {
          "type": "string",
          "format": "date",
          "title": "Expiry Date"
        },
        "provenance": {
          "$ref": "#/$defs/Provenance"
        }
      },
      "type": "object",
      "required": [
        "usi",
        "expiry_date",
        "provenance"
      ],
      "title": "UpcomingExpiry"
    }
  }
}