Skip to content

Commit 1f13c3a

Browse files
gjtorikianclaude
andcommitted
feat: strip Dto from enum class names and file paths
Regenerate SDK with Dto token removal. Enum types like GenerateLinkDtoIntent are now GenerateLinkIntent. Collision cases (OrganizationDto, RedirectUriDto) retain the suffix to avoid conflicts with existing models of the same base name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 245994b commit 1f13c3a

30 files changed

+135
-137
lines changed

docs/V6_MIGRATION_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ from workos.types.portal.portal_link_intent import PortalLinkIntent
212212

213213
```python
214214
from workos.organizations.models import Organization
215-
from workos.common.models import GenerateLinkDtoIntent
215+
from workos.common.models import GenerateLinkIntent
216216
```
217217

218218
**Migration:** Move imports to `workos.<resource>.models` wherever possible. If you are importing a shared enum or common helper type, look in `workos.common.models`.

src/workos/admin_portal/_resource.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from .._types import RequestOptions, enum_value
1111
from .models import IntentOptions, PortalLinkResponse
12-
from workos.common.models import GenerateLinkDtoIntent
12+
from workos.common.models import GenerateLinkIntent
1313

1414

1515
class AdminPortal:
@@ -24,7 +24,7 @@ def generate_link(
2424
organization: str,
2525
return_url: Optional[str] = None,
2626
success_url: Optional[str] = None,
27-
intent: Optional[Union[GenerateLinkDtoIntent, str]] = None,
27+
intent: Optional[Union[GenerateLinkIntent, str]] = None,
2828
intent_options: Optional[IntentOptions] = None,
2929
request_options: Optional[RequestOptions] = None,
3030
) -> PortalLinkResponse:
@@ -94,7 +94,7 @@ async def generate_link(
9494
organization: str,
9595
return_url: Optional[str] = None,
9696
success_url: Optional[str] = None,
97-
intent: Optional[Union[GenerateLinkDtoIntent, str]] = None,
97+
intent: Optional[Union[GenerateLinkIntent, str]] = None,
9898
intent_options: Optional[IntentOptions] = None,
9999
request_options: Optional[RequestOptions] = None,
100100
) -> PortalLinkResponse:

src/workos/admin_portal/models/generate_link.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from workos._errors import WorkOSError
99

1010
from .intent_options import IntentOptions
11-
from workos.common.models import GenerateLinkDtoIntent
11+
from workos.common.models import GenerateLinkIntent
1212

1313

