{
  "openapi": "3.1.1",
  "info": {
    "title": "PowerAtlas | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://poweratlas.ipv64.net/"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/sources": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SourceInfo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfstringAndSourceInfo[]AndintAndint"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cities": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnonymousTypeOfstringAndstringAndstringAndstring"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coverage": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnonymousTypeOfstringAndstringAndstringAndInt32[]AndIEnumerableOfCoverageAndJsonElementAndstring"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cities/{city}/daily": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/cities/{city}/index": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/cities/{city}/schedules": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/ranking": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "PowerAtlas"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnonymousTypeOfstringAndSourceInfo[]AndintAndint": {
        "required": [
          "based_on",
          "sources",
          "city_count",
          "fully_configured_cities"
        ],
        "type": "object",
        "properties": {
          "based_on": {
            "type": [
              "null",
              "string"
            ]
          },
          "sources": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SourceInfo"
            }
          },
          "city_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "fully_configured_cities": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AnonymousTypeOfstringAndstringAndstringAndInt32[]AndIEnumerableOfCoverageAndJsonElementAndstring": {
        "required": [
          "city_id",
          "name",
          "status",
          "operators",
          "mappings",
          "candidate_source",
          "source_audit"
        ],
        "type": "object",
        "properties": {
          "city_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "operators": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "mappings": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Coverage"
            }
          },
          "candidate_source": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "source_audit": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AnonymousTypeOfstringAndstringAndstringAndstring": {
        "required": [
          "city_id",
          "name",
          "russian_name",
          "status"
        ],
        "type": "object",
        "properties": {
          "city_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "russian_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Coverage": {
        "required": [
          "city",
          "operator",
          "queues",
          "verified",
          "evidence",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "city": {
            "type": "string"
          },
          "operator": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "queues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified": {
            "type": "boolean"
          },
          "evidence": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "complete": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "JsonElement": { },
      "SourceInfo": {
        "required": [
          "id",
          "name",
          "url",
          "adapter",
          "source_ok",
          "stale",
          "last_attempt",
          "last_success",
          "last_publication",
          "next_attempt",
          "failures",
          "status",
          "schedule_published",
          "schedule_applies"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "adapter": {
            "type": "string"
          },
          "source_ok": {
            "type": "boolean"
          },
          "stale": {
            "type": "boolean"
          },
          "last_attempt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "last_success": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "last_publication": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "next_attempt": {
            "type": "string",
            "format": "date-time"
          },
          "failures": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "schedule_published": {
            "type": "boolean"
          },
          "schedule_applies": {
            "type": "boolean"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "PowerAtlas"
    }
  ]
}