package restapi

import (
	"encoding/json"
)

var (

	SwaggerJSON json.RawMessage

	FlatSwaggerJSON json.RawMessage
)

func init() {
	SwaggerJSON = json.RawMessage([]byte(`{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "This is the API for the freecloud server.",
    "title": "freecloud API",
    "license": {
      "name": "Apache 2.0",
      "url": "http:
    },
    "version": "1.0.0"
  },
  "host": "freecloud.glidingthrough.space",
  "basePath": "/api/v1",
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login with existing user",
        "operationId": "login",
        "parameters": [
          {
            "description": "Credentials for login",
            "name": "credentials",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LoginData"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "auth"
        ],
        "summary": "Logout current user",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/signup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Signup as a new user",
        "operationId": "signup",
        "parameters": [
          {
            "description": "User that should be registered",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get pathInfo of requested path",
        "operationId": "getPathInfo",
        "parameters": [
          {
            "type": "string",
            "description": "Requested path",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested pathInfo",
            "schema": {
              "$ref": "#/definitions/PathInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Create new file/folder",
        "operationId": "createFile",
        "parameters": [
          {
            "name": "createFileRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateFileRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/FileInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete file/folder",
        "operationId": "deleteFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to delete",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Update file/folder",
        "operationId": "updateFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to update",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "name": "fileInfoUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FileInfoUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/download": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "produces": [
          "application/gzip"
        ],
        "tags": [
          "file"
        ],
        "summary": "Downloads a file.",
        "operationId": "downloadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to the file to download",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested gzipped file",
            "schema": {
              "type": "file"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/me": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan own data folder",
        "operationId": "rescanCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/{id}": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan data folder by user id",
        "operationId": "rescanUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/search": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Search files/folders",
        "operationId": "searchFile",
        "parameters": [
          {
            "name": "searchRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SearchRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Share files/folders",
        "operationId": "shareFiles",
        "parameters": [
          {
            "name": "shareRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ShareRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/{shareID}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get share entry by shareID",
        "operationId": "getShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "Requested shareID",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Share entry",
            "schema": {
              "$ref": "#/definitions/ShareEntry"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete share entry by shareID",
        "operationId": "deleteShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "ShareID to be deleted",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/starred": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get starred files/folders infos",
        "operationId": "getStarredFileInfos",
        "responses": {
          "200": {
            "description": "Starred file infos",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/upload": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "file"
        ],
        "summary": "Uploads a file.",
        "operationId": "uploadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path where to upload file",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "type": "file",
            "description": "The file to upload.",
            "name": "upfile",
            "in": "formData"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/zip": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Creates a zip archive from files",
        "operationId": "zipFiles",
        "parameters": [
          {
            "name": "paths",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PathList"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Path"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/system/stats": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "system"
        ],
        "summary": "Get system status",
        "operationId": "getSystemStats",
        "responses": {
          "200": {
            "description": "System stats",
            "schema": {
              "$ref": "#/definitions/SystemStats"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/me": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get current user",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete current user",
        "operationId": "deleteCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify current user",
        "operationId": "updateCurrentUser",
        "parameters": [
          {
            "description": "Updated user info",
            "name": "userInfo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/{id}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get specific user by id",
        "operationId": "getUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete user by id",
        "operationId": "deleteUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify user by id",
        "operationId": "updateUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated user info",
            "name": "userUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UserUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "CreateFileRequest": {
      "type": "object",
      "properties": {
        "fullPath": {
          "type": "string"
        },
        "isDir": {
          "type": "boolean"
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "FileInfo": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "isDir": {
          "type": "boolean"
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64"
        },
        "mimeType": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "ownerID": {
          "type": "integer"
        },
        "parentID": {
          "type": "integer",
          "format": "int64"
        },
        "path": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "shareID": {
          "type": "integer",
          "format": "int64"
        },
        "size": {
          "type": "integer",
          "format": "int64"
        },
        "starred": {
          "type": "boolean",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "FileInfoUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "isDir": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "mimeType": {
          "type": "string",
          "x-nullable": true
        },
        "name": {
          "type": "string",
          "x-nullable": true
        },
        "ownerID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "parentID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "path": {
          "type": "string",
          "x-nullable": true
        },
        "shareID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "starred": {
          "type": "boolean",
          "x-nullable": true
        }
      }
    },
    "FileList": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        }
      }
    },
    "LoginData": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "Path": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        }
      }
    },
    "PathInfo": {
      "type": "object",
      "properties": {
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        },
        "fileInfo": {
          "$ref": "#/definitions/FileInfo"
        }
      }
    },
    "PathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "token": {
          "$ref": "#/definitions/Token"
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "SearchRequest": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        }
      }
    },
    "ShareEntry": {
      "type": "object",
      "properties": {
        "FileID": {
          "type": "integer",
          "format": "int64"
        },
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "OwnerID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        },
        "SharedWithID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "ShareRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "users": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "SystemStats": {
      "type": "object",
      "properties": {
        "allocMem": {
          "type": "integer",
          "format": "int64"
        },
        "goVersion": {
          "type": "string"
        },
        "numGC": {
          "type": "integer"
        },
        "numGoroutines": {
          "type": "integer"
        },
        "numSessions": {
          "type": "integer"
        },
        "systemMem": {
          "type": "integer",
          "format": "int64"
        },
        "totalAllocMem": {
          "type": "integer",
          "format": "int64"
        },
        "uptime": {
          "type": "integer",
          "format": "int64"
        },
        "version": {
          "type": "string"
        }
      }
    },
    "Token": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "created": {
          "type": "integer",
          "format": "int64"
        },
        "email": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"unique_index\""
        },
        "firstName": {
          "type": "string"
        },
        "isAdmin": {
          "type": "boolean"
        },
        "lastName": {
          "type": "string"
        },
        "lastSession": {
          "type": "integer",
          "format": "int64"
        },
        "password": {
          "type": "string"
        },
        "retainFilesAfterDeletion": {
          "type": "boolean"
        },
        "updated": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "UserUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "created": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "x-nullable": true
        },
        "firstName": {
          "type": "string",
          "x-nullable": true
        },
        "isAdmin": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "x-nullable": true
        },
        "lastSession": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "password": {
          "type": "string",
          "x-nullable": true
        },
        "retainFilesAfterDeletion": {
          "type": "boolean",
          "x-nullable": true
        },
        "updated": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        }
      }
    }
  },
  "securityDefinitions": {
    "TokenAuth": {
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "https:
      "tokenUrl": "https:
      "scopes": {
        "admin": "admin with all privileges",
        "user": "normal user"
      }
    }
  },
  "tags": [
    {
      "description": "Authentication",
      "name": "auth"
    },
    {
      "description": "User management",
      "name": "user"
    },
    {
      "description": "File management",
      "name": "file"
    },
    {
      "description": "System management",
      "name": "system"
    }
  ]
}`))
	FlatSwaggerJSON = json.RawMessage([]byte(`{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "This is the API for the freecloud server.",
    "title": "freecloud API",
    "license": {
      "name": "Apache 2.0",
      "url": "http:
    },
    "version": "1.0.0"
  },
  "host": "freecloud.glidingthrough.space",
  "basePath": "/api/v1",
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login with existing user",
        "operationId": "login",
        "parameters": [
          {
            "description": "Credentials for login",
            "name": "credentials",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LoginData"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "auth"
        ],
        "summary": "Logout current user",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/signup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Signup as a new user",
        "operationId": "signup",
        "parameters": [
          {
            "description": "User that should be registered",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get pathInfo of requested path",
        "operationId": "getPathInfo",
        "parameters": [
          {
            "type": "string",
            "description": "Requested path",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested pathInfo",
            "schema": {
              "$ref": "#/definitions/PathInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Create new file/folder",
        "operationId": "createFile",
        "parameters": [
          {
            "name": "createFileRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateFileRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/FileInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete file/folder",
        "operationId": "deleteFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to delete",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Update file/folder",
        "operationId": "updateFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to update",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "name": "fileInfoUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FileInfoUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/download": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "produces": [
          "application/gzip"
        ],
        "tags": [
          "file"
        ],
        "summary": "Downloads a file.",
        "operationId": "downloadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to the file to download",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested gzipped file",
            "schema": {
              "type": "file"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/me": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan own data folder",
        "operationId": "rescanCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/{id}": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan data folder by user id",
        "operationId": "rescanUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/search": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Search files/folders",
        "operationId": "searchFile",
        "parameters": [
          {
            "name": "searchRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SearchRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Share files/folders",
        "operationId": "shareFiles",
        "parameters": [
          {
            "name": "shareRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ShareRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/{shareID}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get share entry by shareID",
        "operationId": "getShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "Requested shareID",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Share entry",
            "schema": {
              "$ref": "#/definitions/ShareEntry"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete share entry by shareID",
        "operationId": "deleteShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "ShareID to be deleted",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/starred": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get starred files/folders infos",
        "operationId": "getStarredFileInfos",
        "responses": {
          "200": {
            "description": "Starred file infos",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/upload": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "file"
        ],
        "summary": "Uploads a file.",
        "operationId": "uploadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path where to upload file",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "type": "file",
            "description": "The file to upload.",
            "name": "upfile",
            "in": "formData"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/zip": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Creates a zip archive from files",
        "operationId": "zipFiles",
        "parameters": [
          {
            "name": "paths",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PathList"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Path"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/system/stats": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "system"
        ],
        "summary": "Get system status",
        "operationId": "getSystemStats",
        "responses": {
          "200": {
            "description": "System stats",
            "schema": {
              "$ref": "#/definitions/SystemStats"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/me": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get current user",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete current user",
        "operationId": "deleteCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify current user",
        "operationId": "updateCurrentUser",
        "parameters": [
          {
            "description": "Updated user info",
            "name": "userInfo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/{id}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get specific user by id",
        "operationId": "getUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete user by id",
        "operationId": "deleteUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify user by id",
        "operationId": "updateUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated user info",
            "name": "userUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UserUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "CreateFileRequest": {
      "type": "object",
      "properties": {
        "fullPath": {
          "type": "string"
        },
        "isDir": {
          "type": "boolean"
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "FileInfo": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "isDir": {
          "type": "boolean"
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64"
        },
        "mimeType": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "ownerID": {
          "type": "integer"
        },
        "parentID": {
          "type": "integer",
          "format": "int64"
        },
        "path": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "shareID": {
          "type": "integer",
          "format": "int64"
        },
        "size": {
          "type": "integer",
          "format": "int64"
        },
        "starred": {
          "type": "boolean",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "FileInfoUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "isDir": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "mimeType": {
          "type": "string",
          "x-nullable": true
        },
        "name": {
          "type": "string",
          "x-nullable": true
        },
        "ownerID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "parentID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "path": {
          "type": "string",
          "x-nullable": true
        },
        "shareID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "starred": {
          "type": "boolean",
          "x-nullable": true
        }
      }
    },
    "FileList": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        }
      }
    },
    "LoginData": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "Path": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        }
      }
    },
    "PathInfo": {
      "type": "object",
      "properties": {
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        },
        "fileInfo": {
          "$ref": "#/definitions/FileInfo"
        }
      }
    },
    "PathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "token": {
          "$ref": "#/definitions/Token"
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "SearchRequest": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        }
      }
    },
    "ShareEntry": {
      "type": "object",
      "properties": {
        "FileID": {
          "type": "integer",
          "format": "int64"
        },
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "OwnerID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        },
        "SharedWithID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "ShareRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "users": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "SystemStats": {
      "type": "object",
      "properties": {
        "allocMem": {
          "type": "integer",
          "format": "int64"
        },
        "goVersion": {
          "type": "string"
        },
        "numGC": {
          "type": "integer"
        },
        "numGoroutines": {
          "type": "integer"
        },
        "numSessions": {
          "type": "integer"
        },
        "systemMem": {
          "type": "integer",
          "format": "int64"
        },
        "totalAllocMem": {
          "type": "integer",
          "format": "int64"
        },
        "uptime": {
          "type": "integer",
          "format": "int64"
        },
        "version": {
          "type": "string"
        }
      }
    },
    "Token": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "created": {
          "type": "integer",
          "format": "int64"
        },
        "email": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"unique_index\""
        },
        "firstName": {
          "type": "string"
        },
        "isAdmin": {
          "type": "boolean"
        },
        "lastName": {
          "type": "string"
        },
        "lastSession": {
          "type": "integer",
          "format": "int64"
        },
        "password": {
          "type": "string"
        },
        "retainFilesAfterDeletion": {
          "type": "boolean"
        },
        "updated": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "UserUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "created": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "x-nullable": true
        },
        "firstName": {
          "type": "string",
          "x-nullable": true
        },
        "isAdmin": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "x-nullable": true
        },
        "lastSession": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "password": {
          "type": "string",
          "x-nullable": true
        },
        "retainFilesAfterDeletion": {
          "type": "boolean",
          "x-nullable": true
        },
        "updated": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        }
      }
    }
  },
  "securityDefinitions": {
    "TokenAuth": {
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "https:
      "tokenUrl": "https:
      "scopes": {
        "admin": "admin with all privileges",
        "user": "normal user"
      }
    }
  },
  "tags": [
    {
      "description": "Authentication",
      "name": "auth"
    },
    {
      "description": "User management",
      "name": "user"
    },
    {
      "description": "File management",
      "name": "file"
    },
    {
      "description": "System management",
      "name": "system"
    }
  ]
}`))
}
// Code generated by go-swagger; DO NOT EDIT.

