UserAutofillParameters returns all recently used parameters for the given user.
(ctx context.Context, user string, templateID uuid.UUID)
| 484 | |
| 485 | // UserAutofillParameters returns all recently used parameters for the given user. |
| 486 | func (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(¶ms) |
| 499 | } |
| 500 | |
| 501 | // HasFirstUser returns whether the first user has been created. |
| 502 | func (c *Client) HasFirstUser(ctx context.Context) (bool, error) { |