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

Method TemplateVersionRichParameters

codersdk/templateversions.go:133–144  ·  view source on GitHub ↗

TemplateVersionParameters returns parameters a template version exposes.

(ctx context.Context, version uuid.UUID)

Source from the content-addressed store, hash-verified

131
132// TemplateVersionParameters returns parameters a template version exposes.
133func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error) {
134 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/rich-parameters", version), nil)
135 if err != nil {
136 return nil, err
137 }
138 defer res.Body.Close()
139 if res.StatusCode != http.StatusOK {
140 return nil, ReadBodyAsError(res)
141 }
142 var params []TemplateVersionParameter
143 return params, json.NewDecoder(res.Body).Decode(&params)
144}
145
146// TemplateVersionExternalAuth returns authentication providers for the requested template version.
147func (c *Client) TemplateVersionExternalAuth(ctx context.Context, version uuid.UUID) ([]TemplateVersionExternalAuth, error) {

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65