delete method

Future<Empty> delete(
  1. String name, {
  2. bool? force,
  3. String? $fields,
})

Deletes a notification channel.Design your application to single-thread API calls that modify the state of notification channels in a single project.

This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Request parameters:

name - Required. The channel for which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] Value must have pattern ^projects/\[^/\]+/notificationChannels/\[^/\]+$.

force - If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation.

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

  final url_ = 'v3/' + core.Uri.encodeFull('$name');

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