
{
  "openapi": "3.0.1",
  "info": {
    "title": "Sarpas API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "http://brutm.xmobots.com/api/brutm",
      "description": "Generated server url"
    }
  ],
  "paths": {
    "/sarpas/providers/user_token/{token}/assign": {
      "put": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de assignar meu token com um provedor",
        "operationId": "assignProvider",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignProviderData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/solicitation": {
      "post": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de criar uma solicitação de voo",
        "operationId": "submitSolicitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SolicitationDataDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SolicitationDataResponseDTO"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/providers/auth": {
      "post": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de registrar meu token para um provedor",
        "operationId": "registerToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessTokenData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SarpasAccessTokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/polygon/{poligonId}/{userUuid}": {
      "post": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de criar uma área no ASA",
        "operationId": "createAsaPolygon",
        "parameters": [
          {
            "name": "poligonId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userUuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AsaIdDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AsaIdResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/user-keys/{token}": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de aprovar um provedor",
        "operationId": "approveToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/sarpas/user-aircraft": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de buscar as minhas aeronaves",
        "operationId": "retrieveMyAircrafts",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AircraftResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/shared-aircraft-user": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de buscar as aeronaves compartilhadas comigo",
        "operationId": "retrieveMySharedAircrafts",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AircraftResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/polygon/{solicitationProtocol}/result": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de obter o resultado da minha análise",
        "operationId": "resultSolicitation",
        "parameters": [
          {
            "name": "solicitationProtocol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/sarpas/flights": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de buscar a minha lista de solicitações de voo",
        "operationId": "retrieveFlightSolicitationList",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/FlightDTO"
                }
              }
            }
          }
        }
      }
    },
    "/sarpas/bypass/categorize/{solicitationProtocol}": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de categorizar uma solicitação",
        "operationId": "categoryzeSolicitation",
        "parameters": [
          {
            "name": "solicitationProtocol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/sarpas/bypass/analyze/{solicitationProtocol}": {
      "get": {
        "tags": [
          "sarpas-controller"
        ],
        "summary": "Como usuário, eu gostaria de analisar uma solicitação",
        "operationId": "analyzeSolicitation",
        "parameters": [
          {
            "name": "solicitationProtocol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AssignProviderDTO": {
        "type": "object",
        "properties": {
          "provider_secret": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          }
        }
      },
      "AssignProviderData": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AssignProviderDTO"
          }
        }
      },
      "SarpasAccessTokenResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "pilot": {
            "$ref": "#/components/schemas/SarpasPilotResponse"
          },
          "actualUserInformation": {
            "$ref": "#/components/schemas/UserInformationResponse"
          }
        }
      },
      "AreaDTO": {
        "type": "object",
        "properties": {
          "asa_id": {
            "type": "string"
          },
          "takeoff_point": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            }
          },
          "landing_point": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            }
          },
          "required_route": {
            "$ref": "#/components/schemas/RequiredRouteDTO"
          },
          "flight_type": {
            "type": "string"
          },
          "flight_distance": {
            "type": "number"
          }
        }
      },
      "CommunicationDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ats_call_type": {
            "type": "string"
          },
          "rpa_call_type": {
            "type": "string"
          },
          "rps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RpsDTO"
            }
          }
        }
      },
      "DateDTO": {
        "type": "object",
        "properties": {
          "start_day": {
            "type": "string"
          },
          "start_hour": {
            "type": "string"
          },
          "finish_day": {
            "type": "string"
          },
          "finish_hour": {
            "type": "string"
          }
        }
      },
      "GeojsonDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "properties": {
            "type": "object"
          },
          "geometry": {
            "$ref": "#/components/schemas/GeojsonGeometryDTO"
          }
        }
      },
      "GeojsonGeometryDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "coordinates": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      },
      "RequiredRouteDTO": {
        "type": "object",
        "properties": {
          "geojson": {
            "$ref": "#/components/schemas/GeojsonDTO"
          }
        }
      },
      "RpsDTO": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "string"
          },
          "lng": {
            "type": "string"
          },
          "contact_info": {
            "type": "string"
          },
          "radius": {
            "type": "number"
          }
        }
      },
      "SolicitationDataAttributesDTO": {
        "type": "object",
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/SolicitationDataAttributesOperationDTO"
          }
        }
      },
      "SolicitationDataAttributesOperationAircraftsDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "uuid": {
            "type": "string"
          }
        }
      },
      "SolicitationDataAttributesOperationBasicInformationDTO": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "agree_terms": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SolicitationDataAttributesOperationDTO": {
        "type": "object",
        "properties": {
          "aircrafts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolicitationDataAttributesOperationAircraftsDTO"
            }
          },
          "flight": {
            "$ref": "#/components/schemas/SolicitationDataAttributesOperationFlightDTO"
          },
          "basic_information": {
            "$ref": "#/components/schemas/SolicitationDataAttributesOperationBasicInformationDTO"
          }
        }
      },
      "SolicitationDataAttributesOperationFlightDTO": {
        "type": "object",
        "properties": {
          "pilots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "date": {
            "$ref": "#/components/schemas/DateDTO"
          },
          "type": {
            "type": "string"
          },
          "observations": {
            "type": "string"
          },
          "communication": {
            "$ref": "#/components/schemas/CommunicationDTO"
          },
          "sarpas_code": {
            "type": "string"
          },
          "area": {
            "$ref": "#/components/schemas/AreaDTO"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "SolicitationDataDTO": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SolicitationDataTypeAttributesDTO"
          }
        }
      },
      "SolicitationDataTypeAttributesDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/SolicitationDataAttributesDTO"
          }
        }
      },
      "SolicitationDataResponseAttributesDTO": {
        "type": "object",
        "properties": {
          "protocol": {
            "type": "string"
          },
          "operation_name": {
            "type": "string"
          },
          "operation_start": {
            "type": "string"
          },
          "operation_finish": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "operation_type": {
            "$ref": "#/components/schemas/SolicitationDataResponseOperationType"
          },
          "visual_type": {
            "$ref": "#/components/schemas/SolicitationDataResponseVisualType"
          },
          "status": {
            "$ref": "#/components/schemas/SolicitationDataResponseStatus"
          },
          "operation_responsible": {
            "$ref": "#/components/schemas/SolicitationDataResponseOperationResponsible"
          },
          "operation_requester": {
            "$ref": "#/components/schemas/SolicitationDataResponseOperationResponsible"
          },
          "provider": {
            "$ref": "#/components/schemas/SolicitationDataResponseProvider"
          }
        }
      },
      "SolicitationDataResponseDTO": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SolicitationDataResponseObjectDTO"
          }
        }
      },
      "SolicitationDataResponseObjectDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/SolicitationDataResponseAttributesDTO"
          }
        }
      },
      "SolicitationDataResponseOperationResponsible": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "information": {
            "$ref": "#/components/schemas/SolicitationDataResponseOperationResponsibleInformation"
          },
          "profile": {
            "$ref": "#/components/schemas/SolicitationDataResponseOperationResponsibleProfile"
          }
        }
      },
      "SolicitationDataResponseOperationResponsibleInformation": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "SolicitationDataResponseOperationResponsibleProfile": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SolicitationDataResponseOperationType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SolicitationDataResponseProvider": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "SolicitationDataResponseStatus": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SolicitationDataResponseVisualType": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "AccessTokenData": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AssignProviderDTO"
          }
        }
      },
      "AsaIdDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "properties": {
            "$ref": "#/components/schemas/AsaIdPropertiesDTO"
          },
          "geometry": {
            "$ref": "#/components/schemas/AsaIdGeometryDTO"
          }
        }
      },
      "AsaIdGeometryDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "coordinates": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      },
      "AsaIdPropertiesDTO": {
        "type": "object",
        "properties": {
          "poligonoId": {
            "type": "string"
          },
          "perfil": {
            "type": "string"
          },
          "datasHoras": {
            "type": "string"
          },
          "elevacoes": {
            "$ref": "#/components/schemas/AsaIdPropertiesElevationDTO"
          },
          "raio": {
            "type": "number"
          },
          "altura": {
            "type": "string"
          },
          "formato": {
            "type": "string"
          },
          "contextoId": {
            "type": "integer",
            "format": "int32"
          },
          "pontoDecolagem": {
            "$ref": "#/components/schemas/AsaIdPropertiesTakeoffPointDTO"
          }
        }
      },
      "AsaIdPropertiesElevationDTO": {
        "type": "object",
        "properties": {
          "criarAreaMaximo": {
            "type": "number"
          },
          "criarAreaMinimo": {
            "type": "number"
          },
          "criarAreaMaximoFt": {
            "type": "number"
          },
          "criarAreaMinimoFt": {
            "type": "number"
          },
          "criarAreaNome": {
            "type": "string"
          },
          "criarAreaDescricao": {
            "type": "string"
          },
          "alturaEditavelMetros": {
            "type": "string"
          },
          "alturaEditavelPes": {
            "type": "number"
          },
          "dataInicio": {
            "type": "string"
          },
          "dataTermino": {
            "type": "string"
          },
          "horaInicio": {
            "type": "string"
          },
          "horaTermino": {
            "type": "string"
          },
          "update": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "AsaIdPropertiesTakeoffPointDTO": {
        "type": "object",
        "properties": {
          "latLng": {
            "$ref": "#/components/schemas/AsaIdPropertiesTakeoffPointLatLngDTO"
          },
          "unidade": {
            "type": "string"
          },
          "elevationM": {
            "type": "number"
          },
          "elevationFt": {
            "type": "number"
          },
          "valido": {
            "type": "boolean"
          }
        }
      },
      "AsaIdPropertiesTakeoffPointLatLngDTO": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "format": "double"
          },
          "lng": {
            "type": "number",
            "format": "double"
          },
          "valido": {
            "type": "boolean"
          }
        }
      },
      "AsaIdResponse": {
        "type": "object",
        "properties": {
          "voo_id": {
            "type": "string"
          }
        }
      },
      "FlightAircraftDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "document_number": {
            "type": "string"
          },
          "pmd": {
            "type": "number"
          }
        }
      },
      "FlightAreaDTO": {
        "type": "object",
        "properties": {
          "route_coordinates": {
            "$ref": "#/components/schemas/FlightGeometryDTO"
          },
          "vertical_distance": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "FlightDTO": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlightDataDTO"
            }
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "FlightDataDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "operation_name": {
            "type": "string"
          },
          "protocol": {
            "type": "string"
          },
          "operation_start": {
            "type": "string"
          },
          "operation_finish": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "aircrafts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlightAircraftDTO"
            }
          },
          "operation_type": {
            "$ref": "#/components/schemas/FlightOperationDTO"
          },
          "status": {
            "$ref": "#/components/schemas/FlightStatusDTO"
          },
          "flight_pilots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlightPilotDTO"
            }
          },
          "visual_type": {
            "$ref": "#/components/schemas/FlightVisualTypeDTO"
          },
          "flight_pilot": {
            "$ref": "#/components/schemas/FlightPilotDTO"
          },
          "requested_area": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlightAreaDTO"
            }
          }
        }
      },
      "FlightGeometryDTO": {
        "type": "object",
        "properties": {
          "coordinates": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      },
      "FlightOperationDTO": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "FlightPilotDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "operational_id": {
            "type": "string"
          }
        }
      },
      "FlightStatusDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "code": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          }
        }
      },
      "FlightVisualTypeDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "GeometryDTO": {
        "type": "object",
        "properties": {
          "spatialReference": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "properties": {
              "empty": {
                "type": "boolean"
              }
            },
            "items": {
              "type": "object"
            }
          },
          "rings": {
            "type": "array",
            "properties": {
              "empty": {
                "type": "boolean"
              }
            },
            "items": {
              "type": "object"
            }
          },
          "ringsArrayList": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "paths": {
            "type": "array",
            "properties": {
              "empty": {
                "type": "boolean"
              }
            },
            "items": {
              "type": "object"
            }
          },
          "pathsArrayList": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      }
    }
  }
}