()
| 73 | } |
| 74 | |
| 75 | func (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 | |
| 102 | func (r *RootCmd) testNotifications() *serpent.Command { |
| 103 | cmd := &serpent.Command{ |
no test coverage detected