query method

Future<QueryDomainStatsResponse> query(
  1. QueryDomainStatsRequest request,
  2. String parent, {
  3. String? $fields,
})

Retrieves a list of domain statistics for a given domain and time period.

Returns statistics only for dates where data is available. Returns PERMISSION_DENIED if you don't have permission to access DomainStats for the domain.

request - The metadata request object.

Request parameters:

parent - Required. The parent resource name where the stats are queried. Format: domains/{domain} Value must have pattern ^domains/\[^/\]+$.

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

Completes with a QueryDomainStatsResponse.

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<QueryDomainStatsResponse> query(
  QueryDomainStatsRequest request,
  core.String parent, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/domainStats:query';

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