{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Required new-build JSON endpoint error",
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "code": {
          "enum": [
            "AUTH_REQUIRED",
            "DRIVE_REAUTH_REQUIRED",
            "FORBIDDEN",
            "ACCOUNT_DISABLED",
            "VALIDATION_ERROR",
            "NOT_FOUND",
            "ACCOUNT_MISMATCH",
            "REVISION_CONFLICT",
            "UPLOAD_OFFSET_MISMATCH",
            "MIGRATION_RECEIPT_MISMATCH",
            "PAYLOAD_TOO_LARGE",
            "UNSUPPORTED_ENCODING",
            "RATE_LIMITED",
            "PROVIDER_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "retryable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "requestId": {
      "type": "string",
      "minLength": 1
    },
    "maxBytes": {
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "error": {
            "properties": {
              "code": {
                "const": "PAYLOAD_TOO_LARGE"
              }
            }
          }
        }
      },
      "then": {
        "required": [
          "maxBytes"
        ]
      }
    }
  ]
}
