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

Method ListInboxNotifications

codersdk/inboxnotification.go:73–90  ·  view source on GitHub ↗
(ctx context.Context, req ListInboxNotificationsRequest)

Source from the content-addressed store, hash-verified

71}
72
73func (c *Client) ListInboxNotifications(ctx context.Context, req ListInboxNotificationsRequest) (ListInboxNotificationsResponse, error) {
74 res, err := c.Request(
75 ctx, http.MethodGet,
76 "/api/v2/notifications/inbox",
77 nil, ListInboxNotificationsRequestToQueryParams(req)...,
78 )
79 if err != nil {
80 return ListInboxNotificationsResponse{}, err
81 }
82 defer res.Body.Close()
83
84 if res.StatusCode != http.StatusOK {
85 return ListInboxNotificationsResponse{}, ReadBodyAsError(res)
86 }
87
88 var listInboxNotificationsResponse ListInboxNotificationsResponse
89 return listInboxNotificationsResponse, json.NewDecoder(res.Body).Decode(&listInboxNotificationsResponse)
90}
91
92type UpdateInboxNotificationReadStatusRequest struct {
93 IsRead bool `json:"is_read"`

Calls 4

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65