list method

Future<ListSearchKeywordImpressionsMonthlyResponse> list(
  1. String parent, {
  2. int? monthlyRange_endMonth_day,
  3. int? monthlyRange_endMonth_month,
  4. int? monthlyRange_endMonth_year,
  5. int? monthlyRange_startMonth_day,
  6. int? monthlyRange_startMonth_month,
  7. int? monthlyRange_startMonth_year,
  8. int? pageSize,
  9. String? pageToken,
  10. String? $fields,
})

Returns the search keywords used to find a business in search or maps.

Each search keyword is accompanied by impressions which are aggregated on a monthly basis. Example request: GET https://businessprofileperformance.googleapis.com/v1/locations/12345/searchkeywords/impressions/monthly?monthly_range.start_month.year=2022&monthly_range.start_month.month=1&monthly_range.end_month.year=2022&monthly_range.end_month.month=3

Request parameters:

parent - Required. The location for which the time series should be fetched. Format: locations/{location_id} where location_id is an unobfuscated listing id. Value must have pattern ^locations/\[^/\]+$.

monthlyRange_endMonth_day - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

monthlyRange_endMonth_month - Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

monthlyRange_endMonth_year - Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

monthlyRange_startMonth_day - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

monthlyRange_startMonth_month - Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

monthlyRange_startMonth_year - Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

pageSize - Optional. The number of results requested. The default page size is 100. Page size can be set to a maximum of 100.

pageToken - Optional. A token indicating the next paginated result to be returned.

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

Completes with a ListSearchKeywordImpressionsMonthlyResponse.

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<ListSearchKeywordImpressionsMonthlyResponse> list(
  core.String parent, {
  core.int? monthlyRange_endMonth_day,
  core.int? monthlyRange_endMonth_month,
  core.int? monthlyRange_endMonth_year,
  core.int? monthlyRange_startMonth_day,
  core.int? monthlyRange_startMonth_month,
  core.int? monthlyRange_startMonth_year,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (monthlyRange_endMonth_day != null)
      'monthlyRange.endMonth.day': ['${monthlyRange_endMonth_day}'],
    if (monthlyRange_endMonth_month != null)
      'monthlyRange.endMonth.month': ['${monthlyRange_endMonth_month}'],
    if (monthlyRange_endMonth_year != null)
      'monthlyRange.endMonth.year': ['${monthlyRange_endMonth_year}'],
    if (monthlyRange_startMonth_day != null)
      'monthlyRange.startMonth.day': ['${monthlyRange_startMonth_day}'],
    if (monthlyRange_startMonth_month != null)
      'monthlyRange.startMonth.month': ['${monthlyRange_startMonth_month}'],
    if (monthlyRange_startMonth_year != null)
      'monthlyRange.startMonth.year': ['${monthlyRange_startMonth_year}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' +
      core.Uri.encodeFull('$parent') +
      '/searchkeywords/impressions/monthly';

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