{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "const": "v1"
        },
        "generated": {
          "type": "string"
        },
        "licence": {
          "type": "string",
          "const": "CC BY 4.0"
        },
        "licence_url": {
          "type": "string",
          "const": "https://creativecommons.org/licenses/by/4.0/"
        },
        "cite_as": {
          "type": "string",
          "const": "Scamstats (Armidale), scamstats.org"
        },
        "page_url": {
          "type": "string"
        },
        "iso2": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "people_scammed": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "share_of_adults": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "money_lost": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "money_lost_usd": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "cases_recorded": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "top_types": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "rank": {
                "type": "number"
              },
              "code": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "rank",
              "code",
              "label"
            ],
            "additionalProperties": false
          }
        },
        "unranked_share": {
          "type": [
            "number",
            "null"
          ]
        },
        "police": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "series_id": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "reporting_bodies": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "counts": {
                "type": "string",
                "enum": [
                  "cases",
                  "people"
                ]
              },
              "includes_attempted": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  "unknown"
                ]
              },
              "authorisation": {
                "type": "string",
                "enum": [
                  "authorised",
                  "unauthorised",
                  "both",
                  "unknown"
                ]
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              },
              "value": {
                "type": "number"
              }
            },
            "required": [
              "series_id",
              "description",
              "reporting_bodies",
              "counts",
              "includes_attempted",
              "authorisation",
              "period_start",
              "period_end",
              "value"
            ],
            "additionalProperties": false
          }
        },
        "status": {
          "type": "string",
          "const": "live"
        },
        "population": {
          "type": "object",
          "properties": {
            "total": {
              "type": "number"
            },
            "adults": {
              "type": "number"
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "total",
            "adults",
            "year"
          ],
          "additionalProperties": false
        },
        "share_lost_money": {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "display": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "enum": [
                "measured",
                "estimated",
                "borrowed"
              ]
            },
            "donors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "donors_name": {
              "type": "string"
            },
            "period_start": {
              "type": "string"
            },
            "period_end": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "display",
            "basis",
            "donors",
            "donors_name",
            "period_start",
            "period_end"
          ],
          "additionalProperties": false
        },
        "share_told_police": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "value": {
                  "type": "number"
                },
                "display": {
                  "type": "string"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "measured",
                    "estimated",
                    "borrowed"
                  ]
                },
                "donors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "donors_name": {
                  "type": "string"
                },
                "period_start": {
                  "type": "string"
                },
                "period_end": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "display",
                "basis",
                "donors",
                "donors_name",
                "period_start",
                "period_end"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "money_returned_usd": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "value": {
                  "type": "number"
                },
                "display": {
                  "type": "string"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "measured",
                    "estimated",
                    "borrowed"
                  ]
                },
                "donors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "donors_name": {
                  "type": "string"
                },
                "period_start": {
                  "type": "string"
                },
                "period_end": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "display",
                "basis",
                "donors",
                "donors_name",
                "period_start",
                "period_end"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "money_returned_share": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "value": {
                  "type": "number"
                },
                "display": {
                  "type": "string"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "measured",
                    "estimated",
                    "borrowed"
                  ]
                },
                "donors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "donors_name": {
                  "type": "string"
                },
                "period_start": {
                  "type": "string"
                },
                "period_end": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "display",
                "basis",
                "donors",
                "donors_name",
                "period_start",
                "period_end"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "scam_types": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "people": {
                "type": "number"
              },
              "people_display": {
                "type": "string"
              },
              "money_usd": {
                "type": "number"
              },
              "money_usd_display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "label",
              "people",
              "people_display",
              "money_usd",
              "money_usd_display",
              "basis",
              "donors",
              "donors_name"
            ],
            "additionalProperties": false
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source_id": {
                "type": "string"
              },
              "publisher": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "archive_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "published": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "kind": {
                "type": "string",
                "enum": [
                  "official",
                  "survey",
                  "industry",
                  "news",
                  "derived"
                ]
              }
            },
            "required": [
              "source_id",
              "publisher",
              "title",
              "url",
              "archive_url",
              "published",
              "kind"
            ],
            "additionalProperties": false
          }
        },
        "catalogue_url": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "generated",
        "licence",
        "licence_url",
        "cite_as",
        "page_url",
        "iso2",
        "name",
        "currency",
        "people_scammed",
        "share_of_adults",
        "money_lost",
        "money_lost_usd",
        "cases_recorded",
        "top_types",
        "unranked_share",
        "police",
        "status",
        "population",
        "share_lost_money",
        "share_told_police",
        "money_returned_usd",
        "money_returned_share",
        "scam_types",
        "sources",
        "catalogue_url"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "const": "v1"
        },
        "generated": {
          "type": "string"
        },
        "licence": {
          "type": "string",
          "const": "CC BY 4.0"
        },
        "licence_url": {
          "type": "string",
          "const": "https://creativecommons.org/licenses/by/4.0/"
        },
        "cite_as": {
          "type": "string",
          "const": "Scamstats (Armidale), scamstats.org"
        },
        "page_url": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "no_data"
        },
        "iso2": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "catalogue_url": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "generated",
        "licence",
        "licence_url",
        "cite_as",
        "page_url",
        "status",
        "iso2",
        "name",
        "catalogue_url"
      ],
      "additionalProperties": false
    }
  ]
}
