{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/favorite.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "FavoriteService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/favorites": {
      "get": {
        "operationId": "FavoriteService_ListFavorites",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListFavoritesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "FavoriteService"
        ]
      }
    },
    "/api/v1/favorites/batch/is-favorite": {
      "post": {
        "summary": "Batch counterpart of IsFavorite: one call answers for a whole screen.\nPOST because the id list does not fit a query string at grid sizes, and on\na path deeper than /api/v1/favorites/{media_item_id} so the gateway can\nnever route it to AddFavorite with media_item_id=\"batch\".",
        "operationId": "FavoriteService_BatchIsFavorite",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1BatchIsFavoriteResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1BatchIsFavoriteRequest"
            }
          }
        ],
        "tags": [
          "FavoriteService"
        ]
      }
    },
    "/api/v1/favorites/{mediaItemId}": {
      "get": {
        "operationId": "FavoriteService_IsFavorite",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1IsFavoriteResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mediaItemId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "FavoriteService"
        ]
      },
      "delete": {
        "operationId": "FavoriteService_RemoveFavorite",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RemoveFavoriteResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mediaItemId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "FavoriteService"
        ]
      },
      "post": {
        "operationId": "FavoriteService_AddFavorite",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AddFavoriteResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mediaItemId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FavoriteServiceAddFavoriteBody"
            }
          }
        ],
        "tags": [
          "FavoriteService"
        ]
      }
    }
  },
  "definitions": {
    "FavoriteServiceAddFavoriteBody": {
      "type": "object",
      "properties": {
        "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"
          }
        }
      }
    },
    "v1AddFavoriteResponse": {
      "type": "object",
      "properties": {
        "isFavorite": {
          "type": "boolean"
        }
      }
    },
    "v1BatchIsFavoriteRequest": {
      "type": "object",
      "properties": {
        "mediaItemIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Over the server's ceiling the call is REFUSED, never truncated: a silently\nshortened answer reads as \"not a favorite\" on the client and paints an\nempty heart over a real favorite."
        },
        "profileId": {
          "type": "string"
        }
      }
    },
    "v1BatchIsFavoriteResponse": {
      "type": "object",
      "properties": {
        "favoriteMediaItemIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Only the ids that ARE favorites of the caller's profile. Anything asked\nabout and not returned is simply \"not a favorite\" - which is also what an\nunknown id, an item in a library the caller cannot access and a parentally\nblocked item look like, so the answer never reveals that a media item exists."
        }
      }
    },
    "v1FavoriteProto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "profileId": {
          "type": "string"
        },
        "mediaItemId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "year": {
          "type": "integer",
          "format": "int32"
        },
        "communityRating": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "v1IsFavoriteResponse": {
      "type": "object",
      "properties": {
        "isFavorite": {
          "type": "boolean"
        }
      }
    },
    "v1ListFavoritesResponse": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1FavoriteProto"
          }
        }
      }
    },
    "v1RemoveFavoriteResponse": {
      "type": "object"
    }
  }
}
