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

Method GetChatRetentionDays

codersdk/chats.go:2639–2650  ·  view source on GitHub ↗

GetChatRetentionDays returns the configured chat retention period.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2637
2638// GetChatRetentionDays returns the configured chat retention period.
2639func (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.
2653func (c *ExperimentalClient) UpdateChatRetentionDays(ctx context.Context, req UpdateChatRetentionDaysRequest) error {

Callers 1

TestChatRetentionDaysFunction · 0.95

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1

TestChatRetentionDaysFunction · 0.76