MCPcopy Index your code
hub / github.com/coder/coder / UpdateTemplateVersion

Method UpdateTemplateVersion

codersdk/templateversions.go:304–315  ·  view source on GitHub ↗
(ctx context.Context, versionID uuid.UUID, req PatchTemplateVersionRequest)

Source from the content-addressed store, hash-verified

302}
303
304func (c *Client) UpdateTemplateVersion(ctx context.Context, versionID uuid.UUID, req PatchTemplateVersionRequest) (TemplateVersion, error) {
305 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templateversions/%s", versionID), req)
306 if err != nil {
307 return TemplateVersion{}, err
308 }
309 defer res.Body.Close()
310 if res.StatusCode != http.StatusOK {
311 return TemplateVersion{}, ReadBodyAsError(res)
312 }
313 var version TemplateVersion
314 return version, json.NewDecoder(res.Body).Decode(&version)
315}

Callers 1

TestTemplateVersionPatchFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1

TestTemplateVersionPatchFunction · 0.64