get method

Future<GetDataSourceIndexStatsResponse> get(
  1. String name, {
  2. int? fromDate_day,
  3. int? fromDate_month,
  4. int? fromDate_year,
  5. int? toDate_day,
  6. int? toDate_month,
  7. int? toDate_year,
  8. String? $fields,
})

Gets indexed item statistics for a single data source.

Note: This API requires a standard end user account to execute.

Request parameters:

name - The resource id of the data source to retrieve statistics for, in the following format: "datasources/{source_id}" Value must have pattern ^datasources/\[^/\]+$.

fromDate_day - Day of month. Must be from 1 to 31 and valid for the year and month.

fromDate_month - Month of date. Must be from 1 to 12.

fromDate_year - Year of date. Must be from 1 to 9999.

toDate_day - Day of month. Must be from 1 to 31 and valid for the year and month.

toDate_month - Month of date. Must be from 1 to 12.

toDate_year - Year of date. Must be from 1 to 9999.

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

Completes with a GetDataSourceIndexStatsResponse.

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<GetDataSourceIndexStatsResponse> get(
  core.String name, {
  core.int? fromDate_day,
  core.int? fromDate_month,
  core.int? fromDate_year,
  core.int? toDate_day,
  core.int? toDate_month,
  core.int? toDate_year,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (fromDate_day != null) 'fromDate.day': ['${fromDate_day}'],
    if (fromDate_month != null) 'fromDate.month': ['${fromDate_month}'],
    if (fromDate_year != null) 'fromDate.year': ['${fromDate_year}'],
    if (toDate_day != null) 'toDate.day': ['${toDate_day}'],
    if (toDate_month != null) 'toDate.month': ['${toDate_month}'],
    if (toDate_year != null) 'toDate.year': ['${toDate_year}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/stats/index/' + core.Uri.encodeFull('$name');

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