Add adds a new user with the specified id and optional extra data.
(ctx context.Context, user User, getOrCreate bool)
| 24 | |
| 25 | // Add adds a new user with the specified id and optional extra data. |
| 26 | func (c *UsersClient) Add(ctx context.Context, user User, getOrCreate bool) (*UserResponse, error) { |
| 27 | endpoint := c.client.makeEndpoint("user/") |
| 28 | endpoint.addQueryParam(makeRequestOption("get_or_create", getOrCreate)) |
| 29 | |
| 30 | return c.decode(c.client.post(ctx, endpoint, user, c.client.authenticator.usersAuth)) |
| 31 | } |
| 32 | |
| 33 | // Update updates the user's data. |
| 34 | func (c *UsersClient) Update(ctx context.Context, id string, data map[string]any) (*UserResponse, error) { |