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

Method CreateUser

codersdk/users.go:544–556  ·  view source on GitHub ↗

CreateUser Deprecated: Use CreateUserWithOrgs instead. This will be removed. TODO: When removing, we should rename CreateUserWithOrgs -> CreateUser with an alias of CreateUserWithOrgs.

(ctx context.Context, req CreateUserRequest)

Source from the content-addressed store, hash-verified

542// TODO: When removing, we should rename CreateUserWithOrgs -> CreateUser
543// with an alias of CreateUserWithOrgs.
544func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (User, error) {
545 if req.DisableLogin {
546 req.UserLoginType = LoginTypeNone
547 }
548 return c.CreateUserWithOrgs(ctx, CreateUserRequestWithOrgs{
549 Email: req.Email,
550 Username: req.Username,
551 Name: req.Name,
552 Password: req.Password,
553 UserLoginType: req.UserLoginType,
554 OrganizationIDs: []uuid.UUID{req.OrganizationID},
555 })
556}
557
558// CreateUserWithOrgs creates a new user.
559func (c *Client) CreateUserWithOrgs(ctx context.Context, req CreateUserRequestWithOrgs) (User, error) {

Callers

nothing calls this directly

Calls 1

CreateUserWithOrgsMethod · 0.95

Tested by

no test coverage detected