# Trash

## Список удаленных профилей

`GET /trash`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Список удаленных профилей",
  "description": "Возвращает профили, заархивированные `DELETE /profiles/{id}`, сначала самые новые, со сроком окончания их восстановления. Записи с истекшим сроком действия удаляются при запуске лаунчера.",
  "responses": {
    "200": {
      "description": "Мусор.",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrashEntry"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Восстановить удаленный профиль

`POST /trash/{id}/restore`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Восстановить удаленный профиль",
  "description": "Восстанавливает профиль с исходным идентификатором. Архив удаляется после восстановления профиля.\n\nФайлы cookie, логины, веб-данные, настройки, история, закладки, локальное хранилище и IndexedDB восстанавливаются. Данные кэша восстанавливаются при следующем запуске.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Восстановленный профиль.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProfileMeta"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "description": "Нет удаленного профиля с этим идентификатором.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## Удалить удаленный профиль навсегда

`DELETE /trash/{id}`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Удалить удаленный профиль навсегда",
  "description": "Безвозвратно удаляет архив профиля. Это действие невозможно отменить.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Очищено.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "purged": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
