{
  "openapi": "3.0.2",
  "info": {
    "title": "api/index_ati",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/index/license/v1/current_index": {
      "post": {
        "tags": [
          "Платное АПИ"
        ],
        "summary": "Текущее состояние общего индекса",
        "description": "Текущее состояние общего индекса",
        "operationId": "current_index_license_license_v1_current_index_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenseCurrentIndexRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseCurrentIndexResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            }
          },
          "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/general_index_dynamic": {
      "post": {
        "tags": [
          "Платное АПИ"
        ],
        "summary": "Динамика общего индекса",
        "description": "Динамика общего индекса",
        "operationId": "general_index_dynamic_license_v1_general_index_dynamic_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenseGeneralIndexRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseGeneralIndexResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorFormatResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "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": "какие-либо дополнительные детали ошибки"
          }
        }
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "LicenseCurrentIndexRequest": {
        "title": "Запрос: Входные параметры для получения текущего состояни общего индекса",
        "required": [
          "CarType"
        ],
        "type": "object",
        "properties": {
          "CarType": {
            "title": "Тип кузова: [\"all\", \"close\", \"open\", \"ref\"]",
            "type": "string",
            "description": "Тип кузова.\n* `ref` - Рефрижераторы.\n* `close` - Закрытые.\n* `open` - Открытые.\n* `all` - Все типы.\n        ",
            "example": "all"
          }
        }
      },
      "LicenseCurrentIndexResponse": {
        "title": "Ответ: Текущее состояние общего индекса",
        "required": [
          "Index",
          "IndexMovingUp",
          "Dynamic"
        ],
        "type": "object",
        "properties": {
          "Index": {
            "title": "Текущее значение индекса",
            "type": "integer",
            "description": "Текущее значение индекса"
          },
          "IndexMovingUp": {
            "title": "Индикатор роста индекса",
            "type": "boolean",
            "description": "Параметр, который показывает, был ли рост индекса по отношению к предыдущему значению"
          },
          "CarType": {
            "title": "Тип кузова: [\"all\", \"close\", \"open\", \"ref\"]",
            "type": "string",
            "description": "Тип кузова.\n* `ref` - Рефрижераторы.\n* `close` - Закрытые.\n* `open` - Открытые.\n* `all` - Все типы.\n        "
          },
          "Dynamic": {
            "title": "Динамика индекса",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamic"
              }
            ]
          }
        }
      },
      "LicenseDynamic": {
        "title": "Подпараметр ответа: Динамика индекса",
        "required": [
          "day",
          "week",
          "month",
          "3m",
          "6m",
          "ytd",
          "1y",
          "3y",
          "alltime"
        ],
        "type": "object",
        "properties": {
          "day": {
            "title": "Динамика за день",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за день. Значение указано в процентах."
          },
          "week": {
            "title": "Динамика за неделю",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за неделю. Значение указано в процентах."
          },
          "month": {
            "title": "Динамика за месяц",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за месяц. Значение указано в процентах."
          },
          "3m": {
            "title": "Динамика за три месяца",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за три месяца. Значение указано в процентах."
          },
          "6m": {
            "title": "Динамика за шесть месяцев",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за шесть месяцев. Значение указано в процентах."
          },
          "ytd": {
            "title": "Динамика с начала года",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса с начала года. Значение указано в процентах."
          },
          "1y": {
            "title": "Динамика за год",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за год. Значение указано в процентах."
          },
          "3y": {
            "title": "Динамика за три года",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за три года. Значение указано в процентах."
          },
          "alltime": {
            "title": "Динамика за все время",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenseDynamicValues"
              }
            ],
            "description": "Динамика индекса за все время. Значение указано в процентах."
          }
        }
      },
      "LicenseDynamicValues": {
        "title": "Подпараметр ответа: Значения динамики за период",
        "required": [
          "Delta"
        ],
        "type": "object",
        "properties": {
          "Delta": {
            "title": "Дельта индекса, проценты",
            "type": "number",
            "description": "Дельта индекса, значение указано в процентах"
          }
        }
      },
      "LicenseGeneralIndexRequest": {
        "title": "Ответ: Динамика общего индекса",
        "required": [
          "DateFrom",
          "DateTo"
        ],
        "type": "object",
        "properties": {
          "CarType": {
            "title": "Тип кузова: [\"all\", \"close\", \"open\", \"ref\"]",
            "type": "string",
            "description": "Тип кузова.\n* `ref` - Рефрижераторы.\n* `close` - Закрытые.\n* `open` - Открытые.\n* `all` - Все типы.\n        ",
            "default": "all",
            "example": "all"
          },
          "DateFrom": {
            "title": "Начало периода.",
            "type": "string",
            "description": "Начало периода. Формат ISO-8601.\n        ",
            "format": "date",
            "example": "2022-02-01"
          },
          "DateTo": {
            "title": "Конец периода.",
            "type": "string",
            "description": "Конец периода. Формат ISO-8601.\n        ",
            "format": "date",
            "example": "2022-03-02"
          }
        }
      },
      "LicenseGeneralIndexResponse": {
        "title": "Ответ: Текущее состояние общего индекса",
        "required": [
          "Data"
        ],
        "type": "object",
        "properties": {
          "CarType": {
            "title": "Тип кузова: [\"all\", \"close\", \"open\", \"ref\"]",
            "type": "string",
            "description": "Тип кузова.\n* `ref` - Рефрижераторы.\n* `close` - Закрытые.\n* `open` - Открытые.\n* `all` - Все типы.\n        "
          },
          "Data": {
            "title": "Набор данных индекса",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LicenseTimePoint"
            },
            "description": "Набор данных индекса"
          }
        }
      },
      "LicenseTimePoint": {
        "title": "Подпараметр ответа: Значение индекса в конкретную дату",
        "required": [
          "Date",
          "Index"
        ],
        "type": "object",
        "properties": {
          "Date": {
            "title": "Дата",
            "type": "string",
            "description": "Дата, Формат ISO-8601",
            "format": "date"
          },
          "Index": {
            "title": "Значение индекса",
            "type": "integer",
            "description": "Значение индекса"
          }
        }
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}