getAirportDelaysWithHttpInfo method

Future<Response> getAirportDelaysWithHttpInfo(
  1. AirportCodesByEnum codeType,
  2. String code,
  3. DateTime dateFromLocal,
  4. DateTime dateToLocal,
)

Airport delays (historical period) TIER 3

What were the delays within a specific period of time? or How the delays changed within a specific period of time? Please read more about airport delays on here: https://aerodatabox.com/api-airport-delays/ Returns: Statistical delay information about delays (median delay, delay index, cancelled flights) of arrivals and departures for the requested airport, represented by a collection of AiportDelayContract items displaying the delay information at multiple moments within the period between dateLocal and dateToLocal.

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.

  • DateTime dateFromLocal (required): The beginning of the period of time for which delay data is requested (local time, format: YYYY-MM-DDTHH:mm).

  • DateTime dateToLocal (required): The end of the period of time for which delay data is requested (local time, format: YYYY-MM-DDTHH:mm).

Implementation

Future<Response> getAirportDelaysWithHttpInfo(
  AirportCodesByEnum codeType,
  String code,
  DateTime dateFromLocal,
  DateTime dateToLocal,
) async {
  // ignore: prefer_const_declarations
  final path =
      r'/airports/{codeType}/{code}/delays/{dateFromLocal}/{dateToLocal}'
          .replaceAll('{codeType}', codeType.toString())
          .replaceAll('{code}', code)
          .replaceAll('{dateFromLocal}', dateFromLocal.toString())
          .replaceAll('{dateToLocal}', dateToLocal.toString());

  // ignore: prefer_final_locals
  Object? postBody;

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

  const contentTypes = <String>[];

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