Skip to content

Commit 67d3869

Browse files
chore(generated): regenerate shared files for UserManagement, Radar
1 parent a1486eb commit 67d3869

9 files changed

Lines changed: 527 additions & 30 deletions

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4b4e0618779460dbebc1cf5e0f02197c21796d1f
1+
23faa38318d596e581656934ed72c4a18476d742

.oagen-manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"version": 2,
33
"language": "python",
4-
"generatedAt": "2026-07-02T17:29:55.736Z",
54
"files": [
65
"src/workos/_client.py",
76
"src/workos/admin_portal/__init__.py",

src/workos/user_management/_resource.py

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ def authenticate_with_password(
176176
ip_address: Optional[str] = None,
177177
device_id: Optional[str] = None,
178178
user_agent: Optional[str] = None,
179+
signals_id: Optional[str] = None,
180+
radar_auth_attempt_id: Optional[str] = None,
179181
request_options: Optional[RequestOptions] = None,
180182
) -> AuthenticateResponse:
181183
"""Authenticate with password."""
@@ -196,6 +198,10 @@ def authenticate_with_password(
196198
body["device_id"] = device_id
197199
if user_agent is not None:
198200
body["user_agent"] = user_agent
201+
if signals_id is not None:
202+
body["signals_id"] = signals_id
203+
if radar_auth_attempt_id is not None:
204+
body["radar_auth_attempt_id"] = radar_auth_attempt_id
199205

200206
return self._client.request(
201207
method="POST",
@@ -214,6 +220,7 @@ def authenticate_with_code(
214220
ip_address: Optional[str] = None,
215221
device_id: Optional[str] = None,
216222
user_agent: Optional[str] = None,
223+
signals_id: Optional[str] = None,
217224
request_options: Optional[RequestOptions] = None,
218225
) -> AuthenticateResponse:
219226
"""Authenticate with code."""
@@ -235,6 +242,8 @@ def authenticate_with_code(
235242
body["device_id"] = device_id
236243
if user_agent is not None:
237244
body["user_agent"] = user_agent
245+
if signals_id is not None:
246+
body["signals_id"] = signals_id
238247

239248
return self._client.request(
240249
method="POST",
@@ -289,6 +298,7 @@ def authenticate_with_magic_auth(
289298
ip_address: Optional[str] = None,
290299
device_id: Optional[str] = None,
291300
user_agent: Optional[str] = None,
301+
radar_auth_attempt_id: Optional[str] = None,
292302
request_options: Optional[RequestOptions] = None,
293303
) -> AuthenticateResponse:
294304
"""Authenticate with magic auth."""
@@ -309,6 +319,8 @@ def authenticate_with_magic_auth(
309319
body["device_id"] = device_id
310320
if user_agent is not None:
311321
body["user_agent"] = user_agent
322+
if radar_auth_attempt_id is not None:
323+
body["radar_auth_attempt_id"] = radar_auth_attempt_id
312324

313325
return self._client.request(
314326
method="POST",
@@ -456,6 +468,82 @@ def authenticate_with_device_code(
456468
request_options=request_options,
457469
)
458470

471+
def authenticate_with_radar_email_challenge(
472+
self,
473+
*,
474+
code: str,
475+
radar_challenge_id: str,
476+
pending_authentication_token: str,
477+
ip_address: Optional[str] = None,
478+
device_id: Optional[str] = None,
479+
user_agent: Optional[str] = None,
480+
request_options: Optional[RequestOptions] = None,
481+
) -> AuthenticateResponse:
482+
"""Authenticate with radar email challenge."""
483+
body: Dict[str, Any] = {
484+
"grant_type": "urn:workos:oauth:grant-type:radar-email-challenge:code",
485+
"code": code,
486+
"radar_challenge_id": radar_challenge_id,
487+
"pending_authentication_token": pending_authentication_token,
488+
}
489+
if self._client.client_id is not None:
490+
body["client_id"] = self._client.client_id
491+
if self._client._api_key is not None:
492+
body["client_secret"] = self._client._api_key
493+
if ip_address is not None:
494+
body["ip_address"] = ip_address
495+
if device_id is not None:
496+
body["device_id"] = device_id
497+
if user_agent is not None:
498+
body["user_agent"] = user_agent
499+
500+
return self._client.request(
501+
method="POST",
502+
path=("user_management", "authenticate"),
503+
body=body,
504+
model=AuthenticateResponse,
505+
request_options=request_options,
506+
)
507+
508+
def authenticate_with_radar_sms_challenge(
509+
self,
510+
*,
511+
code: str,
512+
verification_id: str,
513+
phone_number: str,
514+
pending_authentication_token: str,
515+
ip_address: Optional[str] = None,
516+
device_id: Optional[str] = None,
517+
user_agent: Optional[str] = None,
518+
request_options: Optional[RequestOptions] = None,
519+
) -> AuthenticateResponse:
520+
"""Authenticate with radar sms challenge."""
521+
body: Dict[str, Any] = {
522+
"grant_type": "urn:workos:oauth:grant-type:radar-sms-challenge:code",
523+
"code": code,
524+
"verification_id": verification_id,
525+
"phone_number": phone_number,
526+
"pending_authentication_token": pending_authentication_token,
527+
}
528+
if self._client.client_id is not None:
529+
body["client_id"] = self._client.client_id
530+
if self._client._api_key is not None:
531+
body["client_secret"] = self._client._api_key
532+
if ip_address is not None:
533+
body["ip_address"] = ip_address
534+
if device_id is not None:
535+
body["device_id"] = device_id
536+
if user_agent is not None:
537+
body["user_agent"] = user_agent
538+
539+
return self._client.request(
540+
method="POST",
541+
path=("user_management", "authenticate"),
542+
body=body,
543+
model=AuthenticateResponse,
544+
request_options=request_options,
545+
)
546+
459547
def get_authorization_url(
460548
self,
461549
*,
@@ -2379,6 +2467,8 @@ async def authenticate_with_password(
23792467
ip_address: Optional[str] = None,
23802468
device_id: Optional[str] = None,
23812469
user_agent: Optional[str] = None,
2470+
signals_id: Optional[str] = None,
2471+
radar_auth_attempt_id: Optional[str] = None,
23822472
request_options: Optional[RequestOptions] = None,
23832473
) -> AuthenticateResponse:
23842474
"""Authenticate with password."""
@@ -2399,6 +2489,10 @@ async def authenticate_with_password(
23992489
body["device_id"] = device_id
24002490
if user_agent is not None:
24012491
body["user_agent"] = user_agent
2492+
if signals_id is not None:
2493+
body["signals_id"] = signals_id
2494+
if radar_auth_attempt_id is not None:
2495+
body["radar_auth_attempt_id"] = radar_auth_attempt_id
24022496

24032497
return await self._client.request(
24042498
method="POST",
@@ -2417,6 +2511,7 @@ async def authenticate_with_code(
24172511
ip_address: Optional[str] = None,
24182512
device_id: Optional[str] = None,
24192513
user_agent: Optional[str] = None,
2514+
signals_id: Optional[str] = None,
24202515
request_options: Optional[RequestOptions] = None,
24212516
) -> AuthenticateResponse:
24222517
"""Authenticate with code."""
@@ -2438,6 +2533,8 @@ async def authenticate_with_code(
24382533
body["device_id"] = device_id
24392534
if user_agent is not None:
24402535
body["user_agent"] = user_agent
2536+
if signals_id is not None:
2537+
body["signals_id"] = signals_id
24412538

24422539
return await self._client.request(
24432540
method="POST",
@@ -2492,6 +2589,7 @@ async def authenticate_with_magic_auth(
24922589
ip_address: Optional[str] = None,
24932590
device_id: Optional[str] = None,
24942591
user_agent: Optional[str] = None,
2592+
radar_auth_attempt_id: Optional[str] = None,
24952593
request_options: Optional[RequestOptions] = None,
24962594
) -> AuthenticateResponse:
24972595
"""Authenticate with magic auth."""
@@ -2512,6 +2610,8 @@ async def authenticate_with_magic_auth(
25122610
body["device_id"] = device_id
25132611
if user_agent is not None:
25142612
body["user_agent"] = user_agent
2613+
if radar_auth_attempt_id is not None:
2614+
body["radar_auth_attempt_id"] = radar_auth_attempt_id
25152615

25162616
return await self._client.request(
25172617
method="POST",
@@ -2659,6 +2759,82 @@ async def authenticate_with_device_code(
26592759
request_options=request_options,
26602760
)
26612761

2762+
async def authenticate_with_radar_email_challenge(
2763+
self,
2764+
*,
2765+
code: str,
2766+
radar_challenge_id: str,
2767+
pending_authentication_token: str,
2768+
ip_address: Optional[str] = None,
2769+
device_id: Optional[str] = None,
2770+
user_agent: Optional[str] = None,
2771+
request_options: Optional[RequestOptions] = None,
2772+
) -> AuthenticateResponse:
2773+
"""Authenticate with radar email challenge."""
2774+
body: Dict[str, Any] = {
2775+
"grant_type": "urn:workos:oauth:grant-type:radar-email-challenge:code",
2776+
"code": code,
2777+
"radar_challenge_id": radar_challenge_id,
2778+
"pending_authentication_token": pending_authentication_token,
2779+
}
2780+
if self._client.client_id is not None:
2781+
body["client_id"] = self._client.client_id
2782+
if self._client._api_key is not None:
2783+
body["client_secret"] = self._client._api_key
2784+
if ip_address is not None:
2785+
body["ip_address"] = ip_address
2786+
if device_id is not None:
2787+
body["device_id"] = device_id
2788+
if user_agent is not None:
2789+
body["user_agent"] = user_agent
2790+
2791+
return await self._client.request(
2792+
method="POST",
2793+
path=("user_management", "authenticate"),
2794+
body=body,
2795+
model=AuthenticateResponse,
2796+
request_options=request_options,
2797+
)
2798+
2799+
async def authenticate_with_radar_sms_challenge(
2800+
self,
2801+
*,
2802+
code: str,
2803+
verification_id: str,
2804+
phone_number: str,
2805+
pending_authentication_token: str,
2806+
ip_address: Optional[str] = None,
2807+
device_id: Optional[str] = None,
2808+
user_agent: Optional[str] = None,
2809+
request_options: Optional[RequestOptions] = None,
2810+
) -> AuthenticateResponse:
2811+
"""Authenticate with radar sms challenge."""
2812+
body: Dict[str, Any] = {
2813+
"grant_type": "urn:workos:oauth:grant-type:radar-sms-challenge:code",
2814+
"code": code,
2815+
"verification_id": verification_id,
2816+
"phone_number": phone_number,
2817+
"pending_authentication_token": pending_authentication_token,
2818+
}
2819+
if self._client.client_id is not None:
2820+
body["client_id"] = self._client.client_id
2821+
if self._client._api_key is not None:
2822+
body["client_secret"] = self._client._api_key
2823+
if ip_address is not None:
2824+
body["ip_address"] = ip_address
2825+
if device_id is not None:
2826+
body["device_id"] = device_id
2827+
if user_agent is not None:
2828+
body["user_agent"] = user_agent
2829+
2830+
return await self._client.request(
2831+
method="POST",
2832+
path=("user_management", "authenticate"),
2833+
body=body,
2834+
model=AuthenticateResponse,
2835+
request_options=request_options,
2836+
)
2837+
26622838
def get_authorization_url(
26632839
self,
26642840
*,

src/workos/user_management/models/magic_auth_send_magic_auth_code_and_return_response.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,32 @@
33
from __future__ import annotations
44

55
from dataclasses import dataclass
6-
from typing import Any, Dict, Optional
6+
from datetime import datetime
7+
from typing import Any, Dict, Literal, Optional
78
from workos._types import _raise_deserialize_error
9+
from workos._types import _format_datetime, _parse_datetime
810

911

1012
@dataclass(slots=True)
1113
class MagicAuthSendMagicAuthCodeAndReturnResponse:
1214
"""Magic Auth Send Magic Auth Code And Return Response model."""
1315

16+
object: Literal["magic_auth"]
17+
"""Distinguishes the Magic Auth object."""
18+
id: str
19+
"""The unique ID of the Magic Auth code."""
20+
user_id: str
21+
"""The unique ID of the user."""
22+
email: str
23+
"""The email address of the user."""
24+
expires_at: datetime
25+
"""The timestamp when the Magic Auth code expires."""
26+
created_at: datetime
27+
"""An ISO 8601 timestamp."""
28+
updated_at: datetime
29+
"""An ISO 8601 timestamp."""
30+
code: str
31+
"""The code used to verify the Magic Auth code."""
1432
radar_auth_attempt_id: Optional[str] = None
1533
"""The ID of the Radar authentication attempt created for this request when Radar is enabled. Pass this value to the authenticate endpoint to associate the subsequent authentication with this Radar attempt."""
1634

@@ -21,6 +39,14 @@ def from_dict(
2139
"""Deserialize from a dictionary."""
2240
try:
2341
return cls(
42+
object=data.get("object", "magic_auth"),
43+
id=data["id"],
44+
user_id=data["user_id"],
45+
email=data["email"],
46+
expires_at=_parse_datetime(data["expires_at"]),
47+
created_at=_parse_datetime(data["created_at"]),
48+
updated_at=_parse_datetime(data["updated_at"]),
49+
code=data["code"],
2450
radar_auth_attempt_id=data.get("radar_auth_attempt_id"),
2551
)
2652
except (KeyError, ValueError) as e:
@@ -29,6 +55,14 @@ def from_dict(
2955
def to_dict(self) -> Dict[str, Any]:
3056
"""Serialize to a dictionary."""
3157
result: Dict[str, Any] = {}
58+
result["object"] = self.object
59+
result["id"] = self.id
60+
result["user_id"] = self.user_id
61+
result["email"] = self.email
62+
result["expires_at"] = _format_datetime(self.expires_at)
63+
result["created_at"] = _format_datetime(self.created_at)
64+
result["updated_at"] = _format_datetime(self.updated_at)
65+
result["code"] = self.code
3266
if self.radar_auth_attempt_id is not None:
3367
result["radar_auth_attempt_id"] = self.radar_auth_attempt_id
3468
return result

0 commit comments

Comments
 (0)