account.updateUsername
Changes username for the current user.
func (c *Client) AccountUpdateUsername(ctx context.Context, username string) (UserClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountUpdateUsername(ctx, username)
if err != nil {
return err
}
_ = res // UserClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Username | string | yes | username or empty string if username is to be removedAccepted characters: a-z (case-insensitive), 0-9 and underscores.Length: 5-32 characters. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | USERNAME_INVALID | The provided username is not valid. |
| 400 | USERNAME_NOT_MODIFIED | The username was not modified. |
| 400 | USERNAME_OCCUPIED | The provided username is already occupied. |
| 400 | USERNAME_PURCHASE_AVAILABLE | The specified username can be purchased on https://fragment.com. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.updateUsername#3e0bdd7c