| 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) |
| 3061 | if err != nil { |
| 3062 | return ChatACL{}, err |
| 3063 | } |
| 3064 | defer res.Body.Close() |
| 3065 | if res.StatusCode != http.StatusOK { |
| 3066 | return ChatACL{}, ReadBodyAsError(res) |
| 3067 | } |
| 3068 | var acl ChatACL |
| 3069 | return acl, json.NewDecoder(res.Body).Decode(&acl) |
| 3070 | } |
| 3071 | |
| 3072 | func (c *ExperimentalClient) UpdateChatACL(ctx context.Context, chatID uuid.UUID, req UpdateChatACL) error { |
| 3073 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/experimental/chats/%s/acl", chatID), req) |