diff --git a/.changelog-pending/2026-10-15T16-01-05-f828c87a2b14abbb0f0127a6cb0b3a52f3dfc76f.md b/.changelog-pending/2026-10-15T16-01-05-f828c87a2b14abbb0f0127a6cb0b3a52f3dfc76f.md new file mode 100644 index 00000000..8e031365 --- /dev/null +++ b/.changelog-pending/2026-10-15T16-01-05-f828c87a2b14abbb0f0127a6cb0b3a52f3dfc76f.md @@ -0,0 +1,10 @@ +* [#749](https://github.com/workos/workos-python/pull/749) feat(generated)!: regenerate from spec (3 changes) + + **Features** + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `POST /user_management/users` + * Changed errors for endpoint `POST /user_management/magic_auth` + + **Fixes** + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `POST /user_management/authenticate` diff --git a/.last-synced-sha b/.last-synced-sha index 90399c99..54a4cc9f 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -81a34a1dfa516c1987aff4038af330436b53e151 +d430b394483f6e00ff7f9e2ca8d4340ff8f7aa54 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index 80065d9d..787ef6ee 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -2297,7 +2297,7 @@ "service": "admin_portal" }, "POST /portal/revoke_link": { - "sdkMethod": "create_revoke_link", + "sdkMethod": "revoke_link", "service": "admin_portal" }, "POST /radar/attempts": { diff --git a/src/workos/admin_portal/_resource.py b/src/workos/admin_portal/_resource.py index cb85a3ce..6c4558f4 100644 --- a/src/workos/admin_portal/_resource.py +++ b/src/workos/admin_portal/_resource.py @@ -82,7 +82,7 @@ def generate_link( request_options=request_options, ) - def create_revoke_link( + def revoke_link( self, *, organization: str, @@ -186,7 +186,7 @@ async def generate_link( request_options=request_options, ) - async def create_revoke_link( + async def revoke_link( self, *, organization: str, diff --git a/src/workos/user_management/_resource.py b/src/workos/user_management/_resource.py index 7293a2e9..7d99b9dd 100644 --- a/src/workos/user_management/_resource.py +++ b/src/workos/user_management/_resource.py @@ -1242,6 +1242,7 @@ def create_user( Raises: BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). UnprocessableEntityError: If the request data is unprocessable (422). AuthenticationError: If the API key is invalid (401). @@ -2040,6 +2041,7 @@ def create_magic_auth( Raises: BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). AuthenticationError: If the API key is invalid (401). @@ -3994,6 +3996,7 @@ async def create_user( Raises: BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). UnprocessableEntityError: If the request data is unprocessable (422). AuthenticationError: If the API key is invalid (401). @@ -4792,6 +4795,7 @@ async def create_magic_auth( Raises: BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). AuthenticationError: If the API key is invalid (401). diff --git a/tests/test_admin_portal.py b/tests/test_admin_portal.py index f75c374c..f61bea46 100644 --- a/tests/test_admin_portal.py +++ b/tests/test_admin_portal.py @@ -34,9 +34,9 @@ def test_generate_link(self, workos, httpx_mock): body = json.loads(request.content) assert body["organization"] == "test_organization" - def test_create_revoke_link(self, workos, httpx_mock): + def test_revoke_link(self, workos, httpx_mock): httpx_mock.add_response(json={}) - workos.admin_portal.create_revoke_link( + workos.admin_portal.revoke_link( organization="test_organization", external_user_id="test_external_user_id" ) request = httpx_mock.get_request() @@ -137,9 +137,9 @@ async def test_generate_link(self, async_workos, httpx_mock): assert request.url.path.endswith("/portal/generate_link") @pytest.mark.asyncio - async def test_create_revoke_link(self, async_workos, httpx_mock): + async def test_revoke_link(self, async_workos, httpx_mock): httpx_mock.add_response(json={}) - await async_workos.admin_portal.create_revoke_link( + await async_workos.admin_portal.revoke_link( organization="test_organization", external_user_id="test_external_user_id" ) request = httpx_mock.get_request()