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

Method GetChatDiffContents

codersdk/chats.go:3264–3275  ·  view source on GitHub ↗

GetChatDiffContents returns resolved diff contents for a chat.

(ctx context.Context, chatID uuid.UUID)

Source from the content-addressed store, hash-verified

3262
3263// GetChatDiffContents returns resolved diff contents for a chat.
3264func (c *ExperimentalClient) GetChatDiffContents(ctx context.Context, chatID uuid.UUID) (ChatDiffContents, error) {
3265 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/experimental/chats/%s/diff", chatID), nil)
3266 if err != nil {
3267 return ChatDiffContents{}, err
3268 }
3269 defer res.Body.Close()
3270 if res.StatusCode != http.StatusOK {
3271 return ChatDiffContents{}, ReadBodyAsError(res)
3272 }
3273 var diff ChatDiffContents
3274 return diff, json.NewDecoder(res.Body).Decode(&diff)
3275}
3276
3277// UploadChatFile uploads a file for use in chat messages.
3278func (c *ExperimentalClient) UploadChatFile(ctx context.Context, organizationID uuid.UUID, contentType string, filename string, rd io.Reader) (UploadChatFileResponse, error) {

Callers 1

TestGetChatDiffContentsFunction · 0.95

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1

TestGetChatDiffContentsFunction · 0.76