-
Notifications
You must be signed in to change notification settings - Fork 30
feat(generated): Add new event types and user object to membership models #642
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
Open
workos-sdk-automation
wants to merge
1
commit into
main
Choose a base branch
from
oagen/spec-update-91fc76ae21e088f16365ddfab59bf9c29940d135
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 92db0495807c86fbbc4d45bd266a6c1f5bcbb59c | ||
| f908f520f9fcd63dfd42ed35b7f141a65b61609b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/workos/api_keys/models/api_key_validation_response_api_key.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| from typing import TypeAlias | ||
| from .api_key import ApiKey | ||
|
|
||
| ApiKeyValidationResponseApiKey: TypeAlias = ApiKey |
6 changes: 6 additions & 0 deletions
6
src/workos/api_keys/models/api_key_validation_response_api_key_owner.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| from typing import TypeAlias | ||
| from workos.common.models.api_key_created_data_owner import ApiKeyCreatedDataOwner | ||
|
|
||
| ApiKeyValidationResponseApiKeyOwner: TypeAlias = ApiKeyCreatedDataOwner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/workos/authorization/models/user_organization_membership_base_with_user.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from datetime import datetime | ||
| from enum import Enum | ||
| from typing import cast | ||
| from typing import Any, Dict, Literal, Optional | ||
| from workos._types import _raise_deserialize_error | ||
| from workos._types import _format_datetime, _parse_datetime | ||
|
|
||
| from workos.user_management.models.user import User | ||
| from workos.common.models.user_organization_membership_base_with_user_status import ( | ||
| UserOrganizationMembershipBaseWithUserStatus, | ||
| ) | ||
|
|
||
|
|
||
| @dataclass(slots=True) | ||
| class UserOrganizationMembershipBaseWithUser: | ||
| """User Organization Membership Base With User model.""" | ||
|
|
||
| object: Literal["organization_membership"] | ||
| """Distinguishes the organization membership object.""" | ||
| id: str | ||
| """The unique ID of the organization membership.""" | ||
| user_id: str | ||
| """The ID of the user.""" | ||
| organization_id: str | ||
| """The ID of the organization which the user belongs to.""" | ||
| status: "UserOrganizationMembershipBaseWithUserStatus" | ||
| """The status of the organization membership. One of `active`, `inactive`, or `pending`.""" | ||
| directory_managed: bool | ||
| """Whether this organization membership is managed by a directory sync connection.""" | ||
| created_at: datetime | ||
| """An ISO 8601 timestamp.""" | ||
| updated_at: datetime | ||
| """An ISO 8601 timestamp.""" | ||
| user: "User" | ||
| """The user that belongs to the organization through this membership.""" | ||
| organization_name: Optional[str] = None | ||
| """The name of the organization which the user belongs to.""" | ||
| custom_attributes: Optional[Dict[str, Any]] = None | ||
| """An object containing IdP-sourced attributes from the linked [Directory User](https://workos.com/docs/reference/directory-sync/directory-user) or [SSO Profile](https://workos.com/docs/reference/sso/profile). Directory User attributes take precedence when both are linked.""" | ||
|
|
||
| @classmethod | ||
| def from_dict( | ||
| cls, data: Dict[str, Any] | ||
| ) -> "UserOrganizationMembershipBaseWithUser": | ||
| """Deserialize from a dictionary.""" | ||
| try: | ||
| return cls( | ||
| object=data.get("object", "organization_membership"), | ||
| id=data["id"], | ||
| user_id=data["user_id"], | ||
| organization_id=data["organization_id"], | ||
| status=UserOrganizationMembershipBaseWithUserStatus(data["status"]), | ||
| directory_managed=data["directory_managed"], | ||
| created_at=_parse_datetime(data["created_at"]), | ||
| updated_at=_parse_datetime(data["updated_at"]), | ||
| user=User.from_dict(cast(Dict[str, Any], data["user"])), | ||
| organization_name=data.get("organization_name"), | ||
| custom_attributes=data.get("custom_attributes"), | ||
| ) | ||
| except (KeyError, ValueError) as e: | ||
| _raise_deserialize_error("UserOrganizationMembershipBaseWithUser", e) | ||
|
|
||
| def to_dict(self) -> Dict[str, Any]: | ||
| """Serialize to a dictionary.""" | ||
| result: Dict[str, Any] = {} | ||
| result["object"] = self.object | ||
| result["id"] = self.id | ||
| result["user_id"] = self.user_id | ||
| result["organization_id"] = self.organization_id | ||
| result["status"] = ( | ||
| self.status.value if isinstance(self.status, Enum) else self.status | ||
| ) | ||
| result["directory_managed"] = self.directory_managed | ||
| result["created_at"] = _format_datetime(self.created_at) | ||
| result["updated_at"] = _format_datetime(self.updated_at) | ||
| result["user"] = self.user.to_dict() | ||
| if self.organization_name is not None: | ||
| result["organization_name"] = self.organization_name | ||
| if self.custom_attributes is not None: | ||
| result["custom_attributes"] = self.custom_attributes | ||
| return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
UserOrganizationMembershipBaseListDatafrom authorization exportsUserOrganizationMembershipBaseListDatahas been entirely removed fromworkos.authorization.modelsand the underlying file deleted from theauthorization/models/directory. Any existing consumer that imports this class from its documented location (from workos.authorization.models import UserOrganizationMembershipBaseListData) will receive anImportErrorafter upgrading. The class is now only available fromworkos.groups.models.Without a re-export shim (e.g.
from workos.groups.models import UserOrganizationMembershipBaseListData as UserOrganizationMembershipBaseListDatain the old__init__.py) or a deprecation warning, this constitutes a hard breaking change. Consider whether a major version bump or a compatibility alias is needed.