fetchMultiDailyMetricsTimeSeries method
Returns the values for each date from a given time range and optionally the sub entity type, where applicable, that are associated with the specific daily metrics.
Example request: GET https://businessprofileperformance.googleapis.com/v1/locations/12345:fetchMultiDailyMetricsTimeSeries?dailyMetrics=WEBSITE_CLICKS&dailyMetrics=CALL_CLICKS&daily_range.start_date.year=2022&daily_range.start_date.month=1&daily_range.start_date.day=1&daily_range.end_date.year=2022&daily_range.end_date.month=3&daily_range.end_date.day=31
Request parameters:
location
- 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/\[^/\]+$
.
dailyMetrics
- Required. The metrics to retrieve time series for.
dailyRange_endDate_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.
dailyRange_endDate_month
- Month of a year. Must be from 1 to 12, or 0
to specify a year without a month and day.
dailyRange_endDate_year
- Year of the date. Must be from 1 to 9999, or 0
to specify a date without a year.
dailyRange_startDate_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.
dailyRange_startDate_month
- Month of a year. Must be from 1 to 12, or 0
to specify a year without a month and day.
dailyRange_startDate_year
- Year of the date. Must be from 1 to 9999, or
0 to specify a date without a year.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a FetchMultiDailyMetricsTimeSeriesResponse.
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<FetchMultiDailyMetricsTimeSeriesResponse>
fetchMultiDailyMetricsTimeSeries(
core.String location, {
core.List<core.String>? dailyMetrics,
core.int? dailyRange_endDate_day,
core.int? dailyRange_endDate_month,
core.int? dailyRange_endDate_year,
core.int? dailyRange_startDate_day,
core.int? dailyRange_startDate_month,
core.int? dailyRange_startDate_year,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (dailyMetrics != null) 'dailyMetrics': dailyMetrics,
if (dailyRange_endDate_day != null)
'dailyRange.endDate.day': ['${dailyRange_endDate_day}'],
if (dailyRange_endDate_month != null)
'dailyRange.endDate.month': ['${dailyRange_endDate_month}'],
if (dailyRange_endDate_year != null)
'dailyRange.endDate.year': ['${dailyRange_endDate_year}'],
if (dailyRange_startDate_day != null)
'dailyRange.startDate.day': ['${dailyRange_startDate_day}'],
if (dailyRange_startDate_month != null)
'dailyRange.startDate.month': ['${dailyRange_startDate_month}'],
if (dailyRange_startDate_year != null)
'dailyRange.startDate.year': ['${dailyRange_startDate_year}'],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' +
core.Uri.encodeFull('$location') +
':fetchMultiDailyMetricsTimeSeries';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchMultiDailyMetricsTimeSeriesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}