{
  "swagger": "2.0",
  "info": {
    "title": "radio.proto",
    "version": "1.0"
  },
  "tags": [
    {
      "name": "RadioService"
    }
  ],
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/radio/next": {
      "get": {
        "summary": "Get the next episode to play.",
        "operationId": "getNext",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/rskNextRadioEpisode"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "search"
        ]
      }
    },
    "/api/radio/state": {
      "get": {
        "summary": "Get the current episode to play.",
        "operationId": "getState",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/rskRadioState"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "search"
        ]
      },
      "put": {
        "summary": "Store the current state.",
        "operationId": "putState",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/rskPutRadioStateRequest"
            }
          }
        ],
        "tags": [
          "search"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "rskCurrentRadioEpisode": {
      "type": "object",
      "properties": {
        "shortId": {
          "type": "string"
        },
        "startedAt": {
          "type": "string"
        }
      }
    },
    "rskNextRadioEpisode": {
      "type": "object",
      "properties": {
        "shortId": {
          "type": "string"
        }
      }
    },
    "rskPutRadioStateRequest": {
      "type": "object",
      "properties": {
        "currentEpisode": {
          "$ref": "#/definitions/rskCurrentRadioEpisode"
        },
        "currentTimestampMs": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "rskRadioState": {
      "type": "object",
      "properties": {
        "currentEpisode": {
          "$ref": "#/definitions/rskCurrentRadioEpisode"
        },
        "currentTimestampMs": {
          "type": "integer",
          "format": "int32"
        }
      }
    }
  },
  "externalDocs": {
    "description": "Radio service provides endpoints for radio player.",
    "url": "https://scrimpton.com"
  }
}