-
Notifications
You must be signed in to change notification settings - Fork 23
Add intent_options parameter on Portal.generate_link() method
#406
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
Add intent_options parameter on Portal.generate_link() method
#406
Conversation
intent_options_sso_bookmark_slug parameter on Portal.generate_link() methodintent_options_sso_bookmark_slug parameter on Portal.generate_link() method
d8b5abd to
b35d101
Compare
mattgd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a method signature suggestion. Let me know your thoughts.
workos/portal.py
Outdated
| organization_id: str, | ||
| return_url: Optional[str] = None, | ||
| success_url: Optional[str] = None, | ||
| intent_options_sso_bookmark_slug: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should defined this as a structured TypedDict so it makes future expansion easier.
For example:
# types/portal/portal_link_intent_options.py
class SSOIntentOptions(TypedDict):
bookmark_slug: str
class IntentOptions(TypedDict):
sso: SSOIntentOptions
# portal.py
def generate_link(
self,
*,
intent: PortalLinkIntent,
organization_id: str,
return_url: Optional[str] = None,
success_url: Optional[str] = None,
intent_options: Optional[IntentOptions] = None,
) -> PortalLink:
...
if intent_options and intent_options["sso"]:
json["intent_options"] = {
"sso": {
"bookmark_slug": intent_options["sso"]["bookmark_slug"],
}
}
Usage would be something like:
Portal.generate_link(
intent="sso",
organization_id="org_123",
intent_options={"sso": {"bookmark_slug": "test"}},
)
intent_options_sso_bookmark_slug parameter on Portal.generate_link() methodintent_options parameter on Portal.generate_link() method
b35d101 to
2643cb0
Compare
mattgd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Description
This PR introduces the
intent_optionsparameter in thePortal.generate_link()method. This feature is not generally available on WorkOS API. Contact WorkOS support for access.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.