| 359 | } |
| 360 | |
| 361 | func (c *Client) ResumeTask(ctx context.Context, user string, id uuid.UUID) (ResumeTaskResponse, error) { |
| 362 | res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/v2/tasks/%s/%s/resume", user, id.String()), nil) |
| 363 | if err != nil { |
| 364 | return ResumeTaskResponse{}, err |
| 365 | } |
| 366 | defer res.Body.Close() |
| 367 | if res.StatusCode != http.StatusAccepted { |
| 368 | return ResumeTaskResponse{}, ReadBodyAsError(res) |
| 369 | } |
| 370 | |
| 371 | var resp ResumeTaskResponse |
| 372 | if err := json.NewDecoder(res.Body).Decode(&resp); err != nil { |
| 373 | return ResumeTaskResponse{}, err |
| 374 | } |
| 375 | |
| 376 | return resp, nil |
| 377 | } |
| 378 | |
| 379 | // TaskLogType indicates the source of a task log entry. |
| 380 | type TaskLogType string |