"""Data types and operations from Remote ID Display Data Observation 0.0.1 OpenAPI"""

# This file is autogenerated; do not modify manually!

from __future__ import annotations

from enum import Enum
from typing import Dict, List, Optional

from uas_standards import Operation

from implicitdict import ImplicitDict


class GetDetailsResponse(ImplicitDict):
    """Response to a request to get details about a flight."""



class Position(ImplicitDict):
    """A position on Earth."""

    lat: float
    """Degrees of latitude north of the equator, with reference to the WGS84 ellipsoid."""

    lng: float
    """Degrees of longitude east of the Prime Meridian, with reference to the WGS84 ellipsoid."""

    alt: Optional[float]
    """Geodetic altitude (NOT altitude above launch, altitude above ground, or EGM96): aircraft distance above the WGS84 ellipsoid as measured along a line that passes through the aircraft and is normal to the surface of the WGS84 ellipsoid."""


class Path(ImplicitDict):
    """Path followed by a flight."""

    positions: List[Position]
    """Sequential positions available for a flight."""


class Flight(ImplicitDict):
    id: str
    """Identifier of flight that may be used to obtain details about the flight. This is not necessarily the UTM/flight ID in the remote ID system."""

    most_recent_position: Optional[Position]
    """Most recent position known for the flight."""

    recent_paths: Optional[List[Path]]
    """Paths the flight recently traveled, if available."""


class Cluster(ImplicitDict):
    """A general area containing one or more flight."""

    corners: List[Position]
    """Two opposite corners of a rectangular lat-lng box bounding the cluster."""

    area_sqm: float
    """Area of the cluster in square meters."""

    number_of_flights: int
    """Number of flights within the cluster."""


class GetDisplayDataResponse(ImplicitDict):
    """Response to a request for current data that would be visualized by a Display Application."""

    flights: Optional[List[Flight]] = []
    """Current information for set of discovered flights whose precise locations are known."""

    clusters: Optional[List[Cluster]] = []
    """Current information for sets of discovered flights whose precise locations are not known."""


class OperationID(str, Enum):
    GetDisplayData = "getDisplayData"
    GetDetails = "getDetails"


OPERATIONS: Dict[OperationID, Operation] = {
    OperationID.GetDisplayData: Operation(
        id="getDisplayData",
        path="/display_data",
        verb="GET",
        request_body_type=None,
        response_body_type={
            200: GetDisplayDataResponse,
        }
    ),
    OperationID.GetDetails: Operation(
        id="getDetails",
        path="/display_data/{id}",
        verb="GET",
        request_body_type=None,
        response_body_type={
            200: GetDetailsResponse,
            404: None,
        }
    ),
}
