| 178 | } |
| 179 | |
| 180 | func (c *Client) TemplateVersionDynamicParameters(ctx context.Context, userID string, version uuid.UUID) (*wsjson.Stream[DynamicParametersResponse, DynamicParametersRequest], error) { |
| 181 | endpoint := fmt.Sprintf("/api/v2/templateversions/%s/dynamic-parameters", version) |
| 182 | if userID != Me { |
| 183 | uid, err := uuid.Parse(userID) |
| 184 | if err != nil { |
| 185 | return nil, xerrors.Errorf("invalid user ID: %w", err) |
| 186 | } |
| 187 | endpoint += fmt.Sprintf("?user_id=%s", uid.String()) |
| 188 | } |
| 189 | |
| 190 | conn, err := c.Dial(ctx, endpoint, nil) |
| 191 | if err != nil { |
| 192 | return nil, err |
| 193 | } |
| 194 | return wsjson.NewStream[DynamicParametersResponse, DynamicParametersRequest](conn, websocket.MessageText, websocket.MessageText, c.Logger()), nil |
| 195 | } |