delete method
Delete the specified ad unit from the specified publisher AdSense account.
Request parameters:
accountId
- Account which contains the ad unit.
adClientId
- Ad client for which to get ad unit.
adUnitId
- Ad unit to delete.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a AdUnit.
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<AdUnit> delete(
core.String accountId,
core.String adClientId,
core.String adUnitId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'accounts/' +
commons.escapeVariable('$accountId') +
'/adclients/' +
commons.escapeVariable('$adClientId') +
'/adunits/' +
commons.escapeVariable('$adUnitId');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return AdUnit.fromJson(response_ as core.Map<core.String, core.dynamic>);
}