{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/country-context-review-consent.schema.json",
  "title": "Country Context Reviewer Consent and Publication Scope",
  "type": "object",
  "required": [
    "$schema",
    "record_type",
    "schema_version",
    "release",
    "version",
    "consent_id",
    "reviewer_identity_state",
    "safety_state",
    "publication_scope",
    "withdrawal_and_correction"
  ],
  "properties": {
    "$schema": {
      "const": "https://iarpg.com/country-context-review-consent.schema.json"
    },
    "record_type": {
      "const": "iarpg-country-context-review-consent"
    },
    "schema_version": {
      "const": "1.0"
    },
    "release": {
      "const": "IARPG-OPS-2"
    },
    "version": {
      "const": "2.0.25-wip"
    },
    "consent_id": {
      "type": "string"
    },
    "reviewer_identity_state": {
      "enum": [
        "unanswered",
        "attributable",
        "pseudonymous",
        "confidential",
        "non-public",
        "withdrawn"
      ]
    },
    "safety_state": {
      "enum": [
        "unassessed",
        "assessed-no-special-restriction",
        "restricted",
        "do-not-publish"
      ]
    },
    "reviewer_name_or_consented_pseudonym": {
      "type": [
        "string",
        "null"
      ]
    },
    "identity_verification_method": {
      "type": [
        "string",
        "null"
      ]
    },
    "publication_scope": {
      "type": "object",
      "required": [
        "consent_to_participate",
        "may_quote",
        "may_paraphrase",
        "may_attribute",
        "may_publish_anonymously",
        "may_retain_privately",
        "may_publish_response"
      ],
      "properties": {
        "consent_to_participate": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_quote": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_paraphrase": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_attribute": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_publish_anonymously": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_retain_privately": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "may_publish_response": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "withdrawal_and_correction": {
      "type": "object",
      "required": [
        "withdrawal_route",
        "correction_route",
        "deletion_request_route",
        "request_state"
      ],
      "properties": {
        "withdrawal_route": {
          "type": [
            "string",
            "null"
          ]
        },
        "correction_route": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletion_request_route": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_state": {
          "enum": [
            "none",
            "requested",
            "under-review",
            "completed",
            "denied-with-reason",
            "unanswered"
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}
