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

Method UserQuietHoursSchedule

codersdk/users.go:1000–1011  ·  view source on GitHub ↗

UserQuietHoursSchedule returns the quiet hours settings for the user. This endpoint only exists in enterprise editions.

(ctx context.Context, userIdent string)

Source from the content-addressed store, hash-verified

998// UserQuietHoursSchedule returns the quiet hours settings for the user. This
999// endpoint only exists in enterprise editions.
1000func (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.

Callers 1

TestUserQuietHoursFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1

TestUserQuietHoursFunction · 0.64