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

Method GetChat

codersdk/chats.go:3046–3057  ·  view source on GitHub ↗

GetChat returns a chat by ID.

(ctx context.Context, chatID uuid.UUID)

Source from the content-addressed store, hash-verified

3044
3045// GetChat returns a chat by ID.
3046func (c *ExperimentalClient) GetChat(ctx context.Context, chatID uuid.UUID) (Chat, error) {
3047 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/experimental/chats/%s", chatID), nil)
3048 if err != nil {
3049 return Chat{}, err
3050 }
3051 defer res.Body.Close()
3052 if res.StatusCode != http.StatusOK {
3053 return Chat{}, ReadBodyAsError(res)
3054 }
3055 var chat Chat
3056 return chat, json.NewDecoder(res.Body).Decode(&chat)
3057}
3058
3059func (c *ExperimentalClient) GetChatACL(ctx context.Context, chatID uuid.UUID) (ChatACL, error) {
3060 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/experimental/chats/%s/acl", chatID), nil)

Callers 15

TestPostChatsFunction · 0.95
TestPostChats_ClientTypeFunction · 0.95
TestGetChatFunction · 0.95
TestPatchChatFunction · 0.95
TestGetChatDiffStatusFunction · 0.95
TestChatWithMCPServerIDsFunction · 0.95
TestChatSharingDisabledFunction · 0.95

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 15

TestPostChatsFunction · 0.76
TestPostChats_ClientTypeFunction · 0.76
TestGetChatFunction · 0.76
TestPatchChatFunction · 0.76
TestGetChatDiffStatusFunction · 0.76
TestChatWithMCPServerIDsFunction · 0.76
TestChatSharingDisabledFunction · 0.76