{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "pigeon/droppings/report/v1",
  "title": "A periodic transparency report (ADR-0013 (e), ADR-0015 (d) 2)",
  "description": "One file per report in data/reports/. Counts are exact and true as of as_of, and only then. No national-security figure: nsl and fisa are not count kinds (ADR-0015 amendment 1, L16).",
  "type": "object",
  "additionalProperties": false,
  "required": ["format", "number", "as_of", "published", "counts", "accounts_affected", "data_produced", "could_give_version", "history"],
  "properties": {
    "format": {"const": "pigeon/droppings/report/v1"},
    "number": {"type": "integer", "minimum": 1},
    "as_of": {"type": "string", "format": "date"},
    "published": {"type": "string", "format": "date"},
    "counts": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["kind", "received"],
        "properties": {
          "kind": {"enum": ["subpoena", "court_order", "search_warrant", "prospective", "preservation", "emergency", "foreign", "assistance", "civil", "takedown_dmca", "takedown_tida", "takedown_other", "ncmec_report"]},
          "received": {"type": "integer", "minimum": 0}
        }
      }
    },
    "accounts_affected": {"type": "integer", "minimum": 0},
    "data_produced": {"enum": ["none", "some"]},
    "could_give_version": {"type": "integer", "minimum": 1},
    "approved_by": {"$ref": "entry.schema.json#/$defs/approvals"},
    "history": {"$ref": "entry.schema.json#/$defs/history"}
  }
}
