{
  "openapi": "3.0.2",
  "info": {
    "title": "paid-api/index-by-directions",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/index/license/v1/index_by_direction": {
      "post": {
        "tags": [
          "Внешнее АПИ"
        ],
        "summary": "Динамика индекса по направлению",
        "description": "Динамика индекса по направлению",
        "operationId": "index_by_direction_license_v1_index_by_direction_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenseIndexByDirectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseIndexByDirectionResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/index/license/v1/directions": {
      "get": {
        "tags": [
          "Внешнее АПИ"
        ],
        "summary": "Доступные направления индекса",
        "description": "Доступные направления индекса",
        "operationId": "get_directions_license_v1_directions_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseDirectionsResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorFormatResponse": {
        "title": "Ответ: Формат ответа при ошибке",
        "required": [
          "error_body",
          "reason",
          "status_code",
          "details"
        ],
        "type": "object",
        "properties": {
          "error_body": {
            "title": "Error Body",
            "type": "string",
            "description": "основное тело ошибки с описанием"
          },
          "reason": {
            "title": "Reason",
            "type": "string",
            "description": "тип ошибки если имеется"
          },
          "status_code": {
            "title": "Status Code",
            "type": "integer",
            "description": "код возвращаемой ошибки"
          },
          "details": {
            "title": "Details",
            "type": "object",
            "description": "какие-либо дополнительные детали ошибки"
          }
        }
      },
      "GeoPoint": {
        "title": "GeoPoint",
        "required": [
          "Id"
        ],
        "type": "object",
        "properties": {
          "Id": {
            "title": "Id",
            "type": "integer",
            "description": "Id точки."
          }
        }
      },
      "GeoPointFull": {
        "title": "GeoPointFull",
        "required": [
          "Id",
          "Name"
        ],
        "type": "object",
        "properties": {
          "Id": {
            "title": "Id",
            "type": "integer",
            "description": "Id точки."
          },
          "Name": {
            "title": "Name",
            "type": "string",
            "description": "Название точки."
          }
        }
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "LicenseDirection": {
        "title": "Подпараметр ответа: направление",
        "required": [
          "From",
          "To"
        ],
        "type": "object",
        "properties": {
          "From": {
            "title": "From",
            "allOf": [
              {
                "$ref": "#/components/schemas/GeoPointFull"
              }
            ],
            "description": "Точка откуда.",
            "example": {
              "Id": 1,
              "Name": "Санкт-Петербург"
            }
          },
          "To": {
            "title": "To",
            "allOf": [
              {
                "$ref": "#/components/schemas/GeoPointFull"
              }
            ],
            "description": "Точка куда.",
            "example": {
              "Id": 3611,
              "Name": "Москва"
            }
          }
        }
      },
      "LicenseDirectionsResponse": {
        "title": "Ответ: список направлений",
        "required": [
          "Directions"
        ],
        "type": "object",
        "properties": {
          "Directions": {
            "title": "Directions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LicenseDirection"
            },
            "description": "Все направления для индекса"
          }
        }
      },
      "LicenseIndexByDirectionRequest": {
        "title": "Запрос: Параметры для получения индекса по направлению.",
        "required": [
          "DateFrom",
          "DateTo",
          "From",
          "To"
        ],
        "type": "object",
        "properties": {
          "DateFrom": {
            "title": "Datefrom",
            "type": "string",
            "description": "Начало периода. Формат ISO-8601.",
            "format": "date",
            "example": "2022-02-01"
          },
          "DateTo": {
            "title": "Dateto",
            "type": "string",
            "description": "Конец периода. Формат ISO-8601.",
            "format": "date",
            "example": "2022-03-02"
          },
          "From": {
            "title": "From",
            "allOf": [
              {
                "$ref": "#/components/schemas/GeoPoint"
              }
            ],
            "description": "Точка откуда.",
            "example": {
              "Id": 1
            }
          },
          "To": {
            "title": "To",
            "allOf": [
              {
                "$ref": "#/components/schemas/GeoPoint"
              }
            ],
            "description": "Точка куда.",
            "example": {
              "Id": 3611
            }
          },
          "CarType": {
            "title": "Cartype",
            "type": "string",
            "description": "Тип кузова.\n* `ref` – Рефрижераторы\n\n* `close` – Закрытые\n\n* `open` – Открытые\n\n* `all` – Все типы",
            "default": "all",
            "example": "ref"
          }
        }
      },
      "LicenseIndexByDirectionResponse": {
        "title": "Ответ: Текущее состояние общего индекса",
        "required": [
          "Data"
        ],
        "type": "object",
        "properties": {
          "Data": {
            "title": "Data",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LicenseTimePoint"
            },
            "description": "Набор данных индекса"
          }
        }
      },
      "LicenseTimePoint": {
        "title": "Подпараметр ответа: Значение индекса в конкретную дату",
        "required": [
          "Date",
          "Index"
        ],
        "type": "object",
        "properties": {
          "Date": {
            "title": "Date",
            "type": "string",
            "description": "Дата. Формат ISO-8601",
            "format": "date"
          },
          "Index": {
            "title": "Index",
            "type": "integer",
            "description": "Значение индекса"
          }
        }
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}