Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #20

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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