| 71 | } |
| 72 | |
| 73 | func (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 | |
| 92 | type UpdateInboxNotificationReadStatusRequest struct { |
| 93 | IsRead bool `json:"is_read"` |