get method

Future<GoogleMapsPlacesV1Place> get(
  1. String name, {
  2. String? languageCode,
  3. String? regionCode,
  4. String? $fields,
})

Get place details with a place id (in a name) string.

Request parameters:

name - Required. A place ID returned in a Place (with "places/" prefix), or equivalently the name in the same Place. Format: places / * place_id*. Value must have pattern ^places/\[^/\]+$.

languageCode - Optional. Place details will be displayed with the preferred language if available. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport.

regionCode - Optional. The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported.

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

Completes with a GoogleMapsPlacesV1Place.

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<GoogleMapsPlacesV1Place> get(
  core.String name, {
  core.String? languageCode,
  core.String? regionCode,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (languageCode != null) 'languageCode': [languageCode],
    if (regionCode != null) 'regionCode': [regionCode],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

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