-
Notifications
You must be signed in to change notification settings - Fork 12
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
Type all dsync events #292
Conversation
workos/_base_client.py
Outdated
@@ -19,31 +19,41 @@ class BaseClient(Protocol): | |||
_http_client: BaseHTTPClient | |||
|
|||
@property | |||
def audit_logs(self) -> AuditLogsModule: ... | |||
def audit_logs(self) -> AuditLogsModule: |
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.
... do we have different configs for black
? Or different versions?
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 updated the version of black in the repo. I believe if you try reinstalling the version matching the setup.py you, me and CI will be in sync.
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.
Yup, needed to pip install -U black
class Role(WorkOSModel): | ||
slug: str |
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.
We could reuse this for org. memberships, so I may end up moving it.
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.
Yup, I figured it might move around
class DirectoryGroupCreatedEvent( | ||
EventModel[Literal["dsync.group.created"], DirectoryGroup] | ||
): | ||
event: Literal["dsync.group.created"] |
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.
When I set pylance
to standard type checking rather than basic, it doesn't like this property override because it doesn't match the type on EventModel
.
I'm going to ignore it for now, but it may rear its head again when I test what happens when an unrecognized event type gets parsed.
* Add types for directory group events * Add directory user events * Under refactor of separate type files, we can do that later across all resources if we want * Add group membership events * Fix types for user events, they do not contain groups * Reformat * Reformat... again * mypy fixes
Description
Add types for the rest of the Dsync events. Needed to refactor the API return type. The Event does not contain groups.
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.