getAirportDistanceTimeWithHttpInfo method

Future<Response> getAirportDistanceTimeWithHttpInfo(
  1. AirportCodesByEnum codeType,
  2. String codeFrom,
  3. String codeTo, {
  4. String? aircraftName,
  5. ModelFlightTimeEnum? flightTimeModel,
})

🤖 Distance and flight time between airports TIER 2

What is the great circle distance between airports? What is approximate flight time between airports? ** What is the flight time between airports based on history of flights and/or aircraft type?** (machine-learning based) Use flightTimeModel = <a href="#model-ModelFlightTimeEnum">ML01 to get more accurate results based on historical performance of flights on route and aircraft type. Returns: Distance and approximate flight time between airports, if both airports found.

Note: This method returns the HTTP Response.

Parameters:

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

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

  • String codeTo (required): If codeType is: * icao, then this field must be a 4-character ICAO-code of the destination airport (e.g.: EHAM, KLAX, UUEE, etc.); * iata, then this field must be a 3-character IATA-code of the destination airport (e.g.: AMS, SFO, LAX, etc.); * local, then the format of this field is subject to specific standards of relevant national or local airport codification systems. Full, stripped and any case formats are acceptable.

  • String aircraftName: Aircraft type name (free text). If specified and flightTimeModel is set to <a href="#model-ModelFlightTimeEnum">ML01, the aircraft type will be attempted to be taken into to provide more accurate result. If flightTimeModel is set to <a href="#model-ModelFlightTimeEnum">Standard, the value is ignored.

  • ModelFlightTimeEnum flightTimeModel: Model of calculation of the flight time. Default is <a href="#model-ModelFlightTimeEnum"> More advanced model(s) is available, including machine learning-based models. See <a href="#model-ModelFlightTimeEnum">ModelFlightTimeEnum for details.

Implementation

Future<Response> getAirportDistanceTimeWithHttpInfo(
  AirportCodesByEnum codeType,
  String codeFrom,
  String codeTo, {
  String? aircraftName,
  ModelFlightTimeEnum? flightTimeModel,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/airports/{codeType}/{codeFrom}/distance-time/{codeTo}'
      .replaceAll('{codeType}', codeType.toString())
      .replaceAll('{codeFrom}', codeFrom)
      .replaceAll('{codeTo}', codeTo);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (aircraftName != null) {
    queryParams.addAll(_queryParams('', 'aircraftName', aircraftName));
  }
  if (flightTimeModel != null) {
    queryParams.addAll(_queryParams('', 'flightTimeModel', flightTimeModel));
  }

  const contentTypes = <String>[];

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