hotelsGetDestinationsWithHttpInfo method

Future<Response> hotelsGetDestinationsWithHttpInfo(
  1. String q, {
  2. String? countryCode,
  3. int? limit,
  4. Future<void>? abortTrigger,
})

Search hotel destinations

Finds the places to search hotels in by name: a country, a region, a city or a district. Returns { items }: at most limit places whose names match q, most relevant first, without paging. Send a place's id as searchCriteria.location.geoNodeId in a search; it finds the hotels of every place inside it. name includes the place's parents, for example "Downtown Dubai, Dubai, United Arab Emirates", and category is its level: country, region, city or area. Only places where OpenRoam has had hotels are listed. q is required: plain text, at most 100 characters, without control characters. countryCode keeps the places of one ISO 3166-1 alpha-2 country; limit is 1–100 (default 10). An invalid or blank value, or any other query parameter, gives 400 / 10001. 503 / 10007 when the destination index is unavailable or does not answer within 5 seconds: retry.

Note: This method returns the HTTP Response.

Parameters:

  • String q (required): Required. Free text over place names, for example downtown dub; at most 100 characters, without control characters.

  • String countryCode: Optional ISO 3166-1 alpha-2 country, in either case: only places in that country. A blank value is rejected.

  • int limit: The most places to return, 1 to 100; default 10.

Implementation

Future<Response> hotelsGetDestinationsWithHttpInfo(String q, { String? countryCode, int? limit, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/hotels/destinations';

  // ignore: prefer_final_locals
  Object? postBody;

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

    queryParams.addAll(_queryParams('', 'q', q));
  if (countryCode != null) {
    queryParams.addAll(_queryParams('', 'countryCode', countryCode));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }

  const contentTypes = <String>[];


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