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

Method pauseNotifications

cli/notifications.go:48–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func (r *RootCmd) pauseNotifications() *serpent.Command {
49 cmd := &serpent.Command{
50 Use: "pause",
51 Short: "Pause notifications",
52 Middleware: serpent.Chain(
53 serpent.RequireNArgs(0),
54 ),
55 Handler: func(inv *serpent.Invocation) error {
56 client, err := r.InitClient(inv)
57 if err != nil {
58 return err
59 }
60
61 err = client.PutNotificationsSettings(inv.Context(), codersdk.NotificationsSettings{
62 NotifierPaused: true,
63 })
64 if err != nil {
65 return xerrors.Errorf("unable to pause notifications: %w", err)
66 }
67
68 _, _ = fmt.Fprintln(inv.Stderr, "Notifications are now paused.")
69 return nil
70 },
71 }
72 return cmd
73}
74
75func (r *RootCmd) resumeNotifications() *serpent.Command {
76 cmd := &serpent.Command{

Callers 1

notificationsMethod · 0.95

Calls 4

InitClientMethod · 0.95
ContextMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected