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

Method UpdateTemplateMeta

codersdk/templates.go:353–364  ·  view source on GitHub ↗
(ctx context.Context, templateID uuid.UUID, req UpdateTemplateMeta)

Source from the content-addressed store, hash-verified

351}
352
353func (c *Client) UpdateTemplateMeta(ctx context.Context, templateID uuid.UUID, req UpdateTemplateMeta) (Template, error) {
354 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templates/%s", templateID), req)
355 if err != nil {
356 return Template{}, err
357 }
358 defer res.Body.Close()
359 if res.StatusCode != http.StatusOK {
360 return Template{}, ReadBodyAsError(res)
361 }
362 var updated Template
363 return updated, json.NewDecoder(res.Body).Decode(&updated)
364}
365
366func (c *Client) UpdateTemplateACL(ctx context.Context, templateID uuid.UUID, req UpdateTemplateACL) error {
367 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templates/%s/acl", templateID), req)

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65