patch method
Adds data points to a dataset.
The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics: the data points provided are merely inserted, with no existing data replaced.
request
- The metadata request object.
Request parameters:
userId
- Patch a dataset for the person identified. Use me to indicate
the authenticated user. Only me is supported at this time.
dataSourceId
- The data stream ID of the data source that created the
dataset.
datasetId
- This field is not used, and can be safely omitted.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Dataset.
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<Dataset> patch(
Dataset request,
core.String userId,
core.String dataSourceId,
core.String datasetId, {
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_ = commons.escapeVariable('$userId') +
'/dataSources/' +
commons.escapeVariable('$dataSourceId') +
'/datasets/' +
commons.escapeVariable('$datasetId');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}