def delete(self, channels): """ Delete the given notification channels in a single request. Parameters ---------- channels : list of :class:`NotificationChannel` Notification channels. Returns ------- bool ``True`` if the delete was successful. Raises ------ :class:`requests.HTTPError` If the delete failed. """ channel_ids = arg_handler.extract_ids(channels) msg = _AlertService.DeleteNotificationChannelRequest(ids=channel_ids) endpoint = "/api/v1/alerts/deleteNotificationChannel" response = self._conn.make_proto_request("DELETE", endpoint, body=msg) self._conn.must_response(response) return True
def delete(self): """ Delete this notification channel. Returns ------- bool ``True`` if the delete was successful. Raises ------ :class:`requests.HTTPError` If the delete failed. """ msg = _AlertService.DeleteNotificationChannelRequest(ids=[self.id]) endpoint = "/api/v1/alerts/deleteNotificationChannel" response = self._conn.make_proto_request("DELETE", endpoint, body=msg) self._conn.must_response(response) return True