GetChat returns a chat by ID.
(ctx context.Context, chatID uuid.UUID)
| 3044 | |
| 3045 | // GetChat returns a chat by ID. |
| 3046 | func (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 | |
| 3059 | func (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) |