MCPcopy Index your code
hub / github.com/coder/coder / DeleteWebpushSubscription

Method DeleteWebpushSubscription

codersdk/notifications.go:258–269  ·  view source on GitHub ↗

DeleteWebpushSubscription deletes a push notification subscription for a given user. Think of this as an unsubscribe, but for a specific push notification subscription.

(ctx context.Context, user string, req DeleteWebpushSubscription)

Source from the content-addressed store, hash-verified

256// DeleteWebpushSubscription deletes a push notification subscription for a given user.
257// Think of this as an unsubscribe, but for a specific push notification subscription.
258func (c *Client) DeleteWebpushSubscription(ctx context.Context, user string, req DeleteWebpushSubscription) error {
259 res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/users/%s/webpush/subscription", user), req)
260 if err != nil {
261 return err
262 }
263 defer res.Body.Close()
264
265 if res.StatusCode != http.StatusNoContent {
266 return ReadBodyAsError(res)
267 }
268 return nil
269}
270
271func (c *Client) PostTestWebpushMessage(ctx context.Context) error {
272 res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/v2/users/%s/webpush/test", Me), WebpushMessage{

Callers 2

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2