1414
@dataclass(slots=True)
@@ -21,7 +21,7 @@ class GenerateLink:
2121
"""The URL to go to when an admin clicks on your logo in the Admin Portal. If not specified, the return URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used."""
2222
success_url: Optional[str] = None
2323
"""The URL to redirect the admin to when they finish setup. If not specified, the success URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used."""
24-
intent: Optional["GenerateLinkDtoIntent"] = None
24+
intent: Optional["GenerateLinkIntent"] = None
2525
"""
2626
The intent of the Admin Portal.
2727
- `sso` - Launch Admin Portal for creating SSO connections
@@ -42,7 +42,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "GenerateLink":
4242
organization=data["organization"],
4343
return_url=data.get("return_url"),
4444
success_url=data.get("success_url"),
45-
intent=GenerateLinkDtoIntent(_v)
45+
intent=GenerateLinkIntent(_v)
4646
if (_v := data.get("intent")) is not None
4747
else None,
4848
intent_options=IntentOptions.from_dict(cast(Dict[str, Any], _v))

src/workos/common/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
from .models import ConnectionState as ConnectionState
2121
from .models import ConnectionStatus as ConnectionStatus
2222
from .models import ConnectionType as ConnectionType
23-
from .models import CreateUserDtoPasswordHashType as CreateUserDtoPasswordHashType
24-
from .models import CreateUserInviteOptionsDtoLocale as CreateUserInviteOptionsDtoLocale
25-
from .models import CreateWebhookEndpointDtoEvents as CreateWebhookEndpointDtoEvents
23+
from .models import CreateUserPasswordHashType as CreateUserPasswordHashType
24+
from .models import CreateUserInviteOptionsLocale as CreateUserInviteOptionsLocale
25+
from .models import CreateWebhookEndpointEvents as CreateWebhookEndpointEvents
2626
from .models import (
2727
DataIntegrationsListResponseDataConnectedAccountState as DataIntegrationsListResponseDataConnectedAccountState,
2828
)
@@ -32,10 +32,10 @@
3232
from .models import DirectoryState as DirectoryState
3333
from .models import DirectoryType as DirectoryType
3434
from .models import DirectoryUserWithGroupsState as DirectoryUserWithGroupsState
35-
from .models import GenerateLinkDtoIntent as GenerateLinkDtoIntent
35+
from .models import GenerateLinkIntent as GenerateLinkIntent
3636
from .models import InvitationState as InvitationState
3737
from .models import ListDataType as ListDataType
38-
from .models import OrganizationDomainDataDtoState as OrganizationDomainDataDtoState
38+
from .models import OrganizationDomainDataState as OrganizationDomainDataState
3939
from .models import (
4040
OrganizationDomainStandAloneState as OrganizationDomainStandAloneState,
4141
)
@@ -59,11 +59,11 @@
5959
)
6060
from .models import RadarStandaloneResponseControl as RadarStandaloneResponseControl
6161
from .models import RadarStandaloneResponseVerdict as RadarStandaloneResponseVerdict
62-
from .models import ResendUserInviteOptionsDtoLocale as ResendUserInviteOptionsDtoLocale
62+
from .models import ResendUserInviteOptionsLocale as ResendUserInviteOptionsLocale
6363
from .models import RoleType as RoleType
64-
from .models import UpdateUserDtoPasswordHashType as UpdateUserDtoPasswordHashType
65-
from .models import UpdateWebhookEndpointDtoEvents as UpdateWebhookEndpointDtoEvents
66-
from .models import UpdateWebhookEndpointDtoStatus as UpdateWebhookEndpointDtoStatus
64+
from .models import UpdateUserPasswordHashType as UpdateUserPasswordHashType
65+
from .models import UpdateWebhookEndpointEvents as UpdateWebhookEndpointEvents
66+
from .models import UpdateWebhookEndpointStatus as UpdateWebhookEndpointStatus
6767
from .models import UserIdentitiesGetItemProvider as UserIdentitiesGetItemProvider
6868
from .models import UserInviteState as UserInviteState
6969
from .models import (
@@ -73,4 +73,4 @@
7373
from .models import UserSessionsAuthMethod as UserSessionsAuthMethod
7474
from .models import UserSessionsStatus as UserSessionsStatus
7575
from .models import WebhookEndpointJsonStatus as WebhookEndpointJsonStatus
76-
from .models import WidgetSessionTokenDtoScopes as WidgetSessionTokenDtoScopes
76+
from .models import WidgetSessionTokenScopes as WidgetSessionTokenScopes

src/workos/common/models/__init__.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
from .connection_state import ConnectionState as ConnectionState
2929
from .connection_status import ConnectionStatus as ConnectionStatus
3030
from .connection_type import ConnectionType as ConnectionType
31-
from .create_user_dto_password_hash_type import (
32-
CreateUserDtoPasswordHashType as CreateUserDtoPasswordHashType,
31+
from .create_user_password_hash_type import (
32+
CreateUserPasswordHashType as CreateUserPasswordHashType,
3333
)
34-
from .create_user_invite_options_dto_locale import (
35-
CreateUserInviteOptionsDtoLocale as CreateUserInviteOptionsDtoLocale,
34+
from .create_user_invite_options_locale import (
35+
CreateUserInviteOptionsLocale as CreateUserInviteOptionsLocale,
3636
)
37-
from .create_webhook_endpoint_dto_events import (
38-
CreateWebhookEndpointDtoEvents as CreateWebhookEndpointDtoEvents,
37+
from .create_webhook_endpoint_events import (
38+
CreateWebhookEndpointEvents as CreateWebhookEndpointEvents,
3939
)
4040
from .data_integrations_list_response_data_connected_account_state import (
4141
DataIntegrationsListResponseDataConnectedAccountState as DataIntegrationsListResponseDataConnectedAccountState,
@@ -48,11 +48,11 @@
4848
from .directory_user_with_groups_state import (
4949
DirectoryUserWithGroupsState as DirectoryUserWithGroupsState,
5050
)
51-
from .generate_link_dto_intent import GenerateLinkDtoIntent as GenerateLinkDtoIntent
51+
from .generate_link_intent import GenerateLinkIntent as GenerateLinkIntent
5252
from .invitation_state import InvitationState as InvitationState
5353
from .list_data_type import ListDataType as ListDataType
54-
from .organization_domain_data_dto_state import (
55-
OrganizationDomainDataDtoState as OrganizationDomainDataDtoState,
54+
from .organization_domain_data_state import (
55+
OrganizationDomainDataState as OrganizationDomainDataState,
5656
)
5757
from .organization_domain_stand_alone_state import (
5858
OrganizationDomainStandAloneState as OrganizationDomainStandAloneState,
@@ -85,18 +85,18 @@
8585
from .radar_standalone_response_verdict import (
8686
RadarStandaloneResponseVerdict as RadarStandaloneResponseVerdict,
8787
)
88-
from .resend_user_invite_options_dto_locale import (
89-
ResendUserInviteOptionsDtoLocale as ResendUserInviteOptionsDtoLocale,
88+
from .resend_user_invite_options_locale import (
89+
ResendUserInviteOptionsLocale as ResendUserInviteOptionsLocale,
9090
)
9191
from .role_type import RoleType as RoleType
92-
from .update_user_dto_password_hash_type import (
93-
UpdateUserDtoPasswordHashType as UpdateUserDtoPasswordHashType,
92+
from .update_user_password_hash_type import (
93+
UpdateUserPasswordHashType as UpdateUserPasswordHashType,
9494
)
95-
from .update_webhook_endpoint_dto_events import (
96-
UpdateWebhookEndpointDtoEvents as UpdateWebhookEndpointDtoEvents,
95+
from .update_webhook_endpoint_events import (
96+
UpdateWebhookEndpointEvents as UpdateWebhookEndpointEvents,
9797
)
98-
from .update_webhook_endpoint_dto_status import (
99-
UpdateWebhookEndpointDtoStatus as UpdateWebhookEndpointDtoStatus,
98+
from .update_webhook_endpoint_status import (
99+
UpdateWebhookEndpointStatus as UpdateWebhookEndpointStatus,
100100
)
101101
from .user_identities_get_item_provider import (
102102
UserIdentitiesGetItemProvider as UserIdentitiesGetItemProvider,
@@ -113,6 +113,6 @@
113113
from .webhook_endpoint_json_status import (
114114
WebhookEndpointJsonStatus as WebhookEndpointJsonStatus,
115115
)
116-
from .widget_session_token_dto_scopes import (
117-
WidgetSessionTokenDtoScopes as WidgetSessionTokenDtoScopes,
116+
from .widget_session_token_scopes import (
117+
WidgetSessionTokenScopes as WidgetSessionTokenScopes,
118118
)

src/workos/common/models/create_user_invite_options_dto_locale.py renamed to src/workos/common/models/create_user_invite_options_locale.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from typing_extensions import Literal, TypeAlias
1010

1111

12-
class CreateUserInviteOptionsDtoLocale(str, Enum):
13-
"""Known values for CreateUserInviteOptionsDtoLocale."""
12+
class CreateUserInviteOptionsLocale(str, Enum):
13+
"""Known values for CreateUserInviteOptionsLocale."""
1414

1515
AF = "af"
1616
AM = "am"
@@ -104,7 +104,7 @@ class CreateUserInviteOptionsDtoLocale(str, Enum):
104104
ZU = "zu"
105105

106106
@classmethod
107-
def _missing_(cls, value: object) -> Optional["CreateUserInviteOptionsDtoLocale"]:
107+
def _missing_(cls, value: object) -> Optional["CreateUserInviteOptionsLocale"]:
108108
if not isinstance(value, str):
109109
return None
110110
unknown = str.__new__(cls, value)
@@ -113,7 +113,7 @@ def _missing_(cls, value: object) -> Optional["CreateUserInviteOptionsDtoLocale"
113113
return unknown
114114

115115

116-
CreateUserInviteOptionsDtoLocaleLiteral: TypeAlias = Literal[
116+
CreateUserInviteOptionsLocaleLiteral: TypeAlias = Literal[
117117
"af",
118118
"am",
119119
"ar",

src/workos/common/models/create_user_dto_password_hash_type.py renamed to src/workos/common/models/create_user_password_hash_type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from typing_extensions import Literal, TypeAlias
1010

1111

12-
class CreateUserDtoPasswordHashType(str, Enum):
13-
"""Known values for CreateUserDtoPasswordHashType."""
12+
class CreateUserPasswordHashType(str, Enum):
13+
"""Known values for CreateUserPasswordHashType."""
1414

1515
BCRYPT = "bcrypt"
1616
FIREBASE_SCRYPT = "firebase-scrypt"
@@ -20,7 +20,7 @@ class CreateUserDtoPasswordHashType(str, Enum):
2020
ARGON_2 = "argon2"
2121

2222
@classmethod
23-
def _missing_(cls, value: object) -> Optional["CreateUserDtoPasswordHashType"]:
23+
def _missing_(cls, value: object) -> Optional["CreateUserPasswordHashType"]:
2424
if not isinstance(value, str):
2525
return None
2626
unknown = str.__new__(cls, value)
@@ -29,6 +29,6 @@ def _missing_(cls, value: object) -> Optional["CreateUserDtoPasswordHashType"]:
2929
return unknown
3030

3131

32-
CreateUserDtoPasswordHashTypeLiteral: TypeAlias = Literal[
32+
CreateUserPasswordHashTypeLiteral: TypeAlias = Literal[
3333
"bcrypt", "firebase-scrypt", "ssha", "scrypt", "pbkdf2", "argon2"
3434
]

src/workos/common/models/create_webhook_endpoint_dto_events.py renamed to src/workos/common/models/create_webhook_endpoint_events.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from typing_extensions import Literal, TypeAlias
1010

1111

12-
class CreateWebhookEndpointDtoEvents(str, Enum):
13-
"""Known values for CreateWebhookEndpointDtoEvents."""
12+
class CreateWebhookEndpointEvents(str, Enum):
13+
"""Known values for CreateWebhookEndpointEvents."""
1414

1515
AUTHENTICATION_EMAIL_VERIFICATION_SUCCEEDED = (
1616
"authentication.email_verification_succeeded"
@@ -87,7 +87,7 @@ class CreateWebhookEndpointDtoEvents(str, Enum):
8787
SESSION_REVOKED = "session.revoked"
8888

8989
@classmethod
90-
def _missing_(cls, value: object) -> Optional["CreateWebhookEndpointDtoEvents"]:
90+
def _missing_(cls, value: object) -> Optional["CreateWebhookEndpointEvents"]:
9191
if not isinstance(value, str):
9292
return None
9393
unknown = str.__new__(cls, value)
@@ -96,7 +96,7 @@ def _missing_(cls, value: object) -> Optional["CreateWebhookEndpointDtoEvents"]:
9696
return unknown
9797

9898

99-
CreateWebhookEndpointDtoEventsLiteral: TypeAlias = Literal[
99+
CreateWebhookEndpointEventsLiteral: TypeAlias = Literal[
100100
"authentication.email_verification_succeeded",
101101
"authentication.magic_auth_failed",
102102
"authentication.magic_auth_succeeded",

src/workos/common/models/generate_link_dto_intent.py renamed to src/workos/common/models/generate_link_intent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from typing_extensions import Literal, TypeAlias
1010

1111

12-
class GenerateLinkDtoIntent(str, Enum):
13-
"""Known values for GenerateLinkDtoIntent."""
12+
class GenerateLinkIntent(str, Enum):
13+
"""Known values for GenerateLinkIntent."""
1414

1515
SSO = "sso"
1616
DSYNC = "dsync"
@@ -21,7 +21,7 @@ class GenerateLinkDtoIntent(str, Enum):
2121
BRING_YOUR_OWN_KEY = "bring_your_own_key"
2222

2323
@classmethod
24-
def _missing_(cls, value: object) -> Optional["GenerateLinkDtoIntent"]:
24+
def _missing_(cls, value: object) -> Optional["GenerateLinkIntent"]:
2525
if not isinstance(value, str):
2626
return None
2727
unknown = str.__new__(cls, value)
@@ -30,7 +30,7 @@ def _missing_(cls, value: object) -> Optional["GenerateLinkDtoIntent"]:
3030
return unknown
3131

3232

33-
GenerateLinkDtoIntentLiteral: TypeAlias = Literal[
33+
GenerateLinkIntentLiteral: TypeAlias = Literal[
3434
"sso",
3535
"dsync",
3636
"audit_logs",

src/workos/common/models/organization_domain_data_dto_state.py renamed to src/workos/common/models/organization_domain_data_state.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from typing_extensions import Literal, TypeAlias
1010

1111

12-
class OrganizationDomainDataDtoState(str, Enum):
13-
"""Known values for OrganizationDomainDataDtoState."""
12+
class OrganizationDomainDataState(str, Enum):
13+
"""Known values for OrganizationDomainDataState."""
1414

1515
PENDING = "pending"
1616
VERIFIED = "verified"
1717

1818
@classmethod
19-
def _missing_(cls, value: object) -> Optional["OrganizationDomainDataDtoState"]:
19+
def _missing_(cls, value: object) -> Optional["OrganizationDomainDataState"]:
2020
if not isinstance(value, str):
2121
return None
2222
unknown = str.__new__(cls, value)
@@ -25,4 +25,4 @@ def _missing_(cls, value: object) -> Optional["OrganizationDomainDataDtoState"]:
2525
return unknown
2626

2727

28-
OrganizationDomainDataDtoStateLiteral: TypeAlias = Literal["pending", "verified"]
28+
OrganizationDomainDataStateLiteral: TypeAlias = Literal["pending", "verified"]

0 commit comments

Comments
 (0)