{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "leaderboard": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "title": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0,
                "maximum": 8640000000000000
              },
              "end": {
                "type": "integer",
                "minimum": 0,
                "maximum": 8640000000000000
              }
            },
            "required": ["start", "end"]
          },
          "ties": {
            "type": "string",
            "enum": ["shared", "earliest"]
          },
          "status": {
            "type": "string",
            "enum": ["pending", "approved", "rejected"]
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "winners": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8640000000000000
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 8640000000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "approvalReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "type": "object",
            "properties": {
              "startedAt": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "deadline": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": ["startedAt", "deadline"]
          },
          "rejectedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "rejectedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rejectionReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "leaderboard",
          "version",
          "title",
          "period",
          "ties",
          "status",
          "total",
          "winners",
          "createdAt",
          "approvedAt",
          "approvedBy",
          "approvalReason",
          "rejectedAt",
          "rejectedBy",
          "rejectionReason"
        ]
      }
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": ["items", "nextCursor"]
}
