{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "consent": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "member": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "channel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "state": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "wording": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": ["member", "channel", "state", "at", "wording", "source"]
      }
    },
    "history": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "member": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^[a-zA-Z0-9_-]+$"
              },
              "channel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "state": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "at": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "wording": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "required": [
              "member",
              "channel",
              "state",
              "at",
              "wording",
              "source"
            ]
          }
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": ["items", "nextCursor"]
    }
  },
  "required": ["consent", "history"]
}
