Skip to content

Commit 9c237fa

Browse files
authored
Update generated code (#26)
1 parent da9b79a commit 9c237fa

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

src/userhub_sdk/_internal/constants.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import sys
55

66
API_BASE_URL = "https://api.userhub.com"
7-
USER_AGENT = "UserHub-Python/0.6.2"
8-
VERSION = "0.6.2"
7+
USER_AGENT = "UserHub-Python/0.6.4"
8+
VERSION = "0.6.4"
99

1010
AUTH_HEADER = "Authorization"
1111
API_KEY_HEADER = "UserHub-Api-Key"

src/userhub_sdk/adminapi/_users.py

+50-2
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ def create_portal_session(
520520
portal_url: Optional[str] = None,
521521
return_url: Optional[str] = None,
522522
success_url: Optional[str] = None,
523+
organization_id: Optional[str] = None,
523524
) -> adminv1.CreatePortalSessionResponse:
524525
"""
525526
Create Portal session.
@@ -535,16 +536,37 @@ def create_portal_session(
535536
The portal URL, this is the target URL on the portal site.
536537
537538
If not defined the root URL for the portal will be used.
539+
540+
This does not need to be the full URL, you have the option
541+
of passing in a path instead (e.g. `/`).
542+
543+
You also have the option of including the `{accountId}`
544+
string in the path/URL which will be replaced with either the
545+
UserHub user ID (if `organizationId` is not specified)
546+
or the UserHub organization ID (if specified).
547+
548+
Examples:
549+
* `/{accountId}` - the billing dashboard
550+
* `/{accountId}/plans` - select a plan to checkout
551+
* `/{accountId}/checkout/<some-plan-id>` - checkout specified plan
552+
* `/{accountId}/members` - manage organization members
553+
* `/{accountId}/invite` - invite a user to an organization
538554
:param return_url:
539555
The URL the user should be sent to when they want to return to
540556
the app (e.g. cancel checkout).
541557
542558
If not defined the app URL will be used.
543559
:param success_url:
544-
The URl the user should be sent after they successfully complete
560+
The URL the user should be sent after they successfully complete
545561
an action (e.g. checkout).
546562
547563
If not defined the return URL will be used.
564+
:param organization_id:
565+
The organization ID.
566+
567+
When specified the `{accountId}` in the `portalUrl` will be
568+
replaced with the organization ID, otherwise the user ID
569+
will be used.
548570
"""
549571
req = Request(
550572
"admin.users.createPortalSession",
@@ -561,6 +583,8 @@ def create_portal_session(
561583
body["returnUrl"] = return_url
562584
if success_url:
563585
body["successUrl"] = success_url
586+
if organization_id:
587+
body["organizationId"] = organization_id
564588

565589
req.set_body(body)
566590

@@ -1079,6 +1103,7 @@ async def create_portal_session(
10791103
portal_url: Optional[str] = None,
10801104
return_url: Optional[str] = None,
10811105
success_url: Optional[str] = None,
1106+
organization_id: Optional[str] = None,
10821107
) -> adminv1.CreatePortalSessionResponse:
10831108
"""
10841109
Create Portal session.
@@ -1094,16 +1119,37 @@ async def create_portal_session(
10941119
The portal URL, this is the target URL on the portal site.
10951120
10961121
If not defined the root URL for the portal will be used.
1122+
1123+
This does not need to be the full URL, you have the option
1124+
of passing in a path instead (e.g. `/`).
1125+
1126+
You also have the option of including the `{accountId}`
1127+
string in the path/URL which will be replaced with either the
1128+
UserHub user ID (if `organizationId` is not specified)
1129+
or the UserHub organization ID (if specified).
1130+
1131+
Examples:
1132+
* `/{accountId}` - the billing dashboard
1133+
* `/{accountId}/plans` - select a plan to checkout
1134+
* `/{accountId}/checkout/<some-plan-id>` - checkout specified plan
1135+
* `/{accountId}/members` - manage organization members
1136+
* `/{accountId}/invite` - invite a user to an organization
10971137
:param return_url:
10981138
The URL the user should be sent to when they want to return to
10991139
the app (e.g. cancel checkout).
11001140
11011141
If not defined the app URL will be used.
11021142
:param success_url:
1103-
The URl the user should be sent after they successfully complete
1143+
The URL the user should be sent after they successfully complete
11041144
an action (e.g. checkout).
11051145
11061146
If not defined the return URL will be used.
1147+
:param organization_id:
1148+
The organization ID.
1149+
1150+
When specified the `{accountId}` in the `portalUrl` will be
1151+
replaced with the organization ID, otherwise the user ID
1152+
will be used.
11071153
"""
11081154
req = Request(
11091155
"admin.users.createPortalSession",
@@ -1120,6 +1166,8 @@ async def create_portal_session(
11201166
body["returnUrl"] = return_url
11211167
if success_url:
11221168
body["successUrl"] = success_url
1169+
if organization_id:
1170+
body["organizationId"] = organization_id
11231171

11241172
req.set_body(body)
11251173

0 commit comments

Comments
 (0)