delete method

Future<void> delete(
  1. String profileId,
  2. String objectId,
  3. String name,
  4. String objectType, {
  5. String? $fields,
})

Deletes an existing dynamic targeting key.

Request parameters:

profileId - User profile ID associated with this request. Value must have pattern ^\[^/\]+$.

objectId - ID of the object of this dynamic targeting key. This is a required field. Value must have pattern ^\[^/\]+$.

name - Required. Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase.

objectType - Required. Type of the object of this dynamic targeting key. This is a required field. Possible string values are:

  • "OBJECT_ADVERTISER"
  • "OBJECT_AD"
  • "OBJECT_CREATIVE"
  • "OBJECT_PLACEMENT"

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

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<void> delete(
  core.String profileId,
  core.String objectId,
  core.String name,
  core.String objectType, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'name': [name],
    'objectType': [objectType],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'userprofiles/' +
      core.Uri.encodeFull('$profileId') +
      '/dynamicTargetingKeys/' +
      core.Uri.encodeFull('$objectId');

  await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}