UserQuietHoursSchedule returns the quiet hours settings for the user. This endpoint only exists in enterprise editions.
(ctx context.Context, userIdent string)
| 998 | // UserQuietHoursSchedule returns the quiet hours settings for the user. This |
| 999 | // endpoint only exists in enterprise editions. |
| 1000 | func (c *Client) UserQuietHoursSchedule(ctx context.Context, userIdent string) (UserQuietHoursScheduleResponse, error) { |
| 1001 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/users/%s/quiet-hours", userIdent), nil) |
| 1002 | if err != nil { |
| 1003 | return UserQuietHoursScheduleResponse{}, err |
| 1004 | } |
| 1005 | defer res.Body.Close() |
| 1006 | if res.StatusCode != http.StatusOK { |
| 1007 | return UserQuietHoursScheduleResponse{}, ReadBodyAsError(res) |
| 1008 | } |
| 1009 | var resp UserQuietHoursScheduleResponse |
| 1010 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 1011 | } |
| 1012 | |
| 1013 | // UpdateUserQuietHoursSchedule updates the quiet hours settings for the user. |
| 1014 | // This endpoint only exists in enterprise editions. |