GetChatRetentionDays returns the configured chat retention period.
(ctx context.Context)
| 2637 | |
| 2638 | // GetChatRetentionDays returns the configured chat retention period. |
| 2639 | func (c *ExperimentalClient) GetChatRetentionDays(ctx context.Context) (ChatRetentionDaysResponse, error) { |
| 2640 | res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/retention-days", nil) |
| 2641 | if err != nil { |
| 2642 | return ChatRetentionDaysResponse{}, err |
| 2643 | } |
| 2644 | defer res.Body.Close() |
| 2645 | if res.StatusCode != http.StatusOK { |
| 2646 | return ChatRetentionDaysResponse{}, ReadBodyAsError(res) |
| 2647 | } |
| 2648 | var resp ChatRetentionDaysResponse |
| 2649 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 2650 | } |
| 2651 | |
| 2652 | // UpdateChatRetentionDays updates the chat retention period. |
| 2653 | func (c *ExperimentalClient) UpdateChatRetentionDays(ctx context.Context, req UpdateChatRetentionDaysRequest) error { |