{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/playlist.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "PlaylistService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/playlists": {
      "get": {
        "operationId": "PlaylistService_ListPlaylists",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListPlaylistsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "profileId",
            "description": "Deprecated: playlists are user-scoped; the handler uses claims.UserID and\nignores this field. Retained for wire compatibility; remove in a future\nproto release per ADR-0004.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      },
      "post": {
        "operationId": "PlaylistService_CreatePlaylist",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaylistProto"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreatePlaylistRequest"
            }
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      }
    },
    "/api/v1/playlists/{id}": {
      "get": {
        "operationId": "PlaylistService_GetPlaylist",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaylistProto"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      },
      "delete": {
        "operationId": "PlaylistService_DeletePlaylist",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DeletePlaylistResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      },
      "patch": {
        "operationId": "PlaylistService_UpdatePlaylist",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaylistProto"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PlaylistServiceUpdatePlaylistBody"
            }
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      }
    },
    "/api/v1/playlists/{id}/items": {
      "get": {
        "operationId": "PlaylistService_GetPlaylistItems",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetPlaylistItemsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      },
      "post": {
        "operationId": "PlaylistService_AddPlaylistItem",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddPlaylistItemResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PlaylistServiceAddPlaylistItemBody"
            }
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      }
    },
    "/api/v1/playlists/{id}/items/{mediaItemId}": {
      "delete": {
        "operationId": "PlaylistService_RemovePlaylistItem",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RemovePlaylistItemResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "mediaItemId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PlaylistService"
        ]
      }
    }
  },
  "definitions": {
    "PlaylistServiceAddPlaylistItemBody": {
      "type": "object",
      "properties": {
        "mediaItemId": {
          "type": "string"
        },
        "profileId": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        }
      }
    },
    "PlaylistServiceUpdatePlaylistBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PlaylistRule"
          }
        },
        "sortBy": {
          "type": "string"
        },
        "sortOrder": {
          "type": "string"
        },
        "profileId": {
          "type": "string"
        }
      }
    },
    "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"
          }
        }
      }
    },
    "v1AddPlaylistItemResponse": {
      "type": "object"
    },
    "v1CreatePlaylistRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/v1PlaylistType"
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PlaylistRule"
          }
        },
        "sortBy": {
          "type": "string"
        },
        "sortOrder": {
          "type": "string"
        },
        "profileId": {
          "type": "string"
        }
      }
    },
    "v1DeletePlaylistResponse": {
      "type": "object"
    },
    "v1GetPlaylistItemsResponse": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PlaylistItemProto"
          }
        }
      }
    },
    "v1ListPlaylistsResponse": {
      "type": "object",
      "properties": {
        "playlists": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PlaylistProto"
          }
        }
      }
    },
    "v1PlaylistItemProto": {
      "type": "object",
      "properties": {
        "playlistId": {
          "type": "string"
        },
        "mediaItemId": {
          "type": "string"
        },
        "sortOrder": {
          "type": "integer",
          "format": "int32"
        },
        "addedAt": {
          "type": "string",
          "format": "date-time"
        },
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "year": {
          "type": "integer",
          "format": "int32"
        },
        "mediaType": {
          "type": "string"
        }
      }
    },
    "v1PlaylistProto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "userId": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/v1PlaylistType"
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PlaylistRule"
          }
        },
        "sortBy": {
          "type": "string"
        },
        "sortOrder": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1PlaylistRule": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "v1PlaylistType": {
      "type": "string",
      "enum": [
        "PLAYLIST_TYPE_UNSPECIFIED",
        "PLAYLIST_TYPE_MANUAL",
        "PLAYLIST_TYPE_SMART"
      ],
      "default": "PLAYLIST_TYPE_UNSPECIFIED"
    },
    "v1RemovePlaylistItemResponse": {
      "type": "object"
    }
  }
}
