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

Method UpsertChatUsageLimitOverride

codersdk/chats.go:3342–3353  ·  view source on GitHub ↗

UpsertChatUsageLimitOverride creates or updates a per-user usage limit override.

(ctx context.Context, userID uuid.UUID, req UpsertChatUsageLimitOverrideRequest)

Source from the content-addressed store, hash-verified

3340
3341// UpsertChatUsageLimitOverride creates or updates a per-user usage limit override.
3342func (c *ExperimentalClient) UpsertChatUsageLimitOverride(ctx context.Context, userID uuid.UUID, req UpsertChatUsageLimitOverrideRequest) (ChatUsageLimitOverride, error) {
3343 res, err := c.Request(ctx, http.MethodPut, fmt.Sprintf("/api/experimental/chats/usage-limits/overrides/%s", userID), req)
3344 if err != nil {
3345 return ChatUsageLimitOverride{}, err
3346 }
3347 defer res.Body.Close()
3348 if res.StatusCode != http.StatusOK {
3349 return ChatUsageLimitOverride{}, ReadBodyAsError(res)
3350 }
3351 var resp ChatUsageLimitOverride
3352 return resp, json.NewDecoder(res.Body).Decode(&resp)
3353}
3354
3355// UpdateChatUserUsageLimitOverride creates or updates a per-user usage limit override.
3356func (c *ExperimentalClient) UpdateChatUserUsageLimitOverride(ctx context.Context, userID uuid.UUID, req UpdateChatUsageLimitOverrideRequest) (ChatUsageLimitOverride, error) {

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1