{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/syncplay.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "SyncPlayService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/syncplay/join": {
      "post": {
        "operationId": "SyncPlayService_JoinByCode",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1JoinSyncPlayByCodeResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1JoinSyncPlayByCodeRequest"
            }
          }
        ],
        "tags": [
          "SyncPlayService"
        ]
      }
    },
    "/api/v1/syncplay/rooms": {
      "post": {
        "operationId": "SyncPlayService_CreateRoom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateSyncPlayRoomResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateSyncPlayRoomRequest"
            }
          }
        ],
        "tags": [
          "SyncPlayService"
        ]
      }
    },
    "/api/v1/syncplay/rooms/{roomId}": {
      "get": {
        "operationId": "SyncPlayService_GetRoom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetSyncPlayRoomResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SyncPlayService"
        ]
      }
    },
    "/api/v1/syncplay/rooms/{roomId}/join": {
      "post": {
        "operationId": "SyncPlayService_JoinRoom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1JoinSyncPlayRoomResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SyncPlayServiceJoinRoomBody"
            }
          }
        ],
        "tags": [
          "SyncPlayService"
        ]
      }
    },
    "/api/v1/syncplay/rooms/{roomId}/leave": {
      "delete": {
        "operationId": "SyncPlayService_LeaveRoom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1LeaveSyncPlayRoomResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SyncPlayService"
        ]
      }
    }
  },
  "definitions": {
    "SyncPlayServiceJoinRoomBody": {
      "type": "object"
    },
    "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"
          }
        }
      }
    },
    "v1CreateSyncPlayRoomRequest": {
      "type": "object",
      "properties": {
        "mediaId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "mediaType": {
          "type": "string",
          "title": "\"video\" (default) or \"music\""
        },
        "playlistId": {
          "type": "string",
          "title": "optional: bind room to a music playlist (implies media_type=music)"
        },
        "queue": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "optional: an explicit ordered queue of track IDs (implies media_type=music).\nLets the client build a room from a mix of albums, individual tracks and\nplaylists. When set, the first id becomes the current track and the rest\nform the queue; media_id/playlist_id are ignored."
        }
      }
    },
    "v1CreateSyncPlayRoomResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "hostId": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        }
      }
    },
    "v1GetSyncPlayRoomResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "hostId": {
          "type": "string"
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1SyncPlayMember"
          }
        },
        "state": {
          "$ref": "#/definitions/v1SyncPlayState"
        },
        "code": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "queue": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "trackIndex": {
          "type": "integer",
          "format": "int32"
        },
        "playlistId": {
          "type": "string"
        }
      }
    },
    "v1JoinSyncPlayByCodeRequest": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        }
      }
    },
    "v1JoinSyncPlayByCodeResponse": {
      "type": "object",
      "properties": {
        "roomId": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "wsUrl": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        }
      }
    },
    "v1JoinSyncPlayRoomResponse": {
      "type": "object",
      "properties": {
        "roomId": {
          "type": "string"
        },
        "wsUrl": {
          "type": "string"
        }
      }
    },
    "v1LeaveSyncPlayRoomResponse": {
      "type": "object"
    },
    "v1SyncPlayMember": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "string"
        },
        "username": {
          "type": "string"
        }
      }
    },
    "v1SyncPlayState": {
      "type": "object",
      "properties": {
        "playing": {
          "type": "boolean"
        },
        "positionMs": {
          "type": "string",
          "format": "int64"
        }
      }
    }
  }
}
