delete method

Future<Empty> delete(
  1. String advertiserId,
  2. String lineItemId,
  3. String youtubeAssetType,
  4. String youtubeAssetAssociationId, {
  5. String? linkedEntity_adGroupId,
  6. String? $fields,
})

Deletes an existing association between the identified resource and a YouTube asset.

Warning: This method is only available to an informed subset of users.

Request parameters:

advertiserId - Required. The ID of the advertiser that the linked entity belongs to. Value must have pattern ^\[^/\]+$.

lineItemId - The ID of a line item. Value must have pattern ^\[^/\]+$.

youtubeAssetType - Required. The type of YouTube asset associated with the resource. Value must have pattern ^\[^/\]+$. Possible string values are:

  • "YOUTUBE_ASSET_TYPE_UNSPECIFIED" : YouTube asset type is not specified or is unknown in this version.
  • "YOUTUBE_ASSET_TYPE_LOCATION" : Location asset.
  • "YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION" : Affiliate location asset.
  • "YOUTUBE_ASSET_TYPE_SITELINK" : Sitelink asset.

youtubeAssetAssociationId - Required. The ID of the YouTube asset in the association. For YOUTUBE_ASSET_TYPE_LOCATION and YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION associations: This should be the ID of the asset set linked, or 0 if the location_asset_filter or affiliate_location_asset_filter is DISABLED. For YOUTUBE_ASSET_TYPE_SITELINK associations: This should be the ID of the sitelink asset linked. Value must have pattern ^\[^/\]+$.

linkedEntity_adGroupId - The ID of an ad group.

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

Completes with a Empty.

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<Empty> delete(
  core.String advertiserId,
  core.String lineItemId,
  core.String youtubeAssetType,
  core.String youtubeAssetAssociationId, {
  core.String? linkedEntity_adGroupId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'linkedEntity.adGroupId': ?linkedEntity_adGroupId == null
        ? null
        : [linkedEntity_adGroupId],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'v4/advertisers/' +
      core.Uri.encodeFull('$advertiserId') +
      '/lineItems/' +
      core.Uri.encodeFull('$lineItemId') +
      '/youtubeAssetTypes/' +
      core.Uri.encodeFull('$youtubeAssetType') +
      '/youtubeAssetAssociations/' +
      core.Uri.encodeFull('$youtubeAssetAssociationId');

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