GetChatAutoArchiveDays returns the configured chat auto-archive period.
(ctx context.Context)
| 2692 | |
| 2693 | // GetChatAutoArchiveDays returns the configured chat auto-archive period. |
| 2694 | func (c *ExperimentalClient) GetChatAutoArchiveDays(ctx context.Context) (ChatAutoArchiveDaysResponse, error) { |
| 2695 | res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/auto-archive-days", nil) |
| 2696 | if err != nil { |
| 2697 | return ChatAutoArchiveDaysResponse{}, err |
| 2698 | } |
| 2699 | defer res.Body.Close() |
| 2700 | if res.StatusCode != http.StatusOK { |
| 2701 | return ChatAutoArchiveDaysResponse{}, ReadBodyAsError(res) |
| 2702 | } |
| 2703 | var resp ChatAutoArchiveDaysResponse |
| 2704 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 2705 | } |
| 2706 | |
| 2707 | // UpdateChatAutoArchiveDays updates the chat auto-archive period. |
| 2708 | func (c *ExperimentalClient) UpdateChatAutoArchiveDays(ctx context.Context, req UpdateChatAutoArchiveDaysRequest) error { |