Skip to content

Commit

Permalink
PR feedback and make sure all docstrings use a colon to parameter des…
Browse files Browse the repository at this point in the history
…criptions
  • Loading branch information
tribble committed Aug 14, 2024
1 parent 0e5181f commit 81b87ea
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions workos/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def create_export(
"""Trigger the creation of an export of audit logs.
Kwargs:
organization (str): Organization's unique identifier.
organization_id (str): Organization's unique identifier.
range_start (str): Start date of the date range filter.
range_end (str): End date of the date range filter.
actions (list): Optional list of actions to filter. (Optional)
actors (list): Optional list of actors to filter. (Optional)
actor_names (list): Optional list of actors to filter by name. (Optional)
targets (list): Optional list of targets to filter. (Optional)
Returns:
Expand Down
2 changes: 1 addition & 1 deletion workos/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def list_events(
Kwargs:
events (Sequence[EventType]): Filter to only return events of particular types.
limit (int): Maximum number of records to return. (Optional)
organization_id(str): Organization ID limits scope of events to a single organization. (Optional)
organization_id (str): Organization ID limits scope of events to a single organization. (Optional)
after (str): Pagination cursor to receive records after a provided Event ID. (Optional)
range_start (str): Date range start for stream of events. (Optional)
range_end (str): Date range end for stream of events. (Optional)
Expand Down
4 changes: 2 additions & 2 deletions workos/mfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def enroll_factor(
Kwargs:
type (str): The type of factor to be enrolled (sms or totp).
totp_issuer (str): Name of the Organization. (Optional)
totp_user (str): email of user. (Optional)
totp_issuer (str): Name of the Organization. Required when type is totp, ignored otherwise.
totp_user (str): email of user. Required when type is totp, ignored otherwise.
phone_number (str): phone number of the user. (Optional)
Returns:
Expand Down
8 changes: 4 additions & 4 deletions workos/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def update_organization(
"""Update an organization
Kwargs:
organization(str) - Organization's unique identifier.
name (str) - A descriptive name for the organization. (Optional)
domains (list) - [Deprecated] Use domain_data instead. List of domains that belong to the organization. (Optional)
domain_data (Sequence[DomainDataInput]) - List of domains that belong to the organization. (Optional)
organization (str): Organization's unique identifier.
name (str): A descriptive name for the organization. (Optional)
domains (list): [Deprecated] Use domain_data instead. List of domains that belong to the organization. (Optional)
domain_data (Sequence[DomainDataInput]): List of domains that belong to the organization. (Optional)
Returns:
Organization: Updated Organization response from WorkOS.
Expand Down
2 changes: 1 addition & 1 deletion workos/passwordless.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def create_session(
) -> PasswordlessSession:
"""Create a Passwordless Session.
Args:
Kwargs:
email (str): The email of the user to authenticate.
type (PasswordlessSessionType): The type of Passwordless Session to
create. Currently, the only supported value is 'MagicLink'.
Expand Down
2 changes: 1 addition & 1 deletion workos/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def generate_link(
Kwargs:
intent (PortalLinkIntent): The access scope for the generated Admin Portal link.
organization_id (string): The ID of the organization the Admin Portal link will be generated for.
organization_id (str): The ID of the organization the Admin Portal link will be generated for.
return_url (str): The URL that the end user will be redirected to upon exiting the generated Admin Portal.
If none is provided, the default redirect link set in your WorkOS Dashboard will be used. (Optional)
success_url (str): The URL to which WorkOS will redirect users to upon successfully viewing Audit Logs,
Expand Down
10 changes: 5 additions & 5 deletions workos/sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def get_authorization_url(
WorkOS.
Kwargs:
redirect_uri (str) - A valid redirect URI, as specified on WorkOS
state (str) - An encoded string passed to WorkOS that'd be preserved through the authentication workflow, passed
redirect_uri (str) : A valid redirect URI, as specified on WorkOS
state (str) : An encoded string passed to WorkOS that'd be preserved through the authentication workflow, passed
back as a query parameter
provider (SSOProviderType) - Authentication service provider descriptor
connection_id (string) - Unique identifier for a WorkOS Connection
organization_id (string) - Unique identifier for a WorkOS Organization
provider (SSOProviderType) : Authentication service provider descriptor
connection_id (string) : Unique identifier for a WorkOS Connection
organization_id (string) : Unique identifier for a WorkOS Organization
Returns:
str: URL to redirect a User to to begin the OAuth workflow with WorkOS
Expand Down
66 changes: 33 additions & 33 deletions workos/user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_user(self, user_id: str) -> SyncOrAsync[User]:
"""Get the details of an existing user.
Args:
user_id (str) - User unique identifier
user_id (str): User unique identifier
Returns:
User: User response from WorkOS.
"""
Expand Down Expand Up @@ -158,13 +158,13 @@ def create_user(
"""Create a new user.
Kwargs:
email (str) - The email address of the user.
password (str) - The password to set for the user. (Optional)
password_hash (str) - The hashed password to set for the user. Mutually exclusive with password. (Optional)
password_hash_type (str) - The algorithm originally used to hash the password, used when providing a password_hash. Valid values are 'bcrypt', `firebase-scrypt`, and `ssha`. (Optional)
first_name (str) - The user's first name. (Optional)
last_name (str) - The user's last name. (Optional)
email_verified (bool) - Whether the user's email address was previously verified. (Optional)
email (str): The email address of the user.
password (str): The password to set for the user. (Optional)
password_hash (str): The hashed password to set for the user. Mutually exclusive with password. (Optional)
password_hash_type (str): The algorithm originally used to hash the password, used when providing a password_hash. Valid values are 'bcrypt', `firebase-scrypt`, and `ssha`. (Optional)
first_name (str): The user's first name. (Optional)
last_name (str): The user's last name. (Optional)
email_verified (bool): Whether the user's email address was previously verified. (Optional)
Returns:
User: Created User response from WorkOS.
Expand All @@ -185,13 +185,13 @@ def update_user(
"""Update user attributes.
Kwargs:
user_id (str) - The User unique identifier
first_name (str) - The user's first name. (Optional)
last_name (str) - The user's last name. (Optional)
email_verified (bool) - Whether the user's email address was previously verified. (Optional)
password (str) - The password to set for the user. (Optional)
password_hash (str) - The hashed password to set for the user, used when migrating from another user store. Mutually exclusive with password. (Optional)
password_hash_type (str) - The algorithm originally used to hash the password, used when providing a password_hash. Valid values are 'bcrypt', `firebase-scrypt`, and `ssha`. (Optional)
user_id (str): The User unique identifier
first_name (str): The user's first name. (Optional)
last_name (str): The user's last name. (Optional)
email_verified (bool): Whether the user's email address was previously verified. (Optional)
password (str): The password to set for the user. (Optional)
password_hash (str): The hashed password to set for the user, used when migrating from another user store. Mutually exclusive with password. (Optional)
password_hash_type (str): The algorithm originally used to hash the password, used when providing a password_hash. Valid values are 'bcrypt', `firebase-scrypt`, and `ssha`. (Optional)
Returns:
User: Updated User response from WorkOS.
Expand All @@ -202,7 +202,7 @@ def delete_user(self, user_id: str) -> SyncOrAsync[None]:
"""Delete an existing user.
Args:
user_id (str) - User unique identifier
user_id (str): User unique identifier
Returns:
None
"""
Expand Down Expand Up @@ -230,7 +230,7 @@ def update_organization_membership(
"""Updates an OrganizationMembership for the given id.
Args:
organization_membership_id (str) - The unique ID of the Organization Membership.
organization_membership_id (str): The unique ID of the Organization Membership.
role_slug: The Unique Slug of the Role to which to grant to this membership.
If no slug is passed in, it will not be changed (Optional)
Expand All @@ -245,7 +245,7 @@ def get_organization_membership(
"""Get the details of an organization membership.
Args:
organization_membership_id (str) - The unique ID of the Organization Membership.
organization_membership_id (str): The unique ID of the Organization Membership.
Returns:
OrganizationMembership: OrganizationMembership response from WorkOS.
"""
Expand Down Expand Up @@ -284,7 +284,7 @@ def delete_organization_membership(
"""Delete an existing organization membership.
Args:
organization_membership_id (str) - The unique ID of the Organization Membership.
organization_membership_id (str): The unique ID of the Organization Membership.
Returns:
None
"""
Expand All @@ -296,7 +296,7 @@ def deactivate_organization_membership(
"""Deactivate an organization membership.
Args:
organization_membership_id (str) - The unique ID of the Organization Membership.
organization_membership_id (str): The unique ID of the Organization Membership.
Returns:
OrganizationMembership: OrganizationMembership response from WorkOS.
"""
Expand All @@ -308,7 +308,7 @@ def reactivate_organization_membership(
"""Reactivates an organization membership.
Args:
organization_membership_id (str) - The unique ID of the Organization Membership.
organization_membership_id (str): The unique ID of the Organization Membership.
Returns:
OrganizationMembership: OrganizationMembership response from WorkOS.
"""
Expand All @@ -332,21 +332,21 @@ def get_authorization_url(
WorkOS.
Kwargs:
redirect_uri (str) - A Redirect URI to return an authorized user to.
connection_id (str) - The connection_id connection selector is used to initiate SSO for a Connection.
redirect_uri (str): A Redirect URI to return an authorized user to.
connection_id (str): The connection_id connection selector is used to initiate SSO for a Connection.
The value of this parameter should be a WorkOS Connection ID. (Optional)
organization_id (str) - The organization_id connection selector is used to initiate SSO for an Organization.
organization_id (str): The organization_id connection selector is used to initiate SSO for an Organization.
The value of this parameter should be a WorkOS Organization ID. (Optional)
provider (UserManagementProviderType) - The provider connection selector is used to initiate SSO using an OAuth-compatible provider.
provider (UserManagementProviderType): The provider connection selector is used to initiate SSO using an OAuth-compatible provider.
Currently, the supported values for provider are 'authkit', 'AppleOAuth', 'GitHubOAuth, 'GoogleOAuth', and 'MicrosoftOAuth'. (Optional)
domain_hint (str) - Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth,
domain_hint (str): Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth,
or with a GoogleSAML connection type. (Optional)
login_hint (str) - Can be used to pre-fill the username/email address field of the IdP sign-in page for the user,
login_hint (str): Can be used to pre-fill the username/email address field of the IdP sign-in page for the user,
if you know their username ahead of time. Currently, this parameter is supported for OAuth, OpenID Connect,
OktaSAML, and AzureSAML connection types. (Optional)
state (str) - An encoded string passed to WorkOS that'd be preserved through the authentication workflow, passed
state (str): An encoded string passed to WorkOS that'd be preserved through the authentication workflow, passed
back as a query parameter. (Optional)
code_challenge (str) - Code challenge is derived from the code verifier used for the PKCE flow. (Optional)
code_challenge (str): Code challenge is derived from the code verifier used for the PKCE flow. (Optional)
Returns:
str: URL to redirect a User to to begin the OAuth workflow with WorkOS
Expand Down Expand Up @@ -568,7 +568,7 @@ def get_password_reset(self, password_reset_id: str) -> SyncOrAsync[PasswordRese
"""Get the details of a password reset object.
Args:
password_reset_id (str) - The unique ID of the password reset object.
password_reset_id (str): The unique ID of the password reset object.
Returns:
PasswordReset: PasswordReset response from WorkOS.
Expand Down Expand Up @@ -605,7 +605,7 @@ def get_email_verification(
"""Get the details of an email verification object.
Args:
email_verification_id (str) - The unique ID of the email verification object.
email_verification_id (str): The unique ID of the email verification object.
Returns:
EmailVerification: EmailVerification response from WorkOS.
Expand Down Expand Up @@ -639,7 +639,7 @@ def get_magic_auth(self, magic_auth_id: str) -> SyncOrAsync[MagicAuth]:
"""Get the details of a Magic Auth object.
Args:
magic_auth_id (str) - The unique ID of the Magic Auth object.
magic_auth_id (str): The unique ID of the Magic Auth object.
Returns:
MagicAuth: MagicAuth response from WorkOS.
Expand Down Expand Up @@ -781,7 +781,7 @@ def revoke_invitation(self, invitation_id: str) -> SyncOrAsync[Invitation]:
"""Revokes an existing Invitation.
Args:
invitation_id (str) - The unique ID of the Invitation.
invitation_id (str): The unique ID of the Invitation.
Returns:
Invitation: Invitation response from WorkOS.
Expand Down

0 comments on commit 81b87ea

Please sign in to comment.