delete method
Deletes the specified data source.
The request will fail if the data source contains any data points.
Request parameters:
userId
- Retrieve a data source 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 to delete.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a DataSource.
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<DataSource> delete(
core.String userId,
core.String dataSourceId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = commons.escapeVariable('$userId') +
'/dataSources/' +
commons.escapeVariable('$dataSourceId');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return DataSource.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}