list method
List traffic statistics for all available days.
Returns PERMISSION_DENIED if user does not have permission to access TrafficStats for the domain.
Request parameters:
parent
- The resource name of the domain whose traffic statistics we'd
like to list. It should have the form domains/{domain_name}
, where
domain_name is the fully qualified domain name.
Value must have pattern ^domains/\[^/\]+$
.
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.
endDate_month
- Month of a year. Must be from 1 to 12, or 0 to specify a
year without a month and day.
endDate_year
- Year of the date. Must be from 1 to 9999, or 0 to specify
a date without a year.
pageSize
- Requested page size. Server may return fewer TrafficStats
than requested. If unspecified, server will pick an appropriate default.
pageToken
- The next_page_token value returned from a previous List
request, if any. This is the value of
ListTrafficStatsResponse.next_page_token returned from the previous call
to ListTrafficStats
method.
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.
startDate_month
- Month of a year. Must be from 1 to 12, or 0 to specify
a year without a month and day.
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 ListTrafficStatsResponse.
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<ListTrafficStatsResponse> list(
core.String parent, {
core.int? endDate_day,
core.int? endDate_month,
core.int? endDate_year,
core.int? pageSize,
core.String? pageToken,
core.int? startDate_day,
core.int? startDate_month,
core.int? startDate_year,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (endDate_day != null) 'endDate.day': ['${endDate_day}'],
if (endDate_month != null) 'endDate.month': ['${endDate_month}'],
if (endDate_year != null) 'endDate.year': ['${endDate_year}'],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (startDate_day != null) 'startDate.day': ['${startDate_day}'],
if (startDate_month != null) 'startDate.month': ['${startDate_month}'],
if (startDate_year != null) 'startDate.year': ['${startDate_year}'],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/trafficStats';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListTrafficStatsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}