# Proxies

## Список сохранённых прокси

`GET /proxies`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "Список сохранённых прокси",
  "description": "Прокси, сохранённые в хранилище лаунчера. **Учётные данные (логин/пароль) не возвращаются.**",
  "responses": {
    "200": {
      "description": "Краткая информация о прокси.",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProxySummary"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Добавить прокси

`POST /proxies`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "Добавить прокси",
  "description": "Добавляет прокси в хранилище (с дедупликацией по эндпоинту). Передайте\nстроку `proxy` или явные поля `host`/`port` (+ `kind`/`username`/`password`).\n",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AddProxyRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Краткая информация о сохранённом прокси.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProxySummary"
          }
        }
      }
    },
    "400": {
      "description": "Неразбираемый прокси / не указаны host и port.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Удалить прокси

`DELETE /proxies/{id}`

```json
{
  "tags": [
    "Proxies"
  ],
  "summary": "Удалить прокси",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Удалён.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
