lookup method

Future<LookupForecastResponse> lookup({
  1. int? days,
  2. String? languageCode,
  3. double? location_latitude,
  4. double? location_longitude,
  5. int? pageSize,
  6. String? pageToken,
  7. bool? plantsDescription,
  8. String? $fields,
})

Returns up to 5 days of daily pollen information in more than 65 countries, up to 1km resolution.

Request parameters:

days - Required. A number that indicates how many forecast days to request (minimum value 1, maximum value is 5).

languageCode - Optional. Allows the client to choose the language for the response. If data cannot be provided for that language the API uses the closest match. Allowed values rely on the IETF BCP-47 standard. Default value is "en".

location_latitude - The latitude in degrees. It must be in the range [-90.0, +90.0].

location_longitude - The longitude in degrees. It must be in the range [-180.0, +180.0].

pageSize - Optional. The maximum number of daily info records to return per page. The default and max value is 5 (5 days of data).

pageToken - Optional. A page token received from a previous daily call. It is used to retrieve the subsequent page. Note that when providing a value for the page token all other request parameters provided must match the previous call that provided the page token.

plantsDescription - Optional. Contains general information about plants, including details on their seasonality, special shapes and colors, information about allergic cross-reactions, and plant photos.

$fields - Selector specifying which fields to include in a partial response.

Completes with a LookupForecastResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<LookupForecastResponse> lookup({
  core.int? days,
  core.String? languageCode,
  core.double? location_latitude,
  core.double? location_longitude,
  core.int? pageSize,
  core.String? pageToken,
  core.bool? plantsDescription,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (days != null) 'days': ['${days}'],
    if (languageCode != null) 'languageCode': [languageCode],
    if (location_latitude != null)
      'location.latitude': ['${location_latitude}'],
    if (location_longitude != null)
      'location.longitude': ['${location_longitude}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (plantsDescription != null)
      'plantsDescription': ['${plantsDescription}'],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/forecast:lookup';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return LookupForecastResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}