getAirportFlightsRelativeWithHttpInfo method

Future<Response> getAirportFlightsRelativeWithHttpInfo(
  1. AirportCodesByEnum codeType,
  2. String code, {
  3. int? offsetMinutes,
  4. int? durationMinutes,
  5. FlightDirection? direction,
  6. bool? withLeg,
  7. bool? withCancelled,
  8. bool? withCodeshared,
  9. bool? withCargo,
  10. bool? withPrivate,
  11. bool? withLocation,
})

FIDS (airport departures and arrivals) - by relative time / by current time TIER 2

What are current departures or arrivals at the airport? or What is the flight schedule at the airport? or What is flight history at the airport? Flights may contain live updates with corresponding information related to the actual progress of the flight (including actual/estimated arrival/departure times). In this case this endpoint serves as a FIDS endpoint. Presense of live updates is subject to data coverage: not all airports have this coverage in our system. Otherwise flight information will be limited to scheduled only and will not be updated real-time. Much more airports have this type of coverage. To check if airport is tracked and on which level, use _/health/services/airports/{icao}/feeds endpoint. You can also use _/health/services/feeds/{service}/airports to get the list of supported airports for this or that layer of coverage. To learn more about the data coverage, refer to https://www.aerodatabox.com/data-coverage. Returns: the list of arriving and/or departing flights scheduled and/or planned and/or commenced within a time range specified relatively to the current local time at the airport.

Note: This method returns the HTTP Response.

Parameters:

  • AirportCodesByEnum codeType (required): Type of code to search airport by (iata or icao)

  • String code (required): If codeType is: * icao, then this field must be a 4-character ICAO-code of the airport (e.g.: EHAM, KLAX, UUEE, etc.); * iata, then this field must be a 3-character IATA-code of the airport (e.g.: AMS, SFO, LAX, etc.). Full, stripped and any case formats are acceptable.

  • int offsetMinutes: Beginning of the search range expressed in minutes relative to the current time at the airport (default: -120)

  • int durationMinutes: Length (duration) of the search range expressed in minutes (default: 720)

  • FlightDirection direction: Direction of flights: Arrival, Departure or Both (default)

  • bool withLeg: If set to true, the result will include movement information from airport opposite in this flight leg (airport of origin for arriving flight or airport of destination for departing flight). In this case, Movement property will be replaced with Departure and Arrival properties for each flight. Default: false.

  • bool withCancelled: If set to true, result will include cancelled, divered, likely cancelled (CanceledUncertain) flights. Default: true.

  • bool withCodeshared: If set to true, the result will include flights with all code-shared statuses. Otherwise, code-sharing flights will be exclued. For airports, where no information about code-share statuses of flights are supplied (all flights are CodeshareStatus=Unknown), complex filtering will be applied to determine which flights are likely to be operational (caution: false results are possible).

  • bool withCargo: If set to true, the result will include cargo flights (subject to availability).

  • bool withPrivate: If set to true, the result will include private flights (subject to availability).

  • bool withLocation: If set to true, each currently active flight within the result will be populated with its present real-time location, altitude, speed and track (subject to availability).

Implementation

Future<Response> getAirportFlightsRelativeWithHttpInfo(
  AirportCodesByEnum codeType,
  String code, {
  int? offsetMinutes,
  int? durationMinutes,
  FlightDirection? direction,
  bool? withLeg,
  bool? withCancelled,
  bool? withCodeshared,
  bool? withCargo,
  bool? withPrivate,
  bool? withLocation,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/flights/airports/{codeType}/{code}'
      .replaceAll('{codeType}', codeType.toString())
      .replaceAll('{code}', code);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (offsetMinutes != null) {
    queryParams.addAll(_queryParams('', 'offsetMinutes', offsetMinutes));
  }
  if (durationMinutes != null) {
    queryParams.addAll(_queryParams('', 'durationMinutes', durationMinutes));
  }
  if (direction != null) {
    queryParams.addAll(_queryParams('', 'direction', direction));
  }
  if (withLeg != null) {
    queryParams.addAll(_queryParams('', 'withLeg', withLeg));
  }
  if (withCancelled != null) {
    queryParams.addAll(_queryParams('', 'withCancelled', withCancelled));
  }
  if (withCodeshared != null) {
    queryParams.addAll(_queryParams('', 'withCodeshared', withCodeshared));
  }
  if (withCargo != null) {
    queryParams.addAll(_queryParams('', 'withCargo', withCargo));
  }
  if (withPrivate != null) {
    queryParams.addAll(_queryParams('', 'withPrivate', withPrivate));
  }
  if (withLocation != null) {
    queryParams.addAll(_queryParams('', 'withLocation', withLocation));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}