{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/photo.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "PhotoService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/photos": {
      "get": {
        "operationId": "PhotoService_ListPhotos",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListPhotosResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "libraryId",
            "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"
          },
          {
            "name": "album",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "cursor",
            "description": "Opaque keyset cursor from a previous ListPhotosResponse.next_cursor. When\nset, offset is ignored and the page is served by index seek instead of the\nCOUNT(*) OVER() window the offset path carries - measured 6.9-8.4ms vs\n0.14-0.24ms on a 7199-photo library, and the gap grows with the table.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PhotoService"
        ]
      }
    },
    "/api/v1/photos/albums": {
      "get": {
        "operationId": "PhotoService_ListPhotoAlbums",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListPhotoAlbumsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "libraryId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "PhotoService"
        ]
      }
    },
    "/api/v1/photos/scan": {
      "post": {
        "operationId": "PhotoService_ScanPhotoDirectory",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ScanPhotoDirectoryResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1ScanPhotoDirectoryRequest"
            }
          }
        ],
        "tags": [
          "PhotoService"
        ]
      }
    },
    "/api/v1/photos/search": {
      "get": {
        "operationId": "PhotoService_SearchPhotos",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SearchPhotosResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "libraryId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "PhotoService"
        ]
      }
    },
    "/api/v1/photos/{id}": {
      "get": {
        "operationId": "PhotoService_GetPhoto",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Photo"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "PhotoService"
        ]
      },
      "delete": {
        "operationId": "PhotoService_DeletePhoto",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "PhotoService"
        ]
      }
    }
  },
  "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"
          }
        }
      }
    },
    "v1ListPhotoAlbumsResponse": {
      "type": "object",
      "properties": {
        "albums": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1PhotoAlbum"
          }
        }
      }
    },
    "v1ListPhotosResponse": {
      "type": "object",
      "properties": {
        "photos": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Photo"
          }
        },
        "total": {
          "type": "integer",
          "format": "int32",
          "description": "Exact row count. Only populated on the OFFSET path: computing it is the\nvery cost the cursor path exists to avoid. On the cursor path it stays 0 -\nuse next_cursor (or a page shorter than the requested limit) to know when\nto stop, never total."
        },
        "nextCursor": {
          "type": "string",
          "description": "Cursor for the following page. Empty means this was the last page."
        }
      }
    },
    "v1Photo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "libraryId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "filePath": {
          "type": "string"
        },
        "fileSize": {
          "type": "string",
          "format": "int64"
        },
        "mimeType": {
          "type": "string"
        },
        "width": {
          "type": "integer",
          "format": "int32"
        },
        "height": {
          "type": "integer",
          "format": "int32"
        },
        "album": {
          "type": "string"
        },
        "takenAt": {
          "type": "string",
          "format": "date-time"
        },
        "cameraModel": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "blurhash": {
          "type": "string",
          "description": "Compact (~30-char) blurhash placeholder computed at scan time. Empty\nwhen the file pre-dates migration 000096 or the encoder couldn't\ndecode the image (HEIC, RAW, etc.). Clients show a coloured preview\nwhile the full photo streams in."
        }
      }
    },
    "v1PhotoAlbum": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "libraryId": {
          "type": "string"
        },
        "photoCount": {
          "type": "integer",
          "format": "int32"
        },
        "coverPhotoId": {
          "type": "string"
        }
      }
    },
    "v1ScanPhotoDirectoryRequest": {
      "type": "object",
      "properties": {
        "libraryId": {
          "type": "string"
        },
        "directory": {
          "type": "string"
        }
      }
    },
    "v1ScanPhotoDirectoryResponse": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "v1SearchPhotosResponse": {
      "type": "object",
      "properties": {
        "photos": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Photo"
          }
        }
      }
    }
  }
}
