{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SlidePack API",
  "description": "Schema for SlidePack HTTP API endpoint responses",

  "$defs": {
    "_session": {
      "type": "object",
      "description": "The [Session object](#session-object).",
      "description-ja": "[Sessionオブジェクト](#session-object)"
    },
    "_upload": {
      "type": "object",
      "description": "Parameters for [uploading the input zip file](#upload).",
      "description-ja": "[入力zipファイルアップロード](#upload)に利用するパラメータ"
    },
    "_download-url": {
      "type": "string",
      "description": "Download URL for your rendered PPTX file.",
      "description-ja": "レンダリング済みpptxファイルのダウンロードURL"
    },

    "post-sessions": {
      "type": "object",
      "x-method": "POST",
      "x-path": "/sessions",
      "x-doc-properties": ["session", "upload"],
      "properties": {
        "session": {
          "$ref": "#/$defs/_session",
          "description": "The created [Session object](#session-object).",
          "description-ja": "作成された[Sessionオブジェクト](#session-object)"
        },
        "upload": { "$ref": "#/$defs/_upload" }
      }
    },
    "get-sessions": {
      "type": "object",
      "x-method": "GET",
      "x-path": "/sessions",
      "x-doc-properties": ["sessions"],
      "properties": {
        "sessions": {
          "type": "array",
          "x-display-type": "object[]",
          "description": "Array of [Session object](#session-object) summary subsets.",
          "description-ja": "[Sessionオブジェクト](#session-object)のサブセットの配列"
        }
      }
    },
    "get-session": {
      "type": "object",
      "x-method": "GET",
      "x-path": "/sessions/{uuid}",
      "x-doc-properties": ["session", "upload"],
      "properties": {
        "session": { "$ref": "#/$defs/_session" },
        "upload": { "$ref": "#/$defs/_upload" }
      }
    },
    "render": {
      "type": "object",
      "x-method": "POST",
      "x-path": "/sessions/{uuid}/render",
      "x-doc-properties": ["session", "download_url"],
      "properties": {
        "session": { "$ref": "#/$defs/_session" },
        "download_url": { "$ref": "#/$defs/_download-url" }
      }
    },
    "reissue-download-url": {
      "type": "object",
      "x-method": "POST",
      "x-path": "/sessions/{uuid}/download_url",
      "x-doc-properties": ["session", "download_url"],
      "properties": {
        "session": { "$ref": "#/$defs/_session" },
        "download_url": { "$ref": "#/$defs/_download-url" }
      }
    },
    "session-object": {
      "type": "object",
      "x-doc-properties": [
        "uuid",
        "created_at",
        "rendered_at",
        "render_succeeded",
        "render_slide_count",
        "render_message"
      ],
      "properties": {
        "uuid": {
          "type": "string",
          "description": "Unique identifier for the object.",
          "description-ja": "セッションのユニークID"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Creation timestamp.",
          "description-ja": "作成日時"
        },
        "rendered_at": {
          "type": ["string", "null"],
          "format": "date-time",
          "x-display-type": "string or null",
          "description": "Rendered timestamp.\n`null` if session has not been rendered yet.",
          "description-ja": "レンダリング日時。\n未レンダリングの場合は`null`"
        },
        "render_succeeded": {
          "type": ["boolean", "null"],
          "x-display-type": "boolean or null",
          "description": "`true` if render was successful, `false` if not. \n`null` if session has not been rendered yet.",
          "description-ja": "レンダリングが成功した場合は`true`、失敗した場合は`false`。\n未レンダリングの場合は`null`"
        },
        "render_slide_count": {
          "type": ["integer", "null"],
          "x-display-type": "integer or null",
          "description": "Number of slides rendered if render was successful. \n`null` if session has not been rendered yet.",
          "description-ja": "レンダリング成功時の実績スライド枚数。\n未レンダリングの場合は`null`"
        },
        "render_message": {
          "type": ["string", "null"],
          "x-display-type": "string or null",
          "description": "Error message if render was unsuccessful. \n`null` if session has not been rendered yet, or render was successful.",
          "description-ja": "レンダリング失敗時のエラーメッセージ。\n未レンダリングの場合、およびレンダリングが成功した場合は`null`"
        }
      }
    }
  }
}