package restapi

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"
)

var (
	// SwaggerJSON embedded version of the swagger document used at generation time
	SwaggerJSON json.RawMessage
	// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
	FlatSwaggerJSON json.RawMessage
)

func init() {
	SwaggerJSON = json.RawMessage([]byte(`{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "This is the API for the freecloud server.",
    "title": "freecloud API",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "host": "freecloud.glidingthrough.space",
  "basePath": "/api/v1",
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login with existing user",
        "operationId": "login",
        "parameters": [
          {
            "description": "Credentials for login",
            "name": "credentials",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LoginData"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "auth"
        ],
        "summary": "Logout current user",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/signup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Signup as a new user",
        "operationId": "signup",
        "parameters": [
          {
            "description": "User that should be registered",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get pathInfo of requested path",
        "operationId": "getPathInfo",
        "parameters": [
          {
            "type": "string",
            "description": "Requested path",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested pathInfo",
            "schema": {
              "$ref": "#/definitions/PathInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Create new file/folder",
        "operationId": "createFile",
        "parameters": [
          {
            "name": "createFileRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateFileRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/FileInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete file/folder",
        "operationId": "deleteFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to delete",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Update file/folder",
        "operationId": "updateFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to update",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "name": "fileInfoUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FileInfoUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/download": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "produces": [
          "application/gzip"
        ],
        "tags": [
          "file"
        ],
        "summary": "Downloads a file.",
        "operationId": "downloadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to the file to download",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested gzipped file",
            "schema": {
              "type": "file"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/me": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan own data folder",
        "operationId": "rescanCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/{id}": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan data folder by user id",
        "operationId": "rescanUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/search": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Search files/folders",
        "operationId": "searchFile",
        "parameters": [
          {
            "name": "searchRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SearchRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Share files/folders",
        "operationId": "shareFiles",
        "parameters": [
          {
            "name": "shareRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ShareRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/{shareID}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get share entry by shareID",
        "operationId": "getShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "Requested shareID",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Share entry",
            "schema": {
              "$ref": "#/definitions/ShareEntry"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete share entry by shareID",
        "operationId": "deleteShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "ShareID to be deleted",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/starred": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get starred files/folders infos",
        "operationId": "getStarredFileInfos",
        "responses": {
          "200": {
            "description": "Starred file infos",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/upload": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "file"
        ],
        "summary": "Uploads a file.",
        "operationId": "uploadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path where to upload file",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "type": "file",
            "description": "The file to upload.",
            "name": "upfile",
            "in": "formData"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/zip": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Creates a zip archive from files",
        "operationId": "zipFiles",
        "parameters": [
          {
            "name": "paths",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PathList"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Path"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/system/stats": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "system"
        ],
        "summary": "Get system status",
        "operationId": "getSystemStats",
        "responses": {
          "200": {
            "description": "System stats",
            "schema": {
              "$ref": "#/definitions/SystemStats"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/me": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get current user",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete current user",
        "operationId": "deleteCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify current user",
        "operationId": "updateCurrentUser",
        "parameters": [
          {
            "description": "Updated user info",
            "name": "userInfo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/{id}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get specific user by id",
        "operationId": "getUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete user by id",
        "operationId": "deleteUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify user by id",
        "operationId": "updateUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated user info",
            "name": "userUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UserUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "CreateFileRequest": {
      "type": "object",
      "properties": {
        "fullPath": {
          "type": "string"
        },
        "isDir": {
          "type": "boolean"
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "FileInfo": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "isDir": {
          "type": "boolean"
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64"
        },
        "mimeType": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "ownerID": {
          "type": "integer"
        },
        "parentID": {
          "type": "integer",
          "format": "int64"
        },
        "path": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "shareID": {
          "type": "integer",
          "format": "int64"
        },
        "size": {
          "type": "integer",
          "format": "int64"
        },
        "starred": {
          "type": "boolean",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "FileInfoUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "isDir": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "mimeType": {
          "type": "string",
          "x-nullable": true
        },
        "name": {
          "type": "string",
          "x-nullable": true
        },
        "ownerID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "parentID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "path": {
          "type": "string",
          "x-nullable": true
        },
        "shareID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "starred": {
          "type": "boolean",
          "x-nullable": true
        }
      }
    },
    "FileList": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        }
      }
    },
    "LoginData": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "Path": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        }
      }
    },
    "PathInfo": {
      "type": "object",
      "properties": {
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        },
        "fileInfo": {
          "$ref": "#/definitions/FileInfo"
        }
      }
    },
    "PathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "token": {
          "$ref": "#/definitions/Token"
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "SearchRequest": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        }
      }
    },
    "ShareEntry": {
      "type": "object",
      "properties": {
        "FileID": {
          "type": "integer",
          "format": "int64"
        },
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "OwnerID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        },
        "SharedWithID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "ShareRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "users": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "SystemStats": {
      "type": "object",
      "properties": {
        "allocMem": {
          "type": "integer",
          "format": "int64"
        },
        "goVersion": {
          "type": "string"
        },
        "numGC": {
          "type": "integer"
        },
        "numGoroutines": {
          "type": "integer"
        },
        "numSessions": {
          "type": "integer"
        },
        "systemMem": {
          "type": "integer",
          "format": "int64"
        },
        "totalAllocMem": {
          "type": "integer",
          "format": "int64"
        },
        "uptime": {
          "type": "integer",
          "format": "int64"
        },
        "version": {
          "type": "string"
        }
      }
    },
    "Token": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "created": {
          "type": "integer",
          "format": "int64"
        },
        "email": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"unique_index\""
        },
        "firstName": {
          "type": "string"
        },
        "isAdmin": {
          "type": "boolean"
        },
        "lastName": {
          "type": "string"
        },
        "lastSession": {
          "type": "integer",
          "format": "int64"
        },
        "password": {
          "type": "string"
        },
        "retainFilesAfterDeletion": {
          "type": "boolean"
        },
        "updated": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "UserUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "created": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "x-nullable": true
        },
        "firstName": {
          "type": "string",
          "x-nullable": true
        },
        "isAdmin": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "x-nullable": true
        },
        "lastSession": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "password": {
          "type": "string",
          "x-nullable": true
        },
        "retainFilesAfterDeletion": {
          "type": "boolean",
          "x-nullable": true
        },
        "updated": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        }
      }
    }
  },
  "securityDefinitions": {
    "TokenAuth": {
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "https://dummy.oauth.net/auth",
      "tokenUrl": "https://dumy.oauth.net/token",
      "scopes": {
        "admin": "admin with all privileges",
        "user": "normal user"
      }
    }
  },
  "tags": [
    {
      "description": "Authentication",
      "name": "auth"
    },
    {
      "description": "User management",
      "name": "user"
    },
    {
      "description": "File management",
      "name": "file"
    },
    {
      "description": "System management",
      "name": "system"
    }
  ]
}`))
	FlatSwaggerJSON = json.RawMessage([]byte(`{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "This is the API for the freecloud server.",
    "title": "freecloud API",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "host": "freecloud.glidingthrough.space",
  "basePath": "/api/v1",
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login with existing user",
        "operationId": "login",
        "parameters": [
          {
            "description": "Credentials for login",
            "name": "credentials",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/LoginData"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "auth"
        ],
        "summary": "Logout current user",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/auth/signup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Signup as a new user",
        "operationId": "signup",
        "parameters": [
          {
            "description": "User that should be registered",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Token"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get pathInfo of requested path",
        "operationId": "getPathInfo",
        "parameters": [
          {
            "type": "string",
            "description": "Requested path",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested pathInfo",
            "schema": {
              "$ref": "#/definitions/PathInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Create new file/folder",
        "operationId": "createFile",
        "parameters": [
          {
            "name": "createFileRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateFileRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/FileInfo"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete file/folder",
        "operationId": "deleteFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to delete",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Update file/folder",
        "operationId": "updateFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to fileInfo to update",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "name": "fileInfoUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FileInfoUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/download": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "produces": [
          "application/gzip"
        ],
        "tags": [
          "file"
        ],
        "summary": "Downloads a file.",
        "operationId": "downloadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path to the file to download",
            "name": "path",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Requested gzipped file",
            "schema": {
              "type": "file"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/me": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan own data folder",
        "operationId": "rescanCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/rescan/{id}": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Rescan data folder by user id",
        "operationId": "rescanUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/search": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Search files/folders",
        "operationId": "searchFile",
        "parameters": [
          {
            "name": "searchRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SearchRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Share files/folders",
        "operationId": "shareFiles",
        "parameters": [
          {
            "name": "shareRequest",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ShareRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/share/{shareID}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get share entry by shareID",
        "operationId": "getShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "Requested shareID",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Share entry",
            "schema": {
              "$ref": "#/definitions/ShareEntry"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Delete share entry by shareID",
        "operationId": "deleteShareEntryByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "ShareID to be deleted",
            "name": "shareID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/starred": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Get starred files/folders infos",
        "operationId": "getStarredFileInfos",
        "responses": {
          "200": {
            "description": "Starred file infos",
            "schema": {
              "$ref": "#/definitions/FileList"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/upload": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "consumes": [
          "multipart/form-data"
        ],
        "tags": [
          "file"
        ],
        "summary": "Uploads a file.",
        "operationId": "uploadFile",
        "parameters": [
          {
            "type": "string",
            "description": "Path where to upload file",
            "name": "path",
            "in": "query",
            "required": true
          },
          {
            "type": "file",
            "description": "The file to upload.",
            "name": "upfile",
            "in": "formData"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/file/zip": {
      "post": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "file"
        ],
        "summary": "Creates a zip archive from files",
        "operationId": "zipFiles",
        "parameters": [
          {
            "name": "paths",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PathList"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Path"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/system/stats": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "system"
        ],
        "summary": "Get system status",
        "operationId": "getSystemStats",
        "responses": {
          "200": {
            "description": "System stats",
            "schema": {
              "$ref": "#/definitions/SystemStats"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/me": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get current user",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete current user",
        "operationId": "deleteCurrentUser",
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "user"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify current user",
        "operationId": "updateCurrentUser",
        "parameters": [
          {
            "description": "Updated user info",
            "name": "userInfo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    },
    "/user/{id}": {
      "get": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Get specific user by id",
        "operationId": "getUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Delete user by id",
        "operationId": "deleteUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "TokenAuth": [
              "admin"
            ]
          }
        ],
        "tags": [
          "user"
        ],
        "summary": "Modify user by id",
        "operationId": "updateUserByID",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "description": "The user id",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated user info",
            "name": "userUpdate",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UserUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "default": {
            "description": "Unexpected error",
            "schema": {
              "$ref": "#/definitions/Error"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "CreateFileRequest": {
      "type": "object",
      "properties": {
        "fullPath": {
          "type": "string"
        },
        "isDir": {
          "type": "boolean"
        }
      }
    },
    "Error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "FileInfo": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "isDir": {
          "type": "boolean"
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64"
        },
        "mimeType": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "ownerID": {
          "type": "integer"
        },
        "parentID": {
          "type": "integer",
          "format": "int64"
        },
        "path": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"index:fullPath\""
        },
        "shareID": {
          "type": "integer",
          "format": "int64"
        },
        "size": {
          "type": "integer",
          "format": "int64"
        },
        "starred": {
          "type": "boolean",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "FileInfoUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "isDir": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastChanged": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "mimeType": {
          "type": "string",
          "x-nullable": true
        },
        "name": {
          "type": "string",
          "x-nullable": true
        },
        "ownerID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "parentID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "path": {
          "type": "string",
          "x-nullable": true
        },
        "shareID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "starred": {
          "type": "boolean",
          "x-nullable": true
        }
      }
    },
    "FileList": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        }
      }
    },
    "LoginData": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "Path": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        }
      }
    },
    "PathInfo": {
      "type": "object",
      "properties": {
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FileInfo"
          }
        },
        "fileInfo": {
          "$ref": "#/definitions/FileInfo"
        }
      }
    },
    "PathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "token": {
          "$ref": "#/definitions/Token"
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "SearchRequest": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        }
      }
    },
    "ShareEntry": {
      "type": "object",
      "properties": {
        "FileID": {
          "type": "integer",
          "format": "int64"
        },
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "OwnerID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        },
        "SharedWithID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"-\""
        }
      }
    },
    "ShareRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "users": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "SystemStats": {
      "type": "object",
      "properties": {
        "allocMem": {
          "type": "integer",
          "format": "int64"
        },
        "goVersion": {
          "type": "string"
        },
        "numGC": {
          "type": "integer"
        },
        "numGoroutines": {
          "type": "integer"
        },
        "numSessions": {
          "type": "integer"
        },
        "systemMem": {
          "type": "integer",
          "format": "int64"
        },
        "totalAllocMem": {
          "type": "integer",
          "format": "int64"
        },
        "uptime": {
          "type": "integer",
          "format": "int64"
        },
        "version": {
          "type": "string"
        }
      }
    },
    "Token": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-go-custom-tag": "gorm:\"primary_key;auto_increment\""
        },
        "created": {
          "type": "integer",
          "format": "int64"
        },
        "email": {
          "type": "string",
          "x-go-custom-tag": "gorm:\"unique_index\""
        },
        "firstName": {
          "type": "string"
        },
        "isAdmin": {
          "type": "boolean"
        },
        "lastName": {
          "type": "string"
        },
        "lastSession": {
          "type": "integer",
          "format": "int64"
        },
        "password": {
          "type": "string"
        },
        "retainFilesAfterDeletion": {
          "type": "boolean"
        },
        "updated": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "UserUpdate": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "created": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "x-nullable": true
        },
        "firstName": {
          "type": "string",
          "x-nullable": true
        },
        "isAdmin": {
          "type": "boolean",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "x-nullable": true
        },
        "lastSession": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "password": {
          "type": "string",
          "x-nullable": true
        },
        "retainFilesAfterDeletion": {
          "type": "boolean",
          "x-nullable": true
        },
        "updated": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        }
      }
    }
  },
  "securityDefinitions": {
    "TokenAuth": {
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "https://dummy.oauth.net/auth",
      "tokenUrl": "https://dumy.oauth.net/token",
      "scopes": {
        "admin": "admin with all privileges",
        "user": "normal user"
      }
    }
  },
  "tags": [
    {
      "description": "Authentication",
      "name": "auth"
    },
    {
      "description": "User management",
      "name": "user"
    },
    {
      "description": "File management",
      "name": "file"
    },
    {
      "description": "System management",
      "name": "system"
    }
  ]
}`))
}
