Skip to content

Commit a8e8d8a

Browse files
chore(generated): regenerate shared files for UserManagement, Radar
1 parent e955d90 commit a8e8d8a

6 files changed

Lines changed: 256 additions & 24 deletions

File tree

.oagen-manifest.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "python",
4-
"generatedAt": "2026-07-02T14:58:45.916Z",
4+
"generatedAt": "2026-07-02T17:29:55.736Z",
55
"files": [
66
"src/workos/_client.py",
77
"src/workos/admin_portal/__init__.py",
@@ -661,16 +661,21 @@
661661
"src/workos/user_management/models/jwt_template_response.py",
662662
"src/workos/user_management/models/magic_auth.py",
663663
"src/workos/user_management/models/magic_auth_code_session_authenticate_request.py",
664+
"src/workos/user_management/models/magic_auth_send_magic_auth_code_and_return_response.py",
664665
"src/workos/user_management/models/mfa_totp_session_authenticate_request.py",
665666
"src/workos/user_management/models/organization_selection_session_authenticate_request.py",
666667
"src/workos/user_management/models/password_reset.py",
667668
"src/workos/user_management/models/password_session_authenticate_request.py",
669+
"src/workos/user_management/models/radar_email_challenge_code_session_authenticate_request.py",
670+
"src/workos/user_management/models/radar_sms_challenge_code_session_authenticate_request.py",
668671
"src/workos/user_management/models/redirect_uri.py",
669672
"src/workos/user_management/models/refresh_token_session_authenticate_request.py",
670673
"src/workos/user_management/models/resend_user_invite_options.py",
671674
"src/workos/user_management/models/reset_password_response.py",
672675
"src/workos/user_management/models/revoke_session.py",
673676
"src/workos/user_management/models/send_email_change.py",
677+
"src/workos/user_management/models/send_radar_sms_challenge.py",
678+
"src/workos/user_management/models/send_radar_sms_challenge_response.py",
674679
"src/workos/user_management/models/send_verification_email_response.py",
675680
"src/workos/user_management/models/sso_device_authorization_request.py",
676681
"src/workos/user_management/models/update_jwt_template.py",
@@ -679,6 +684,7 @@
679684
"src/workos/user_management/models/user_api_key_owner.py",
680685
"src/workos/user_management/models/user_api_key_with_value.py",
681686
"src/workos/user_management/models/user_api_key_with_value_owner.py",
687+
"src/workos/user_management/models/user_create_response.py",
682688
"src/workos/user_management/models/user_identities_get_item.py",
683689
"src/workos/user_management/models/user_invite.py",
684690
"src/workos/user_management/models/user_management_authentication_provider.py",
@@ -1042,6 +1048,7 @@
10421048
"tests/fixtures/magic_auth_code_session_authenticate_request.json",
10431049
"tests/fixtures/magic_auth_created.json",
10441050
"tests/fixtures/magic_auth_created_data.json",
1051+
"tests/fixtures/magic_auth_send_magic_auth_code_and_return_response.json",
10451052
"tests/fixtures/mfa_totp_session_authenticate_request.json",
10461053
"tests/fixtures/new_connect_application_secret.json",
10471054
"tests/fixtures/object_metadata.json",
@@ -1110,7 +1117,9 @@
11101117
"tests/fixtures/pipes_connected_account_reauthorization_needed.json",
11111118
"tests/fixtures/portal_link_response.json",
11121119
"tests/fixtures/profile.json",
1120+
"tests/fixtures/radar_email_challenge_code_session_authenticate_request.json",
11131121
"tests/fixtures/radar_list_entry_already_present_response.json",
1122+
"tests/fixtures/radar_sms_challenge_code_session_authenticate_request.json",
11141123
"tests/fixtures/radar_standalone_assess_request.json",
11151124
"tests/fixtures/radar_standalone_delete_radar_list_entry_request.json",
11161125
"tests/fixtures/radar_standalone_response.json",
@@ -1135,6 +1144,8 @@
11351144
"tests/fixtures/role_updated.json",
11361145
"tests/fixtures/role_updated_data.json",
11371146
"tests/fixtures/send_email_change.json",
1147+
"tests/fixtures/send_radar_sms_challenge.json",
1148+
"tests/fixtures/send_radar_sms_challenge_response.json",
11381149
"tests/fixtures/send_verification_email_response.json",
11391150
"tests/fixtures/session_created.json",
11401151
"tests/fixtures/session_created_data.json",
@@ -1178,6 +1189,7 @@
11781189
"tests/fixtures/user_authentication_factor_enroll_response.json",
11791190
"tests/fixtures/user_consent_option.json",
11801191
"tests/fixtures/user_consent_option_choice.json",
1192+
"tests/fixtures/user_create_response.json",
11811193
"tests/fixtures/user_created.json",
11821194
"tests/fixtures/user_deleted.json",
11831195
"tests/fixtures/user_identities_get_item.json",
@@ -1252,6 +1264,7 @@
12521264
"tests/test_pipes_models_round_trip.py",
12531265
"tests/test_pipes_provider.py",
12541266
"tests/test_radar.py",
1267+
"tests/test_radar_models_round_trip.py",
12551268
"tests/test_sso.py",
12561269
"tests/test_user_management.py",
12571270
"tests/test_user_management_models_round_trip.py",

src/workos/radar/_resource.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def create_attempt(
3232
email: str,
3333
auth_method: Union[RadarStandaloneAssessRequestAuthMethod, str],
3434
action: Union[RadarStandaloneAssessRequestAction, str],
35+
signals_id: Optional[str] = None,
3536
request_options: Optional[RequestOptions] = None,
3637
) -> RadarStandaloneResponse:
3738
"""Create an attempt
@@ -44,6 +45,7 @@ def create_attempt(
4445
email: The email address of the user making the request.
4546
auth_method: The authentication method being used.
4647
action: The action being performed.
48+
signals_id: An optional Radar signals ID for the request.
4749
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
4850
4951
Returns:
@@ -56,11 +58,16 @@ def create_attempt(
5658
ServerError: If the server returns a 5xx error.
5759
"""
5860
body: Dict[str, Any] = {
59-
"ip_address": ip_address,
60-
"user_agent": user_agent,
61-
"email": email,
62-
"auth_method": enum_value(auth_method),
63-
"action": enum_value(action),
61+
k: v
62+
for k, v in {
63+
"ip_address": ip_address,
64+
"user_agent": user_agent,
65+
"email": email,
66+
"auth_method": enum_value(auth_method),
67+
"action": enum_value(action),
68+
"signals_id": signals_id,
69+
}.items()
70+
if v is not None
6471
}
6572
return self._client.request(
6673
method="post",
@@ -198,6 +205,7 @@ async def create_attempt(
198205
email: str,
199206
auth_method: Union[RadarStandaloneAssessRequestAuthMethod, str],
200207
action: Union[RadarStandaloneAssessRequestAction, str],
208+
signals_id: Optional[str] = None,
201209
request_options: Optional[RequestOptions] = None,
202210
) -> RadarStandaloneResponse:
203211
"""Create an attempt
@@ -210,6 +218,7 @@ async def create_attempt(
210218
email: The email address of the user making the request.
211219
auth_method: The authentication method being used.
212220
action: The action being performed.
221+
signals_id: An optional Radar signals ID for the request.
213222
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
214223
215224
Returns:
@@ -222,11 +231,16 @@ async def create_attempt(
222231
ServerError: If the server returns a 5xx error.
223232
"""
224233
body: Dict[str, Any] = {
225-
"ip_address": ip_address,
226-
"user_agent": user_agent,
227-
"email": email,
228-
"auth_method": enum_value(auth_method),
229-
"action": enum_value(action),
234+
k: v
235+
for k, v in {
236+
"ip_address": ip_address,
237+
"user_agent": user_agent,
238+
"email": email,
239+
"auth_method": enum_value(auth_method),
240+
"action": enum_value(action),
241+
"signals_id": signals_id,
242+
}.items()
243+
if v is not None
230244
}
231245
return await self._client.request(
232246
method="post",

src/workos/radar/models/radar_standalone_assess_request.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from dataclasses import dataclass
66
from enum import Enum
7-
from typing import Any, Dict
7+
from typing import Any, Dict, Optional
88
from workos._types import _raise_deserialize_error
99
from workos.common.models.radar_standalone_assess_request_action import (
1010
RadarStandaloneAssessRequestAction,
@@ -28,6 +28,8 @@ class RadarStandaloneAssessRequest:
2828
"""The authentication method being used."""
2929
action: "RadarStandaloneAssessRequestAction"
3030
"""The action being performed."""
31+
signals_id: Optional[str] = None
32+
"""An optional Radar signals ID for the request."""
3133

3234
@classmethod
3335
def from_dict(cls, data: Dict[str, Any]) -> "RadarStandaloneAssessRequest":
@@ -39,6 +41,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "RadarStandaloneAssessRequest":
3941
email=data["email"],
4042
auth_method=RadarStandaloneAssessRequestAuthMethod(data["auth_method"]),
4143
action=RadarStandaloneAssessRequestAction(data["action"]),
44+
signals_id=data.get("signals_id"),
4245
)
4346
except (KeyError, ValueError) as e:
4447
_raise_deserialize_error("RadarStandaloneAssessRequest", e)
@@ -57,4 +60,6 @@ def to_dict(self) -> Dict[str, Any]:
5760
result["action"] = (
5861
self.action.value if isinstance(self.action, Enum) else self.action
5962
)
63+
if self.signals_id is not None:
64+
result["signals_id"] = self.signals_id
6065
return result

tests/fixtures/radar_standalone_assess_request.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"user_agent": "Mozilla/5.0",
44
"email": "user@example.com",
55
"auth_method": "Password",
6-
"action": "sign-in"
6+
"action": "sign-in",
7+
"signals_id": "01JBS0GN92GC2RJQS4X9DBPQ2A"
78
}

tests/test_common_models_round_trip.py

Lines changed: 142 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,155 @@
44

55
from tests.generated_helpers import load_fixture
66

7-
from workos.common.models import AuthMethodMismatchError
7+
from workos.common.models import (
8+
ConnectApplicationM2M,
9+
ConnectApplicationOAuth,
10+
ConnectApplicationOAuthRedirectUris,
11+
)
812

913

1014
class TestModelRoundTrip:
11-
def test_auth_method_mismatch_error_round_trip(self):
12-
data = load_fixture("auth_method_mismatch_error.json")
13-
instance = AuthMethodMismatchError.from_dict(data)
15+
def test_connect_application_oauth_round_trip(self):
16+
data = load_fixture("connect_application_oauth.json")
17+
instance = ConnectApplicationOAuth.from_dict(data)
1418
serialized = instance.to_dict()
1519
assert serialized == data
16-
restored = AuthMethodMismatchError.from_dict(serialized)
20+
restored = ConnectApplicationOAuth.from_dict(serialized)
1721
assert restored.to_dict() == serialized
1822

19-
def test_auth_method_mismatch_error_minimal_payload(self):
23+
def test_connect_application_oauth_minimal_payload(self):
2024
data = {
21-
"code": "auth_method_mismatch",
22-
"message": "This installation uses oauth authentication. Use the POST /:slug/token endpoint instead.",
25+
"object": "connect_application",
26+
"id": "conn_app_01HXYZ123456789ABCDEFGHIJ",
27+
"client_id": "client_01HXYZ123456789ABCDEFGHIJ",
28+
"description": None,
29+
"name": "My Application",
30+
"scopes": ["openid", "profile", "email"],
31+
"created_at": "2026-01-15T12:00:00.000Z",
32+
"updated_at": "2026-01-15T12:00:00.000Z",
33+
"application_type": "oauth",
34+
"redirect_uris": [{"uri": "https://example.com/callback", "default": True}],
35+
"uses_pkce": True,
36+
"is_first_party": True,
2337
}
24-
instance = AuthMethodMismatchError.from_dict(data)
38+
instance = ConnectApplicationOAuth.from_dict(data)
2539
serialized = instance.to_dict()
26-
assert serialized["code"] == data["code"]
27-
assert serialized["message"] == data["message"]
40+
assert serialized["object"] == data["object"]
41+
assert serialized["id"] == data["id"]
42+
assert serialized["client_id"] == data["client_id"]
43+
assert serialized["description"] == data["description"]
44+
assert serialized["name"] == data["name"]
45+
assert serialized["scopes"] == data["scopes"]
46+
assert serialized["created_at"] == data["created_at"]
47+
assert serialized["updated_at"] == data["updated_at"]
48+
assert serialized["application_type"] == data["application_type"]
49+
assert serialized["redirect_uris"] == data["redirect_uris"]
50+
assert serialized["uses_pkce"] == data["uses_pkce"]
51+
assert serialized["is_first_party"] == data["is_first_party"]
52+
53+
def test_connect_application_oauth_omits_absent_optional_non_nullable_fields(self):
54+
data = {
55+
"object": "connect_application",
56+
"id": "conn_app_01HXYZ123456789ABCDEFGHIJ",
57+
"client_id": "client_01HXYZ123456789ABCDEFGHIJ",
58+
"description": "An application for managing user access",
59+
"name": "My Application",
60+
"scopes": ["openid", "profile", "email"],
61+
"created_at": "2026-01-15T12:00:00.000Z",
62+
"updated_at": "2026-01-15T12:00:00.000Z",
63+
"application_type": "oauth",
64+
"redirect_uris": [{"uri": "https://example.com/callback", "default": True}],
65+
"uses_pkce": True,
66+
"is_first_party": True,
67+
}
68+
instance = ConnectApplicationOAuth.from_dict(data)
69+
serialized = instance.to_dict()
70+
assert "was_dynamically_registered" not in serialized
71+
assert "organization_id" not in serialized
72+
73+
def test_connect_application_oauth_preserves_nullable_fields(self):
74+
data = {
75+
"object": "connect_application",
76+
"id": "conn_app_01HXYZ123456789ABCDEFGHIJ",
77+
"client_id": "client_01HXYZ123456789ABCDEFGHIJ",
78+
"description": None,
79+
"name": "My Application",
80+
"scopes": ["openid", "profile", "email"],
81+
"created_at": "2026-01-15T12:00:00.000Z",
82+
"updated_at": "2026-01-15T12:00:00.000Z",
83+
"application_type": "oauth",
84+
"redirect_uris": [{"uri": "https://example.com/callback", "default": True}],
85+
"uses_pkce": True,
86+
"is_first_party": True,
87+
"was_dynamically_registered": True,
88+
"organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
89+
}
90+
instance = ConnectApplicationOAuth.from_dict(data)
91+
serialized = instance.to_dict()
92+
assert serialized["description"] is None
93+
94+
def test_connect_application_oauth_redirect_uris_round_trip(self):
95+
data = load_fixture("connect_application_oauth_redirect_uris.json")
96+
instance = ConnectApplicationOAuthRedirectUris.from_dict(data)
97+
serialized = instance.to_dict()
98+
assert serialized == data
99+
restored = ConnectApplicationOAuthRedirectUris.from_dict(serialized)
100+
assert restored.to_dict() == serialized
101+
102+
def test_connect_application_oauth_redirect_uris_minimal_payload(self):
103+
data = {"uri": "https://example.com/callback", "default": True}
104+
instance = ConnectApplicationOAuthRedirectUris.from_dict(data)
105+
serialized = instance.to_dict()
106+
assert serialized["uri"] == data["uri"]
107+
assert serialized["default"] == data["default"]
108+
109+
def test_connect_application_m2m_round_trip(self):
110+
data = load_fixture("connect_application_m2m.json")
111+
instance = ConnectApplicationM2M.from_dict(data)
112+
serialized = instance.to_dict()
113+
assert serialized == data
114+
restored = ConnectApplicationM2M.from_dict(serialized)
115+
assert restored.to_dict() == serialized
116+
117+
def test_connect_application_m2m_minimal_payload(self):
118+
data = {
119+
"object": "connect_application",
120+
"id": "conn_app_01HXYZ123456789ABCDEFGHIJ",
121+
"client_id": "client_01HXYZ123456789ABCDEFGHIJ",
122+
"description": None,
123+
"name": "My Application",
124+
"scopes": ["openid", "profile", "email"],
125+
"created_at": "2026-01-15T12:00:00.000Z",
126+
"updated_at": "2026-01-15T12:00:00.000Z",
127+
"application_type": "m2m",
128+
"organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
129+
}
130+
instance = ConnectApplicationM2M.from_dict(data)
131+
serialized = instance.to_dict()
132+
assert serialized["object"] == data["object"]
133+
assert serialized["id"] == data["id"]
134+
assert serialized["client_id"] == data["client_id"]
135+
assert serialized["description"] == data["description"]
136+
assert serialized["name"] == data["name"]
137+
assert serialized["scopes"] == data["scopes"]
138+
assert serialized["created_at"] == data["created_at"]
139+
assert serialized["updated_at"] == data["updated_at"]
140+
assert serialized["application_type"] == data["application_type"]
141+
assert serialized["organization_id"] == data["organization_id"]
142+
143+
def test_connect_application_m2m_preserves_nullable_fields(self):
144+
data = {
145+
"object": "connect_application",
146+
"id": "conn_app_01HXYZ123456789ABCDEFGHIJ",
147+
"client_id": "client_01HXYZ123456789ABCDEFGHIJ",
148+
"description": None,
149+
"name": "My Application",
150+
"scopes": ["openid", "profile", "email"],
151+
"created_at": "2026-01-15T12:00:00.000Z",
152+
"updated_at": "2026-01-15T12:00:00.000Z",
153+
"application_type": "m2m",
154+
"organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
155+
}
156+
instance = ConnectApplicationM2M.from_dict(data)
157+
serialized = instance.to_dict()
158+
assert serialized["description"] is None

0 commit comments

Comments
 (0)