batchGet method

Future<BatchGetCategoriesResponse> batchGet({
  1. String? languageCode,
  2. List<String>? names,
  3. String? regionCode,
  4. String? view,
  5. String? $fields,
})

Returns a list of business categories for the provided language and GConcept ids.

Request parameters:

languageCode - Required. The BCP 47 code of language that the category names should be returned in.

names - Required. At least one name must be set. The GConcept ids the localized category names should be returned for. To return details for more than one category, repeat this parameter in the request.

regionCode - Optional. The ISO 3166-1 alpha-2 country code used to infer non-standard language.

view - Required. Specifies which parts to the Category resource should be returned in the response. Possible string values are:

  • "CATEGORY_VIEW_UNSPECIFIED" : Not specified, equivalent to CATEGORY_METADATA_ONLY.
  • "BASIC" : The server response will only include Category fields display_name, category_id and language_code. It omits any service type metadata related fields.
  • "FULL" : Returns all the fields in the response.

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

Completes with a BatchGetCategoriesResponse.

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

  const url_ = 'v1/categories:batchGet';

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