diff --git a/auth.go b/auth.go index a6fccaf..6653dfd 100644 --- a/auth.go +++ b/auth.go @@ -51,11 +51,11 @@ func (a *auth) CreateMagicLinkWithEmail( send bool, opts *MagicLinkOptions, ) (*MagicLink, error) { - args := CreateMagicLinkBody{ - Email: email, - Channel: EmailChannel, - Type: magicLinkType, - Send: send, + args := magicLinkArgs{ + Email: email, + ChannelType: EmailChannel, + Type: magicLinkType, + Send: send, } return a.createMagicLink(args, opts) @@ -68,11 +68,11 @@ func (a *auth) CreateMagicLinkWithPhone( send bool, opts *MagicLinkOptions, ) (*MagicLink, error) { - args := CreateMagicLinkBody{ - Phone: phone, - Channel: PhoneChannel, - Type: magicLinkType, - Send: send, + args := magicLinkArgs{ + Phone: phone, + ChannelType: PhoneChannel, + Type: magicLinkType, + Send: send, } return a.createMagicLink(args, opts) @@ -86,11 +86,11 @@ func (a *auth) CreateMagicLinkWithUser( send bool, opts *MagicLinkOptions, ) (*MagicLink, error) { - args := CreateMagicLinkBody{ - UserID: userID, - Channel: channel, - Type: magicLinkType, - Send: send, + args := magicLinkArgs{ + UserID: userID, + ChannelType: channel, + Type: magicLinkType, + Send: send, } return a.createMagicLink(args, opts) @@ -124,7 +124,7 @@ func (a *auth) ValidateJWT(jwt string) (string, error) { return userID, nil } -func (a *auth) createMagicLink(args CreateMagicLinkBody, opts *MagicLinkOptions) (*MagicLink, error) { +func (a *auth) createMagicLink(args magicLinkArgs, opts *MagicLinkOptions) (*MagicLink, error) { if opts != nil { args.Language = opts.Language args.MagicLinkPath = opts.MagicLinkPath diff --git a/user.go b/user.go index 8d79cd2..eacecca 100644 --- a/user.go +++ b/user.go @@ -7,10 +7,6 @@ import ( "strings" ) -type PassageUser = User -type CreateUserArgs = CreateUserBody -type UpdateUserOptions = UpdateBody - type user struct { appID string client *ClientWithResponses @@ -35,7 +31,7 @@ func (u *user) Get(userID string) (*PassageUser, error) { } if res.JSON200 != nil { - return &res.JSON200.User, nil + return &res.JSON200.PassageUser, nil } return nil, errorFromResponse(res.Body, res.StatusCode()) @@ -91,7 +87,7 @@ func (u *user) Activate(userID string) (*PassageUser, error) { } if res.JSON200 != nil { - return &res.JSON200.User, nil + return &res.JSON200.PassageUser, nil } return nil, errorFromResponse(res.Body, res.StatusCode()) @@ -109,7 +105,7 @@ func (u *user) Deactivate(userID string) (*PassageUser, error) { } if res.JSON200 != nil { - return &res.JSON200.User, nil + return &res.JSON200.PassageUser, nil } return nil, errorFromResponse(res.Body, res.StatusCode()) @@ -127,7 +123,7 @@ func (u *user) Update(userID string, options UpdateUserOptions) (*PassageUser, e } if res.JSON200 != nil { - return &res.JSON200.User, nil + return &res.JSON200.PassageUser, nil } return nil, errorFromResponse(res.Body, res.StatusCode()) @@ -145,7 +141,7 @@ func (u *user) Create(args CreateUserArgs) (*PassageUser, error) { } if res.JSON201 != nil { - return &res.JSON201.User, nil + return &res.JSON201.PassageUser, nil } return nil, errorFromResponse(res.Body, res.StatusCode())