Skip to content

Commit

Permalink
Update generated code (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
silas authored Jun 11, 2024
1 parent 7e8bf84 commit 8b7dcb4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion adminapi/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,17 +644,38 @@ type UserCreatePortalSessionInput struct {
// The portal URL, this is the target URL on the portal site.
//
// If not defined the root URL for the portal will be used.
//
// This does not need to be the full URL, you have the option
// of passing in a path instead (e.g. `/`).
//
// You also have the option of including the `{accountId}`
// string in the path/URL which will be replaced with either the
// UserHub user ID (if `organizationId` is not specified)
// or the UserHub organization ID (if specified).
//
// Examples:
// * `/{accountId}` - the billing dashboard
// * `/{accountId}/plans` - select a plan to checkout
// * `/{accountId}/checkout/<some-plan-id>` - checkout specified plan
// * `/{accountId}/members` - manage organization members
// * `/{accountId}/invite` - invite a user to an organization
PortalUrl string
// The URL the user should be sent to when they want to return to
// the app (e.g. cancel checkout).
//
// If not defined the app URL will be used.
ReturnUrl string
// The URl the user should be sent after they successfully complete
// The URL the user should be sent after they successfully complete
// an action (e.g. checkout).
//
// If not defined the return URL will be used.
SuccessUrl string
// The organization ID.
//
// When specified the `{accountId}` in the `portalUrl` will be
// replaced with the organization ID, otherwise the user ID
// will be used.
OrganizationId string
}

func (n *usersImpl) CreatePortalSession(ctx context.Context, userId string, input *UserCreatePortalSessionInput) (*adminv1.CreatePortalSessionResponse, error) {
Expand All @@ -679,6 +700,9 @@ func (n *usersImpl) CreatePortalSession(ctx context.Context, userId string, inpu
if !internal.IsEmpty(input.SuccessUrl) {
body["successUrl"] = input.SuccessUrl
}
if !internal.IsEmpty(input.OrganizationId) {
body["organizationId"] = input.OrganizationId
}
}

req.SetBody(body)
Expand Down
4 changes: 2 additions & 2 deletions internal/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

const (
ApiBaseUrl = "https://api.userhub.com"
UserAgent = "UserHub-Go/0.6.3"
Version = "0.6.3"
UserAgent = "UserHub-Go/0.6.4"
Version = "0.6.4"

AuthHeader = "Authorization"
ApiKeyHeader = "UserHub-Api-Key"
Expand Down

0 comments on commit 8b7dcb4

Please sign in to comment.