getByDataFilter method

Future<Spreadsheet> getByDataFilter(
  1. GetSpreadsheetByDataFilterRequest request,
  2. String spreadsheetId, {
  3. String? $fields,
})

Returns the spreadsheet at the given ID.

The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. Specifying one or more data filters returns the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids is not returned. You can include grid data one of 2 ways: * Specify a field mask listing your desired fields using the fields URL parameter in HTTP * Set the includeGridData parameter to true. If a field mask is set, the includeGridData parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want.

request - The metadata request object.

Request parameters:

spreadsheetId - The spreadsheet to request.

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

Completes with a Spreadsheet.

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<Spreadsheet> getByDataFilter(
  GetSpreadsheetByDataFilterRequest request,
  core.String spreadsheetId, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v4/spreadsheets/' +
      commons.escapeVariable('$spreadsheetId') +
      ':getByDataFilter';

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