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

Method UserAutofillParameters

codersdk/users.go:486–499  ·  view source on GitHub ↗

UserAutofillParameters returns all recently used parameters for the given user.

(ctx context.Context, user string, templateID uuid.UUID)

Source from the content-addressed store, hash-verified

484
485// UserAutofillParameters returns all recently used parameters for the given user.
486func (c *Client) UserAutofillParameters(ctx context.Context, user string, templateID uuid.UUID) ([]UserParameter, error) {
487 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/users/%s/autofill-parameters?template_id=%s", user, templateID), nil)
488 if err != nil {
489 return nil, err
490 }
491 defer res.Body.Close()
492
493 if res.StatusCode != http.StatusOK {
494 return nil, ReadBodyAsError(res)
495 }
496
497 var params []UserParameter
498 return params, json.NewDecoder(res.Body).Decode(&params)
499}
500
501// HasFirstUser returns whether the first user has been created.
502func (c *Client) HasFirstUser(ctx context.Context) (bool, error) {

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1