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

Method resumeNotifications

cli/notifications.go:75–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75func (r *RootCmd) resumeNotifications() *serpent.Command {
76 cmd := &serpent.Command{
77 Use: "resume",
78 Short: "Resume notifications",
79 Middleware: serpent.Chain(
80 serpent.RequireNArgs(0),
81 ),
82 Handler: func(inv *serpent.Invocation) error {
83 client, err := r.InitClient(inv)
84 if err != nil {
85 return err
86 }
87
88 err = client.PutNotificationsSettings(inv.Context(), codersdk.NotificationsSettings{
89 NotifierPaused: false,
90 })
91 if err != nil {
92 return xerrors.Errorf("unable to resume notifications: %w", err)
93 }
94
95 _, _ = fmt.Fprintln(inv.Stderr, "Notifications are now resumed.")
96 return nil
97 },
98 }
99 return cmd
100}
101
102func (r *RootCmd) testNotifications() *serpent.Command {
103 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