list method

Future<ListTrafficStatsResponse> list(
  1. String parent, {
  2. int? endDate_day,
  3. int? endDate_month,
  4. int? endDate_year,
  5. int? pageSize,
  6. String? pageToken,
  7. int? startDate_day,
  8. int? startDate_month,
  9. int? startDate_year,
  10. String? $fields,
})

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>>{
    'endDate.day': ?endDate_day == null ? null : ['${endDate_day}'],
    'endDate.month': ?endDate_month == null ? null : ['${endDate_month}'],
    'endDate.year': ?endDate_year == null ? null : ['${endDate_year}'],
    'pageSize': ?pageSize == null ? null : ['${pageSize}'],
    'pageToken': ?pageToken == null ? null : [pageToken],
    'startDate.day': ?startDate_day == null ? null : ['${startDate_day}'],
    'startDate.month': ?startDate_month == null
        ? null
        : ['${startDate_month}'],
    'startDate.year': ?startDate_year == null ? null : ['${startDate_year}'],
    'fields': ?$fields == null ? null : [$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>,
  );
}