CancelTemplateVersion marks a template version job as canceled.
(ctx context.Context, version uuid.UUID)
| 118 | |
| 119 | // CancelTemplateVersion marks a template version job as canceled. |
| 120 | func (c *Client) CancelTemplateVersion(ctx context.Context, version uuid.UUID) error { |
| 121 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templateversions/%s/cancel", version), nil) |
| 122 | if err != nil { |
| 123 | return err |
| 124 | } |
| 125 | defer res.Body.Close() |
| 126 | if res.StatusCode != http.StatusOK { |
| 127 | return ReadBodyAsError(res) |
| 128 | } |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // TemplateVersionParameters returns parameters a template version exposes. |
| 133 | func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error) { |