From ace46ea2f1c768cec8420186e9b1acb5453aa3cc Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:11 +0000 Subject: [PATCH 1/6] feat(directory_sync)!: Change directory sync API surface --- src/workos/directory_sync/_resource.py | 16 +++---- tests/test_directory_sync.py | 64 +++++++++++++------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/workos/directory_sync/_resource.py b/src/workos/directory_sync/_resource.py index b1e06517..9c17ed9a 100644 --- a/src/workos/directory_sync/_resource.py +++ b/src/workos/directory_sync/_resource.py @@ -171,7 +171,7 @@ def create_directory_sync( request_options=request_options, ) - def list_directory_groups( + def list_groups_for_directory( self, directory_id: str, *, @@ -225,7 +225,7 @@ def list_directory_groups( request_options=request_options, ) - def get_directory_group( + def get_group_for_directory( self, directory_id: str, group_id: str, @@ -258,7 +258,7 @@ def get_directory_group( request_options=request_options, ) - def list_directory_users( + def list_users_for_directory( self, directory_id: str, *, @@ -318,7 +318,7 @@ def list_directory_users( request_options=request_options, ) - def get_directory_user( + def get_user_for_directory( self, directory_id: str, user_id: str, @@ -699,7 +699,7 @@ async def create_directory_sync( request_options=request_options, ) - async def list_directory_groups( + async def list_groups_for_directory( self, directory_id: str, *, @@ -753,7 +753,7 @@ async def list_directory_groups( request_options=request_options, ) - async def get_directory_group( + async def get_group_for_directory( self, directory_id: str, group_id: str, @@ -786,7 +786,7 @@ async def get_directory_group( request_options=request_options, ) - async def list_directory_users( + async def list_users_for_directory( self, directory_id: str, *, @@ -846,7 +846,7 @@ async def list_directory_users( request_options=request_options, ) - async def get_directory_user( + async def get_user_for_directory( self, directory_id: str, user_id: str, diff --git a/tests/test_directory_sync.py b/tests/test_directory_sync.py index 5d7e42d6..a9fec64a 100644 --- a/tests/test_directory_sync.py +++ b/tests/test_directory_sync.py @@ -89,24 +89,24 @@ def test_create_directory_sync(self, workos, httpx_mock): assert request.method == "POST" assert request.url.path.endswith("/directories/test_id/sync") - def test_list_directory_groups(self, workos, httpx_mock): + def test_list_groups_for_directory(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("list_directory_group.json"), ) - page = workos.directory_sync.list_directory_groups("test_directoryId") + page = workos.directory_sync.list_groups_for_directory("test_directoryId") assert isinstance(page, SyncPage) assert len(page.data) == 1 assert isinstance(page.data[0], DirectoryGroup) - def test_list_directory_groups_empty_page(self, workos, httpx_mock): + def test_list_groups_for_directory_empty_page(self, workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - page = workos.directory_sync.list_directory_groups("test_directoryId") + page = workos.directory_sync.list_groups_for_directory("test_directoryId") assert isinstance(page, SyncPage) assert page.data == [] - def test_list_directory_groups_encodes_query_params(self, workos, httpx_mock): + def test_list_groups_for_directory_encodes_query_params(self, workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - workos.directory_sync.list_directory_groups( + workos.directory_sync.list_groups_for_directory( "test_directoryId", limit=10, before="cursor before", @@ -121,11 +121,11 @@ def test_list_directory_groups_encodes_query_params(self, workos, httpx_mock): assert request.url.params["order"] == "value_order" assert request.url.params["user"] == "value user/test" - def test_get_directory_group(self, workos, httpx_mock): + def test_get_group_for_directory(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("directory_group.json"), ) - result = workos.directory_sync.get_directory_group( + result = workos.directory_sync.get_group_for_directory( "test_directoryId", "test_groupId" ) assert isinstance(result, DirectoryGroup) @@ -137,24 +137,24 @@ def test_get_directory_group(self, workos, httpx_mock): "/directories/test_directoryId/groups/test_groupId" ) - def test_list_directory_users(self, workos, httpx_mock): + def test_list_users_for_directory(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("list_directory_user.json"), ) - page = workos.directory_sync.list_directory_users("test_directoryId") + page = workos.directory_sync.list_users_for_directory("test_directoryId") assert isinstance(page, SyncPage) assert len(page.data) == 1 assert isinstance(page.data[0], DirectoryUser) - def test_list_directory_users_empty_page(self, workos, httpx_mock): + def test_list_users_for_directory_empty_page(self, workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - page = workos.directory_sync.list_directory_users("test_directoryId") + page = workos.directory_sync.list_users_for_directory("test_directoryId") assert isinstance(page, SyncPage) assert page.data == [] - def test_list_directory_users_encodes_query_params(self, workos, httpx_mock): + def test_list_users_for_directory_encodes_query_params(self, workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - workos.directory_sync.list_directory_users( + workos.directory_sync.list_users_for_directory( "test_directoryId", limit=10, before="cursor before", @@ -173,11 +173,11 @@ def test_list_directory_users_encodes_query_params(self, workos, httpx_mock): assert request.url.params["idp_id"] == "value idp_id/test" assert request.url.params["email"] == "value email/test" - def test_get_directory_user(self, workos, httpx_mock): + def test_get_user_for_directory(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("directory_user.json"), ) - result = workos.directory_sync.get_directory_user( + result = workos.directory_sync.get_user_for_directory( "test_directoryId", "test_userId" ) assert isinstance(result, DirectoryUser) @@ -429,9 +429,9 @@ async def test_create_directory_sync(self, async_workos, httpx_mock): assert request.url.path.endswith("/directories/test_id/sync") @pytest.mark.asyncio - async def test_list_directory_groups(self, async_workos, httpx_mock): + async def test_list_groups_for_directory(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("list_directory_group.json")) - page = await async_workos.directory_sync.list_directory_groups( + page = await async_workos.directory_sync.list_groups_for_directory( "test_directoryId" ) assert isinstance(page, AsyncPage) @@ -439,20 +439,20 @@ async def test_list_directory_groups(self, async_workos, httpx_mock): assert isinstance(page.data[0], DirectoryGroup) @pytest.mark.asyncio - async def test_list_directory_groups_empty_page(self, async_workos, httpx_mock): + async def test_list_groups_for_directory_empty_page(self, async_workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - page = await async_workos.directory_sync.list_directory_groups( + page = await async_workos.directory_sync.list_groups_for_directory( "test_directoryId" ) assert isinstance(page, AsyncPage) assert page.data == [] @pytest.mark.asyncio - async def test_list_directory_groups_encodes_query_params( + async def test_list_groups_for_directory_encodes_query_params( self, async_workos, httpx_mock ): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - await async_workos.directory_sync.list_directory_groups( + await async_workos.directory_sync.list_groups_for_directory( "test_directoryId", limit=10, before="cursor before", @@ -468,9 +468,9 @@ async def test_list_directory_groups_encodes_query_params( assert request.url.params["user"] == "value user/test" @pytest.mark.asyncio - async def test_get_directory_group(self, async_workos, httpx_mock): + async def test_get_group_for_directory(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("directory_group.json")) - result = await async_workos.directory_sync.get_directory_group( + result = await async_workos.directory_sync.get_group_for_directory( "test_directoryId", "test_groupId" ) assert isinstance(result, DirectoryGroup) @@ -483,9 +483,9 @@ async def test_get_directory_group(self, async_workos, httpx_mock): ) @pytest.mark.asyncio - async def test_list_directory_users(self, async_workos, httpx_mock): + async def test_list_users_for_directory(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("list_directory_user.json")) - page = await async_workos.directory_sync.list_directory_users( + page = await async_workos.directory_sync.list_users_for_directory( "test_directoryId" ) assert isinstance(page, AsyncPage) @@ -493,20 +493,20 @@ async def test_list_directory_users(self, async_workos, httpx_mock): assert isinstance(page.data[0], DirectoryUser) @pytest.mark.asyncio - async def test_list_directory_users_empty_page(self, async_workos, httpx_mock): + async def test_list_users_for_directory_empty_page(self, async_workos, httpx_mock): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - page = await async_workos.directory_sync.list_directory_users( + page = await async_workos.directory_sync.list_users_for_directory( "test_directoryId" ) assert isinstance(page, AsyncPage) assert page.data == [] @pytest.mark.asyncio - async def test_list_directory_users_encodes_query_params( + async def test_list_users_for_directory_encodes_query_params( self, async_workos, httpx_mock ): httpx_mock.add_response(json={"data": [], "list_metadata": {}}) - await async_workos.directory_sync.list_directory_users( + await async_workos.directory_sync.list_users_for_directory( "test_directoryId", limit=10, before="cursor before", @@ -526,9 +526,9 @@ async def test_list_directory_users_encodes_query_params( assert request.url.params["email"] == "value email/test" @pytest.mark.asyncio - async def test_get_directory_user(self, async_workos, httpx_mock): + async def test_get_user_for_directory(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("directory_user.json")) - result = await async_workos.directory_sync.get_directory_user( + result = await async_workos.directory_sync.get_user_for_directory( "test_directoryId", "test_userId" ) assert isinstance(result, DirectoryUser) From c055c648597cb3cb5fcf74bdb36c11e9da98884c Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:11 +0000 Subject: [PATCH 2/6] feat(sso): Add SSO API surface --- .../connection_saml_certificate_replaced.py | 61 +++++++++++++++++++ ...nnection_saml_certificate_replaced_data.py | 52 ++++++++++++++++ ...l_certificate_replaced_data_certificate.py | 60 ++++++++++++++++++ ...laced_data_certificate_certificate_type.py | 18 ++++++ ...ml_certificate_replaced_data_connection.py | 11 ++++ .../connection_saml_certificate_replaced.json | 38 ++++++++++++ ...ection_saml_certificate_replaced_data.json | 12 ++++ ...certificate_replaced_data_certificate.json | 5 ++ ..._certificate_replaced_data_connection.json | 4 ++ 9 files changed, 261 insertions(+) create mode 100644 src/workos/common/models/connection_saml_certificate_replaced.py create mode 100644 src/workos/common/models/connection_saml_certificate_replaced_data.py create mode 100644 src/workos/common/models/connection_saml_certificate_replaced_data_certificate.py create mode 100644 src/workos/common/models/connection_saml_certificate_replaced_data_certificate_certificate_type.py create mode 100644 src/workos/common/models/connection_saml_certificate_replaced_data_connection.py create mode 100644 tests/fixtures/connection_saml_certificate_replaced.json create mode 100644 tests/fixtures/connection_saml_certificate_replaced_data.json create mode 100644 tests/fixtures/connection_saml_certificate_replaced_data_certificate.json create mode 100644 tests/fixtures/connection_saml_certificate_replaced_data_connection.json diff --git a/src/workos/common/models/connection_saml_certificate_replaced.py b/src/workos/common/models/connection_saml_certificate_replaced.py new file mode 100644 index 00000000..db35542a --- /dev/null +++ b/src/workos/common/models/connection_saml_certificate_replaced.py @@ -0,0 +1,61 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .connection_saml_certificate_replaced_data import ( + ConnectionSAMLCertificateReplacedData, +) +from .event_context import EventContext + + +@dataclass(slots=True) +class ConnectionSAMLCertificateReplaced: + """Connection SAML Certificate Replaced model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["connection.saml_certificate_replaced"] + data: ConnectionSAMLCertificateReplacedData + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ConnectionSAMLCertificateReplaced: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "connection.saml_certificate_replaced"), + data=ConnectionSAMLCertificateReplacedData.from_dict( + cast(dict[str, Any], data["data"]) + ), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ConnectionSAMLCertificateReplaced", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/connection_saml_certificate_replaced_data.py b/src/workos/common/models/connection_saml_certificate_replaced_data.py new file mode 100644 index 00000000..a14b9d24 --- /dev/null +++ b/src/workos/common/models/connection_saml_certificate_replaced_data.py @@ -0,0 +1,52 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .connection_saml_certificate_replaced_data_certificate import ( + ConnectionSAMLCertificateReplacedDataCertificate, +) +from .connection_saml_certificate_replaced_data_connection import ( + ConnectionSAMLCertificateReplacedDataConnection, +) + + +@dataclass(slots=True) +class ConnectionSAMLCertificateReplacedData: + """The event payload.""" + + connection: ConnectionSAMLCertificateReplacedDataConnection + """The connection with the replaced certificate.""" + certificate: ConnectionSAMLCertificateReplacedDataCertificate + """The new SAML certificate details.""" + replaced_at: datetime + """An ISO 8601 timestamp.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ConnectionSAMLCertificateReplacedData: + """Deserialize from a dictionary.""" + try: + return cls( + connection=ConnectionSAMLCertificateReplacedDataConnection.from_dict( + cast(dict[str, Any], data["connection"]) + ), + certificate=ConnectionSAMLCertificateReplacedDataCertificate.from_dict( + cast(dict[str, Any], data["certificate"]) + ), + replaced_at=_parse_datetime(data["replaced_at"]), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ConnectionSAMLCertificateReplacedData", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["connection"] = self.connection.to_dict() + result["certificate"] = self.certificate.to_dict() + result["replaced_at"] = _format_datetime(self.replaced_at) + return result diff --git a/src/workos/common/models/connection_saml_certificate_replaced_data_certificate.py b/src/workos/common/models/connection_saml_certificate_replaced_data_certificate.py new file mode 100644 index 00000000..464eefff --- /dev/null +++ b/src/workos/common/models/connection_saml_certificate_replaced_data_certificate.py @@ -0,0 +1,60 @@ +# 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 Any + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .connection_saml_certificate_replaced_data_certificate_certificate_type import ( + ConnectionSAMLCertificateReplacedDataCertificateCertificateType, +) + + +@dataclass(slots=True) +class ConnectionSAMLCertificateReplacedDataCertificate: + """The new SAML certificate details.""" + + certificate_type: ConnectionSAMLCertificateReplacedDataCertificateCertificateType + """The type of the SAML certificate.""" + expiry_date: datetime + """An ISO 8601 timestamp.""" + previous_expiry_date: datetime | None = None + """The expiry date of the certificate that was replaced. Absent when the connection had no certificate of this type.""" + + @classmethod + def from_dict( + cls, data: dict[str, Any] + ) -> ConnectionSAMLCertificateReplacedDataCertificate: + """Deserialize from a dictionary.""" + try: + return cls( + certificate_type=ConnectionSAMLCertificateReplacedDataCertificateCertificateType( + data["certificate_type"] + ), + expiry_date=_parse_datetime(data["expiry_date"]), + previous_expiry_date=_parse_datetime(_v_previous_expiry_date) + if (_v_previous_expiry_date := data.get("previous_expiry_date")) + is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error( + "ConnectionSAMLCertificateReplacedDataCertificate", e + ) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["certificate_type"] = ( + self.certificate_type.value + if isinstance(self.certificate_type, Enum) + else self.certificate_type + ) + result["expiry_date"] = _format_datetime(self.expiry_date) + if self.previous_expiry_date is not None: + result["previous_expiry_date"] = _format_datetime(self.previous_expiry_date) + return result diff --git a/src/workos/common/models/connection_saml_certificate_replaced_data_certificate_certificate_type.py b/src/workos/common/models/connection_saml_certificate_replaced_data_certificate_certificate_type.py new file mode 100644 index 00000000..e8f2cc65 --- /dev/null +++ b/src/workos/common/models/connection_saml_certificate_replaced_data_certificate_certificate_type.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .connection_saml_certificate_renewal_required_data_certificate_certificate_type import ( + ConnectionSAMLCertificateRenewalRequiredDataCertificateCertificateType, +) + +ConnectionSAMLCertificateReplacedDataCertificateCertificateType: TypeAlias = ( + ConnectionSAMLCertificateRenewalRequiredDataCertificateCertificateType +) +ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral: TypeAlias = ( + Literal["ResponseSigning", "RequestSigning", "ResponseEncryption"] +) +__all__ = [ + "ConnectionSAMLCertificateReplacedDataCertificateCertificateType", + "ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral", +] diff --git a/src/workos/common/models/connection_saml_certificate_replaced_data_connection.py b/src/workos/common/models/connection_saml_certificate_replaced_data_connection.py new file mode 100644 index 00000000..45a0df2c --- /dev/null +++ b/src/workos/common/models/connection_saml_certificate_replaced_data_connection.py @@ -0,0 +1,11 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from .connection_saml_certificate_renewal_required_data_connection import ( + ConnectionSAMLCertificateRenewalRequiredDataConnection, +) + +ConnectionSAMLCertificateReplacedDataConnection: TypeAlias = ( + ConnectionSAMLCertificateRenewalRequiredDataConnection +) diff --git a/tests/fixtures/connection_saml_certificate_replaced.json b/tests/fixtures/connection_saml_certificate_replaced.json new file mode 100644 index 00000000..dd4a3b26 --- /dev/null +++ b/tests/fixtures/connection_saml_certificate_replaced.json @@ -0,0 +1,38 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "connection.saml_certificate_replaced", + "data": { + "connection": { + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + }, + "certificate": { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z" + }, + "replaced_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/connection_saml_certificate_replaced_data.json b/tests/fixtures/connection_saml_certificate_replaced_data.json new file mode 100644 index 00000000..25fff4a9 --- /dev/null +++ b/tests/fixtures/connection_saml_certificate_replaced_data.json @@ -0,0 +1,12 @@ +{ + "connection": { + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + }, + "certificate": { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z" + }, + "replaced_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/connection_saml_certificate_replaced_data_certificate.json b/tests/fixtures/connection_saml_certificate_replaced_data_certificate.json new file mode 100644 index 00000000..1afeb43a --- /dev/null +++ b/tests/fixtures/connection_saml_certificate_replaced_data_certificate.json @@ -0,0 +1,5 @@ +{ + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/connection_saml_certificate_replaced_data_connection.json b/tests/fixtures/connection_saml_certificate_replaced_data_connection.json new file mode 100644 index 00000000..2fe9b1af --- /dev/null +++ b/tests/fixtures/connection_saml_certificate_replaced_data_connection.json @@ -0,0 +1,4 @@ +{ + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" +} From 219c6405d891f7930b8df77e6560c9344c7fffa6 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:11 +0000 Subject: [PATCH 3/6] feat(webhooks): Add webhook API surface --- .../models/create_webhook_endpoint_events.py | 12 ++++ .../models/update_webhook_endpoint_events.py | 6 ++ src/workos/webhooks/_resource.py | 60 +++++++++++++++++++ tests/test_webhooks.py | 23 +++++++ 4 files changed, 101 insertions(+) diff --git a/src/workos/common/models/create_webhook_endpoint_events.py b/src/workos/common/models/create_webhook_endpoint_events.py index aba8ed74..339ba921 100644 --- a/src/workos/common/models/create_webhook_endpoint_events.py +++ b/src/workos/common/models/create_webhook_endpoint_events.py @@ -55,12 +55,15 @@ class CreateWebhookEndpointEvents(str, Enum): API_KEY_CREATED = "api_key.created" API_KEY_REVOKED = "api_key.revoked" API_KEY_UPDATED = "api_key.updated" + APPLICATION_TOKEN_EXCHANGE_FAILED = "application.token_exchange_failed" + APPLICATION_TOKEN_EXCHANGE_SUCCEEDED = "application.token_exchange_succeeded" CONNECTION_ACTIVATED = "connection.activated" CONNECTION_DEACTIVATED = "connection.deactivated" CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED = ( "connection.saml_certificate_renewal_required" ) CONNECTION_SAML_CERTIFICATE_RENEWED = "connection.saml_certificate_renewed" + CONNECTION_SAML_CERTIFICATE_REPLACED = "connection.saml_certificate_replaced" CONNECTION_DELETED = "connection.deleted" DSYNC_ACTIVATED = "dsync.activated" DSYNC_DELETED = "dsync.deleted" @@ -94,6 +97,9 @@ class CreateWebhookEndpointEvents(str, Enum): INVITATION_CREATED = "invitation.created" INVITATION_RESENT = "invitation.resent" INVITATION_REVOKED = "invitation.revoked" + ISSUER_TRUST_CREATED = "issuer_trust.created" + ISSUER_TRUST_DELETED = "issuer_trust.deleted" + ISSUER_TRUST_UPDATED = "issuer_trust.updated" MAGIC_AUTH_CREATED = "magic_auth.created" ORGANIZATION_CREATED = "organization.created" ORGANIZATION_DELETED = "organization.deleted" @@ -190,10 +196,13 @@ def _missing_(cls, value: object) -> CreateWebhookEndpointEvents | None: "api_key.created", "api_key.revoked", "api_key.updated", + "application.token_exchange_failed", + "application.token_exchange_succeeded", "connection.activated", "connection.deactivated", "connection.saml_certificate_renewal_required", "connection.saml_certificate_renewed", + "connection.saml_certificate_replaced", "connection.deleted", "dsync.activated", "dsync.deleted", @@ -227,6 +236,9 @@ def _missing_(cls, value: object) -> CreateWebhookEndpointEvents | None: "invitation.created", "invitation.resent", "invitation.revoked", + "issuer_trust.created", + "issuer_trust.deleted", + "issuer_trust.updated", "magic_auth.created", "organization.created", "organization.deleted", diff --git a/src/workos/common/models/update_webhook_endpoint_events.py b/src/workos/common/models/update_webhook_endpoint_events.py index 4fc8c689..30c795ad 100644 --- a/src/workos/common/models/update_webhook_endpoint_events.py +++ b/src/workos/common/models/update_webhook_endpoint_events.py @@ -42,10 +42,13 @@ "api_key.created", "api_key.revoked", "api_key.updated", + "application.token_exchange_failed", + "application.token_exchange_succeeded", "connection.activated", "connection.deactivated", "connection.saml_certificate_renewal_required", "connection.saml_certificate_renewed", + "connection.saml_certificate_replaced", "connection.deleted", "dsync.activated", "dsync.deleted", @@ -79,6 +82,9 @@ "invitation.created", "invitation.resent", "invitation.revoked", + "issuer_trust.created", + "issuer_trust.deleted", + "issuer_trust.updated", "magic_auth.created", "organization.created", "organization.deleted", diff --git a/src/workos/webhooks/_resource.py b/src/workos/webhooks/_resource.py index 94d81397..e8c9a3c0 100644 --- a/src/workos/webhooks/_resource.py +++ b/src/workos/webhooks/_resource.py @@ -123,6 +123,36 @@ def create_webhook_endpoint( request_options=request_options, ) + def get_webhook_endpoint( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> WebhookEndpoint: + """Get a Webhook Endpoint + + Get the details of an existing webhook endpoint. + + Args: + id: Unique identifier of the Webhook Endpoint. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + WebhookEndpoint + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return self._client.request( + method="get", + path=("webhook_endpoints", str(id)), + model=WebhookEndpoint, + request_options=request_options, + ) + def update_webhook_endpoint( self, id: str, @@ -380,6 +410,36 @@ async def create_webhook_endpoint( request_options=request_options, ) + async def get_webhook_endpoint( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> WebhookEndpoint: + """Get a Webhook Endpoint + + Get the details of an existing webhook endpoint. + + Args: + id: Unique identifier of the Webhook Endpoint. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + WebhookEndpoint + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return await self._client.request( + method="get", + path=("webhook_endpoints", str(id)), + model=WebhookEndpoint, + request_options=request_options, + ) + async def update_webhook_endpoint( self, id: str, diff --git a/tests/test_webhooks.py b/tests/test_webhooks.py index f8e23a9e..4af89b38 100644 --- a/tests/test_webhooks.py +++ b/tests/test_webhooks.py @@ -66,6 +66,18 @@ def test_create_webhook_endpoint(self, workos, httpx_mock): assert body["endpoint_url"] == "test_endpoint_url" assert "events" in body + def test_get_webhook_endpoint(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("webhook_endpoint.json"), + ) + result = workos.webhooks.get_webhook_endpoint("test_id") + assert isinstance(result, WebhookEndpoint) + assert result.object == "webhook_endpoint" + assert result.id == "we_0123456789" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith("/webhook_endpoints/test_id") + def test_update_webhook_endpoint(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("webhook_endpoint.json"), @@ -208,6 +220,17 @@ async def test_create_webhook_endpoint(self, async_workos, httpx_mock): assert request.method == "POST" assert request.url.path.endswith("/webhook_endpoints") + @pytest.mark.asyncio + async def test_get_webhook_endpoint(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("webhook_endpoint.json")) + result = await async_workos.webhooks.get_webhook_endpoint("test_id") + assert isinstance(result, WebhookEndpoint) + assert result.object == "webhook_endpoint" + assert result.id == "we_0123456789" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith("/webhook_endpoints/test_id") + @pytest.mark.asyncio async def test_update_webhook_endpoint(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("webhook_endpoint.json")) From 6723aa06d5dac618c710a7614baeea0edf6e5430 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:11 +0000 Subject: [PATCH 4/6] fix(events): Updated model `EventSchema` --- src/workos/events/models/event_schema.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/workos/events/models/event_schema.py b/src/workos/events/models/event_schema.py index e66f8841..2f477dd2 100644 --- a/src/workos/events/models/event_schema.py +++ b/src/workos/events/models/event_schema.py @@ -41,6 +41,12 @@ from workos.common.models.api_key_created import ApiKeyCreated from workos.common.models.api_key_revoked import ApiKeyRevoked from workos.common.models.api_key_updated import ApiKeyUpdated +from workos.common.models.application_token_exchange_failed import ( + ApplicationTokenExchangeFailed, +) +from workos.common.models.application_token_exchange_succeeded import ( + ApplicationTokenExchangeSucceeded, +) from workos.common.models.authentication_email_verification_failed import ( AuthenticationEmailVerificationFailed, ) @@ -90,6 +96,9 @@ from workos.common.models.connection_saml_certificate_renewed import ( ConnectionSAMLCertificateRenewed, ) +from workos.common.models.connection_saml_certificate_replaced import ( + ConnectionSAMLCertificateReplaced, +) from workos.common.models.dsync_activated import DsyncActivated from workos.common.models.dsync_deleted import DsyncDeleted from workos.common.models.dsync_group_created import DsyncGroupCreated @@ -134,6 +143,9 @@ from workos.common.models.invitation_created import InvitationCreated from workos.common.models.invitation_resent import InvitationResent from workos.common.models.invitation_revoked import InvitationRevoked +from workos.common.models.issuer_trust_created import IssuerTrustCreated +from workos.common.models.issuer_trust_deleted import IssuerTrustDeleted +from workos.common.models.issuer_trust_updated import IssuerTrustUpdated from workos.common.models.magic_auth_created import MagicAuthCreated from workos.common.models.organization_created import OrganizationCreated from workos.common.models.organization_deleted import OrganizationDeleted @@ -261,6 +273,8 @@ def to_dict(self) -> dict[str, Any]: ApiKeyCreated, ApiKeyRevoked, ApiKeyUpdated, + ApplicationTokenExchangeFailed, + ApplicationTokenExchangeSucceeded, AuthenticationEmailVerificationFailed, AuthenticationEmailVerificationSucceeded, AuthenticationMagicAuthFailed, @@ -284,6 +298,7 @@ def to_dict(self) -> dict[str, Any]: ConnectionDeleted, ConnectionSAMLCertificateRenewalRequired, ConnectionSAMLCertificateRenewed, + ConnectionSAMLCertificateReplaced, DsyncActivated, DsyncDeleted, DsyncGroupCreated, @@ -318,6 +333,9 @@ def to_dict(self) -> dict[str, Any]: InvitationCreated, InvitationResent, InvitationRevoked, + IssuerTrustCreated, + IssuerTrustDeleted, + IssuerTrustUpdated, MagicAuthCreated, OrganizationCreated, OrganizationDeleted, @@ -405,6 +423,8 @@ class EventSchema: "api_key.created": ApiKeyCreated, "api_key.revoked": ApiKeyRevoked, "api_key.updated": ApiKeyUpdated, + "application.token_exchange_failed": ApplicationTokenExchangeFailed, + "application.token_exchange_succeeded": ApplicationTokenExchangeSucceeded, "authentication.email_verification_failed": AuthenticationEmailVerificationFailed, "authentication.email_verification_succeeded": AuthenticationEmailVerificationSucceeded, "authentication.magic_auth_failed": AuthenticationMagicAuthFailed, @@ -428,6 +448,7 @@ class EventSchema: "connection.deleted": ConnectionDeleted, "connection.saml_certificate_renewal_required": ConnectionSAMLCertificateRenewalRequired, "connection.saml_certificate_renewed": ConnectionSAMLCertificateRenewed, + "connection.saml_certificate_replaced": ConnectionSAMLCertificateReplaced, "dsync.activated": DsyncActivated, "dsync.deleted": DsyncDeleted, "dsync.group.created": DsyncGroupCreated, @@ -462,6 +483,9 @@ class EventSchema: "invitation.created": InvitationCreated, "invitation.resent": InvitationResent, "invitation.revoked": InvitationRevoked, + "issuer_trust.created": IssuerTrustCreated, + "issuer_trust.deleted": IssuerTrustDeleted, + "issuer_trust.updated": IssuerTrustUpdated, "magic_auth.created": MagicAuthCreated, "organization_domain.created": OrganizationDomainCreated, "organization_domain.deleted": OrganizationDomainDeleted, From 111b0b3730b48204ab90559f29180bb555ee7fc8 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:11 +0000 Subject: [PATCH 5/6] chore(generated): regenerate shared files for AdminPortal, Agents, ApiKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, OrganizationsIssuerTrusts, Pipes, PipesProvider, PlatformTeams, Radar, SSO, UserManagement, Vault, Webhooks, Widgets --- .last-synced-sha | 2 +- .oagen-manifest.json | 191 +- src/workos/_client.py | 14 + src/workos/agents/_resource.py | 18 +- src/workos/agents/models/__init__.py | 9 + src/workos/agents/models/agent_blueprint.py | 21 +- .../agent_blueprint_scoped_permission.py | 9 + .../models/agent_blueprints_create_request.py | 7 +- ...nt_blueprints_create_request_permission.py | 11 + .../models/agent_blueprints_update_request.py | 7 +- ...nt_blueprints_update_request_permission.py | 11 + .../audit_logs/models/audit_log_event.py | 11 +- src/workos/authorization/_resource.py | 105 +- src/workos/authorization/models/__init__.py | 4 + .../models/patch_role_assignment_entry.py | 7 + .../models/patch_role_assignments.py | 7 + src/workos/common/__init__.py | 522 ++++ src/workos/common/models/__init__.py | 590 +++++ .../models/agent_blueprint_created_data.py | 28 +- ...lueprint_created_data_scoped_permission.py | 49 + ...d_data_scoped_permission_instance_types.py | 18 + ...eprint_scoped_permission_instance_types.py | 18 + ...lueprint_updated_data_scoped_permission.py | 11 + ...d_data_scoped_permission_instance_types.py | 18 + ...reate_request_permission_instance_types.py | 18 + ...pdate_request_permission_instance_types.py | 18 + .../application_token_exchange_failed.py | 59 + .../application_token_exchange_failed_data.py | 53 + ...cation_token_exchange_failed_data_error.py | 36 + .../application_token_exchange_succeeded.py | 61 + ...plication_token_exchange_succeeded_data.py | 66 + ...on_email_verification_failed_data_error.py | 2 +- ...authentication_radar_risk_detected_data.py | 4 +- src/workos/common/models/blocked_tld.py | 31 + src/workos/common/models/bot_detection.py | 54 + .../common/models/brute_force_attack.py | 56 + .../models/create_application_secret.py | 0 .../common/models/domain_protections.py | 56 + ...ity_not_found_error_body_with_entity_id.py | 40 + ...tity_not_found_error_body_with_ids_list.py | 40 + src/workos/common/models/error_body_code.py | 24 + .../common/models/error_body_with_code.py | 37 +- src/workos/common/models/impossible_travel.py | 56 + src/workos/common/models/issuer_trust.py | 61 + .../common/models/issuer_trust_created.py | 57 + .../common/models/issuer_trust_deleted.py | 57 + .../common/models/issuer_trust_updated.py | 57 + src/workos/common/models/normalized_email.py | 35 + .../common/models/radar_detection_action.py | 11 + .../models/radar_detection_allowed_by.py | 48 + .../models/radar_detection_auth_method.py | 42 + .../radar_detection_bot_detection_details.py | 121 + ...n_bot_detection_details_browser_signals.py | 40 + ...ection_bot_detection_details_decided_by.py | 44 + ...ion_bot_detection_details_email_pattern.py | 32 + ...detection_bot_detection_details_ip_risk.py | 32 + .../radar_detection_bot_detection_signal.py | 50 + ...r_detection_bot_detection_signal_action.py | 27 + ...r_detection_bot_detection_signal_signal.py | 25 + ...ar_detection_brute_force_attack_details.py | 50 + ...n_brute_force_attack_details_matched_on.py | 31 + .../models/radar_detection_challenge_type.py | 27 + .../common/models/radar_detection_control.py | 42 + ...ar_detection_domain_protections_details.py | 58 + .../models/radar_detection_domain_sign_ups.py | 37 + .../radar_detection_evidence_restriction.py | 57 + ...dar_detection_impossible_travel_details.py | 44 + .../models/radar_detection_ip_sign_ups.py | 36 + .../common/models/radar_detection_list.py | 58 + .../models/radar_detection_list_action.py | 31 + .../models/radar_detection_list_type.py | 40 + .../common/models/radar_detection_location.py | 42 + .../radar_detection_previous_attempt.py | 59 + ...dar_detection_previous_attempt_location.py | 7 + .../radar_detection_repeat_sign_up_details.py | 71 + ..._detection_repeat_sign_up_details_email.py | 39 + .../radar_detection_restriction_details.py | 72 + ...adar_detection_restriction_details_list.py | 51 + .../radar_detection_stale_account_details.py | 38 + ...r_detection_unrecognized_device_details.py | 41 + .../common/models/radar_detection_verdict.py | 9 + .../models/radar_sms_challenge_error_body.py | 36 + ...adar_standalone_response_blocklist_type.py | 17 +- src/workos/common/models/repeat_sign_up.py | 57 + ...le_assignment_update_overlap_error_body.py | 36 + src/workos/common/models/sign_up.py | 31 + src/workos/common/models/sms_sign_in.py | 55 + .../common/models/sms_sign_in_trigger.py | 36 + src/workos/common/models/stale_account.py | 54 + .../common/models/unrecognized_device.py | 56 + src/workos/connect/_resource.py | 26 +- src/workos/connect/models/__init__.py | 6 +- .../models/__init__.py | 3 + .../models/it_contact_list_list_metadata.py | 43 +- .../organizations_issuer_trusts/__init__.py | 5 + .../organizations_issuer_trusts/_resource.py | 385 +++ .../models/__init__.py | 14 + .../models/issuer_trust_list.py | 48 + .../models/issuer_trust_list_list_metadata.py | 42 + .../models/issuer_trusts_create_request.py | 36 + .../models/issuer_trusts_update_request.py | 33 + src/workos/pipes/models/__init__.py | 1 + src/workos/pipes_provider/models/__init__.py | 3 + src/workos/radar/_resource.py | 61 + src/workos/radar/models/__init__.py | 17 + src/workos/radar/models/radar_detection.py | 148 ++ .../radar/models/radar_detection_evidence.py | 80 + src/workos/radar/models/radar_list_type.py | 38 +- .../organizations_issuer_trusts/__init__.py | 3 + src/workos/user_management/_resource.py | 52 + src/workos/user_management/models/__init__.py | 3 + .../waitlist_list_response_list_metadata.py | 6 +- tests/fixtures/agent_blueprint.json | 15 + tests/fixtures/agent_blueprint_created.json | 15 + .../agent_blueprint_created_data.json | 15 + ...eprint_created_data_scoped_permission.json | 6 + .../agent_blueprint_scoped_permission.json | 6 + tests/fixtures/agent_blueprint_updated.json | 15 + .../agent_blueprint_updated_data.json | 15 + ...eprint_updated_data_scoped_permission.json | 6 + .../agent_blueprints_create_request.json | 15 +- ..._blueprints_create_request_permission.json | 6 + .../agent_blueprints_update_request.json | 15 +- ..._blueprints_update_request_permission.json | 6 + .../application_token_exchange_failed.json | 35 + ...pplication_token_exchange_failed_data.json | 9 + ...tion_token_exchange_failed_data_error.json | 4 + .../application_token_exchange_succeeded.json | 36 + ...ication_token_exchange_succeeded_data.json | 10 + .../authentication_radar_risk_detected.json | 4 +- ...thentication_radar_risk_detected_data.json | 4 +- tests/fixtures/blocked_tld.json | 3 + tests/fixtures/bot_detection.json | 51 + tests/fixtures/brute_force_attack.json | 19 + tests/fixtures/domain_protections.json | 35 + ...y_not_found_error_body_with_entity_id.json | 5 + ...ty_not_found_error_body_with_ids_list.json | 8 + tests/fixtures/error_body_with_error.json | 2 +- tests/fixtures/impossible_travel.json | 28 + tests/fixtures/issuer_trust.json | 10 + tests/fixtures/issuer_trust_created.json | 36 + tests/fixtures/issuer_trust_deleted.json | 36 + tests/fixtures/issuer_trust_list.json | 19 + .../issuer_trust_list_list_metadata.json | 4 + tests/fixtures/issuer_trust_updated.json | 36 + .../issuer_trusts_create_request.json | 4 + .../issuer_trusts_update_request.json | 3 + tests/fixtures/list_agent_blueprint.json | 15 + tests/fixtures/normalized_email.json | 4 + .../fixtures/patch_role_assignment_entry.json | 6 + tests/fixtures/patch_role_assignments.json | 18 + tests/fixtures/radar_detection.json | 71 + .../fixtures/radar_detection_allowed_by.json | 10 + ...radar_detection_bot_detection_details.json | 37 + .../radar_detection_bot_detection_signal.json | 4 + ..._detection_brute_force_attack_details.json | 5 + ..._detection_domain_protections_details.json | 21 + .../radar_detection_domain_sign_ups.json | 4 + tests/fixtures/radar_detection_evidence.json | 51 + .../radar_detection_evidence_restriction.json | 25 + ...r_detection_impossible_travel_details.json | 14 + .../fixtures/radar_detection_ip_sign_ups.json | 4 + tests/fixtures/radar_detection_list.json | 6 + tests/fixtures/radar_detection_location.json | 4 + .../radar_detection_previous_attempt.json | 10 + ...r_detection_previous_attempt_location.json | 4 + ...etection_repeat_sign_up_details_email.json | 5 + ...ar_detection_restriction_details_list.json | 11 + ...radar_detection_stale_account_details.json | 3 + ...detection_unrecognized_device_details.json | 12 + .../radar_sms_challenge_error_body.json | 4 + tests/fixtures/repeat_sign_up.json | 19 + ..._assignment_update_overlap_error_body.json | 4 + tests/fixtures/sign_up.json | 3 + tests/fixtures/sms_sign_in.json | 7 + tests/fixtures/stale_account.json | 17 + tests/fixtures/unrecognized_device.json | 26 + tests/test_agents_models_round_trip.py | 57 + tests/test_audit_logs_models_round_trip.py | 4 +- tests/test_authorization.py | 21 + tests/test_authorization_models_round_trip.py | 25 + tests/test_common_models_round_trip.py | 2180 +++++++++++++++-- tests/test_organizations_issuer_trusts.py | 368 +++ ...zations_issuer_trusts_models_round_trip.py | 98 + tests/test_radar.py | 25 +- tests/test_radar_models_round_trip.py | 258 ++ tests/test_user_management.py | 17 + 187 files changed, 9125 insertions(+), 397 deletions(-) create mode 100644 src/workos/agents/models/agent_blueprint_scoped_permission.py create mode 100644 src/workos/agents/models/agent_blueprints_create_request_permission.py create mode 100644 src/workos/agents/models/agent_blueprints_update_request_permission.py create mode 100644 src/workos/authorization/models/patch_role_assignment_entry.py create mode 100644 src/workos/authorization/models/patch_role_assignments.py create mode 100644 src/workos/common/models/agent_blueprint_created_data_scoped_permission.py create mode 100644 src/workos/common/models/agent_blueprint_created_data_scoped_permission_instance_types.py create mode 100644 src/workos/common/models/agent_blueprint_scoped_permission_instance_types.py create mode 100644 src/workos/common/models/agent_blueprint_updated_data_scoped_permission.py create mode 100644 src/workos/common/models/agent_blueprint_updated_data_scoped_permission_instance_types.py create mode 100644 src/workos/common/models/agent_blueprints_create_request_permission_instance_types.py create mode 100644 src/workos/common/models/agent_blueprints_update_request_permission_instance_types.py create mode 100644 src/workos/common/models/application_token_exchange_failed.py create mode 100644 src/workos/common/models/application_token_exchange_failed_data.py create mode 100644 src/workos/common/models/application_token_exchange_failed_data_error.py create mode 100644 src/workos/common/models/application_token_exchange_succeeded.py create mode 100644 src/workos/common/models/application_token_exchange_succeeded_data.py create mode 100644 src/workos/common/models/blocked_tld.py create mode 100644 src/workos/common/models/bot_detection.py create mode 100644 src/workos/common/models/brute_force_attack.py rename src/workos/{connect => common}/models/create_application_secret.py (100%) create mode 100644 src/workos/common/models/domain_protections.py create mode 100644 src/workos/common/models/entity_not_found_error_body_with_entity_id.py create mode 100644 src/workos/common/models/entity_not_found_error_body_with_ids_list.py create mode 100644 src/workos/common/models/impossible_travel.py create mode 100644 src/workos/common/models/issuer_trust.py create mode 100644 src/workos/common/models/issuer_trust_created.py create mode 100644 src/workos/common/models/issuer_trust_deleted.py create mode 100644 src/workos/common/models/issuer_trust_updated.py create mode 100644 src/workos/common/models/normalized_email.py create mode 100644 src/workos/common/models/radar_detection_action.py create mode 100644 src/workos/common/models/radar_detection_allowed_by.py create mode 100644 src/workos/common/models/radar_detection_auth_method.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_details.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_details_browser_signals.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_details_decided_by.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_details_email_pattern.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_details_ip_risk.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_signal.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_signal_action.py create mode 100644 src/workos/common/models/radar_detection_bot_detection_signal_signal.py create mode 100644 src/workos/common/models/radar_detection_brute_force_attack_details.py create mode 100644 src/workos/common/models/radar_detection_brute_force_attack_details_matched_on.py create mode 100644 src/workos/common/models/radar_detection_challenge_type.py create mode 100644 src/workos/common/models/radar_detection_control.py create mode 100644 src/workos/common/models/radar_detection_domain_protections_details.py create mode 100644 src/workos/common/models/radar_detection_domain_sign_ups.py create mode 100644 src/workos/common/models/radar_detection_evidence_restriction.py create mode 100644 src/workos/common/models/radar_detection_impossible_travel_details.py create mode 100644 src/workos/common/models/radar_detection_ip_sign_ups.py create mode 100644 src/workos/common/models/radar_detection_list.py create mode 100644 src/workos/common/models/radar_detection_list_action.py create mode 100644 src/workos/common/models/radar_detection_list_type.py create mode 100644 src/workos/common/models/radar_detection_location.py create mode 100644 src/workos/common/models/radar_detection_previous_attempt.py create mode 100644 src/workos/common/models/radar_detection_previous_attempt_location.py create mode 100644 src/workos/common/models/radar_detection_repeat_sign_up_details.py create mode 100644 src/workos/common/models/radar_detection_repeat_sign_up_details_email.py create mode 100644 src/workos/common/models/radar_detection_restriction_details.py create mode 100644 src/workos/common/models/radar_detection_restriction_details_list.py create mode 100644 src/workos/common/models/radar_detection_stale_account_details.py create mode 100644 src/workos/common/models/radar_detection_unrecognized_device_details.py create mode 100644 src/workos/common/models/radar_detection_verdict.py create mode 100644 src/workos/common/models/radar_sms_challenge_error_body.py create mode 100644 src/workos/common/models/repeat_sign_up.py create mode 100644 src/workos/common/models/role_assignment_update_overlap_error_body.py create mode 100644 src/workos/common/models/sign_up.py create mode 100644 src/workos/common/models/sms_sign_in.py create mode 100644 src/workos/common/models/sms_sign_in_trigger.py create mode 100644 src/workos/common/models/stale_account.py create mode 100644 src/workos/common/models/unrecognized_device.py create mode 100644 src/workos/organizations_issuer_trusts/__init__.py create mode 100644 src/workos/organizations_issuer_trusts/_resource.py create mode 100644 src/workos/organizations_issuer_trusts/models/__init__.py create mode 100644 src/workos/organizations_issuer_trusts/models/issuer_trust_list.py create mode 100644 src/workos/organizations_issuer_trusts/models/issuer_trust_list_list_metadata.py create mode 100644 src/workos/organizations_issuer_trusts/models/issuer_trusts_create_request.py create mode 100644 src/workos/organizations_issuer_trusts/models/issuer_trusts_update_request.py create mode 100644 src/workos/radar/models/radar_detection.py create mode 100644 src/workos/radar/models/radar_detection_evidence.py create mode 100644 src/workos/types/organizations_issuer_trusts/__init__.py create mode 100644 tests/fixtures/agent_blueprint_created_data_scoped_permission.json create mode 100644 tests/fixtures/agent_blueprint_scoped_permission.json create mode 100644 tests/fixtures/agent_blueprint_updated_data_scoped_permission.json create mode 100644 tests/fixtures/agent_blueprints_create_request_permission.json create mode 100644 tests/fixtures/agent_blueprints_update_request_permission.json create mode 100644 tests/fixtures/application_token_exchange_failed.json create mode 100644 tests/fixtures/application_token_exchange_failed_data.json create mode 100644 tests/fixtures/application_token_exchange_failed_data_error.json create mode 100644 tests/fixtures/application_token_exchange_succeeded.json create mode 100644 tests/fixtures/application_token_exchange_succeeded_data.json create mode 100644 tests/fixtures/blocked_tld.json create mode 100644 tests/fixtures/bot_detection.json create mode 100644 tests/fixtures/brute_force_attack.json create mode 100644 tests/fixtures/domain_protections.json create mode 100644 tests/fixtures/entity_not_found_error_body_with_entity_id.json create mode 100644 tests/fixtures/entity_not_found_error_body_with_ids_list.json create mode 100644 tests/fixtures/impossible_travel.json create mode 100644 tests/fixtures/issuer_trust.json create mode 100644 tests/fixtures/issuer_trust_created.json create mode 100644 tests/fixtures/issuer_trust_deleted.json create mode 100644 tests/fixtures/issuer_trust_list.json create mode 100644 tests/fixtures/issuer_trust_list_list_metadata.json create mode 100644 tests/fixtures/issuer_trust_updated.json create mode 100644 tests/fixtures/issuer_trusts_create_request.json create mode 100644 tests/fixtures/issuer_trusts_update_request.json create mode 100644 tests/fixtures/normalized_email.json create mode 100644 tests/fixtures/patch_role_assignment_entry.json create mode 100644 tests/fixtures/patch_role_assignments.json create mode 100644 tests/fixtures/radar_detection.json create mode 100644 tests/fixtures/radar_detection_allowed_by.json create mode 100644 tests/fixtures/radar_detection_bot_detection_details.json create mode 100644 tests/fixtures/radar_detection_bot_detection_signal.json create mode 100644 tests/fixtures/radar_detection_brute_force_attack_details.json create mode 100644 tests/fixtures/radar_detection_domain_protections_details.json create mode 100644 tests/fixtures/radar_detection_domain_sign_ups.json create mode 100644 tests/fixtures/radar_detection_evidence.json create mode 100644 tests/fixtures/radar_detection_evidence_restriction.json create mode 100644 tests/fixtures/radar_detection_impossible_travel_details.json create mode 100644 tests/fixtures/radar_detection_ip_sign_ups.json create mode 100644 tests/fixtures/radar_detection_list.json create mode 100644 tests/fixtures/radar_detection_location.json create mode 100644 tests/fixtures/radar_detection_previous_attempt.json create mode 100644 tests/fixtures/radar_detection_previous_attempt_location.json create mode 100644 tests/fixtures/radar_detection_repeat_sign_up_details_email.json create mode 100644 tests/fixtures/radar_detection_restriction_details_list.json create mode 100644 tests/fixtures/radar_detection_stale_account_details.json create mode 100644 tests/fixtures/radar_detection_unrecognized_device_details.json create mode 100644 tests/fixtures/radar_sms_challenge_error_body.json create mode 100644 tests/fixtures/repeat_sign_up.json create mode 100644 tests/fixtures/role_assignment_update_overlap_error_body.json create mode 100644 tests/fixtures/sign_up.json create mode 100644 tests/fixtures/sms_sign_in.json create mode 100644 tests/fixtures/stale_account.json create mode 100644 tests/fixtures/unrecognized_device.json create mode 100644 tests/test_organizations_issuer_trusts.py create mode 100644 tests/test_organizations_issuer_trusts_models_round_trip.py diff --git a/.last-synced-sha b/.last-synced-sha index 6a89764f..b14c24ba 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -d23707bf603250a73e6433561428e58fc2be036b +23bb5055bdec0b3d2efcc7d73eb162b57e1e7b43 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index 480fbf78..8f54f48f 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -18,16 +18,19 @@ "src/workos/agents/models/agent_blueprint.py", "src/workos/agents/models/agent_blueprint_invocable_as.py", "src/workos/agents/models/agent_blueprint_invocable_by.py", + "src/workos/agents/models/agent_blueprint_scoped_permission.py", "src/workos/agents/models/agent_blueprint_session_setting.py", "src/workos/agents/models/agent_blueprints_create_request.py", "src/workos/agents/models/agent_blueprints_create_request_invocable_as.py", "src/workos/agents/models/agent_blueprints_create_request_invocable_by.py", + "src/workos/agents/models/agent_blueprints_create_request_permission.py", "src/workos/agents/models/agent_blueprints_create_request_session_setting.py", "src/workos/agents/models/agent_blueprints_token_mint_token_request.py", "src/workos/agents/models/agent_blueprints_token_validate_token_request.py", "src/workos/agents/models/agent_blueprints_update_request.py", "src/workos/agents/models/agent_blueprints_update_request_invocable_as.py", "src/workos/agents/models/agent_blueprints_update_request_invocable_by.py", + "src/workos/agents/models/agent_blueprints_update_request_permission.py", "src/workos/agents/models/agent_blueprints_update_request_session_setting.py", "src/workos/agents/models/agent_credential_validation.py", "src/workos/agents/models/agent_instance.py", @@ -89,6 +92,8 @@ "src/workos/authorization/models/group_role_assignment_list.py", "src/workos/authorization/models/group_role_assignment_resource.py", "src/workos/authorization/models/patch_group_role_assignments.py", + "src/workos/authorization/models/patch_role_assignment_entry.py", + "src/workos/authorization/models/patch_role_assignments.py", "src/workos/authorization/models/permission.py", "src/workos/authorization/models/remove_role.py", "src/workos/authorization/models/replace_group_role_assignment_entry.py", @@ -128,19 +133,26 @@ "src/workos/common/models/agent_blueprint_created_data_invocable_as.py", "src/workos/common/models/agent_blueprint_created_data_invocable_as_instance_types.py", "src/workos/common/models/agent_blueprint_created_data_invocable_by.py", + "src/workos/common/models/agent_blueprint_created_data_scoped_permission.py", + "src/workos/common/models/agent_blueprint_created_data_scoped_permission_instance_types.py", "src/workos/common/models/agent_blueprint_created_data_session_setting.py", "src/workos/common/models/agent_blueprint_deleted.py", "src/workos/common/models/agent_blueprint_deleted_data.py", "src/workos/common/models/agent_blueprint_invocable_as_instance_types.py", + "src/workos/common/models/agent_blueprint_scoped_permission_instance_types.py", "src/workos/common/models/agent_blueprint_updated.py", "src/workos/common/models/agent_blueprint_updated_data.py", "src/workos/common/models/agent_blueprint_updated_data_invocable_as.py", "src/workos/common/models/agent_blueprint_updated_data_invocable_as_instance_types.py", "src/workos/common/models/agent_blueprint_updated_data_invocable_by.py", + "src/workos/common/models/agent_blueprint_updated_data_scoped_permission.py", + "src/workos/common/models/agent_blueprint_updated_data_scoped_permission_instance_types.py", "src/workos/common/models/agent_blueprint_updated_data_session_setting.py", "src/workos/common/models/agent_blueprints_create_request_invocable_as_instance_types.py", + "src/workos/common/models/agent_blueprints_create_request_permission_instance_types.py", "src/workos/common/models/agent_blueprints_token_mint_token_request_type.py", "src/workos/common/models/agent_blueprints_update_request_invocable_as_instance_types.py", + "src/workos/common/models/agent_blueprints_update_request_permission_instance_types.py", "src/workos/common/models/agent_instance_created.py", "src/workos/common/models/agent_instance_created_data.py", "src/workos/common/models/agent_instance_created_data_type.py", @@ -192,6 +204,11 @@ "src/workos/common/models/api_key_updated_data_owner.py", "src/workos/common/models/api_key_updated_data_previous_attribute.py", "src/workos/common/models/application_consent_required_error_body.py", + "src/workos/common/models/application_token_exchange_failed.py", + "src/workos/common/models/application_token_exchange_failed_data.py", + "src/workos/common/models/application_token_exchange_failed_data_error.py", + "src/workos/common/models/application_token_exchange_succeeded.py", + "src/workos/common/models/application_token_exchange_succeeded_data.py", "src/workos/common/models/audit_log_configuration_log_stream_state.py", "src/workos/common/models/audit_log_configuration_log_stream_type.py", "src/workos/common/models/audit_log_configuration_state.py", @@ -267,6 +284,9 @@ "src/workos/common/models/authorization_url_not_found_error_body_code.py", "src/workos/common/models/authorization_url_request_error_body.py", "src/workos/common/models/authorization_url_request_error_body_code.py", + "src/workos/common/models/blocked_tld.py", + "src/workos/common/models/bot_detection.py", + "src/workos/common/models/brute_force_attack.py", "src/workos/common/models/claim_view_response_status.py", "src/workos/common/models/client_credentials_data_integration_vended_credential.py", "src/workos/common/models/code_challenge_not_found_error_body.py", @@ -314,10 +334,16 @@ "src/workos/common/models/connection_saml_certificate_renewed_data_certificate.py", "src/workos/common/models/connection_saml_certificate_renewed_data_certificate_certificate_type.py", "src/workos/common/models/connection_saml_certificate_renewed_data_connection.py", + "src/workos/common/models/connection_saml_certificate_replaced.py", + "src/workos/common/models/connection_saml_certificate_replaced_data.py", + "src/workos/common/models/connection_saml_certificate_replaced_data_certificate.py", + "src/workos/common/models/connection_saml_certificate_replaced_data_certificate_certificate_type.py", + "src/workos/common/models/connection_saml_certificate_replaced_data_connection.py", "src/workos/common/models/connection_state.py", "src/workos/common/models/connection_status.py", "src/workos/common/models/connection_type.py", "src/workos/common/models/connection_type_not_updatable_error_body.py", + "src/workos/common/models/create_application_secret.py", "src/workos/common/models/create_connected_account_state.py", "src/workos/common/models/create_connection_oidc_options_id_token_signature_algorithm.py", "src/workos/common/models/create_connection_oidc_options_token_authentication_method.py", @@ -378,6 +404,7 @@ "src/workos/common/models/directory_user_email.py", "src/workos/common/models/directory_user_state.py", "src/workos/common/models/directory_user_with_groups_state.py", + "src/workos/common/models/domain_protections.py", "src/workos/common/models/dsync_activated.py", "src/workos/common/models/dsync_activated_data.py", "src/workos/common/models/dsync_activated_data_domain.py", @@ -416,6 +443,8 @@ "src/workos/common/models/email_verification_created_data.py", "src/workos/common/models/email_verification_required_error_body.py", "src/workos/common/models/entity_not_found_error_body.py", + "src/workos/common/models/entity_not_found_error_body_with_entity_id.py", + "src/workos/common/models/entity_not_found_error_body_with_ids_list.py", "src/workos/common/models/error_body.py", "src/workos/common/models/error_body_code.py", "src/workos/common/models/error_body_with_code.py", @@ -538,6 +567,7 @@ "src/workos/common/models/group_member_removed_data.py", "src/workos/common/models/group_updated.py", "src/workos/common/models/idp_metadata_fetch_failed_error_body.py", + "src/workos/common/models/impossible_travel.py", "src/workos/common/models/invalid_client_oauth_error_body.py", "src/workos/common/models/invalid_connection_oauth_error_body.py", "src/workos/common/models/invalid_credentials_error_body.py", @@ -574,6 +604,10 @@ "src/workos/common/models/invitation_revoked_data_state.py", "src/workos/common/models/invitation_state.py", "src/workos/common/models/invite_it_contact_intents.py", + "src/workos/common/models/issuer_trust.py", + "src/workos/common/models/issuer_trust_created.py", + "src/workos/common/models/issuer_trust_deleted.py", + "src/workos/common/models/issuer_trust_updated.py", "src/workos/common/models/list_metadata.py", "src/workos/common/models/magic_auth_created.py", "src/workos/common/models/magic_auth_created_data.py", @@ -582,6 +616,7 @@ "src/workos/common/models/mfa_enrollment_oauth_error_body.py", "src/workos/common/models/multiple_roles_not_enabled_error_body.py", "src/workos/common/models/must_use_sso_for_selected_organization_message_error_body.py", + "src/workos/common/models/normalized_email.py", "src/workos/common/models/oauth_data_integration_vended_credential.py", "src/workos/common/models/oauth_error_body.py", "src/workos/common/models/one_time_code_expired_error_body.py", @@ -694,8 +729,42 @@ "src/workos/common/models/radar_challenge_created.py", "src/workos/common/models/radar_challenge_created_data.py", "src/workos/common/models/radar_challenge_error_body.py", + "src/workos/common/models/radar_detection_action.py", + "src/workos/common/models/radar_detection_allowed_by.py", + "src/workos/common/models/radar_detection_auth_method.py", + "src/workos/common/models/radar_detection_bot_detection_details.py", + "src/workos/common/models/radar_detection_bot_detection_details_browser_signals.py", + "src/workos/common/models/radar_detection_bot_detection_details_decided_by.py", + "src/workos/common/models/radar_detection_bot_detection_details_email_pattern.py", + "src/workos/common/models/radar_detection_bot_detection_details_ip_risk.py", + "src/workos/common/models/radar_detection_bot_detection_signal.py", + "src/workos/common/models/radar_detection_bot_detection_signal_action.py", + "src/workos/common/models/radar_detection_bot_detection_signal_signal.py", + "src/workos/common/models/radar_detection_brute_force_attack_details.py", + "src/workos/common/models/radar_detection_brute_force_attack_details_matched_on.py", + "src/workos/common/models/radar_detection_challenge_type.py", + "src/workos/common/models/radar_detection_control.py", + "src/workos/common/models/radar_detection_domain_protections_details.py", + "src/workos/common/models/radar_detection_domain_sign_ups.py", + "src/workos/common/models/radar_detection_evidence_restriction.py", + "src/workos/common/models/radar_detection_impossible_travel_details.py", + "src/workos/common/models/radar_detection_ip_sign_ups.py", + "src/workos/common/models/radar_detection_list.py", + "src/workos/common/models/radar_detection_list_action.py", + "src/workos/common/models/radar_detection_list_type.py", + "src/workos/common/models/radar_detection_location.py", + "src/workos/common/models/radar_detection_previous_attempt.py", + "src/workos/common/models/radar_detection_previous_attempt_location.py", + "src/workos/common/models/radar_detection_repeat_sign_up_details.py", + "src/workos/common/models/radar_detection_repeat_sign_up_details_email.py", + "src/workos/common/models/radar_detection_restriction_details.py", + "src/workos/common/models/radar_detection_restriction_details_list.py", + "src/workos/common/models/radar_detection_stale_account_details.py", + "src/workos/common/models/radar_detection_unrecognized_device_details.py", + "src/workos/common/models/radar_detection_verdict.py", "src/workos/common/models/radar_list_entry_already_present_response.py", "src/workos/common/models/radar_sign_up_challenge_error_body.py", + "src/workos/common/models/radar_sms_challenge_error_body.py", "src/workos/common/models/radar_sms_sign_in_challenge_error_body.py", "src/workos/common/models/radar_standalone_assess_request_action.py", "src/workos/common/models/radar_standalone_assess_request_auth_method.py", @@ -703,6 +772,7 @@ "src/workos/common/models/radar_standalone_response_control.py", "src/workos/common/models/radar_standalone_response_verdict.py", "src/workos/common/models/rate_limit_exceeded_error_body_with_retry_after.py", + "src/workos/common/models/repeat_sign_up.py", "src/workos/common/models/resend_user_invite_options_locale.py", "src/workos/common/models/resource_export_completed.py", "src/workos/common/models/resource_export_completed_data.py", @@ -716,6 +786,7 @@ "src/workos/common/models/resource_export_failed.py", "src/workos/common/models/resource_export_failed_data.py", "src/workos/common/models/resource_export_failed_data_resource_type.py", + "src/workos/common/models/role_assignment_update_overlap_error_body.py", "src/workos/common/models/role_created.py", "src/workos/common/models/role_created_data.py", "src/workos/common/models/role_deleted.py", @@ -735,12 +806,16 @@ "src/workos/common/models/session_revoked_data_auth_method.py", "src/workos/common/models/session_revoked_data_impersonator.py", "src/workos/common/models/session_revoked_data_status.py", + "src/workos/common/models/sign_up.py", "src/workos/common/models/sign_up_not_allowed_oauth_error_body.py", "src/workos/common/models/slim_role.py", "src/workos/common/models/slow_down_oauth_error_body.py", "src/workos/common/models/sms_challenge_quota_reached_error_body.py", "src/workos/common/models/sms_challenge_rate_limited_error_body.py", + "src/workos/common/models/sms_sign_in.py", + "src/workos/common/models/sms_sign_in_trigger.py", "src/workos/common/models/sso_required_oauth_error_body_with_connection_ids_list_email.py", + "src/workos/common/models/stale_account.py", "src/workos/common/models/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.py", "src/workos/common/models/team_production_state.py", "src/workos/common/models/token_query_grant_type.py", @@ -749,6 +824,7 @@ "src/workos/common/models/too_many_requests_oauth_error_body.py", "src/workos/common/models/unauthorized_client_oauth_error_body.py", "src/workos/common/models/unauthorized_error_body.py", + "src/workos/common/models/unrecognized_device.py", "src/workos/common/models/update_audit_logs_retention_retention_period.py", "src/workos/common/models/update_audit_logs_retention_with_retention_period.py", "src/workos/common/models/update_audit_logs_retention_with_retention_period_in_days.py", @@ -834,7 +910,6 @@ "src/workos/connect/models/__init__.py", "src/workos/connect/models/application_credentials_list_item.py", "src/workos/connect/models/applications_registration_types.py", - "src/workos/connect/models/create_application_secret.py", "src/workos/connect/models/create_m2m_application.py", "src/workos/connect/models/create_oauth_application.py", "src/workos/connect/models/external_auth_complete_response.py", @@ -909,6 +984,13 @@ "src/workos/organizations/models/update_organization.py", "src/workos/organizations_data_providers/__init__.py", "src/workos/organizations_data_providers/models/__init__.py", + "src/workos/organizations_issuer_trusts/__init__.py", + "src/workos/organizations_issuer_trusts/_resource.py", + "src/workos/organizations_issuer_trusts/models/__init__.py", + "src/workos/organizations_issuer_trusts/models/issuer_trust_list.py", + "src/workos/organizations_issuer_trusts/models/issuer_trust_list_list_metadata.py", + "src/workos/organizations_issuer_trusts/models/issuer_trusts_create_request.py", + "src/workos/organizations_issuer_trusts/models/issuer_trusts_update_request.py", "src/workos/pipes/__init__.py", "src/workos/pipes/_resource.py", "src/workos/pipes/models/__init__.py", @@ -955,6 +1037,8 @@ "src/workos/radar/__init__.py", "src/workos/radar/_resource.py", "src/workos/radar/models/__init__.py", + "src/workos/radar/models/radar_detection.py", + "src/workos/radar/models/radar_detection_evidence.py", "src/workos/radar/models/radar_list_action.py", "src/workos/radar/models/radar_list_type.py", "src/workos/radar/models/radar_standalone_assess_request.py", @@ -1011,6 +1095,7 @@ "src/workos/types/organization_domains/__init__.py", "src/workos/types/organization_membership/__init__.py", "src/workos/types/organizations/__init__.py", + "src/workos/types/organizations_issuer_trusts/__init__.py", "src/workos/types/pipes/__init__.py", "src/workos/types/pipes_provider/__init__.py", "src/workos/types/platform_teams/__init__.py", @@ -1139,26 +1224,31 @@ "tests/fixtures/agent_blueprint_created_data.json", "tests/fixtures/agent_blueprint_created_data_invocable_as.json", "tests/fixtures/agent_blueprint_created_data_invocable_by.json", + "tests/fixtures/agent_blueprint_created_data_scoped_permission.json", "tests/fixtures/agent_blueprint_created_data_session_setting.json", "tests/fixtures/agent_blueprint_deleted.json", "tests/fixtures/agent_blueprint_deleted_data.json", "tests/fixtures/agent_blueprint_invocable_as.json", "tests/fixtures/agent_blueprint_invocable_by.json", + "tests/fixtures/agent_blueprint_scoped_permission.json", "tests/fixtures/agent_blueprint_session_setting.json", "tests/fixtures/agent_blueprint_updated.json", "tests/fixtures/agent_blueprint_updated_data.json", "tests/fixtures/agent_blueprint_updated_data_invocable_as.json", "tests/fixtures/agent_blueprint_updated_data_invocable_by.json", + "tests/fixtures/agent_blueprint_updated_data_scoped_permission.json", "tests/fixtures/agent_blueprint_updated_data_session_setting.json", "tests/fixtures/agent_blueprints_create_request.json", "tests/fixtures/agent_blueprints_create_request_invocable_as.json", "tests/fixtures/agent_blueprints_create_request_invocable_by.json", + "tests/fixtures/agent_blueprints_create_request_permission.json", "tests/fixtures/agent_blueprints_create_request_session_setting.json", "tests/fixtures/agent_blueprints_token_mint_token_request.json", "tests/fixtures/agent_blueprints_token_validate_token_request.json", "tests/fixtures/agent_blueprints_update_request.json", "tests/fixtures/agent_blueprints_update_request_invocable_as.json", "tests/fixtures/agent_blueprints_update_request_invocable_by.json", + "tests/fixtures/agent_blueprints_update_request_permission.json", "tests/fixtures/agent_blueprints_update_request_session_setting.json", "tests/fixtures/agent_credential_validation.json", "tests/fixtures/agent_instance.json", @@ -1216,6 +1306,11 @@ "tests/fixtures/api_key_validation_response.json", "tests/fixtures/application_consent_required_error_body.json", "tests/fixtures/application_credentials_list_item.json", + "tests/fixtures/application_token_exchange_failed.json", + "tests/fixtures/application_token_exchange_failed_data.json", + "tests/fixtures/application_token_exchange_failed_data_error.json", + "tests/fixtures/application_token_exchange_succeeded.json", + "tests/fixtures/application_token_exchange_succeeded_data.json", "tests/fixtures/assign_role.json", "tests/fixtures/audit_log_action.json", "tests/fixtures/audit_log_configuration.json", @@ -1309,6 +1404,9 @@ "tests/fixtures/authorization_url_not_found_error_body.json", "tests/fixtures/authorization_url_request_error_body.json", "tests/fixtures/authorized_connect_application_list_data.json", + "tests/fixtures/blocked_tld.json", + "tests/fixtures/bot_detection.json", + "tests/fixtures/brute_force_attack.json", "tests/fixtures/challenge_authentication_factor.json", "tests/fixtures/check_authorization.json", "tests/fixtures/claim_view_response.json", @@ -1349,6 +1447,10 @@ "tests/fixtures/connection_saml_certificate_renewed_data.json", "tests/fixtures/connection_saml_certificate_renewed_data_certificate.json", "tests/fixtures/connection_saml_certificate_renewed_data_connection.json", + "tests/fixtures/connection_saml_certificate_replaced.json", + "tests/fixtures/connection_saml_certificate_replaced_data.json", + "tests/fixtures/connection_saml_certificate_replaced_data_certificate.json", + "tests/fixtures/connection_saml_certificate_replaced_data_connection.json", "tests/fixtures/connection_type_not_updatable_error_body.json", "tests/fixtures/cors_origin_response.json", "tests/fixtures/create_authkit_oauth_resource.json", @@ -1438,6 +1540,7 @@ "tests/fixtures/directory_user_email.json", "tests/fixtures/directory_user_with_groups.json", "tests/fixtures/directory_user_with_groups_email.json", + "tests/fixtures/domain_protections.json", "tests/fixtures/dsync_activated.json", "tests/fixtures/dsync_activated_data.json", "tests/fixtures/dsync_activated_data_domain.json", @@ -1478,6 +1581,8 @@ "tests/fixtures/email_verification_required_error_body.json", "tests/fixtures/enroll_user_authentication_factor.json", "tests/fixtures/entity_not_found_error_body.json", + "tests/fixtures/entity_not_found_error_body_with_entity_id.json", + "tests/fixtures/entity_not_found_error_body_with_ids_list.json", "tests/fixtures/error_body.json", "tests/fixtures/error_body_with_code.json", "tests/fixtures/error_body_with_code_errors.json", @@ -1591,6 +1696,7 @@ "tests/fixtures/group_role_assignment_resource.json", "tests/fixtures/group_updated.json", "tests/fixtures/idp_metadata_fetch_failed_error_body.json", + "tests/fixtures/impossible_travel.json", "tests/fixtures/invalid_client_oauth_error_body.json", "tests/fixtures/invalid_connection_oauth_error_body.json", "tests/fixtures/invalid_credentials_error_body.json", @@ -1623,6 +1729,14 @@ "tests/fixtures/invitation_revoked.json", "tests/fixtures/invitation_revoked_data.json", "tests/fixtures/invite_it_contact.json", + "tests/fixtures/issuer_trust.json", + "tests/fixtures/issuer_trust_created.json", + "tests/fixtures/issuer_trust_deleted.json", + "tests/fixtures/issuer_trust_list.json", + "tests/fixtures/issuer_trust_list_list_metadata.json", + "tests/fixtures/issuer_trust_updated.json", + "tests/fixtures/issuer_trusts_create_request.json", + "tests/fixtures/issuer_trusts_update_request.json", "tests/fixtures/it_contact.json", "tests/fixtures/it_contact_list.json", "tests/fixtures/it_contact_list_list_metadata.json", @@ -1678,6 +1792,7 @@ "tests/fixtures/multiple_roles_not_enabled_error_body.json", "tests/fixtures/must_use_sso_for_selected_organization_message_error_body.json", "tests/fixtures/new_connect_application_secret.json", + "tests/fixtures/normalized_email.json", "tests/fixtures/oauth_data_integration_vended_credential.json", "tests/fixtures/oauth_error_body.json", "tests/fixtures/object_metadata.json", @@ -1756,6 +1871,8 @@ "tests/fixtures/patch_connection_standard_attributes.json", "tests/fixtures/patch_group_memberships.json", "tests/fixtures/patch_group_role_assignments.json", + "tests/fixtures/patch_role_assignment_entry.json", + "tests/fixtures/patch_role_assignments.json", "tests/fixtures/permission.json", "tests/fixtures/permission_created.json", "tests/fixtures/permission_created_data.json", @@ -1785,10 +1902,30 @@ "tests/fixtures/radar_challenge_created.json", "tests/fixtures/radar_challenge_created_data.json", "tests/fixtures/radar_challenge_error_body.json", + "tests/fixtures/radar_detection.json", + "tests/fixtures/radar_detection_allowed_by.json", + "tests/fixtures/radar_detection_bot_detection_details.json", + "tests/fixtures/radar_detection_bot_detection_signal.json", + "tests/fixtures/radar_detection_brute_force_attack_details.json", + "tests/fixtures/radar_detection_domain_protections_details.json", + "tests/fixtures/radar_detection_domain_sign_ups.json", + "tests/fixtures/radar_detection_evidence.json", + "tests/fixtures/radar_detection_evidence_restriction.json", + "tests/fixtures/radar_detection_impossible_travel_details.json", + "tests/fixtures/radar_detection_ip_sign_ups.json", + "tests/fixtures/radar_detection_list.json", + "tests/fixtures/radar_detection_location.json", + "tests/fixtures/radar_detection_previous_attempt.json", + "tests/fixtures/radar_detection_previous_attempt_location.json", + "tests/fixtures/radar_detection_repeat_sign_up_details_email.json", + "tests/fixtures/radar_detection_restriction_details_list.json", + "tests/fixtures/radar_detection_stale_account_details.json", + "tests/fixtures/radar_detection_unrecognized_device_details.json", "tests/fixtures/radar_email_challenge_code_session_authenticate_request.json", "tests/fixtures/radar_list_entry_already_present_response.json", "tests/fixtures/radar_sign_up_challenge_error_body.json", "tests/fixtures/radar_sms_challenge_code_session_authenticate_request.json", + "tests/fixtures/radar_sms_challenge_error_body.json", "tests/fixtures/radar_sms_sign_in_challenge_error_body.json", "tests/fixtures/radar_standalone_assess_request.json", "tests/fixtures/radar_standalone_delete_radar_list_entry_request.json", @@ -1801,6 +1938,7 @@ "tests/fixtures/refresh_token_session_authenticate_request.json", "tests/fixtures/rekey_request.json", "tests/fixtures/remove_role.json", + "tests/fixtures/repeat_sign_up.json", "tests/fixtures/replace_group_role_assignment_entry.json", "tests/fixtures/replace_group_role_assignments.json", "tests/fixtures/resend_user_invite_options.json", @@ -1816,6 +1954,7 @@ "tests/fixtures/revoke_link.json", "tests/fixtures/revoke_session.json", "tests/fixtures/role.json", + "tests/fixtures/role_assignment_update_overlap_error_body.json", "tests/fixtures/role_created.json", "tests/fixtures/role_created_data.json", "tests/fixtures/role_deleted.json", @@ -1840,11 +1979,13 @@ "tests/fixtures/session_revoked_data.json", "tests/fixtures/session_revoked_data_impersonator.json", "tests/fixtures/set_role_permissions.json", + "tests/fixtures/sign_up.json", "tests/fixtures/sign_up_not_allowed_oauth_error_body.json", "tests/fixtures/slim_role.json", "tests/fixtures/slow_down_oauth_error_body.json", "tests/fixtures/sms_challenge_quota_reached_error_body.json", "tests/fixtures/sms_challenge_rate_limited_error_body.json", + "tests/fixtures/sms_sign_in.json", "tests/fixtures/sso_authorize_url_response.json", "tests/fixtures/sso_device_authorization_request.json", "tests/fixtures/sso_logout_authorize_request.json", @@ -1852,6 +1993,7 @@ "tests/fixtures/sso_required_oauth_error_body_with_connection_ids_list_email.json", "tests/fixtures/sso_token_response.json", "tests/fixtures/sso_token_response_oauth_token.json", + "tests/fixtures/stale_account.json", "tests/fixtures/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.json", "tests/fixtures/team.json", "tests/fixtures/token_query.json", @@ -1860,6 +2002,7 @@ "tests/fixtures/too_many_requests_oauth_error_body.json", "tests/fixtures/unauthorized_client_oauth_error_body.json", "tests/fixtures/unauthorized_error_body.json", + "tests/fixtures/unrecognized_device.json", "tests/fixtures/update_audit_logs_retention.json", "tests/fixtures/update_audit_logs_retention_with_retention_period.json", "tests/fixtures/update_audit_logs_retention_with_retention_period_in_days.json", @@ -1983,6 +2126,8 @@ "tests/test_organization_membership.py", "tests/test_organization_membership_models_round_trip.py", "tests/test_organizations.py", + "tests/test_organizations_issuer_trusts.py", + "tests/test_organizations_issuer_trusts_models_round_trip.py", "tests/test_organizations_models_round_trip.py", "tests/test_pipes.py", "tests/test_pipes_models_round_trip.py", @@ -2148,6 +2293,10 @@ "sdkMethod": "assign_role", "service": "authorization" }, + "PATCH /authorization/organization_memberships/{organization_membership_id}/role_assignments": { + "sdkMethod": "update_role_assignments", + "service": "authorization" + }, "DELETE /authorization/organization_memberships/{organization_membership_id}/role_assignments": { "sdkMethod": "remove_role", "service": "authorization" @@ -2453,19 +2602,19 @@ "service": "directory_sync" }, "GET /directories/{directoryId}/groups": { - "sdkMethod": "list_directory_groups", + "sdkMethod": "list_groups_for_directory", "service": "directory_sync" }, "GET /directories/{directoryId}/groups/{groupId}": { - "sdkMethod": "get_directory_group", + "sdkMethod": "get_group_for_directory", "service": "directory_sync" }, "GET /directories/{directoryId}/users": { - "sdkMethod": "list_directory_users", + "sdkMethod": "list_users_for_directory", "service": "directory_sync" }, "GET /directories/{directoryId}/users/{userId}": { - "sdkMethod": "get_directory_user", + "sdkMethod": "get_user_for_directory", "service": "directory_sync" }, "GET /events": { @@ -2628,6 +2777,26 @@ "sdkMethod": "list_organization_data_providers", "service": "pipes" }, + "GET /organizations/{organization_id}/issuer_trusts": { + "sdkMethod": "list_organization_issuer_trusts", + "service": "organizations_issuer_trusts" + }, + "POST /organizations/{organization_id}/issuer_trusts": { + "sdkMethod": "create_organization_issuer_trust", + "service": "organizations_issuer_trusts" + }, + "GET /organizations/{organization_id}/issuer_trusts/{id}": { + "sdkMethod": "get_organization_issuer_trust", + "service": "organizations_issuer_trusts" + }, + "PATCH /organizations/{organization_id}/issuer_trusts/{id}": { + "sdkMethod": "update_organization_issuer_trust", + "service": "organizations_issuer_trusts" + }, + "DELETE /organizations/{organization_id}/issuer_trusts/{id}": { + "sdkMethod": "delete_organization_issuer_trust", + "service": "organizations_issuer_trusts" + }, "GET /organizations/{organization_id}/it_contacts": { "sdkMethod": "list_it_contacts", "service": "organizations" @@ -2672,6 +2841,10 @@ "sdkMethod": "update_attempt", "service": "radar" }, + "GET /radar/detections/{id}": { + "sdkMethod": "get_detection", + "service": "radar" + }, "POST /radar/lists/{type}/{action}": { "sdkMethod": "add_list_entry", "service": "radar" @@ -2752,6 +2925,10 @@ "sdkMethod": "create_cors_origin", "service": "user_management" }, + "DELETE /user_management/cors_origins/{id}": { + "sdkMethod": "delete_cors_origin", + "service": "user_management" + }, "GET /user_management/email_verification/{id}": { "sdkMethod": "get_email_verification", "service": "user_management" @@ -3024,6 +3201,10 @@ "sdkMethod": "create_webhook_endpoint", "service": "webhooks" }, + "GET /webhook_endpoints/{id}": { + "sdkMethod": "get_webhook_endpoint", + "service": "webhooks" + }, "PATCH /webhook_endpoints/{id}": { "sdkMethod": "update_webhook_endpoint", "service": "webhooks" diff --git a/src/workos/_client.py b/src/workos/_client.py index 8425e8f8..a43fcc59 100644 --- a/src/workos/_client.py +++ b/src/workos/_client.py @@ -32,6 +32,10 @@ OrganizationMembershipService, ) from .organizations._resource import AsyncOrganizations, Organizations +from .organizations_issuer_trusts._resource import ( + AsyncOrganizationsIssuerTrusts, + OrganizationsIssuerTrusts, +) from .passwordless import AsyncPasswordless, Passwordless from .pipes._resource import AsyncPipes, Pipes from .pipes_provider._resource import AsyncPipesProvider, PipesProvider @@ -123,6 +127,11 @@ def groups(self) -> Groups: """Groups API resources.""" return Groups(self) + @functools.cached_property + def organizations_issuer_trusts(self) -> OrganizationsIssuerTrusts: + """Organizations Issuer Trusts API resources.""" + return OrganizationsIssuerTrusts(self) + @functools.cached_property def platform_teams(self) -> PlatformTeams: """Platform Teams API resources.""" @@ -277,6 +286,11 @@ def groups(self) -> AsyncGroups: """Groups API resources.""" return AsyncGroups(self) + @functools.cached_property + def organizations_issuer_trusts(self) -> AsyncOrganizationsIssuerTrusts: + """Organizations Issuer Trusts API resources.""" + return AsyncOrganizationsIssuerTrusts(self) + @functools.cached_property def platform_teams(self) -> AsyncPlatformTeams: """Platform Teams API resources.""" diff --git a/src/workos/agents/_resource.py b/src/workos/agents/_resource.py index 6251aa8f..a9a3cb37 100644 --- a/src/workos/agents/_resource.py +++ b/src/workos/agents/_resource.py @@ -22,9 +22,11 @@ AgentBlueprint, AgentBlueprintsCreateRequestInvocableAs, AgentBlueprintsCreateRequestInvocableBy, + AgentBlueprintsCreateRequestPermission, AgentBlueprintsCreateRequestSessionSetting, AgentBlueprintsUpdateRequestInvocableAs, AgentBlueprintsUpdateRequestInvocableBy, + AgentBlueprintsUpdateRequestPermission, AgentBlueprintsUpdateRequestSessionSetting, AgentCredentialValidation, AgentInstance, @@ -93,7 +95,7 @@ def create_blueprint( *, name: str, description: str | None = None, - permissions: list[str] | None = None, + permissions: list[AgentBlueprintsCreateRequestPermission | str] | None = None, invocable_by: AgentBlueprintsCreateRequestInvocableBy | None = None, invocable_as: AgentBlueprintsCreateRequestInvocableAs | None = None, session_settings: AgentBlueprintsCreateRequestSessionSetting | None = None, @@ -106,7 +108,7 @@ def create_blueprint( Args: name: Human-readable name of the agent blueprint. description: Human-readable description of the agent blueprint. - permissions: Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment. + permissions: Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once. invocable_by: Who may mint sessions from this blueprint. invocable_as: How sessions may be minted from this blueprint. session_settings: Token and session lifetimes for sessions minted from this blueprint. @@ -185,7 +187,7 @@ def update_blueprint( *, name: str | None = None, description: str | None | NotGiven = NOT_GIVEN, - permissions: list[str] | None = None, + permissions: list[AgentBlueprintsUpdateRequestPermission | str] | None = None, invocable_by: AgentBlueprintsUpdateRequestInvocableBy | None = None, invocable_as: AgentBlueprintsUpdateRequestInvocableAs | None = None, session_settings: AgentBlueprintsUpdateRequestSessionSetting | None = None, @@ -199,7 +201,7 @@ def update_blueprint( agent_blueprint_id: The unique ID of the agent blueprint. name: Human-readable name of the agent blueprint. description: Human-readable description of the agent blueprint. Pass `null` to clear it. - permissions: Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment. + permissions: Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once. invocable_by: Who may mint sessions from this blueprint. Omitted lists are left unchanged. invocable_as: How sessions may be minted from this blueprint. Omitted lists are left unchanged. session_settings: Token and session lifetimes for sessions minted from this blueprint. Omitted fields are left unchanged. @@ -805,7 +807,7 @@ async def create_blueprint( *, name: str, description: str | None = None, - permissions: list[str] | None = None, + permissions: list[AgentBlueprintsCreateRequestPermission | str] | None = None, invocable_by: AgentBlueprintsCreateRequestInvocableBy | None = None, invocable_as: AgentBlueprintsCreateRequestInvocableAs | None = None, session_settings: AgentBlueprintsCreateRequestSessionSetting | None = None, @@ -818,7 +820,7 @@ async def create_blueprint( Args: name: Human-readable name of the agent blueprint. description: Human-readable description of the agent blueprint. - permissions: Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment. + permissions: Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once. invocable_by: Who may mint sessions from this blueprint. invocable_as: How sessions may be minted from this blueprint. session_settings: Token and session lifetimes for sessions minted from this blueprint. @@ -897,7 +899,7 @@ async def update_blueprint( *, name: str | None = None, description: str | None | NotGiven = NOT_GIVEN, - permissions: list[str] | None = None, + permissions: list[AgentBlueprintsUpdateRequestPermission | str] | None = None, invocable_by: AgentBlueprintsUpdateRequestInvocableBy | None = None, invocable_as: AgentBlueprintsUpdateRequestInvocableAs | None = None, session_settings: AgentBlueprintsUpdateRequestSessionSetting | None = None, @@ -911,7 +913,7 @@ async def update_blueprint( agent_blueprint_id: The unique ID of the agent blueprint. name: Human-readable name of the agent blueprint. description: Human-readable description of the agent blueprint. Pass `null` to clear it. - permissions: Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment. + permissions: Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once. invocable_by: Who may mint sessions from this blueprint. Omitted lists are left unchanged. invocable_as: How sessions may be minted from this blueprint. Omitted lists are left unchanged. session_settings: Token and session lifetimes for sessions minted from this blueprint. Omitted fields are left unchanged. diff --git a/src/workos/agents/models/__init__.py b/src/workos/agents/models/__init__.py index 7d039a81..ab70a7d0 100644 --- a/src/workos/agents/models/__init__.py +++ b/src/workos/agents/models/__init__.py @@ -19,6 +19,9 @@ from .agent_blueprint_invocable_by import ( AgentBlueprintInvocableBy as AgentBlueprintInvocableBy, ) +from .agent_blueprint_scoped_permission import ( + AgentBlueprintScopedPermission as AgentBlueprintScopedPermission, +) from .agent_blueprint_session_setting import ( AgentBlueprintSessionSetting as AgentBlueprintSessionSetting, ) @@ -31,6 +34,9 @@ from .agent_blueprints_create_request_invocable_by import ( AgentBlueprintsCreateRequestInvocableBy as AgentBlueprintsCreateRequestInvocableBy, ) +from .agent_blueprints_create_request_permission import ( + AgentBlueprintsCreateRequestPermission as AgentBlueprintsCreateRequestPermission, +) from .agent_blueprints_create_request_session_setting import ( AgentBlueprintsCreateRequestSessionSetting as AgentBlueprintsCreateRequestSessionSetting, ) @@ -49,6 +55,9 @@ from .agent_blueprints_update_request_invocable_by import ( AgentBlueprintsUpdateRequestInvocableBy as AgentBlueprintsUpdateRequestInvocableBy, ) +from .agent_blueprints_update_request_permission import ( + AgentBlueprintsUpdateRequestPermission as AgentBlueprintsUpdateRequestPermission, +) from .agent_blueprints_update_request_session_setting import ( AgentBlueprintsUpdateRequestSessionSetting as AgentBlueprintsUpdateRequestSessionSetting, ) diff --git a/src/workos/agents/models/agent_blueprint.py b/src/workos/agents/models/agent_blueprint.py index 922387a4..301763ff 100644 --- a/src/workos/agents/models/agent_blueprint.py +++ b/src/workos/agents/models/agent_blueprint.py @@ -10,6 +10,7 @@ from .agent_blueprint_invocable_as import AgentBlueprintInvocableAs from .agent_blueprint_invocable_by import AgentBlueprintInvocableBy +from .agent_blueprint_scoped_permission import AgentBlueprintScopedPermission from .agent_blueprint_session_setting import AgentBlueprintSessionSetting @@ -25,8 +26,8 @@ class AgentBlueprint: """Human-readable name of the agent blueprint.""" description: str | None """Human-readable description of the agent blueprint.""" - permissions: list[str] - """Permission slugs forming the ceiling on what sessions minted from this blueprint may do.""" + scoped_permissions: list[AgentBlueprintScopedPermission] + """Permissions forming the ceiling on what sessions minted from this blueprint may do, with the instance types that receive each one.""" invocable_by: AgentBlueprintInvocableBy """Who may mint sessions from this blueprint.""" invocable_as: AgentBlueprintInvocableAs @@ -37,6 +38,10 @@ class AgentBlueprint: """Timestamp when the agent blueprint was created.""" updated_at: datetime """Timestamp when the agent blueprint was last updated.""" + permissions: list[str] | None = None + """Deprecated: use `scoped_permissions`. Slugs of every permission in the ceiling, across all instance types. + + .. deprecated:: This field is deprecated.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> AgentBlueprint: @@ -47,7 +52,10 @@ def from_dict(cls, data: dict[str, Any]) -> AgentBlueprint: id=data["id"], name=data["name"], description=data["description"], - permissions=data["permissions"], + scoped_permissions=[ + AgentBlueprintScopedPermission.from_dict(cast(dict[str, Any], item)) + for item in cast(list[Any], data["scoped_permissions"]) + ], invocable_by=AgentBlueprintInvocableBy.from_dict( cast(dict[str, Any], data["invocable_by"]) ), @@ -59,6 +67,7 @@ def from_dict(cls, data: dict[str, Any]) -> AgentBlueprint: ), created_at=_parse_datetime(data["created_at"]), updated_at=_parse_datetime(data["updated_at"]), + permissions=data.get("permissions"), ) except (KeyError, ValueError) as e: _raise_deserialize_error("AgentBlueprint", e) @@ -73,10 +82,14 @@ def to_dict(self) -> dict[str, Any]: result["description"] = self.description else: result["description"] = None - result["permissions"] = self.permissions + result["scoped_permissions"] = [ + item.to_dict() for item in self.scoped_permissions + ] result["invocable_by"] = self.invocable_by.to_dict() result["invocable_as"] = self.invocable_as.to_dict() result["session_settings"] = self.session_settings.to_dict() result["created_at"] = _format_datetime(self.created_at) result["updated_at"] = _format_datetime(self.updated_at) + if self.permissions is not None: + result["permissions"] = self.permissions return result diff --git a/src/workos/agents/models/agent_blueprint_scoped_permission.py b/src/workos/agents/models/agent_blueprint_scoped_permission.py new file mode 100644 index 00000000..4077fb32 --- /dev/null +++ b/src/workos/agents/models/agent_blueprint_scoped_permission.py @@ -0,0 +1,9 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from workos.common.models.agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission, +) + +AgentBlueprintScopedPermission: TypeAlias = AgentBlueprintCreatedDataScopedPermission diff --git a/src/workos/agents/models/agent_blueprints_create_request.py b/src/workos/agents/models/agent_blueprints_create_request.py index 9ea794d2..4239bb43 100644 --- a/src/workos/agents/models/agent_blueprints_create_request.py +++ b/src/workos/agents/models/agent_blueprints_create_request.py @@ -13,6 +13,9 @@ from .agent_blueprints_create_request_invocable_by import ( AgentBlueprintsCreateRequestInvocableBy, ) +from .agent_blueprints_create_request_permission import ( + AgentBlueprintsCreateRequestPermission, +) from .agent_blueprints_create_request_session_setting import ( AgentBlueprintsCreateRequestSessionSetting, ) @@ -26,8 +29,8 @@ class AgentBlueprintsCreateRequest: """Human-readable name of the agent blueprint.""" description: str | None = None """Human-readable description of the agent blueprint.""" - permissions: list[str] | None = None - """Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment.""" + permissions: list[AgentBlueprintsCreateRequestPermission | str] | None = None + """Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once.""" invocable_by: AgentBlueprintsCreateRequestInvocableBy | None = None """Who may mint sessions from this blueprint.""" invocable_as: AgentBlueprintsCreateRequestInvocableAs | None = None diff --git a/src/workos/agents/models/agent_blueprints_create_request_permission.py b/src/workos/agents/models/agent_blueprints_create_request_permission.py new file mode 100644 index 00000000..c30a640f --- /dev/null +++ b/src/workos/agents/models/agent_blueprints_create_request_permission.py @@ -0,0 +1,11 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from workos.common.models.agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission, +) + +AgentBlueprintsCreateRequestPermission: TypeAlias = ( + AgentBlueprintCreatedDataScopedPermission +) diff --git a/src/workos/agents/models/agent_blueprints_update_request.py b/src/workos/agents/models/agent_blueprints_update_request.py index 0b54e632..7572fc73 100644 --- a/src/workos/agents/models/agent_blueprints_update_request.py +++ b/src/workos/agents/models/agent_blueprints_update_request.py @@ -13,6 +13,9 @@ from .agent_blueprints_update_request_invocable_by import ( AgentBlueprintsUpdateRequestInvocableBy, ) +from .agent_blueprints_update_request_permission import ( + AgentBlueprintsUpdateRequestPermission, +) from .agent_blueprints_update_request_session_setting import ( AgentBlueprintsUpdateRequestSessionSetting, ) @@ -26,8 +29,8 @@ class AgentBlueprintsUpdateRequest: """Human-readable name of the agent blueprint.""" description: str | None = None """Human-readable description of the agent blueprint. Pass `null` to clear it.""" - permissions: list[str] | None = None - """Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment.""" + permissions: list[AgentBlueprintsUpdateRequestPermission | str] | None = None + """Permissions forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment and may appear once.""" invocable_by: AgentBlueprintsUpdateRequestInvocableBy | None = None """Who may mint sessions from this blueprint. Omitted lists are left unchanged.""" invocable_as: AgentBlueprintsUpdateRequestInvocableAs | None = None diff --git a/src/workos/agents/models/agent_blueprints_update_request_permission.py b/src/workos/agents/models/agent_blueprints_update_request_permission.py new file mode 100644 index 00000000..2fe8b7d0 --- /dev/null +++ b/src/workos/agents/models/agent_blueprints_update_request_permission.py @@ -0,0 +1,11 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from workos.common.models.agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission, +) + +AgentBlueprintsUpdateRequestPermission: TypeAlias = ( + AgentBlueprintCreatedDataScopedPermission +) diff --git a/src/workos/audit_logs/models/audit_log_event.py b/src/workos/audit_logs/models/audit_log_event.py index fe6a20f1..9492d606 100644 --- a/src/workos/audit_logs/models/audit_log_event.py +++ b/src/workos/audit_logs/models/audit_log_event.py @@ -19,14 +19,14 @@ class AuditLogEvent: action: str """Identifier of what happened.""" - occurred_at: datetime - """ISO-8601 value of when the action occurred.""" actor: AuditLogEventActor """The entity that performed the action.""" targets: list[AuditLogEventTarget] """The resources affected by the action.""" context: AuditLogEventContext """Additional context about where and how the action occurred.""" + occurred_at: datetime | None = None + """ISO-8601 timestamp of when the action occurred. When omitted, defaults to the time WorkOS receives the event. Explicit JSON null is rejected.""" metadata: dict[str, str | float | bool] | None = None """Additional data associated with the event or entity.""" version: int | None = None @@ -38,7 +38,6 @@ def from_dict(cls, data: dict[str, Any]) -> AuditLogEvent: try: return cls( action=data["action"], - occurred_at=_parse_datetime(data["occurred_at"]), actor=AuditLogEventActor.from_dict(cast(dict[str, Any], data["actor"])), targets=[ AuditLogEventTarget.from_dict(cast(dict[str, Any], item)) @@ -47,6 +46,9 @@ def from_dict(cls, data: dict[str, Any]) -> AuditLogEvent: context=AuditLogEventContext.from_dict( cast(dict[str, Any], data["context"]) ), + occurred_at=_parse_datetime(_v_occurred_at) + if (_v_occurred_at := data.get("occurred_at")) is not None + else None, metadata=data.get("metadata"), version=data.get("version"), ) @@ -57,10 +59,11 @@ def to_dict(self) -> dict[str, Any]: """Serialize to a dictionary.""" result: dict[str, Any] = {} result["action"] = self.action - result["occurred_at"] = _format_datetime(self.occurred_at) result["actor"] = self.actor.to_dict() result["targets"] = [item.to_dict() for item in self.targets] result["context"] = self.context.to_dict() + if self.occurred_at is not None: + result["occurred_at"] = _format_datetime(self.occurred_at) if self.metadata is not None: result["metadata"] = self.metadata if self.version is not None: diff --git a/src/workos/authorization/_resource.py b/src/workos/authorization/_resource.py index 8e1b79d1..806b66ed 100644 --- a/src/workos/authorization/_resource.py +++ b/src/workos/authorization/_resource.py @@ -23,6 +23,7 @@ AuthorizationResource, GroupRoleAssignment, GroupRoleAssignmentList, + PatchRoleAssignmentEntry, Permission, ReplaceGroupRoleAssignmentEntry, Role, @@ -707,7 +708,7 @@ def assign_role( ) -> UserRoleAssignment: """Assign a role - Assign a role to an organization membership on a specific resource. + Assign a role to an organization membership on a specific resource. If the role is already assigned to the membership on that resource, the existing role assignment is returned and no changes are made. Args: organization_membership_id: The ID of the organization membership. @@ -747,6 +748,56 @@ def assign_role( request_options=request_options, ) + def update_role_assignments( + self, + organization_membership_id: str, + *, + add: list[PatchRoleAssignmentEntry] | None = None, + remove: list[PatchRoleAssignmentEntry] | None = None, + request_options: RequestOptions | None = None, + ) -> None: + """Update role assignments for an organization membership + + Add and remove role assignments for an organization membership in a single atomic operation. Each entry identifies a role and a resource, either by `resource_id` or by `resource_type_slug` and `resource_external_id`; to change an organization-level role, target the organization resource. Additions that already exist and removals that match no assignment are skipped. An assignment in both lists is rejected, as is a removal of a role granted only through a group. `add` and `remove` must contain between 1 and 100 entries combined. + + Args: + organization_membership_id: The ID of the organization membership. + add: Role assignments to add to the organization membership. Assignments that already exist are skipped. + remove: Role assignments to remove from the organization membership. Entries that match no assignment are skipped. Roles granted through a group cannot be removed. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). + NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). + UnprocessableEntityError: If the request data is unprocessable (422). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + k: v + for k, v in { + "add": [item.to_dict() for item in add] if add is not None else None, + "remove": [item.to_dict() for item in remove] + if remove is not None + else None, + }.items() + if v is not None + } + self._client.request( + method="patch", + path=( + "authorization", + "organization_memberships", + str(organization_membership_id), + "role_assignments", + ), + body=body, + request_options=request_options, + ) + def remove_role( self, organization_membership_id: str, @@ -2922,7 +2973,7 @@ async def assign_role( ) -> UserRoleAssignment: """Assign a role - Assign a role to an organization membership on a specific resource. + Assign a role to an organization membership on a specific resource. If the role is already assigned to the membership on that resource, the existing role assignment is returned and no changes are made. Args: organization_membership_id: The ID of the organization membership. @@ -2962,6 +3013,56 @@ async def assign_role( request_options=request_options, ) + async def update_role_assignments( + self, + organization_membership_id: str, + *, + add: list[PatchRoleAssignmentEntry] | None = None, + remove: list[PatchRoleAssignmentEntry] | None = None, + request_options: RequestOptions | None = None, + ) -> None: + """Update role assignments for an organization membership + + Add and remove role assignments for an organization membership in a single atomic operation. Each entry identifies a role and a resource, either by `resource_id` or by `resource_type_slug` and `resource_external_id`; to change an organization-level role, target the organization resource. Additions that already exist and removals that match no assignment are skipped. An assignment in both lists is rejected, as is a removal of a role granted only through a group. `add` and `remove` must contain between 1 and 100 entries combined. + + Args: + organization_membership_id: The ID of the organization membership. + add: Role assignments to add to the organization membership. Assignments that already exist are skipped. + remove: Role assignments to remove from the organization membership. Entries that match no assignment are skipped. Roles granted through a group cannot be removed. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + BadRequestError: If the request is malformed (400). + AuthorizationError: If the request is forbidden (403). + NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). + UnprocessableEntityError: If the request data is unprocessable (422). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + k: v + for k, v in { + "add": [item.to_dict() for item in add] if add is not None else None, + "remove": [item.to_dict() for item in remove] + if remove is not None + else None, + }.items() + if v is not None + } + await self._client.request( + method="patch", + path=( + "authorization", + "organization_memberships", + str(organization_membership_id), + "role_assignments", + ), + body=body, + request_options=request_options, + ) + async def remove_role( self, organization_membership_id: str, diff --git a/src/workos/authorization/models/__init__.py b/src/workos/authorization/models/__init__.py index 012cd369..a3e387bc 100644 --- a/src/workos/authorization/models/__init__.py +++ b/src/workos/authorization/models/__init__.py @@ -40,6 +40,10 @@ from .patch_group_role_assignments import ( PatchGroupRoleAssignments as PatchGroupRoleAssignments, ) +from .patch_role_assignment_entry import ( + PatchRoleAssignmentEntry as PatchRoleAssignmentEntry, +) +from .patch_role_assignments import PatchRoleAssignments as PatchRoleAssignments from .permission import Permission as Permission from .remove_role import RemoveRole as RemoveRole from .replace_group_role_assignment_entry import ( diff --git a/src/workos/authorization/models/patch_role_assignment_entry.py b/src/workos/authorization/models/patch_role_assignment_entry.py new file mode 100644 index 00000000..cd9d79e1 --- /dev/null +++ b/src/workos/authorization/models/patch_role_assignment_entry.py @@ -0,0 +1,7 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from .assign_role import AssignRole + +PatchRoleAssignmentEntry: TypeAlias = AssignRole diff --git a/src/workos/authorization/models/patch_role_assignments.py b/src/workos/authorization/models/patch_role_assignments.py new file mode 100644 index 00000000..3d55a39b --- /dev/null +++ b/src/workos/authorization/models/patch_role_assignments.py @@ -0,0 +1,7 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from .patch_group_role_assignments import PatchGroupRoleAssignments + +PatchRoleAssignments: TypeAlias = PatchGroupRoleAssignments diff --git a/src/workos/common/__init__.py b/src/workos/common/__init__.py index 17f12fb9..c6f2cba9 100644 --- a/src/workos/common/__init__.py +++ b/src/workos/common/__init__.py @@ -35,6 +35,15 @@ from .models import ( AgentBlueprintCreatedDataInvocableBy as AgentBlueprintCreatedDataInvocableBy, ) +from .models import ( + AgentBlueprintCreatedDataScopedPermission as AgentBlueprintCreatedDataScopedPermission, +) +from .models import ( + AgentBlueprintCreatedDataScopedPermissionInstanceTypes as AgentBlueprintCreatedDataScopedPermissionInstanceTypes, +) +from .models import ( + AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral as AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral, +) from .models import ( AgentBlueprintCreatedDataSessionSetting as AgentBlueprintCreatedDataSessionSetting, ) @@ -43,9 +52,27 @@ from .models import ( AgentBlueprintInvocableAsInstanceTypes as AgentBlueprintInvocableAsInstanceTypes, ) +from .models import ( + AgentBlueprintInvocableAsInstanceTypesLiteral as AgentBlueprintInvocableAsInstanceTypesLiteral, +) +from .models import ( + AgentBlueprintScopedPermissionInstanceTypes as AgentBlueprintScopedPermissionInstanceTypes, +) +from .models import ( + AgentBlueprintScopedPermissionInstanceTypesLiteral as AgentBlueprintScopedPermissionInstanceTypesLiteral, +) from .models import ( AgentBlueprintsCreateRequestInvocableAsInstanceTypes as AgentBlueprintsCreateRequestInvocableAsInstanceTypes, ) +from .models import ( + AgentBlueprintsCreateRequestInvocableAsInstanceTypesLiteral as AgentBlueprintsCreateRequestInvocableAsInstanceTypesLiteral, +) +from .models import ( + AgentBlueprintsCreateRequestPermissionInstanceTypes as AgentBlueprintsCreateRequestPermissionInstanceTypes, +) +from .models import ( + AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral as AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral, +) from .models import ( AgentBlueprintsTokenMintTokenRequestType as AgentBlueprintsTokenMintTokenRequestType, ) @@ -55,6 +82,15 @@ from .models import ( AgentBlueprintsUpdateRequestInvocableAsInstanceTypes as AgentBlueprintsUpdateRequestInvocableAsInstanceTypes, ) +from .models import ( + AgentBlueprintsUpdateRequestInvocableAsInstanceTypesLiteral as AgentBlueprintsUpdateRequestInvocableAsInstanceTypesLiteral, +) +from .models import ( + AgentBlueprintsUpdateRequestPermissionInstanceTypes as AgentBlueprintsUpdateRequestPermissionInstanceTypes, +) +from .models import ( + AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral as AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral, +) from .models import AgentBlueprintUpdated as AgentBlueprintUpdated from .models import AgentBlueprintUpdatedData as AgentBlueprintUpdatedData from .models import ( @@ -63,18 +99,36 @@ from .models import ( AgentBlueprintUpdatedDataInvocableAsInstanceTypes as AgentBlueprintUpdatedDataInvocableAsInstanceTypes, ) +from .models import ( + AgentBlueprintUpdatedDataInvocableAsInstanceTypesLiteral as AgentBlueprintUpdatedDataInvocableAsInstanceTypesLiteral, +) from .models import ( AgentBlueprintUpdatedDataInvocableBy as AgentBlueprintUpdatedDataInvocableBy, ) +from .models import ( + AgentBlueprintUpdatedDataScopedPermission as AgentBlueprintUpdatedDataScopedPermission, +) +from .models import ( + AgentBlueprintUpdatedDataScopedPermissionInstanceTypes as AgentBlueprintUpdatedDataScopedPermissionInstanceTypes, +) +from .models import ( + AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral as AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral, +) from .models import ( AgentBlueprintUpdatedDataSessionSetting as AgentBlueprintUpdatedDataSessionSetting, ) from .models import AgentInstanceCreated as AgentInstanceCreated from .models import AgentInstanceCreatedData as AgentInstanceCreatedData from .models import AgentInstanceCreatedDataType as AgentInstanceCreatedDataType +from .models import ( + AgentInstanceCreatedDataTypeLiteral as AgentInstanceCreatedDataTypeLiteral, +) from .models import AgentInstanceDeleted as AgentInstanceDeleted from .models import AgentInstanceDeletedData as AgentInstanceDeletedData from .models import AgentInstanceDeletedDataType as AgentInstanceDeletedDataType +from .models import ( + AgentInstanceDeletedDataTypeLiteral as AgentInstanceDeletedDataTypeLiteral, +) from .models import AgentInstanceSessionCreated as AgentInstanceSessionCreated from .models import AgentInstanceSessionCreatedData as AgentInstanceSessionCreatedData from .models import AgentInstanceSessionRevoked as AgentInstanceSessionRevoked @@ -84,6 +138,7 @@ AgentInstanceSessionStatusLiteral as AgentInstanceSessionStatusLiteral, ) from .models import AgentInstanceType as AgentInstanceType +from .models import AgentInstanceTypeLiteral as AgentInstanceTypeLiteral from .models import ( AgentRegistrationClaimAttemptCreated as AgentRegistrationClaimAttemptCreated, ) @@ -132,6 +187,7 @@ from .models import AgentRegistrationExpired as AgentRegistrationExpired from .models import AgentRegistrationExpiredData as AgentRegistrationExpiredData from .models import AgentRegistrationKind as AgentRegistrationKind +from .models import AgentRegistrationKindLiteral as AgentRegistrationKindLiteral from .models import ( AgentRegistrationOrganizationSwitched as AgentRegistrationOrganizationSwitched, ) @@ -143,6 +199,7 @@ from .models import AgentRegistrationRevoked as AgentRegistrationRevoked from .models import AgentRegistrationRevokedData as AgentRegistrationRevokedData from .models import AgentRegistrationStatus as AgentRegistrationStatus +from .models import AgentRegistrationStatusLiteral as AgentRegistrationStatusLiteral from .models import AlreadyClaimedErrorBody as AlreadyClaimedErrorBody from .models import ApiKeyCreated as ApiKeyCreated from .models import ApiKeyCreatedData as ApiKeyCreatedData @@ -162,6 +219,19 @@ from .models import ( ApplicationConsentRequiredErrorBody as ApplicationConsentRequiredErrorBody, ) +from .models import ApplicationTokenExchangeFailed as ApplicationTokenExchangeFailed +from .models import ( + ApplicationTokenExchangeFailedData as ApplicationTokenExchangeFailedData, +) +from .models import ( + ApplicationTokenExchangeFailedDataError as ApplicationTokenExchangeFailedDataError, +) +from .models import ( + ApplicationTokenExchangeSucceeded as ApplicationTokenExchangeSucceeded, +) +from .models import ( + ApplicationTokenExchangeSucceededData as ApplicationTokenExchangeSucceededData, +) from .models import ( AuditLogConfigurationLogStreamState as AuditLogConfigurationLogStreamState, ) @@ -220,6 +290,7 @@ from .models import AuthenticationFactorSms as AuthenticationFactorSms from .models import AuthenticationFactorTotp as AuthenticationFactorTotp from .models import AuthenticationFactorType as AuthenticationFactorType +from .models import AuthenticationFactorTypeLiteral as AuthenticationFactorTypeLiteral from .models import AuthenticationMagicAuthFailed as AuthenticationMagicAuthFailed from .models import ( AuthenticationMagicAuthFailedData as AuthenticationMagicAuthFailedData, @@ -323,7 +394,11 @@ from .models import ( AuthorizationUrlRequestErrorBodyCodeLiteral as AuthorizationUrlRequestErrorBodyCodeLiteral, ) +from .models import BlockedTld as BlockedTld +from .models import BotDetection as BotDetection +from .models import BruteForceAttack as BruteForceAttack from .models import ClaimViewResponseStatus as ClaimViewResponseStatus +from .models import ClaimViewResponseStatusLiteral as ClaimViewResponseStatusLiteral from .models import ( ClientCredentialsDataIntegrationVendedCredential as ClientCredentialsDataIntegrationVendedCredential, ) @@ -398,15 +473,30 @@ from .models import ( ConnectionDeactivatedDataConnectionType as ConnectionDeactivatedDataConnectionType, ) +from .models import ( + ConnectionDeactivatedDataConnectionTypeLiteral as ConnectionDeactivatedDataConnectionTypeLiteral, +) from .models import ConnectionDeactivatedDataDomain as ConnectionDeactivatedDataDomain from .models import ConnectionDeactivatedDataState as ConnectionDeactivatedDataState +from .models import ( + ConnectionDeactivatedDataStateLiteral as ConnectionDeactivatedDataStateLiteral, +) from .models import ConnectionDeactivatedDataStatus as ConnectionDeactivatedDataStatus +from .models import ( + ConnectionDeactivatedDataStatusLiteral as ConnectionDeactivatedDataStatusLiteral, +) from .models import ConnectionDeleted as ConnectionDeleted from .models import ConnectionDeletedData as ConnectionDeletedData from .models import ( ConnectionDeletedDataConnectionType as ConnectionDeletedDataConnectionType, ) +from .models import ( + ConnectionDeletedDataConnectionTypeLiteral as ConnectionDeletedDataConnectionTypeLiteral, +) from .models import ConnectionDeletedDataState as ConnectionDeletedDataState +from .models import ( + ConnectionDeletedDataStateLiteral as ConnectionDeletedDataStateLiteral, +) from .models import ConnectionFinishErrorBody as ConnectionFinishErrorBody from .models import ConnectionFinishErrorBodyCode as ConnectionFinishErrorBodyCode from .models import ( @@ -440,9 +530,30 @@ from .models import ( ConnectionSAMLCertificateRenewedDataCertificateCertificateType as ConnectionSAMLCertificateRenewedDataCertificateCertificateType, ) +from .models import ( + ConnectionSAMLCertificateRenewedDataCertificateCertificateTypeLiteral as ConnectionSAMLCertificateRenewedDataCertificateCertificateTypeLiteral, +) from .models import ( ConnectionSAMLCertificateRenewedDataConnection as ConnectionSAMLCertificateRenewedDataConnection, ) +from .models import ( + ConnectionSAMLCertificateReplaced as ConnectionSAMLCertificateReplaced, +) +from .models import ( + ConnectionSAMLCertificateReplacedData as ConnectionSAMLCertificateReplacedData, +) +from .models import ( + ConnectionSAMLCertificateReplacedDataCertificate as ConnectionSAMLCertificateReplacedDataCertificate, +) +from .models import ( + ConnectionSAMLCertificateReplacedDataCertificateCertificateType as ConnectionSAMLCertificateReplacedDataCertificateCertificateType, +) +from .models import ( + ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral as ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral, +) +from .models import ( + ConnectionSAMLCertificateReplacedDataConnection as ConnectionSAMLCertificateReplacedDataConnection, +) from .models import ConnectionState as ConnectionState from .models import ConnectionStateLiteral as ConnectionStateLiteral from .models import ConnectionStatus as ConnectionStatus @@ -452,7 +563,11 @@ from .models import ( ConnectionTypeNotUpdatableErrorBody as ConnectionTypeNotUpdatableErrorBody, ) +from .models import CreateApplicationSecret as CreateApplicationSecret from .models import CreateConnectedAccountState as CreateConnectedAccountState +from .models import ( + CreateConnectedAccountStateLiteral as CreateConnectedAccountStateLiteral, +) from .models import ( CreateConnectionOIDCOptionsIdTokenSignatureAlgorithm as CreateConnectionOIDCOptionsIdTokenSignatureAlgorithm, ) @@ -466,6 +581,9 @@ CreateConnectionOIDCOptionsTokenAuthenticationMethodLiteral as CreateConnectionOIDCOptionsTokenAuthenticationMethodLiteral, ) from .models import CreateDataIntegrationAuthMethods as CreateDataIntegrationAuthMethods +from .models import ( + CreateDataIntegrationAuthMethodsLiteral as CreateDataIntegrationAuthMethodsLiteral, +) from .models import CreateDataIntegrationOwnership as CreateDataIntegrationOwnership from .models import ( CreateDataIntegrationOwnershipLiteral as CreateDataIntegrationOwnershipLiteral, @@ -477,8 +595,17 @@ from .models import ( CreateOrganizationConnectedAccountState as CreateOrganizationConnectedAccountState, ) +from .models import ( + CreateOrganizationConnectedAccountStateLiteral as CreateOrganizationConnectedAccountStateLiteral, +) from .models import CreatePasswordResetTokenLocale as CreatePasswordResetTokenLocale +from .models import ( + CreatePasswordResetTokenLocaleLiteral as CreatePasswordResetTokenLocaleLiteral, +) from .models import CreateUserInviteOptionsLocale as CreateUserInviteOptionsLocale +from .models import ( + CreateUserInviteOptionsLocaleLiteral as CreateUserInviteOptionsLocaleLiteral, +) from .models import CreateUserPasswordHashType as CreateUserPasswordHashType from .models import ( CreateUserPasswordHashTypeLiteral as CreateUserPasswordHashTypeLiteral, @@ -519,7 +646,13 @@ from .models import ( DataIntegrationAccessTokenResponseWithErrorError as DataIntegrationAccessTokenResponseWithErrorError, ) +from .models import ( + DataIntegrationAccessTokenResponseWithErrorErrorLiteral as DataIntegrationAccessTokenResponseWithErrorErrorLiteral, +) from .models import DataIntegrationAuthMethods as DataIntegrationAuthMethods +from .models import ( + DataIntegrationAuthMethodsLiteral as DataIntegrationAuthMethodsLiteral, +) from .models import ( DataIntegrationCredentialsCredentialsType as DataIntegrationCredentialsCredentialsType, ) @@ -529,9 +662,15 @@ from .models import ( DataIntegrationCredentialsInputType as DataIntegrationCredentialsInputType, ) +from .models import ( + DataIntegrationCredentialsInputTypeLiteral as DataIntegrationCredentialsInputTypeLiteral, +) from .models import ( DataIntegrationCredentialsResponseError as DataIntegrationCredentialsResponseError, ) +from .models import ( + DataIntegrationCredentialsResponseErrorLiteral as DataIntegrationCredentialsResponseErrorLiteral, +) from .models import ( DataIntegrationCredentialsResponseWithCredential as DataIntegrationCredentialsResponseWithCredential, ) @@ -541,6 +680,9 @@ from .models import ( DataIntegrationCredentialsResponseWithErrorError as DataIntegrationCredentialsResponseWithErrorError, ) +from .models import ( + DataIntegrationCredentialsResponseWithErrorErrorLiteral as DataIntegrationCredentialsResponseWithErrorErrorLiteral, +) from .models import DataIntegrationCredentialType as DataIntegrationCredentialType from .models import ( DataIntegrationCredentialTypeLiteral as DataIntegrationCredentialTypeLiteral, @@ -548,16 +690,29 @@ from .models import ( DataIntegrationCustomProviderAuthenticateVia as DataIntegrationCustomProviderAuthenticateVia, ) +from .models import ( + DataIntegrationCustomProviderAuthenticateViaLiteral as DataIntegrationCustomProviderAuthenticateViaLiteral, +) from .models import ( DataIntegrationInstallationConnectionRole as DataIntegrationInstallationConnectionRole, ) +from .models import ( + DataIntegrationInstallationConnectionRoleLiteral as DataIntegrationInstallationConnectionRoleLiteral, +) from .models import DataIntegrationOwnership as DataIntegrationOwnership +from .models import DataIntegrationOwnershipLiteral as DataIntegrationOwnershipLiteral from .models import ( DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner as DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner, ) +from .models import ( + DataIntegrationsCreateApiKeyConnectionRequestConnectionOwnerLiteral as DataIntegrationsCreateApiKeyConnectionRequestConnectionOwnerLiteral, +) from .models import ( DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner as DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner, ) +from .models import ( + DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwnerLiteral as DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwnerLiteral, +) from .models import ( DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionIntent as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionIntent, ) @@ -567,32 +722,53 @@ from .models import ( DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner, ) +from .models import ( + DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwnerLiteral as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwnerLiteral, +) from .models import ( DataIntegrationsGetUserTokenRequestConnectionOwner as DataIntegrationsGetUserTokenRequestConnectionOwner, ) +from .models import ( + DataIntegrationsGetUserTokenRequestConnectionOwnerLiteral as DataIntegrationsGetUserTokenRequestConnectionOwnerLiteral, +) from .models import DataIntegrationsListResponse as DataIntegrationsListResponse from .models import DataIntegrationsListResponseData as DataIntegrationsListResponseData from .models import ( DataIntegrationsListResponseDataAuthMethods as DataIntegrationsListResponseDataAuthMethods, ) +from .models import ( + DataIntegrationsListResponseDataAuthMethodsLiteral as DataIntegrationsListResponseDataAuthMethodsLiteral, +) from .models import ( DataIntegrationsListResponseDataConnectedAccount as DataIntegrationsListResponseDataConnectedAccount, ) from .models import ( DataIntegrationsListResponseDataConnectedAccountAuthMethod as DataIntegrationsListResponseDataConnectedAccountAuthMethod, ) +from .models import ( + DataIntegrationsListResponseDataConnectedAccountAuthMethodLiteral as DataIntegrationsListResponseDataConnectedAccountAuthMethodLiteral, +) from .models import ( DataIntegrationsListResponseDataConnectedAccountConnectionRole as DataIntegrationsListResponseDataConnectedAccountConnectionRole, ) +from .models import ( + DataIntegrationsListResponseDataConnectedAccountConnectionRoleLiteral as DataIntegrationsListResponseDataConnectedAccountConnectionRoleLiteral, +) from .models import ( DataIntegrationsListResponseDataConnectedAccountState as DataIntegrationsListResponseDataConnectedAccountState, ) +from .models import ( + DataIntegrationsListResponseDataConnectedAccountStateLiteral as DataIntegrationsListResponseDataConnectedAccountStateLiteral, +) from .models import ( DataIntegrationsListResponseDataConnectedAccountWarning as DataIntegrationsListResponseDataConnectedAccountWarning, ) from .models import ( DataIntegrationsListResponseDataConnectionOwner as DataIntegrationsListResponseDataConnectionOwner, ) +from .models import ( + DataIntegrationsListResponseDataConnectionOwnerLiteral as DataIntegrationsListResponseDataConnectionOwnerLiteral, +) from .models import ( DataIntegrationsListResponseDataOwnership as DataIntegrationsListResponseDataOwnership, ) @@ -604,16 +780,28 @@ from .models import ( DataIntegrationsUpsertApiKeyRequestConnectionOwner as DataIntegrationsUpsertApiKeyRequestConnectionOwner, ) +from .models import ( + DataIntegrationsUpsertApiKeyRequestConnectionOwnerLiteral as DataIntegrationsUpsertApiKeyRequestConnectionOwnerLiteral, +) from .models import ( DataIntegrationsUpsertClientCredentialsRequestConnectionOwner as DataIntegrationsUpsertClientCredentialsRequestConnectionOwner, ) +from .models import ( + DataIntegrationsUpsertClientCredentialsRequestConnectionOwnerLiteral as DataIntegrationsUpsertClientCredentialsRequestConnectionOwnerLiteral, +) from .models import ( DataIntegrationsVendCredentialsRequestConnectionOwner as DataIntegrationsVendCredentialsRequestConnectionOwner, ) +from .models import ( + DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral as DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral, +) from .models import DataIntegrationVendedCredential as DataIntegrationVendedCredential from .models import ( DataIntegrationVendedCredentialAuthMethod as DataIntegrationVendedCredentialAuthMethod, ) +from .models import ( + DataIntegrationVendedCredentialAuthMethodLiteral as DataIntegrationVendedCredentialAuthMethodLiteral, +) from .models import ( DataIntegrationVendedCredentialUnknown as DataIntegrationVendedCredentialUnknown, ) @@ -631,6 +819,10 @@ from .models import DirectoryUserState as DirectoryUserState from .models import DirectoryUserStateLiteral as DirectoryUserStateLiteral from .models import DirectoryUserWithGroupsState as DirectoryUserWithGroupsState +from .models import ( + DirectoryUserWithGroupsStateLiteral as DirectoryUserWithGroupsStateLiteral, +) +from .models import DomainProtections as DomainProtections from .models import DsyncActivated as DsyncActivated from .models import DsyncActivatedData as DsyncActivatedData from .models import DsyncActivatedDataDomain as DsyncActivatedDataDomain @@ -641,7 +833,9 @@ from .models import DsyncDeleted as DsyncDeleted from .models import DsyncDeletedData as DsyncDeletedData from .models import DsyncDeletedDataState as DsyncDeletedDataState +from .models import DsyncDeletedDataStateLiteral as DsyncDeletedDataStateLiteral from .models import DsyncDeletedDataType as DsyncDeletedDataType +from .models import DsyncDeletedDataTypeLiteral as DsyncDeletedDataTypeLiteral from .models import DsyncGroupCreated as DsyncGroupCreated from .models import DsyncGroupDeleted as DsyncGroupDeleted from .models import DsyncGroupUpdated as DsyncGroupUpdated @@ -660,6 +854,7 @@ from .models import DsyncUserUpdatedData as DsyncUserUpdatedData from .models import DsyncUserUpdatedDataEmail as DsyncUserUpdatedDataEmail from .models import DsyncUserUpdatedDataState as DsyncUserUpdatedDataState +from .models import DsyncUserUpdatedDataStateLiteral as DsyncUserUpdatedDataStateLiteral from .models import EmailAlreadyInUseErrorBody as EmailAlreadyInUseErrorBody from .models import EmailAlreadyVerifiedErrorBody as EmailAlreadyVerifiedErrorBody from .models import EmailChangeNotAllowedErrorBody as EmailChangeNotAllowedErrorBody @@ -679,6 +874,12 @@ EmailVerificationRequiredErrorBody as EmailVerificationRequiredErrorBody, ) from .models import EntityNotFoundErrorBody as EntityNotFoundErrorBody +from .models import ( + EntityNotFoundErrorBodyWithEntityId as EntityNotFoundErrorBodyWithEntityId, +) +from .models import ( + EntityNotFoundErrorBodyWithIdsList as EntityNotFoundErrorBodyWithIdsList, +) from .models import ErrorBody as ErrorBody from .models import ErrorBodyCode as ErrorBodyCode from .models import ErrorBodyCodeLiteral as ErrorBodyCodeLiteral @@ -730,6 +931,9 @@ from .models import ( FeatureFlagsFlagCreatedContextActorSource as FeatureFlagsFlagCreatedContextActorSource, ) +from .models import ( + FeatureFlagsFlagCreatedContextActorSourceLiteral as FeatureFlagsFlagCreatedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagCreatedData as FeatureFlagsFlagCreatedData from .models import FeatureFlagsFlagCreatedDataOwner as FeatureFlagsFlagCreatedDataOwner from .models import FeatureFlagsFlagDeleted as FeatureFlagsFlagDeleted @@ -740,6 +944,9 @@ from .models import ( FeatureFlagsFlagDeletedContextActorSource as FeatureFlagsFlagDeletedContextActorSource, ) +from .models import ( + FeatureFlagsFlagDeletedContextActorSourceLiteral as FeatureFlagsFlagDeletedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagDeletedData as FeatureFlagsFlagDeletedData from .models import FeatureFlagsFlagDeletedDataOwner as FeatureFlagsFlagDeletedDataOwner from .models import FeatureFlagsFlagRuleCreated as FeatureFlagsFlagRuleCreated @@ -752,6 +959,9 @@ from .models import ( FeatureFlagsFlagRuleCreatedContextActorSource as FeatureFlagsFlagRuleCreatedContextActorSource, ) +from .models import ( + FeatureFlagsFlagRuleCreatedContextActorSourceLiteral as FeatureFlagsFlagRuleCreatedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagRuleDeleted as FeatureFlagsFlagRuleDeleted from .models import ( FeatureFlagsFlagRuleDeletedContext as FeatureFlagsFlagRuleDeletedContext, @@ -762,6 +972,9 @@ from .models import ( FeatureFlagsFlagRuleDeletedContextActorSource as FeatureFlagsFlagRuleDeletedContextActorSource, ) +from .models import ( + FeatureFlagsFlagRuleDeletedContextActorSourceLiteral as FeatureFlagsFlagRuleDeletedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagRuleUpdated as FeatureFlagsFlagRuleUpdated from .models import ( FeatureFlagsFlagRuleUpdatedContext as FeatureFlagsFlagRuleUpdatedContext, @@ -772,6 +985,9 @@ from .models import ( FeatureFlagsFlagRuleUpdatedContextActorSource as FeatureFlagsFlagRuleUpdatedContextActorSource, ) +from .models import ( + FeatureFlagsFlagRuleUpdatedContextActorSourceLiteral as FeatureFlagsFlagRuleUpdatedContextActorSourceLiteral, +) from .models import ( FeatureFlagsFlagRuleUpdatedContextPreviousAttribute as FeatureFlagsFlagRuleUpdatedContextPreviousAttribute, ) @@ -788,6 +1004,9 @@ from .models import ( FeatureFlagsFlagTargetCreatedContextActorSource as FeatureFlagsFlagTargetCreatedContextActorSource, ) +from .models import ( + FeatureFlagsFlagTargetCreatedContextActorSourceLiteral as FeatureFlagsFlagTargetCreatedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagTargetDeleted as FeatureFlagsFlagTargetDeleted from .models import ( FeatureFlagsFlagTargetDeletedContext as FeatureFlagsFlagTargetDeletedContext, @@ -798,6 +1017,9 @@ from .models import ( FeatureFlagsFlagTargetDeletedContextActorSource as FeatureFlagsFlagTargetDeletedContextActorSource, ) +from .models import ( + FeatureFlagsFlagTargetDeletedContextActorSourceLiteral as FeatureFlagsFlagTargetDeletedContextActorSourceLiteral, +) from .models import FeatureFlagsFlagUpdated as FeatureFlagsFlagUpdated from .models import FeatureFlagsFlagUpdatedContext as FeatureFlagsFlagUpdatedContext from .models import ( @@ -806,6 +1028,9 @@ from .models import ( FeatureFlagsFlagUpdatedContextActorSource as FeatureFlagsFlagUpdatedContextActorSource, ) +from .models import ( + FeatureFlagsFlagUpdatedContextActorSourceLiteral as FeatureFlagsFlagUpdatedContextActorSourceLiteral, +) from .models import ( FeatureFlagsFlagUpdatedContextPreviousAttribute as FeatureFlagsFlagUpdatedContextPreviousAttribute, ) @@ -822,12 +1047,18 @@ from .models import FlagCreatedContext as FlagCreatedContext from .models import FlagCreatedContextActor as FlagCreatedContextActor from .models import FlagCreatedContextActorSource as FlagCreatedContextActorSource +from .models import ( + FlagCreatedContextActorSourceLiteral as FlagCreatedContextActorSourceLiteral, +) from .models import FlagCreatedData as FlagCreatedData from .models import FlagCreatedDataOwner as FlagCreatedDataOwner from .models import FlagDeleted as FlagDeleted from .models import FlagDeletedContext as FlagDeletedContext from .models import FlagDeletedContextActor as FlagDeletedContextActor from .models import FlagDeletedContextActorSource as FlagDeletedContextActorSource +from .models import ( + FlagDeletedContextActorSourceLiteral as FlagDeletedContextActorSourceLiteral, +) from .models import FlagDeletedData as FlagDeletedData from .models import FlagDeletedDataOwner as FlagDeletedDataOwner from .models import FlagOwner as FlagOwner @@ -842,6 +1073,9 @@ from .models import ( FlagRuleUpdatedContextActorSource as FlagRuleUpdatedContextActorSource, ) +from .models import ( + FlagRuleUpdatedContextActorSourceLiteral as FlagRuleUpdatedContextActorSourceLiteral, +) from .models import ( FlagRuleUpdatedContextConfiguredTarget as FlagRuleUpdatedContextConfiguredTarget, ) @@ -860,6 +1094,9 @@ from .models import ( FlagRuleUpdatedContextPreviousAttributeContextAccessType as FlagRuleUpdatedContextPreviousAttributeContextAccessType, ) +from .models import ( + FlagRuleUpdatedContextPreviousAttributeContextAccessTypeLiteral as FlagRuleUpdatedContextPreviousAttributeContextAccessTypeLiteral, +) from .models import ( FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget as FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget, ) @@ -881,6 +1118,9 @@ from .models import FlagUpdatedContext as FlagUpdatedContext from .models import FlagUpdatedContextActor as FlagUpdatedContextActor from .models import FlagUpdatedContextActorSource as FlagUpdatedContextActorSource +from .models import ( + FlagUpdatedContextActorSourceLiteral as FlagUpdatedContextActorSourceLiteral, +) from .models import ( FlagUpdatedContextPreviousAttribute as FlagUpdatedContextPreviousAttribute, ) @@ -903,6 +1143,7 @@ from .models import GroupMemberRemovedData as GroupMemberRemovedData from .models import GroupUpdated as GroupUpdated from .models import IdpMetadataFetchFailedErrorBody as IdpMetadataFetchFailedErrorBody +from .models import ImpossibleTravel as ImpossibleTravel from .models import InvalidClientOAuthErrorBody as InvalidClientOAuthErrorBody from .models import InvalidConnectionOAuthErrorBody as InvalidConnectionOAuthErrorBody from .models import InvalidCredentialsErrorBody as InvalidCredentialsErrorBody @@ -943,16 +1184,28 @@ from .models import InvitationCreated as InvitationCreated from .models import InvitationCreatedData as InvitationCreatedData from .models import InvitationCreatedDataState as InvitationCreatedDataState +from .models import ( + InvitationCreatedDataStateLiteral as InvitationCreatedDataStateLiteral, +) from .models import InvitationInvalidOAuthErrorBody as InvitationInvalidOAuthErrorBody from .models import InvitationResent as InvitationResent from .models import InvitationResentData as InvitationResentData from .models import InvitationResentDataState as InvitationResentDataState +from .models import InvitationResentDataStateLiteral as InvitationResentDataStateLiteral from .models import InvitationRevoked as InvitationRevoked from .models import InvitationRevokedData as InvitationRevokedData from .models import InvitationRevokedDataState as InvitationRevokedDataState +from .models import ( + InvitationRevokedDataStateLiteral as InvitationRevokedDataStateLiteral, +) from .models import InvitationState as InvitationState +from .models import InvitationStateLiteral as InvitationStateLiteral from .models import InviteItContactIntents as InviteItContactIntents from .models import InviteItContactIntentsLiteral as InviteItContactIntentsLiteral +from .models import IssuerTrust as IssuerTrust +from .models import IssuerTrustCreated as IssuerTrustCreated +from .models import IssuerTrustDeleted as IssuerTrustDeleted +from .models import IssuerTrustUpdated as IssuerTrustUpdated from .models import ListMetadata as ListMetadata from .models import MagicAuthCreated as MagicAuthCreated from .models import MagicAuthCreatedData as MagicAuthCreatedData @@ -963,6 +1216,7 @@ from .models import ( MustUseSSOForSelectedOrganizationMessageErrorBody as MustUseSSOForSelectedOrganizationMessageErrorBody, ) +from .models import NormalizedEmail as NormalizedEmail from .models import ( OAuthDataIntegrationVendedCredential as OAuthDataIntegrationVendedCredential, ) @@ -989,6 +1243,9 @@ from .models import ( OrganizationConnectedAccountState as OrganizationConnectedAccountState, ) +from .models import ( + OrganizationConnectedAccountStateLiteral as OrganizationConnectedAccountStateLiteral, +) from .models import OrganizationCreated as OrganizationCreated from .models import OrganizationCreatedData as OrganizationCreatedData from .models import OrganizationCreatedDataDomain as OrganizationCreatedDataDomain @@ -1010,18 +1267,30 @@ from .models import ( OrganizationDeletedDataDomainState as OrganizationDeletedDataDomainState, ) +from .models import ( + OrganizationDeletedDataDomainStateLiteral as OrganizationDeletedDataDomainStateLiteral, +) from .models import ( OrganizationDeletedDataDomainVerificationStrategy as OrganizationDeletedDataDomainVerificationStrategy, ) +from .models import ( + OrganizationDeletedDataDomainVerificationStrategyLiteral as OrganizationDeletedDataDomainVerificationStrategyLiteral, +) from .models import OrganizationDomain as OrganizationDomain from .models import OrganizationDomainCreated as OrganizationDomainCreated from .models import OrganizationDomainCreatedData as OrganizationDomainCreatedData from .models import ( OrganizationDomainCreatedDataState as OrganizationDomainCreatedDataState, ) +from .models import ( + OrganizationDomainCreatedDataStateLiteral as OrganizationDomainCreatedDataStateLiteral, +) from .models import ( OrganizationDomainCreatedDataVerificationStrategy as OrganizationDomainCreatedDataVerificationStrategy, ) +from .models import ( + OrganizationDomainCreatedDataVerificationStrategyLiteral as OrganizationDomainCreatedDataVerificationStrategyLiteral, +) from .models import OrganizationDomainDataState as OrganizationDomainDataState from .models import ( OrganizationDomainDataStateLiteral as OrganizationDomainDataStateLiteral, @@ -1031,18 +1300,31 @@ from .models import ( OrganizationDomainDeletedDataState as OrganizationDomainDeletedDataState, ) +from .models import ( + OrganizationDomainDeletedDataStateLiteral as OrganizationDomainDeletedDataStateLiteral, +) from .models import ( OrganizationDomainDeletedDataVerificationStrategy as OrganizationDomainDeletedDataVerificationStrategy, ) +from .models import ( + OrganizationDomainDeletedDataVerificationStrategyLiteral as OrganizationDomainDeletedDataVerificationStrategyLiteral, +) from .models import OrganizationDomainState as OrganizationDomainState +from .models import OrganizationDomainStateLiteral as OrganizationDomainStateLiteral from .models import OrganizationDomainUpdated as OrganizationDomainUpdated from .models import OrganizationDomainUpdatedData as OrganizationDomainUpdatedData from .models import ( OrganizationDomainUpdatedDataState as OrganizationDomainUpdatedDataState, ) +from .models import ( + OrganizationDomainUpdatedDataStateLiteral as OrganizationDomainUpdatedDataStateLiteral, +) from .models import ( OrganizationDomainUpdatedDataVerificationStrategy as OrganizationDomainUpdatedDataVerificationStrategy, ) +from .models import ( + OrganizationDomainUpdatedDataVerificationStrategyLiteral as OrganizationDomainUpdatedDataVerificationStrategyLiteral, +) from .models import ( OrganizationDomainVerificationFailed as OrganizationDomainVerificationFailed, ) @@ -1055,9 +1337,15 @@ from .models import ( OrganizationDomainVerificationFailedDataOrganizationDomainState as OrganizationDomainVerificationFailedDataOrganizationDomainState, ) +from .models import ( + OrganizationDomainVerificationFailedDataOrganizationDomainStateLiteral as OrganizationDomainVerificationFailedDataOrganizationDomainStateLiteral, +) from .models import ( OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategy as OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategy, ) +from .models import ( + OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategyLiteral as OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategyLiteral, +) from .models import ( OrganizationDomainVerificationFailedDataReason as OrganizationDomainVerificationFailedDataReason, ) @@ -1067,14 +1355,23 @@ from .models import ( OrganizationDomainVerificationStrategy as OrganizationDomainVerificationStrategy, ) +from .models import ( + OrganizationDomainVerificationStrategyLiteral as OrganizationDomainVerificationStrategyLiteral, +) from .models import OrganizationDomainVerified as OrganizationDomainVerified from .models import OrganizationDomainVerifiedData as OrganizationDomainVerifiedData from .models import ( OrganizationDomainVerifiedDataState as OrganizationDomainVerifiedDataState, ) +from .models import ( + OrganizationDomainVerifiedDataStateLiteral as OrganizationDomainVerifiedDataStateLiteral, +) from .models import ( OrganizationDomainVerifiedDataVerificationStrategy as OrganizationDomainVerifiedDataVerificationStrategy, ) +from .models import ( + OrganizationDomainVerifiedDataVerificationStrategyLiteral as OrganizationDomainVerifiedDataVerificationStrategyLiteral, +) from .models import OrganizationMembershipCreated as OrganizationMembershipCreated from .models import ( OrganizationMembershipCreatedData as OrganizationMembershipCreatedData, @@ -1092,10 +1389,16 @@ from .models import ( OrganizationMembershipDeletedDataStatus as OrganizationMembershipDeletedDataStatus, ) +from .models import ( + OrganizationMembershipDeletedDataStatusLiteral as OrganizationMembershipDeletedDataStatusLiteral, +) from .models import ( OrganizationMembershipNotFoundOAuthErrorBody as OrganizationMembershipNotFoundOAuthErrorBody, ) from .models import OrganizationMembershipStatus as OrganizationMembershipStatus +from .models import ( + OrganizationMembershipStatusLiteral as OrganizationMembershipStatusLiteral, +) from .models import OrganizationMembershipUpdated as OrganizationMembershipUpdated from .models import ( OrganizationMembershipUpdatedData as OrganizationMembershipUpdatedData, @@ -1103,6 +1406,9 @@ from .models import ( OrganizationMembershipUpdatedDataStatus as OrganizationMembershipUpdatedDataStatus, ) +from .models import ( + OrganizationMembershipUpdatedDataStatusLiteral as OrganizationMembershipUpdatedDataStatusLiteral, +) from .models import ( OrganizationNotFoundOAuthErrorBody as OrganizationNotFoundOAuthErrorBody, ) @@ -1127,9 +1433,15 @@ from .models import ( OrganizationUpdatedDataDomainState as OrganizationUpdatedDataDomainState, ) +from .models import ( + OrganizationUpdatedDataDomainStateLiteral as OrganizationUpdatedDataDomainStateLiteral, +) from .models import ( OrganizationUpdatedDataDomainVerificationStrategy as OrganizationUpdatedDataDomainVerificationStrategy, ) +from .models import ( + OrganizationUpdatedDataDomainVerificationStrategyLiteral as OrganizationUpdatedDataDomainVerificationStrategyLiteral, +) from .models import PaginationOrder as PaginationOrder from .models import PaginationOrderLiteral as PaginationOrderLiteral from .models import ( @@ -1172,10 +1484,17 @@ from .models import PhoneNumberRequiredErrorBody as PhoneNumberRequiredErrorBody from .models import PipeConnectedAccount as PipeConnectedAccount from .models import PipeConnectedAccountAuthMethod as PipeConnectedAccountAuthMethod +from .models import ( + PipeConnectedAccountAuthMethodLiteral as PipeConnectedAccountAuthMethodLiteral, +) from .models import ( PipeConnectedAccountConnectionRole as PipeConnectedAccountConnectionRole, ) +from .models import ( + PipeConnectedAccountConnectionRoleLiteral as PipeConnectedAccountConnectionRoleLiteral, +) from .models import PipeConnectedAccountState as PipeConnectedAccountState +from .models import PipeConnectedAccountStateLiteral as PipeConnectedAccountStateLiteral from .models import PipesAccountConnectionAddFailed as PipesAccountConnectionAddFailed from .models import ( PipesAccountConnectionAddFailedData as PipesAccountConnectionAddFailedData, @@ -1213,10 +1532,122 @@ from .models import RadarChallengeCreated as RadarChallengeCreated from .models import RadarChallengeCreatedData as RadarChallengeCreatedData from .models import RadarChallengeErrorBody as RadarChallengeErrorBody +from .models import RadarDetectionAction as RadarDetectionAction +from .models import RadarDetectionActionLiteral as RadarDetectionActionLiteral +from .models import RadarDetectionAllowedBy as RadarDetectionAllowedBy +from .models import RadarDetectionAuthMethod as RadarDetectionAuthMethod +from .models import RadarDetectionAuthMethodLiteral as RadarDetectionAuthMethodLiteral +from .models import ( + RadarDetectionBotDetectionDetails as RadarDetectionBotDetectionDetails, +) +from .models import ( + RadarDetectionBotDetectionDetailsBrowserSignals as RadarDetectionBotDetectionDetailsBrowserSignals, +) +from .models import ( + RadarDetectionBotDetectionDetailsBrowserSignalsLiteral as RadarDetectionBotDetectionDetailsBrowserSignalsLiteral, +) +from .models import ( + RadarDetectionBotDetectionDetailsDecidedBy as RadarDetectionBotDetectionDetailsDecidedBy, +) +from .models import ( + RadarDetectionBotDetectionDetailsDecidedByLiteral as RadarDetectionBotDetectionDetailsDecidedByLiteral, +) +from .models import ( + RadarDetectionBotDetectionDetailsEmailPattern as RadarDetectionBotDetectionDetailsEmailPattern, +) +from .models import ( + RadarDetectionBotDetectionDetailsEmailPatternLiteral as RadarDetectionBotDetectionDetailsEmailPatternLiteral, +) +from .models import ( + RadarDetectionBotDetectionDetailsIpRisk as RadarDetectionBotDetectionDetailsIpRisk, +) +from .models import ( + RadarDetectionBotDetectionDetailsIpRiskLiteral as RadarDetectionBotDetectionDetailsIpRiskLiteral, +) +from .models import RadarDetectionBotDetectionSignal as RadarDetectionBotDetectionSignal +from .models import ( + RadarDetectionBotDetectionSignalAction as RadarDetectionBotDetectionSignalAction, +) +from .models import ( + RadarDetectionBotDetectionSignalActionLiteral as RadarDetectionBotDetectionSignalActionLiteral, +) +from .models import ( + RadarDetectionBotDetectionSignalSignal as RadarDetectionBotDetectionSignalSignal, +) +from .models import ( + RadarDetectionBotDetectionSignalSignalLiteral as RadarDetectionBotDetectionSignalSignalLiteral, +) +from .models import ( + RadarDetectionBruteForceAttackDetails as RadarDetectionBruteForceAttackDetails, +) +from .models import ( + RadarDetectionBruteForceAttackDetailsMatchedOn as RadarDetectionBruteForceAttackDetailsMatchedOn, +) +from .models import ( + RadarDetectionBruteForceAttackDetailsMatchedOnLiteral as RadarDetectionBruteForceAttackDetailsMatchedOnLiteral, +) +from .models import RadarDetectionChallengeType as RadarDetectionChallengeType +from .models import ( + RadarDetectionChallengeTypeLiteral as RadarDetectionChallengeTypeLiteral, +) +from .models import RadarDetectionControl as RadarDetectionControl +from .models import RadarDetectionControlLiteral as RadarDetectionControlLiteral +from .models import ( + RadarDetectionDomainProtectionsDetails as RadarDetectionDomainProtectionsDetails, +) +from .models import RadarDetectionDomainSignUps as RadarDetectionDomainSignUps +from .models import ( + RadarDetectionEvidenceRestriction as RadarDetectionEvidenceRestriction, +) +from .models import ( + RadarDetectionImpossibleTravelDetails as RadarDetectionImpossibleTravelDetails, +) +from .models import RadarDetectionIpSignUps as RadarDetectionIpSignUps +from .models import RadarDetectionList as RadarDetectionList +from .models import RadarDetectionListAction as RadarDetectionListAction +from .models import RadarDetectionListActionLiteral as RadarDetectionListActionLiteral +from .models import RadarDetectionListType as RadarDetectionListType +from .models import RadarDetectionListTypeLiteral as RadarDetectionListTypeLiteral +from .models import RadarDetectionLocation as RadarDetectionLocation +from .models import RadarDetectionPreviousAttempt as RadarDetectionPreviousAttempt +from .models import ( + RadarDetectionPreviousAttemptLocation as RadarDetectionPreviousAttemptLocation, +) +from .models import ( + RadarDetectionRepeatSignUpDetails as RadarDetectionRepeatSignUpDetails, +) +from .models import ( + RadarDetectionRepeatSignUpDetailsEmail as RadarDetectionRepeatSignUpDetailsEmail, +) +from .models import ( + RadarDetectionRepeatSignUpDetailsUnknown as RadarDetectionRepeatSignUpDetailsUnknown, +) +from .models import ( + RadarDetectionRepeatSignUpDetailsVariant as RadarDetectionRepeatSignUpDetailsVariant, +) +from .models import RadarDetectionRestrictionDetails as RadarDetectionRestrictionDetails +from .models import ( + RadarDetectionRestrictionDetailsList as RadarDetectionRestrictionDetailsList, +) +from .models import ( + RadarDetectionRestrictionDetailsUnknown as RadarDetectionRestrictionDetailsUnknown, +) +from .models import ( + RadarDetectionRestrictionDetailsVariant as RadarDetectionRestrictionDetailsVariant, +) +from .models import ( + RadarDetectionStaleAccountDetails as RadarDetectionStaleAccountDetails, +) +from .models import ( + RadarDetectionUnrecognizedDeviceDetails as RadarDetectionUnrecognizedDeviceDetails, +) +from .models import RadarDetectionVerdict as RadarDetectionVerdict +from .models import RadarDetectionVerdictLiteral as RadarDetectionVerdictLiteral from .models import ( RadarListEntryAlreadyPresentResponse as RadarListEntryAlreadyPresentResponse, ) from .models import RadarSignUpChallengeErrorBody as RadarSignUpChallengeErrorBody +from .models import RadarSmsChallengeErrorBody as RadarSmsChallengeErrorBody from .models import RadarSmsSignInChallengeErrorBody as RadarSmsSignInChallengeErrorBody from .models import ( RadarStandaloneAssessRequestAction as RadarStandaloneAssessRequestAction, @@ -1233,6 +1664,9 @@ from .models import ( RadarStandaloneResponseBlocklistType as RadarStandaloneResponseBlocklistType, ) +from .models import ( + RadarStandaloneResponseBlocklistTypeLiteral as RadarStandaloneResponseBlocklistTypeLiteral, +) from .models import RadarStandaloneResponseControl as RadarStandaloneResponseControl from .models import ( RadarStandaloneResponseControlLiteral as RadarStandaloneResponseControlLiteral, @@ -1244,7 +1678,11 @@ from .models import ( RateLimitExceededErrorBodyWithRetryAfter as RateLimitExceededErrorBodyWithRetryAfter, ) +from .models import RepeatSignUp as RepeatSignUp from .models import ResendUserInviteOptionsLocale as ResendUserInviteOptionsLocale +from .models import ( + ResendUserInviteOptionsLocaleLiteral as ResendUserInviteOptionsLocaleLiteral, +) from .models import ResourceExportCompleted as ResourceExportCompleted from .models import ResourceExportCompletedData as ResourceExportCompletedData from .models import ( @@ -1258,16 +1696,28 @@ from .models import ( ResourceExportCreatedDataResourceType as ResourceExportCreatedDataResourceType, ) +from .models import ( + ResourceExportCreatedDataResourceTypeLiteral as ResourceExportCreatedDataResourceTypeLiteral, +) from .models import ResourceExportDownloaded as ResourceExportDownloaded from .models import ResourceExportDownloadedData as ResourceExportDownloadedData from .models import ( ResourceExportDownloadedDataResourceType as ResourceExportDownloadedDataResourceType, ) +from .models import ( + ResourceExportDownloadedDataResourceTypeLiteral as ResourceExportDownloadedDataResourceTypeLiteral, +) from .models import ResourceExportFailed as ResourceExportFailed from .models import ResourceExportFailedData as ResourceExportFailedData from .models import ( ResourceExportFailedDataResourceType as ResourceExportFailedDataResourceType, ) +from .models import ( + ResourceExportFailedDataResourceTypeLiteral as ResourceExportFailedDataResourceTypeLiteral, +) +from .models import ( + RoleAssignmentUpdateOverlapErrorBody as RoleAssignmentUpdateOverlapErrorBody, +) from .models import RoleCreated as RoleCreated from .models import RoleCreatedData as RoleCreatedData from .models import RoleDeleted as RoleDeleted @@ -1277,7 +1727,11 @@ from .models import RoleUpdated as RoleUpdated from .models import RoleUpdatedData as RoleUpdatedData from .models import SendEmailChangeLocale as SendEmailChangeLocale +from .models import SendEmailChangeLocaleLiteral as SendEmailChangeLocaleLiteral from .models import SendVerificationEmailLocale as SendVerificationEmailLocale +from .models import ( + SendVerificationEmailLocaleLiteral as SendVerificationEmailLocaleLiteral, +) from .models import SessionCreated as SessionCreated from .models import SessionCreatedData as SessionCreatedData from .models import SessionCreatedDataAuthMethod as SessionCreatedDataAuthMethod @@ -1286,11 +1740,17 @@ ) from .models import SessionCreatedDataImpersonator as SessionCreatedDataImpersonator from .models import SessionCreatedDataStatus as SessionCreatedDataStatus +from .models import SessionCreatedDataStatusLiteral as SessionCreatedDataStatusLiteral from .models import SessionRevoked as SessionRevoked from .models import SessionRevokedData as SessionRevokedData from .models import SessionRevokedDataAuthMethod as SessionRevokedDataAuthMethod +from .models import ( + SessionRevokedDataAuthMethodLiteral as SessionRevokedDataAuthMethodLiteral, +) from .models import SessionRevokedDataImpersonator as SessionRevokedDataImpersonator from .models import SessionRevokedDataStatus as SessionRevokedDataStatus +from .models import SessionRevokedDataStatusLiteral as SessionRevokedDataStatusLiteral +from .models import SignUp as SignUp from .models import SignUpNotAllowedOAuthErrorBody as SignUpNotAllowedOAuthErrorBody from .models import SlimRole as SlimRole from .models import SlowDownOAuthErrorBody as SlowDownOAuthErrorBody @@ -1298,9 +1758,13 @@ SmsChallengeQuotaReachedErrorBody as SmsChallengeQuotaReachedErrorBody, ) from .models import SmsChallengeRateLimitedErrorBody as SmsChallengeRateLimitedErrorBody +from .models import SmsSignIn as SmsSignIn +from .models import SmsSignInTrigger as SmsSignInTrigger +from .models import SmsSignInTriggerLiteral as SmsSignInTriggerLiteral from .models import ( SSORequiredOAuthErrorBodyWithConnectionIdsListEmail as SSORequiredOAuthErrorBodyWithConnectionIdsListEmail, ) +from .models import StaleAccount as StaleAccount from .models import ( SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug as SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug, ) @@ -1315,6 +1779,7 @@ from .models import TooManyRequestsOAuthErrorBody as TooManyRequestsOAuthErrorBody from .models import UnauthorizedClientOAuthErrorBody as UnauthorizedClientOAuthErrorBody from .models import UnauthorizedErrorBody as UnauthorizedErrorBody +from .models import UnrecognizedDevice as UnrecognizedDevice from .models import ( UpdateAuditLogsRetentionRetentionPeriod as UpdateAuditLogsRetentionRetentionPeriod, ) @@ -1330,9 +1795,15 @@ from .models import ( UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriod as UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriod, ) +from .models import ( + UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriodLiteral as UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriodLiteral, +) from .models import ( UpdateCustomProviderDefinitionAuthenticateVia as UpdateCustomProviderDefinitionAuthenticateVia, ) +from .models import ( + UpdateCustomProviderDefinitionAuthenticateViaLiteral as UpdateCustomProviderDefinitionAuthenticateViaLiteral, +) from .models import ( UpdateUserOrganizationMembershipWithRoleSlug as UpdateUserOrganizationMembershipWithRoleSlug, ) @@ -1340,8 +1811,17 @@ UpdateUserOrganizationMembershipWithRoleSlugs as UpdateUserOrganizationMembershipWithRoleSlugs, ) from .models import UpdateUserPasswordHashType as UpdateUserPasswordHashType +from .models import ( + UpdateUserPasswordHashTypeLiteral as UpdateUserPasswordHashTypeLiteral, +) from .models import UpdateUserPasswordSaltPosition as UpdateUserPasswordSaltPosition +from .models import ( + UpdateUserPasswordSaltPositionLiteral as UpdateUserPasswordSaltPositionLiteral, +) from .models import UpdateWebhookEndpointEvents as UpdateWebhookEndpointEvents +from .models import ( + UpdateWebhookEndpointEventsLiteral as UpdateWebhookEndpointEventsLiteral, +) from .models import UpdateWebhookEndpointStatus as UpdateWebhookEndpointStatus from .models import ( UpdateWebhookEndpointStatusLiteral as UpdateWebhookEndpointStatusLiteral, @@ -1372,6 +1852,7 @@ UserIdentitiesGetItemProviderLiteral as UserIdentitiesGetItemProviderLiteral, ) from .models import UserInviteState as UserInviteState +from .models import UserInviteStateLiteral as UserInviteStateLiteral from .models import UserMismatchErrorBody as UserMismatchErrorBody from .models import ( UserOrganizationMembershipBaseListData as UserOrganizationMembershipBaseListData, @@ -1379,15 +1860,23 @@ from .models import ( UserOrganizationMembershipBaseListDataStatus as UserOrganizationMembershipBaseListDataStatus, ) +from .models import ( + UserOrganizationMembershipBaseListDataStatusLiteral as UserOrganizationMembershipBaseListDataStatusLiteral, +) from .models import UserOrganizationMembershipStatus as UserOrganizationMembershipStatus +from .models import ( + UserOrganizationMembershipStatusLiteral as UserOrganizationMembershipStatusLiteral, +) from .models import UserRoleAssignmentSourceType as UserRoleAssignmentSourceType from .models import ( UserRoleAssignmentSourceTypeLiteral as UserRoleAssignmentSourceTypeLiteral, ) from .models import UserSessionsAuthMethod as UserSessionsAuthMethod +from .models import UserSessionsAuthMethodLiteral as UserSessionsAuthMethodLiteral from .models import UserSessionsImpersonator as UserSessionsImpersonator from .models import UserSessionsListItem as UserSessionsListItem from .models import UserSessionsStatus as UserSessionsStatus +from .models import UserSessionsStatusLiteral as UserSessionsStatusLiteral from .models import UserUpdated as UserUpdated from .models import VaultByokKeyDeleted as VaultByokKeyDeleted from .models import VaultByokKeyDeletedData as VaultByokKeyDeletedData @@ -1408,40 +1897,73 @@ from .models import VaultDataDeleted as VaultDataDeleted from .models import VaultDataDeletedData as VaultDataDeletedData from .models import VaultDataDeletedDataActorSource as VaultDataDeletedDataActorSource +from .models import ( + VaultDataDeletedDataActorSourceLiteral as VaultDataDeletedDataActorSourceLiteral, +) from .models import VaultDataRead as VaultDataRead from .models import VaultDataReadData as VaultDataReadData from .models import VaultDataReadDataActorSource as VaultDataReadDataActorSource +from .models import ( + VaultDataReadDataActorSourceLiteral as VaultDataReadDataActorSourceLiteral, +) from .models import VaultDataUpdated as VaultDataUpdated from .models import VaultDataUpdatedData as VaultDataUpdatedData from .models import VaultDataUpdatedDataActorSource as VaultDataUpdatedDataActorSource +from .models import ( + VaultDataUpdatedDataActorSourceLiteral as VaultDataUpdatedDataActorSourceLiteral, +) from .models import VaultDekDecrypted as VaultDekDecrypted from .models import VaultDekDecryptedData as VaultDekDecryptedData from .models import VaultDekDecryptedDataActorSource as VaultDekDecryptedDataActorSource +from .models import ( + VaultDekDecryptedDataActorSourceLiteral as VaultDekDecryptedDataActorSourceLiteral, +) from .models import VaultDekRead as VaultDekRead from .models import VaultDekReadData as VaultDekReadData from .models import VaultDekReadDataActorSource as VaultDekReadDataActorSource +from .models import ( + VaultDekReadDataActorSourceLiteral as VaultDekReadDataActorSourceLiteral, +) from .models import VaultDekRekeyed as VaultDekRekeyed from .models import VaultDekRekeyedData as VaultDekRekeyedData from .models import VaultDekRekeyedDataActorSource as VaultDekRekeyedDataActorSource +from .models import ( + VaultDekRekeyedDataActorSourceLiteral as VaultDekRekeyedDataActorSourceLiteral, +) from .models import VaultKekCreated as VaultKekCreated from .models import VaultKekCreatedData as VaultKekCreatedData from .models import VaultKekCreatedDataActorSource as VaultKekCreatedDataActorSource +from .models import ( + VaultKekCreatedDataActorSourceLiteral as VaultKekCreatedDataActorSourceLiteral, +) from .models import VaultKekDeleted as VaultKekDeleted from .models import VaultKekDeletedData as VaultKekDeletedData from .models import VaultKekDeletedDataActorSource as VaultKekDeletedDataActorSource +from .models import ( + VaultKekDeletedDataActorSourceLiteral as VaultKekDeletedDataActorSourceLiteral, +) from .models import VaultMetadataRead as VaultMetadataRead from .models import VaultMetadataReadData as VaultMetadataReadData from .models import VaultMetadataReadDataActorSource as VaultMetadataReadDataActorSource +from .models import ( + VaultMetadataReadDataActorSourceLiteral as VaultMetadataReadDataActorSourceLiteral, +) from .models import VaultNamesListed as VaultNamesListed from .models import VaultNamesListedData as VaultNamesListedData from .models import VaultNamesListedDataActorSource as VaultNamesListedDataActorSource +from .models import ( + VaultNamesListedDataActorSourceLiteral as VaultNamesListedDataActorSourceLiteral, +) from .models import VerificationIdRequiredErrorBody as VerificationIdRequiredErrorBody from .models import WaitlistEntryState as WaitlistEntryState +from .models import WaitlistEntryStateLiteral as WaitlistEntryStateLiteral from .models import WaitlistUser as WaitlistUser from .models import WaitlistUserApproved as WaitlistUserApproved from .models import WaitlistUserCreated as WaitlistUserCreated from .models import WaitlistUserDenied as WaitlistUserDenied from .models import WaitlistUserState as WaitlistUserState +from .models import WaitlistUserStateLiteral as WaitlistUserStateLiteral from .models import WebhookEndpointStatus as WebhookEndpointStatus +from .models import WebhookEndpointStatusLiteral as WebhookEndpointStatusLiteral from .models import WidgetSessionTokenScopes as WidgetSessionTokenScopes from .models import WidgetSessionTokenScopesLiteral as WidgetSessionTokenScopesLiteral diff --git a/src/workos/common/models/__init__.py b/src/workos/common/models/__init__.py index 44618597..f3da88fc 100644 --- a/src/workos/common/models/__init__.py +++ b/src/workos/common/models/__init__.py @@ -49,6 +49,15 @@ from .agent_blueprint_created_data_invocable_by import ( AgentBlueprintCreatedDataInvocableBy as AgentBlueprintCreatedDataInvocableBy, ) +from .agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission as AgentBlueprintCreatedDataScopedPermission, +) +from .agent_blueprint_created_data_scoped_permission_instance_types import ( + AgentBlueprintCreatedDataScopedPermissionInstanceTypes as AgentBlueprintCreatedDataScopedPermissionInstanceTypes, +) +from .agent_blueprint_created_data_scoped_permission_instance_types import ( + AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral as AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral, +) from .agent_blueprint_created_data_session_setting import ( AgentBlueprintCreatedDataSessionSetting as AgentBlueprintCreatedDataSessionSetting, ) @@ -59,6 +68,15 @@ from .agent_blueprint_invocable_as_instance_types import ( AgentBlueprintInvocableAsInstanceTypes as AgentBlueprintInvocableAsInstanceTypes, ) +from .agent_blueprint_invocable_as_instance_types import ( + AgentBlueprintInvocableAsInstanceTypesLiteral as AgentBlueprintInvocableAsInstanceTypesLiteral, +) +from .agent_blueprint_scoped_permission_instance_types import ( + AgentBlueprintScopedPermissionInstanceTypes as AgentBlueprintScopedPermissionInstanceTypes, +) +from .agent_blueprint_scoped_permission_instance_types import ( + AgentBlueprintScopedPermissionInstanceTypesLiteral as AgentBlueprintScopedPermissionInstanceTypesLiteral, +) from .agent_blueprint_updated import AgentBlueprintUpdated as AgentBlueprintUpdated from .agent_blueprint_updated_data import ( AgentBlueprintUpdatedData as AgentBlueprintUpdatedData, @@ -69,15 +87,36 @@ from .agent_blueprint_updated_data_invocable_as_instance_types import ( AgentBlueprintUpdatedDataInvocableAsInstanceTypes as AgentBlueprintUpdatedDataInvocableAsInstanceTypes, ) +from .agent_blueprint_updated_data_invocable_as_instance_types import ( + AgentBlueprintUpdatedDataInvocableAsInstanceTypesLiteral as AgentBlueprintUpdatedDataInvocableAsInstanceTypesLiteral, +) from .agent_blueprint_updated_data_invocable_by import ( AgentBlueprintUpdatedDataInvocableBy as AgentBlueprintUpdatedDataInvocableBy, ) +from .agent_blueprint_updated_data_scoped_permission import ( + AgentBlueprintUpdatedDataScopedPermission as AgentBlueprintUpdatedDataScopedPermission, +) +from .agent_blueprint_updated_data_scoped_permission_instance_types import ( + AgentBlueprintUpdatedDataScopedPermissionInstanceTypes as AgentBlueprintUpdatedDataScopedPermissionInstanceTypes, +) +from .agent_blueprint_updated_data_scoped_permission_instance_types import ( + AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral as AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral, +) from .agent_blueprint_updated_data_session_setting import ( AgentBlueprintUpdatedDataSessionSetting as AgentBlueprintUpdatedDataSessionSetting, ) from .agent_blueprints_create_request_invocable_as_instance_types import ( AgentBlueprintsCreateRequestInvocableAsInstanceTypes as AgentBlueprintsCreateRequestInvocableAsInstanceTypes, ) +from .agent_blueprints_create_request_invocable_as_instance_types import ( + AgentBlueprintsCreateRequestInvocableAsInstanceTypesLiteral as AgentBlueprintsCreateRequestInvocableAsInstanceTypesLiteral, +) +from .agent_blueprints_create_request_permission_instance_types import ( + AgentBlueprintsCreateRequestPermissionInstanceTypes as AgentBlueprintsCreateRequestPermissionInstanceTypes, +) +from .agent_blueprints_create_request_permission_instance_types import ( + AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral as AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral, +) from .agent_blueprints_token_mint_token_request_type import ( AgentBlueprintsTokenMintTokenRequestType as AgentBlueprintsTokenMintTokenRequestType, ) @@ -87,6 +126,15 @@ from .agent_blueprints_update_request_invocable_as_instance_types import ( AgentBlueprintsUpdateRequestInvocableAsInstanceTypes as AgentBlueprintsUpdateRequestInvocableAsInstanceTypes, ) +from .agent_blueprints_update_request_invocable_as_instance_types import ( + AgentBlueprintsUpdateRequestInvocableAsInstanceTypesLiteral as AgentBlueprintsUpdateRequestInvocableAsInstanceTypesLiteral, +) +from .agent_blueprints_update_request_permission_instance_types import ( + AgentBlueprintsUpdateRequestPermissionInstanceTypes as AgentBlueprintsUpdateRequestPermissionInstanceTypes, +) +from .agent_blueprints_update_request_permission_instance_types import ( + AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral as AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral, +) from .agent_instance_created import AgentInstanceCreated as AgentInstanceCreated from .agent_instance_created_data import ( AgentInstanceCreatedData as AgentInstanceCreatedData, @@ -94,6 +142,9 @@ from .agent_instance_created_data_type import ( AgentInstanceCreatedDataType as AgentInstanceCreatedDataType, ) +from .agent_instance_created_data_type import ( + AgentInstanceCreatedDataTypeLiteral as AgentInstanceCreatedDataTypeLiteral, +) from .agent_instance_deleted import AgentInstanceDeleted as AgentInstanceDeleted from .agent_instance_deleted_data import ( AgentInstanceDeletedData as AgentInstanceDeletedData, @@ -101,6 +152,9 @@ from .agent_instance_deleted_data_type import ( AgentInstanceDeletedDataType as AgentInstanceDeletedDataType, ) +from .agent_instance_deleted_data_type import ( + AgentInstanceDeletedDataTypeLiteral as AgentInstanceDeletedDataTypeLiteral, +) from .agent_instance_session_created import ( AgentInstanceSessionCreated as AgentInstanceSessionCreated, ) @@ -120,6 +174,7 @@ AgentInstanceSessionStatusLiteral as AgentInstanceSessionStatusLiteral, ) from .agent_instance_type import AgentInstanceType as AgentInstanceType +from .agent_instance_type import AgentInstanceTypeLiteral as AgentInstanceTypeLiteral from .agent_registration_claim_attempt_created import ( AgentRegistrationClaimAttemptCreated as AgentRegistrationClaimAttemptCreated, ) @@ -184,6 +239,9 @@ AgentRegistrationExpiredData as AgentRegistrationExpiredData, ) from .agent_registration_kind import AgentRegistrationKind as AgentRegistrationKind +from .agent_registration_kind import ( + AgentRegistrationKindLiteral as AgentRegistrationKindLiteral, +) from .agent_registration_organization_switched import ( AgentRegistrationOrganizationSwitched as AgentRegistrationOrganizationSwitched, ) @@ -205,6 +263,9 @@ from .agent_registration_status import ( AgentRegistrationStatus as AgentRegistrationStatus, ) +from .agent_registration_status import ( + AgentRegistrationStatusLiteral as AgentRegistrationStatusLiteral, +) from .already_claimed_error_body import ( AlreadyClaimedErrorBody as AlreadyClaimedErrorBody, ) @@ -226,6 +287,21 @@ from .application_consent_required_error_body import ( ApplicationConsentRequiredErrorBody as ApplicationConsentRequiredErrorBody, ) +from .application_token_exchange_failed import ( + ApplicationTokenExchangeFailed as ApplicationTokenExchangeFailed, +) +from .application_token_exchange_failed_data import ( + ApplicationTokenExchangeFailedData as ApplicationTokenExchangeFailedData, +) +from .application_token_exchange_failed_data_error import ( + ApplicationTokenExchangeFailedDataError as ApplicationTokenExchangeFailedDataError, +) +from .application_token_exchange_succeeded import ( + ApplicationTokenExchangeSucceeded as ApplicationTokenExchangeSucceeded, +) +from .application_token_exchange_succeeded_data import ( + ApplicationTokenExchangeSucceededData as ApplicationTokenExchangeSucceededData, +) from .audit_log_configuration_log_stream_state import ( AuditLogConfigurationLogStreamState as AuditLogConfigurationLogStreamState, ) @@ -304,6 +380,9 @@ from .authentication_factor_type import ( AuthenticationFactorType as AuthenticationFactorType, ) +from .authentication_factor_type import ( + AuthenticationFactorTypeLiteral as AuthenticationFactorTypeLiteral, +) from .authentication_factors_create_request_type import ( AuthenticationFactorsCreateRequestType as AuthenticationFactorsCreateRequestType, ) @@ -473,9 +552,15 @@ from .authorization_url_request_error_body_code import ( AuthorizationUrlRequestErrorBodyCodeLiteral as AuthorizationUrlRequestErrorBodyCodeLiteral, ) +from .blocked_tld import BlockedTld as BlockedTld +from .bot_detection import BotDetection as BotDetection +from .brute_force_attack import BruteForceAttack as BruteForceAttack from .claim_view_response_status import ( ClaimViewResponseStatus as ClaimViewResponseStatus, ) +from .claim_view_response_status import ( + ClaimViewResponseStatusLiteral as ClaimViewResponseStatusLiteral, +) from .client_credentials_data_integration_vended_credential import ( ClientCredentialsDataIntegrationVendedCredential as ClientCredentialsDataIntegrationVendedCredential, ) @@ -574,23 +659,38 @@ from .connection_deactivated_data_connection_type import ( ConnectionDeactivatedDataConnectionType as ConnectionDeactivatedDataConnectionType, ) +from .connection_deactivated_data_connection_type import ( + ConnectionDeactivatedDataConnectionTypeLiteral as ConnectionDeactivatedDataConnectionTypeLiteral, +) from .connection_deactivated_data_domain import ( ConnectionDeactivatedDataDomain as ConnectionDeactivatedDataDomain, ) from .connection_deactivated_data_state import ( ConnectionDeactivatedDataState as ConnectionDeactivatedDataState, ) +from .connection_deactivated_data_state import ( + ConnectionDeactivatedDataStateLiteral as ConnectionDeactivatedDataStateLiteral, +) from .connection_deactivated_data_status import ( ConnectionDeactivatedDataStatus as ConnectionDeactivatedDataStatus, ) +from .connection_deactivated_data_status import ( + ConnectionDeactivatedDataStatusLiteral as ConnectionDeactivatedDataStatusLiteral, +) from .connection_deleted import ConnectionDeleted as ConnectionDeleted from .connection_deleted_data import ConnectionDeletedData as ConnectionDeletedData from .connection_deleted_data_connection_type import ( ConnectionDeletedDataConnectionType as ConnectionDeletedDataConnectionType, ) +from .connection_deleted_data_connection_type import ( + ConnectionDeletedDataConnectionTypeLiteral as ConnectionDeletedDataConnectionTypeLiteral, +) from .connection_deleted_data_state import ( ConnectionDeletedDataState as ConnectionDeletedDataState, ) +from .connection_deleted_data_state import ( + ConnectionDeletedDataStateLiteral as ConnectionDeletedDataStateLiteral, +) from .connection_finish_error_body import ( ConnectionFinishErrorBody as ConnectionFinishErrorBody, ) @@ -630,9 +730,30 @@ from .connection_saml_certificate_renewed_data_certificate_certificate_type import ( ConnectionSAMLCertificateRenewedDataCertificateCertificateType as ConnectionSAMLCertificateRenewedDataCertificateCertificateType, ) +from .connection_saml_certificate_renewed_data_certificate_certificate_type import ( + ConnectionSAMLCertificateRenewedDataCertificateCertificateTypeLiteral as ConnectionSAMLCertificateRenewedDataCertificateCertificateTypeLiteral, +) from .connection_saml_certificate_renewed_data_connection import ( ConnectionSAMLCertificateRenewedDataConnection as ConnectionSAMLCertificateRenewedDataConnection, ) +from .connection_saml_certificate_replaced import ( + ConnectionSAMLCertificateReplaced as ConnectionSAMLCertificateReplaced, +) +from .connection_saml_certificate_replaced_data import ( + ConnectionSAMLCertificateReplacedData as ConnectionSAMLCertificateReplacedData, +) +from .connection_saml_certificate_replaced_data_certificate import ( + ConnectionSAMLCertificateReplacedDataCertificate as ConnectionSAMLCertificateReplacedDataCertificate, +) +from .connection_saml_certificate_replaced_data_certificate_certificate_type import ( + ConnectionSAMLCertificateReplacedDataCertificateCertificateType as ConnectionSAMLCertificateReplacedDataCertificateCertificateType, +) +from .connection_saml_certificate_replaced_data_certificate_certificate_type import ( + ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral as ConnectionSAMLCertificateReplacedDataCertificateCertificateTypeLiteral, +) +from .connection_saml_certificate_replaced_data_connection import ( + ConnectionSAMLCertificateReplacedDataConnection as ConnectionSAMLCertificateReplacedDataConnection, +) from .connection_state import ConnectionState as ConnectionState from .connection_state import ConnectionStateLiteral as ConnectionStateLiteral from .connection_status import ConnectionStatus as ConnectionStatus @@ -642,9 +763,15 @@ from .connection_type_not_updatable_error_body import ( ConnectionTypeNotUpdatableErrorBody as ConnectionTypeNotUpdatableErrorBody, ) +from .create_application_secret import ( + CreateApplicationSecret as CreateApplicationSecret, +) from .create_connected_account_state import ( CreateConnectedAccountState as CreateConnectedAccountState, ) +from .create_connected_account_state import ( + CreateConnectedAccountStateLiteral as CreateConnectedAccountStateLiteral, +) from .create_connection_oidc_options_id_token_signature_algorithm import ( CreateConnectionOIDCOptionsIdTokenSignatureAlgorithm as CreateConnectionOIDCOptionsIdTokenSignatureAlgorithm, ) @@ -660,6 +787,9 @@ from .create_data_integration_auth_methods import ( CreateDataIntegrationAuthMethods as CreateDataIntegrationAuthMethods, ) +from .create_data_integration_auth_methods import ( + CreateDataIntegrationAuthMethodsLiteral as CreateDataIntegrationAuthMethodsLiteral, +) from .create_data_integration_ownership import ( CreateDataIntegrationOwnership as CreateDataIntegrationOwnership, ) @@ -675,12 +805,21 @@ from .create_organization_connected_account_state import ( CreateOrganizationConnectedAccountState as CreateOrganizationConnectedAccountState, ) +from .create_organization_connected_account_state import ( + CreateOrganizationConnectedAccountStateLiteral as CreateOrganizationConnectedAccountStateLiteral, +) from .create_password_reset_token_locale import ( CreatePasswordResetTokenLocale as CreatePasswordResetTokenLocale, ) +from .create_password_reset_token_locale import ( + CreatePasswordResetTokenLocaleLiteral as CreatePasswordResetTokenLocaleLiteral, +) from .create_user_invite_options_locale import ( CreateUserInviteOptionsLocale as CreateUserInviteOptionsLocale, ) +from .create_user_invite_options_locale import ( + CreateUserInviteOptionsLocaleLiteral as CreateUserInviteOptionsLocaleLiteral, +) from .create_user_password_hash_type import ( CreateUserPasswordHashType as CreateUserPasswordHashType, ) @@ -729,9 +868,15 @@ from .data_integration_access_token_response_with_error_error import ( DataIntegrationAccessTokenResponseWithErrorError as DataIntegrationAccessTokenResponseWithErrorError, ) +from .data_integration_access_token_response_with_error_error import ( + DataIntegrationAccessTokenResponseWithErrorErrorLiteral as DataIntegrationAccessTokenResponseWithErrorErrorLiteral, +) from .data_integration_auth_methods import ( DataIntegrationAuthMethods as DataIntegrationAuthMethods, ) +from .data_integration_auth_methods import ( + DataIntegrationAuthMethodsLiteral as DataIntegrationAuthMethodsLiteral, +) from .data_integration_credential_type import ( DataIntegrationCredentialType as DataIntegrationCredentialType, ) @@ -747,9 +892,15 @@ from .data_integration_credentials_input_type import ( DataIntegrationCredentialsInputType as DataIntegrationCredentialsInputType, ) +from .data_integration_credentials_input_type import ( + DataIntegrationCredentialsInputTypeLiteral as DataIntegrationCredentialsInputTypeLiteral, +) from .data_integration_credentials_response_error import ( DataIntegrationCredentialsResponseError as DataIntegrationCredentialsResponseError, ) +from .data_integration_credentials_response_error import ( + DataIntegrationCredentialsResponseErrorLiteral as DataIntegrationCredentialsResponseErrorLiteral, +) from .data_integration_credentials_response_with_credential import ( DataIntegrationCredentialsResponseWithCredential as DataIntegrationCredentialsResponseWithCredential, ) @@ -759,15 +910,27 @@ from .data_integration_credentials_response_with_error_error import ( DataIntegrationCredentialsResponseWithErrorError as DataIntegrationCredentialsResponseWithErrorError, ) +from .data_integration_credentials_response_with_error_error import ( + DataIntegrationCredentialsResponseWithErrorErrorLiteral as DataIntegrationCredentialsResponseWithErrorErrorLiteral, +) from .data_integration_custom_provider_authenticate_via import ( DataIntegrationCustomProviderAuthenticateVia as DataIntegrationCustomProviderAuthenticateVia, ) +from .data_integration_custom_provider_authenticate_via import ( + DataIntegrationCustomProviderAuthenticateViaLiteral as DataIntegrationCustomProviderAuthenticateViaLiteral, +) from .data_integration_installation_connection_role import ( DataIntegrationInstallationConnectionRole as DataIntegrationInstallationConnectionRole, ) +from .data_integration_installation_connection_role import ( + DataIntegrationInstallationConnectionRoleLiteral as DataIntegrationInstallationConnectionRoleLiteral, +) from .data_integration_ownership import ( DataIntegrationOwnership as DataIntegrationOwnership, ) +from .data_integration_ownership import ( + DataIntegrationOwnershipLiteral as DataIntegrationOwnershipLiteral, +) from .data_integration_state import DataIntegrationState as DataIntegrationState from .data_integration_state import ( DataIntegrationStateLiteral as DataIntegrationStateLiteral, @@ -784,12 +947,21 @@ from .data_integration_vended_credential_auth_method import ( DataIntegrationVendedCredentialAuthMethod as DataIntegrationVendedCredentialAuthMethod, ) +from .data_integration_vended_credential_auth_method import ( + DataIntegrationVendedCredentialAuthMethodLiteral as DataIntegrationVendedCredentialAuthMethodLiteral, +) from .data_integrations_create_api_key_connection_request_connection_owner import ( DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner as DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner, ) +from .data_integrations_create_api_key_connection_request_connection_owner import ( + DataIntegrationsCreateApiKeyConnectionRequestConnectionOwnerLiteral as DataIntegrationsCreateApiKeyConnectionRequestConnectionOwnerLiteral, +) from .data_integrations_create_client_credentials_connection_request_connection_owner import ( DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner as DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner, ) +from .data_integrations_create_client_credentials_connection_request_connection_owner import ( + DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwnerLiteral as DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwnerLiteral, +) from .data_integrations_get_data_integration_authorize_url_request_connection_intent import ( DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionIntent as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionIntent, ) @@ -799,9 +971,15 @@ from .data_integrations_get_data_integration_authorize_url_request_connection_owner import ( DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner, ) +from .data_integrations_get_data_integration_authorize_url_request_connection_owner import ( + DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwnerLiteral as DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwnerLiteral, +) from .data_integrations_get_user_token_request_connection_owner import ( DataIntegrationsGetUserTokenRequestConnectionOwner as DataIntegrationsGetUserTokenRequestConnectionOwner, ) +from .data_integrations_get_user_token_request_connection_owner import ( + DataIntegrationsGetUserTokenRequestConnectionOwnerLiteral as DataIntegrationsGetUserTokenRequestConnectionOwnerLiteral, +) from .data_integrations_list_response import ( DataIntegrationsListResponse as DataIntegrationsListResponse, ) @@ -811,24 +989,39 @@ from .data_integrations_list_response_data_auth_methods import ( DataIntegrationsListResponseDataAuthMethods as DataIntegrationsListResponseDataAuthMethods, ) +from .data_integrations_list_response_data_auth_methods import ( + DataIntegrationsListResponseDataAuthMethodsLiteral as DataIntegrationsListResponseDataAuthMethodsLiteral, +) from .data_integrations_list_response_data_connected_account import ( DataIntegrationsListResponseDataConnectedAccount as DataIntegrationsListResponseDataConnectedAccount, ) from .data_integrations_list_response_data_connected_account_auth_method import ( DataIntegrationsListResponseDataConnectedAccountAuthMethod as DataIntegrationsListResponseDataConnectedAccountAuthMethod, ) +from .data_integrations_list_response_data_connected_account_auth_method import ( + DataIntegrationsListResponseDataConnectedAccountAuthMethodLiteral as DataIntegrationsListResponseDataConnectedAccountAuthMethodLiteral, +) from .data_integrations_list_response_data_connected_account_connection_role import ( DataIntegrationsListResponseDataConnectedAccountConnectionRole as DataIntegrationsListResponseDataConnectedAccountConnectionRole, ) +from .data_integrations_list_response_data_connected_account_connection_role import ( + DataIntegrationsListResponseDataConnectedAccountConnectionRoleLiteral as DataIntegrationsListResponseDataConnectedAccountConnectionRoleLiteral, +) from .data_integrations_list_response_data_connected_account_state import ( DataIntegrationsListResponseDataConnectedAccountState as DataIntegrationsListResponseDataConnectedAccountState, ) +from .data_integrations_list_response_data_connected_account_state import ( + DataIntegrationsListResponseDataConnectedAccountStateLiteral as DataIntegrationsListResponseDataConnectedAccountStateLiteral, +) from .data_integrations_list_response_data_connected_account_warning import ( DataIntegrationsListResponseDataConnectedAccountWarning as DataIntegrationsListResponseDataConnectedAccountWarning, ) from .data_integrations_list_response_data_connection_owner import ( DataIntegrationsListResponseDataConnectionOwner as DataIntegrationsListResponseDataConnectionOwner, ) +from .data_integrations_list_response_data_connection_owner import ( + DataIntegrationsListResponseDataConnectionOwnerLiteral as DataIntegrationsListResponseDataConnectionOwnerLiteral, +) from .data_integrations_list_response_data_ownership import ( DataIntegrationsListResponseDataOwnership as DataIntegrationsListResponseDataOwnership, ) @@ -838,12 +1031,21 @@ from .data_integrations_upsert_api_key_request_connection_owner import ( DataIntegrationsUpsertApiKeyRequestConnectionOwner as DataIntegrationsUpsertApiKeyRequestConnectionOwner, ) +from .data_integrations_upsert_api_key_request_connection_owner import ( + DataIntegrationsUpsertApiKeyRequestConnectionOwnerLiteral as DataIntegrationsUpsertApiKeyRequestConnectionOwnerLiteral, +) from .data_integrations_upsert_client_credentials_request_connection_owner import ( DataIntegrationsUpsertClientCredentialsRequestConnectionOwner as DataIntegrationsUpsertClientCredentialsRequestConnectionOwner, ) +from .data_integrations_upsert_client_credentials_request_connection_owner import ( + DataIntegrationsUpsertClientCredentialsRequestConnectionOwnerLiteral as DataIntegrationsUpsertClientCredentialsRequestConnectionOwnerLiteral, +) from .data_integrations_vend_credentials_request_connection_owner import ( DataIntegrationsVendCredentialsRequestConnectionOwner as DataIntegrationsVendCredentialsRequestConnectionOwner, ) +from .data_integrations_vend_credentials_request_connection_owner import ( + DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral as DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral, +) from .directory_group import DirectoryGroup as DirectoryGroup from .directory_state import DirectoryState as DirectoryState from .directory_state import DirectoryStateLiteral as DirectoryStateLiteral @@ -859,6 +1061,10 @@ from .directory_user_with_groups_state import ( DirectoryUserWithGroupsState as DirectoryUserWithGroupsState, ) +from .directory_user_with_groups_state import ( + DirectoryUserWithGroupsStateLiteral as DirectoryUserWithGroupsStateLiteral, +) +from .domain_protections import DomainProtections as DomainProtections from .dsync_activated import DsyncActivated as DsyncActivated from .dsync_activated_data import DsyncActivatedData as DsyncActivatedData from .dsync_activated_data_domain import ( @@ -877,7 +1083,13 @@ from .dsync_deleted import DsyncDeleted as DsyncDeleted from .dsync_deleted_data import DsyncDeletedData as DsyncDeletedData from .dsync_deleted_data_state import DsyncDeletedDataState as DsyncDeletedDataState +from .dsync_deleted_data_state import ( + DsyncDeletedDataStateLiteral as DsyncDeletedDataStateLiteral, +) from .dsync_deleted_data_type import DsyncDeletedDataType as DsyncDeletedDataType +from .dsync_deleted_data_type import ( + DsyncDeletedDataTypeLiteral as DsyncDeletedDataTypeLiteral, +) from .dsync_group_created import DsyncGroupCreated as DsyncGroupCreated from .dsync_group_deleted import DsyncGroupDeleted as DsyncGroupDeleted from .dsync_group_updated import DsyncGroupUpdated as DsyncGroupUpdated @@ -904,6 +1116,9 @@ from .dsync_user_updated_data_state import ( DsyncUserUpdatedDataState as DsyncUserUpdatedDataState, ) +from .dsync_user_updated_data_state import ( + DsyncUserUpdatedDataStateLiteral as DsyncUserUpdatedDataStateLiteral, +) from .email_already_in_use_error_body import ( EmailAlreadyInUseErrorBody as EmailAlreadyInUseErrorBody, ) @@ -937,6 +1152,12 @@ from .entity_not_found_error_body import ( EntityNotFoundErrorBody as EntityNotFoundErrorBody, ) +from .entity_not_found_error_body_with_entity_id import ( + EntityNotFoundErrorBodyWithEntityId as EntityNotFoundErrorBodyWithEntityId, +) +from .entity_not_found_error_body_with_ids_list import ( + EntityNotFoundErrorBodyWithIdsList as EntityNotFoundErrorBodyWithIdsList, +) from .error_body import ErrorBody as ErrorBody from .error_body_code import ErrorBodyCode as ErrorBodyCode from .error_body_code import ErrorBodyCodeLiteral as ErrorBodyCodeLiteral @@ -1010,6 +1231,9 @@ from .feature_flags_flag_created_context_actor_source import ( FeatureFlagsFlagCreatedContextActorSource as FeatureFlagsFlagCreatedContextActorSource, ) +from .feature_flags_flag_created_context_actor_source import ( + FeatureFlagsFlagCreatedContextActorSourceLiteral as FeatureFlagsFlagCreatedContextActorSourceLiteral, +) from .feature_flags_flag_created_data import ( FeatureFlagsFlagCreatedData as FeatureFlagsFlagCreatedData, ) @@ -1028,6 +1252,9 @@ from .feature_flags_flag_deleted_context_actor_source import ( FeatureFlagsFlagDeletedContextActorSource as FeatureFlagsFlagDeletedContextActorSource, ) +from .feature_flags_flag_deleted_context_actor_source import ( + FeatureFlagsFlagDeletedContextActorSourceLiteral as FeatureFlagsFlagDeletedContextActorSourceLiteral, +) from .feature_flags_flag_deleted_data import ( FeatureFlagsFlagDeletedData as FeatureFlagsFlagDeletedData, ) @@ -1046,6 +1273,9 @@ from .feature_flags_flag_rule_created_context_actor_source import ( FeatureFlagsFlagRuleCreatedContextActorSource as FeatureFlagsFlagRuleCreatedContextActorSource, ) +from .feature_flags_flag_rule_created_context_actor_source import ( + FeatureFlagsFlagRuleCreatedContextActorSourceLiteral as FeatureFlagsFlagRuleCreatedContextActorSourceLiteral, +) from .feature_flags_flag_rule_deleted import ( FeatureFlagsFlagRuleDeleted as FeatureFlagsFlagRuleDeleted, ) @@ -1058,6 +1288,9 @@ from .feature_flags_flag_rule_deleted_context_actor_source import ( FeatureFlagsFlagRuleDeletedContextActorSource as FeatureFlagsFlagRuleDeletedContextActorSource, ) +from .feature_flags_flag_rule_deleted_context_actor_source import ( + FeatureFlagsFlagRuleDeletedContextActorSourceLiteral as FeatureFlagsFlagRuleDeletedContextActorSourceLiteral, +) from .feature_flags_flag_rule_updated import ( FeatureFlagsFlagRuleUpdated as FeatureFlagsFlagRuleUpdated, ) @@ -1070,6 +1303,9 @@ from .feature_flags_flag_rule_updated_context_actor_source import ( FeatureFlagsFlagRuleUpdatedContextActorSource as FeatureFlagsFlagRuleUpdatedContextActorSource, ) +from .feature_flags_flag_rule_updated_context_actor_source import ( + FeatureFlagsFlagRuleUpdatedContextActorSourceLiteral as FeatureFlagsFlagRuleUpdatedContextActorSourceLiteral, +) from .feature_flags_flag_rule_updated_context_previous_attribute import ( FeatureFlagsFlagRuleUpdatedContextPreviousAttribute as FeatureFlagsFlagRuleUpdatedContextPreviousAttribute, ) @@ -1088,6 +1324,9 @@ from .feature_flags_flag_target_created_context_actor_source import ( FeatureFlagsFlagTargetCreatedContextActorSource as FeatureFlagsFlagTargetCreatedContextActorSource, ) +from .feature_flags_flag_target_created_context_actor_source import ( + FeatureFlagsFlagTargetCreatedContextActorSourceLiteral as FeatureFlagsFlagTargetCreatedContextActorSourceLiteral, +) from .feature_flags_flag_target_deleted import ( FeatureFlagsFlagTargetDeleted as FeatureFlagsFlagTargetDeleted, ) @@ -1100,6 +1339,9 @@ from .feature_flags_flag_target_deleted_context_actor_source import ( FeatureFlagsFlagTargetDeletedContextActorSource as FeatureFlagsFlagTargetDeletedContextActorSource, ) +from .feature_flags_flag_target_deleted_context_actor_source import ( + FeatureFlagsFlagTargetDeletedContextActorSourceLiteral as FeatureFlagsFlagTargetDeletedContextActorSourceLiteral, +) from .feature_flags_flag_updated import ( FeatureFlagsFlagUpdated as FeatureFlagsFlagUpdated, ) @@ -1112,6 +1354,9 @@ from .feature_flags_flag_updated_context_actor_source import ( FeatureFlagsFlagUpdatedContextActorSource as FeatureFlagsFlagUpdatedContextActorSource, ) +from .feature_flags_flag_updated_context_actor_source import ( + FeatureFlagsFlagUpdatedContextActorSourceLiteral as FeatureFlagsFlagUpdatedContextActorSourceLiteral, +) from .feature_flags_flag_updated_context_previous_attribute import ( FeatureFlagsFlagUpdatedContextPreviousAttribute as FeatureFlagsFlagUpdatedContextPreviousAttribute, ) @@ -1136,6 +1381,9 @@ from .flag_created_context_actor_source import ( FlagCreatedContextActorSource as FlagCreatedContextActorSource, ) +from .flag_created_context_actor_source import ( + FlagCreatedContextActorSourceLiteral as FlagCreatedContextActorSourceLiteral, +) from .flag_created_data import FlagCreatedData as FlagCreatedData from .flag_created_data_owner import FlagCreatedDataOwner as FlagCreatedDataOwner from .flag_deleted import FlagDeleted as FlagDeleted @@ -1146,6 +1394,9 @@ from .flag_deleted_context_actor_source import ( FlagDeletedContextActorSource as FlagDeletedContextActorSource, ) +from .flag_deleted_context_actor_source import ( + FlagDeletedContextActorSourceLiteral as FlagDeletedContextActorSourceLiteral, +) from .flag_deleted_data import FlagDeletedData as FlagDeletedData from .flag_deleted_data_owner import FlagDeletedDataOwner as FlagDeletedDataOwner from .flag_owner import FlagOwner as FlagOwner @@ -1164,6 +1415,9 @@ from .flag_rule_updated_context_actor_source import ( FlagRuleUpdatedContextActorSource as FlagRuleUpdatedContextActorSource, ) +from .flag_rule_updated_context_actor_source import ( + FlagRuleUpdatedContextActorSourceLiteral as FlagRuleUpdatedContextActorSourceLiteral, +) from .flag_rule_updated_context_configured_target import ( FlagRuleUpdatedContextConfiguredTarget as FlagRuleUpdatedContextConfiguredTarget, ) @@ -1182,6 +1436,9 @@ from .flag_rule_updated_context_previous_attribute_context_access_type import ( FlagRuleUpdatedContextPreviousAttributeContextAccessType as FlagRuleUpdatedContextPreviousAttributeContextAccessType, ) +from .flag_rule_updated_context_previous_attribute_context_access_type import ( + FlagRuleUpdatedContextPreviousAttributeContextAccessTypeLiteral as FlagRuleUpdatedContextPreviousAttributeContextAccessTypeLiteral, +) from .flag_rule_updated_context_previous_attribute_context_configured_target import ( FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget as FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget, ) @@ -1211,6 +1468,9 @@ from .flag_updated_context_actor_source import ( FlagUpdatedContextActorSource as FlagUpdatedContextActorSource, ) +from .flag_updated_context_actor_source import ( + FlagUpdatedContextActorSourceLiteral as FlagUpdatedContextActorSourceLiteral, +) from .flag_updated_context_previous_attribute import ( FlagUpdatedContextPreviousAttribute as FlagUpdatedContextPreviousAttribute, ) @@ -1235,6 +1495,7 @@ from .idp_metadata_fetch_failed_error_body import ( IdpMetadataFetchFailedErrorBody as IdpMetadataFetchFailedErrorBody, ) +from .impossible_travel import ImpossibleTravel as ImpossibleTravel from .invalid_client_oauth_error_body import ( InvalidClientOAuthErrorBody as InvalidClientOAuthErrorBody, ) @@ -1303,6 +1564,9 @@ from .invitation_created_data_state import ( InvitationCreatedDataState as InvitationCreatedDataState, ) +from .invitation_created_data_state import ( + InvitationCreatedDataStateLiteral as InvitationCreatedDataStateLiteral, +) from .invitation_invalid_oauth_error_body import ( InvitationInvalidOAuthErrorBody as InvitationInvalidOAuthErrorBody, ) @@ -1311,16 +1575,27 @@ from .invitation_resent_data_state import ( InvitationResentDataState as InvitationResentDataState, ) +from .invitation_resent_data_state import ( + InvitationResentDataStateLiteral as InvitationResentDataStateLiteral, +) from .invitation_revoked import InvitationRevoked as InvitationRevoked from .invitation_revoked_data import InvitationRevokedData as InvitationRevokedData from .invitation_revoked_data_state import ( InvitationRevokedDataState as InvitationRevokedDataState, ) +from .invitation_revoked_data_state import ( + InvitationRevokedDataStateLiteral as InvitationRevokedDataStateLiteral, +) from .invitation_state import InvitationState as InvitationState +from .invitation_state import InvitationStateLiteral as InvitationStateLiteral from .invite_it_contact_intents import InviteItContactIntents as InviteItContactIntents from .invite_it_contact_intents import ( InviteItContactIntentsLiteral as InviteItContactIntentsLiteral, ) +from .issuer_trust import IssuerTrust as IssuerTrust +from .issuer_trust_created import IssuerTrustCreated as IssuerTrustCreated +from .issuer_trust_deleted import IssuerTrustDeleted as IssuerTrustDeleted +from .issuer_trust_updated import IssuerTrustUpdated as IssuerTrustUpdated from .list_metadata import ListMetadata as ListMetadata from .magic_auth_created import MagicAuthCreated as MagicAuthCreated from .magic_auth_created_data import MagicAuthCreatedData as MagicAuthCreatedData @@ -1335,6 +1610,7 @@ from .must_use_sso_for_selected_organization_message_error_body import ( MustUseSSOForSelectedOrganizationMessageErrorBody as MustUseSSOForSelectedOrganizationMessageErrorBody, ) +from .normalized_email import NormalizedEmail as NormalizedEmail from .oauth_data_integration_vended_credential import ( OAuthDataIntegrationVendedCredential as OAuthDataIntegrationVendedCredential, ) @@ -1363,6 +1639,9 @@ from .organization_connected_account_state import ( OrganizationConnectedAccountState as OrganizationConnectedAccountState, ) +from .organization_connected_account_state import ( + OrganizationConnectedAccountStateLiteral as OrganizationConnectedAccountStateLiteral, +) from .organization_created import OrganizationCreated as OrganizationCreated from .organization_created_data import ( OrganizationCreatedData as OrganizationCreatedData, @@ -1392,9 +1671,15 @@ from .organization_deleted_data_domain_state import ( OrganizationDeletedDataDomainState as OrganizationDeletedDataDomainState, ) +from .organization_deleted_data_domain_state import ( + OrganizationDeletedDataDomainStateLiteral as OrganizationDeletedDataDomainStateLiteral, +) from .organization_deleted_data_domain_verification_strategy import ( OrganizationDeletedDataDomainVerificationStrategy as OrganizationDeletedDataDomainVerificationStrategy, ) +from .organization_deleted_data_domain_verification_strategy import ( + OrganizationDeletedDataDomainVerificationStrategyLiteral as OrganizationDeletedDataDomainVerificationStrategyLiteral, +) from .organization_domain import OrganizationDomain as OrganizationDomain from .organization_domain_created import ( OrganizationDomainCreated as OrganizationDomainCreated, @@ -1405,9 +1690,15 @@ from .organization_domain_created_data_state import ( OrganizationDomainCreatedDataState as OrganizationDomainCreatedDataState, ) +from .organization_domain_created_data_state import ( + OrganizationDomainCreatedDataStateLiteral as OrganizationDomainCreatedDataStateLiteral, +) from .organization_domain_created_data_verification_strategy import ( OrganizationDomainCreatedDataVerificationStrategy as OrganizationDomainCreatedDataVerificationStrategy, ) +from .organization_domain_created_data_verification_strategy import ( + OrganizationDomainCreatedDataVerificationStrategyLiteral as OrganizationDomainCreatedDataVerificationStrategyLiteral, +) from .organization_domain_data_state import ( OrganizationDomainDataState as OrganizationDomainDataState, ) @@ -1423,12 +1714,21 @@ from .organization_domain_deleted_data_state import ( OrganizationDomainDeletedDataState as OrganizationDomainDeletedDataState, ) +from .organization_domain_deleted_data_state import ( + OrganizationDomainDeletedDataStateLiteral as OrganizationDomainDeletedDataStateLiteral, +) from .organization_domain_deleted_data_verification_strategy import ( OrganizationDomainDeletedDataVerificationStrategy as OrganizationDomainDeletedDataVerificationStrategy, ) +from .organization_domain_deleted_data_verification_strategy import ( + OrganizationDomainDeletedDataVerificationStrategyLiteral as OrganizationDomainDeletedDataVerificationStrategyLiteral, +) from .organization_domain_state import ( OrganizationDomainState as OrganizationDomainState, ) +from .organization_domain_state import ( + OrganizationDomainStateLiteral as OrganizationDomainStateLiteral, +) from .organization_domain_updated import ( OrganizationDomainUpdated as OrganizationDomainUpdated, ) @@ -1438,9 +1738,15 @@ from .organization_domain_updated_data_state import ( OrganizationDomainUpdatedDataState as OrganizationDomainUpdatedDataState, ) +from .organization_domain_updated_data_state import ( + OrganizationDomainUpdatedDataStateLiteral as OrganizationDomainUpdatedDataStateLiteral, +) from .organization_domain_updated_data_verification_strategy import ( OrganizationDomainUpdatedDataVerificationStrategy as OrganizationDomainUpdatedDataVerificationStrategy, ) +from .organization_domain_updated_data_verification_strategy import ( + OrganizationDomainUpdatedDataVerificationStrategyLiteral as OrganizationDomainUpdatedDataVerificationStrategyLiteral, +) from .organization_domain_verification_failed import ( OrganizationDomainVerificationFailed as OrganizationDomainVerificationFailed, ) @@ -1453,9 +1759,15 @@ from .organization_domain_verification_failed_data_organization_domain_state import ( OrganizationDomainVerificationFailedDataOrganizationDomainState as OrganizationDomainVerificationFailedDataOrganizationDomainState, ) +from .organization_domain_verification_failed_data_organization_domain_state import ( + OrganizationDomainVerificationFailedDataOrganizationDomainStateLiteral as OrganizationDomainVerificationFailedDataOrganizationDomainStateLiteral, +) from .organization_domain_verification_failed_data_organization_domain_verification_strategy import ( OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategy as OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategy, ) +from .organization_domain_verification_failed_data_organization_domain_verification_strategy import ( + OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategyLiteral as OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategyLiteral, +) from .organization_domain_verification_failed_data_reason import ( OrganizationDomainVerificationFailedDataReason as OrganizationDomainVerificationFailedDataReason, ) @@ -1465,6 +1777,9 @@ from .organization_domain_verification_strategy import ( OrganizationDomainVerificationStrategy as OrganizationDomainVerificationStrategy, ) +from .organization_domain_verification_strategy import ( + OrganizationDomainVerificationStrategyLiteral as OrganizationDomainVerificationStrategyLiteral, +) from .organization_domain_verified import ( OrganizationDomainVerified as OrganizationDomainVerified, ) @@ -1474,9 +1789,15 @@ from .organization_domain_verified_data_state import ( OrganizationDomainVerifiedDataState as OrganizationDomainVerifiedDataState, ) +from .organization_domain_verified_data_state import ( + OrganizationDomainVerifiedDataStateLiteral as OrganizationDomainVerifiedDataStateLiteral, +) from .organization_domain_verified_data_verification_strategy import ( OrganizationDomainVerifiedDataVerificationStrategy as OrganizationDomainVerifiedDataVerificationStrategy, ) +from .organization_domain_verified_data_verification_strategy import ( + OrganizationDomainVerifiedDataVerificationStrategyLiteral as OrganizationDomainVerifiedDataVerificationStrategyLiteral, +) from .organization_membership_created import ( OrganizationMembershipCreated as OrganizationMembershipCreated, ) @@ -1498,12 +1819,18 @@ from .organization_membership_deleted_data_status import ( OrganizationMembershipDeletedDataStatus as OrganizationMembershipDeletedDataStatus, ) +from .organization_membership_deleted_data_status import ( + OrganizationMembershipDeletedDataStatusLiteral as OrganizationMembershipDeletedDataStatusLiteral, +) from .organization_membership_not_found_oauth_error_body import ( OrganizationMembershipNotFoundOAuthErrorBody as OrganizationMembershipNotFoundOAuthErrorBody, ) from .organization_membership_status import ( OrganizationMembershipStatus as OrganizationMembershipStatus, ) +from .organization_membership_status import ( + OrganizationMembershipStatusLiteral as OrganizationMembershipStatusLiteral, +) from .organization_membership_updated import ( OrganizationMembershipUpdated as OrganizationMembershipUpdated, ) @@ -1513,6 +1840,9 @@ from .organization_membership_updated_data_status import ( OrganizationMembershipUpdatedDataStatus as OrganizationMembershipUpdatedDataStatus, ) +from .organization_membership_updated_data_status import ( + OrganizationMembershipUpdatedDataStatusLiteral as OrganizationMembershipUpdatedDataStatusLiteral, +) from .organization_not_found_oauth_error_body import ( OrganizationNotFoundOAuthErrorBody as OrganizationNotFoundOAuthErrorBody, ) @@ -1553,9 +1883,15 @@ from .organization_updated_data_domain_state import ( OrganizationUpdatedDataDomainState as OrganizationUpdatedDataDomainState, ) +from .organization_updated_data_domain_state import ( + OrganizationUpdatedDataDomainStateLiteral as OrganizationUpdatedDataDomainStateLiteral, +) from .organization_updated_data_domain_verification_strategy import ( OrganizationUpdatedDataDomainVerificationStrategy as OrganizationUpdatedDataDomainVerificationStrategy, ) +from .organization_updated_data_domain_verification_strategy import ( + OrganizationUpdatedDataDomainVerificationStrategyLiteral as OrganizationUpdatedDataDomainVerificationStrategyLiteral, +) from .pagination_order import PaginationOrder as PaginationOrder from .pagination_order import PaginationOrderLiteral as PaginationOrderLiteral from .passkey_progressive_enrollment_error_body import ( @@ -1606,12 +1942,21 @@ from .pipe_connected_account_auth_method import ( PipeConnectedAccountAuthMethod as PipeConnectedAccountAuthMethod, ) +from .pipe_connected_account_auth_method import ( + PipeConnectedAccountAuthMethodLiteral as PipeConnectedAccountAuthMethodLiteral, +) from .pipe_connected_account_connection_role import ( PipeConnectedAccountConnectionRole as PipeConnectedAccountConnectionRole, ) +from .pipe_connected_account_connection_role import ( + PipeConnectedAccountConnectionRoleLiteral as PipeConnectedAccountConnectionRoleLiteral, +) from .pipe_connected_account_state import ( PipeConnectedAccountState as PipeConnectedAccountState, ) +from .pipe_connected_account_state import ( + PipeConnectedAccountStateLiteral as PipeConnectedAccountStateLiteral, +) from .pipes_account_connection_add_failed import ( PipesAccountConnectionAddFailed as PipesAccountConnectionAddFailed, ) @@ -1663,12 +2008,156 @@ from .radar_challenge_error_body import ( RadarChallengeErrorBody as RadarChallengeErrorBody, ) +from .radar_detection_action import RadarDetectionAction as RadarDetectionAction +from .radar_detection_action import ( + RadarDetectionActionLiteral as RadarDetectionActionLiteral, +) +from .radar_detection_allowed_by import ( + RadarDetectionAllowedBy as RadarDetectionAllowedBy, +) +from .radar_detection_auth_method import ( + RadarDetectionAuthMethod as RadarDetectionAuthMethod, +) +from .radar_detection_auth_method import ( + RadarDetectionAuthMethodLiteral as RadarDetectionAuthMethodLiteral, +) +from .radar_detection_bot_detection_details import ( + RadarDetectionBotDetectionDetails as RadarDetectionBotDetectionDetails, +) +from .radar_detection_bot_detection_details_browser_signals import ( + RadarDetectionBotDetectionDetailsBrowserSignals as RadarDetectionBotDetectionDetailsBrowserSignals, +) +from .radar_detection_bot_detection_details_browser_signals import ( + RadarDetectionBotDetectionDetailsBrowserSignalsLiteral as RadarDetectionBotDetectionDetailsBrowserSignalsLiteral, +) +from .radar_detection_bot_detection_details_decided_by import ( + RadarDetectionBotDetectionDetailsDecidedBy as RadarDetectionBotDetectionDetailsDecidedBy, +) +from .radar_detection_bot_detection_details_decided_by import ( + RadarDetectionBotDetectionDetailsDecidedByLiteral as RadarDetectionBotDetectionDetailsDecidedByLiteral, +) +from .radar_detection_bot_detection_details_email_pattern import ( + RadarDetectionBotDetectionDetailsEmailPattern as RadarDetectionBotDetectionDetailsEmailPattern, +) +from .radar_detection_bot_detection_details_email_pattern import ( + RadarDetectionBotDetectionDetailsEmailPatternLiteral as RadarDetectionBotDetectionDetailsEmailPatternLiteral, +) +from .radar_detection_bot_detection_details_ip_risk import ( + RadarDetectionBotDetectionDetailsIpRisk as RadarDetectionBotDetectionDetailsIpRisk, +) +from .radar_detection_bot_detection_details_ip_risk import ( + RadarDetectionBotDetectionDetailsIpRiskLiteral as RadarDetectionBotDetectionDetailsIpRiskLiteral, +) +from .radar_detection_bot_detection_signal import ( + RadarDetectionBotDetectionSignal as RadarDetectionBotDetectionSignal, +) +from .radar_detection_bot_detection_signal_action import ( + RadarDetectionBotDetectionSignalAction as RadarDetectionBotDetectionSignalAction, +) +from .radar_detection_bot_detection_signal_action import ( + RadarDetectionBotDetectionSignalActionLiteral as RadarDetectionBotDetectionSignalActionLiteral, +) +from .radar_detection_bot_detection_signal_signal import ( + RadarDetectionBotDetectionSignalSignal as RadarDetectionBotDetectionSignalSignal, +) +from .radar_detection_bot_detection_signal_signal import ( + RadarDetectionBotDetectionSignalSignalLiteral as RadarDetectionBotDetectionSignalSignalLiteral, +) +from .radar_detection_brute_force_attack_details import ( + RadarDetectionBruteForceAttackDetails as RadarDetectionBruteForceAttackDetails, +) +from .radar_detection_brute_force_attack_details_matched_on import ( + RadarDetectionBruteForceAttackDetailsMatchedOn as RadarDetectionBruteForceAttackDetailsMatchedOn, +) +from .radar_detection_brute_force_attack_details_matched_on import ( + RadarDetectionBruteForceAttackDetailsMatchedOnLiteral as RadarDetectionBruteForceAttackDetailsMatchedOnLiteral, +) +from .radar_detection_challenge_type import ( + RadarDetectionChallengeType as RadarDetectionChallengeType, +) +from .radar_detection_challenge_type import ( + RadarDetectionChallengeTypeLiteral as RadarDetectionChallengeTypeLiteral, +) +from .radar_detection_control import RadarDetectionControl as RadarDetectionControl +from .radar_detection_control import ( + RadarDetectionControlLiteral as RadarDetectionControlLiteral, +) +from .radar_detection_domain_protections_details import ( + RadarDetectionDomainProtectionsDetails as RadarDetectionDomainProtectionsDetails, +) +from .radar_detection_domain_sign_ups import ( + RadarDetectionDomainSignUps as RadarDetectionDomainSignUps, +) +from .radar_detection_evidence_restriction import ( + RadarDetectionEvidenceRestriction as RadarDetectionEvidenceRestriction, +) +from .radar_detection_impossible_travel_details import ( + RadarDetectionImpossibleTravelDetails as RadarDetectionImpossibleTravelDetails, +) +from .radar_detection_ip_sign_ups import ( + RadarDetectionIpSignUps as RadarDetectionIpSignUps, +) +from .radar_detection_list import RadarDetectionList as RadarDetectionList +from .radar_detection_list_action import ( + RadarDetectionListAction as RadarDetectionListAction, +) +from .radar_detection_list_action import ( + RadarDetectionListActionLiteral as RadarDetectionListActionLiteral, +) +from .radar_detection_list_type import RadarDetectionListType as RadarDetectionListType +from .radar_detection_list_type import ( + RadarDetectionListTypeLiteral as RadarDetectionListTypeLiteral, +) +from .radar_detection_location import RadarDetectionLocation as RadarDetectionLocation +from .radar_detection_previous_attempt import ( + RadarDetectionPreviousAttempt as RadarDetectionPreviousAttempt, +) +from .radar_detection_previous_attempt_location import ( + RadarDetectionPreviousAttemptLocation as RadarDetectionPreviousAttemptLocation, +) +from .radar_detection_repeat_sign_up_details import ( + RadarDetectionRepeatSignUpDetails as RadarDetectionRepeatSignUpDetails, +) +from .radar_detection_repeat_sign_up_details import ( + RadarDetectionRepeatSignUpDetailsUnknown as RadarDetectionRepeatSignUpDetailsUnknown, +) +from .radar_detection_repeat_sign_up_details import ( + RadarDetectionRepeatSignUpDetailsVariant as RadarDetectionRepeatSignUpDetailsVariant, +) +from .radar_detection_repeat_sign_up_details_email import ( + RadarDetectionRepeatSignUpDetailsEmail as RadarDetectionRepeatSignUpDetailsEmail, +) +from .radar_detection_restriction_details import ( + RadarDetectionRestrictionDetails as RadarDetectionRestrictionDetails, +) +from .radar_detection_restriction_details import ( + RadarDetectionRestrictionDetailsUnknown as RadarDetectionRestrictionDetailsUnknown, +) +from .radar_detection_restriction_details import ( + RadarDetectionRestrictionDetailsVariant as RadarDetectionRestrictionDetailsVariant, +) +from .radar_detection_restriction_details_list import ( + RadarDetectionRestrictionDetailsList as RadarDetectionRestrictionDetailsList, +) +from .radar_detection_stale_account_details import ( + RadarDetectionStaleAccountDetails as RadarDetectionStaleAccountDetails, +) +from .radar_detection_unrecognized_device_details import ( + RadarDetectionUnrecognizedDeviceDetails as RadarDetectionUnrecognizedDeviceDetails, +) +from .radar_detection_verdict import RadarDetectionVerdict as RadarDetectionVerdict +from .radar_detection_verdict import ( + RadarDetectionVerdictLiteral as RadarDetectionVerdictLiteral, +) from .radar_list_entry_already_present_response import ( RadarListEntryAlreadyPresentResponse as RadarListEntryAlreadyPresentResponse, ) from .radar_sign_up_challenge_error_body import ( RadarSignUpChallengeErrorBody as RadarSignUpChallengeErrorBody, ) +from .radar_sms_challenge_error_body import ( + RadarSmsChallengeErrorBody as RadarSmsChallengeErrorBody, +) from .radar_sms_sign_in_challenge_error_body import ( RadarSmsSignInChallengeErrorBody as RadarSmsSignInChallengeErrorBody, ) @@ -1687,6 +2176,9 @@ from .radar_standalone_response_blocklist_type import ( RadarStandaloneResponseBlocklistType as RadarStandaloneResponseBlocklistType, ) +from .radar_standalone_response_blocklist_type import ( + RadarStandaloneResponseBlocklistTypeLiteral as RadarStandaloneResponseBlocklistTypeLiteral, +) from .radar_standalone_response_control import ( RadarStandaloneResponseControl as RadarStandaloneResponseControl, ) @@ -1702,9 +2194,13 @@ from .rate_limit_exceeded_error_body_with_retry_after import ( RateLimitExceededErrorBodyWithRetryAfter as RateLimitExceededErrorBodyWithRetryAfter, ) +from .repeat_sign_up import RepeatSignUp as RepeatSignUp from .resend_user_invite_options_locale import ( ResendUserInviteOptionsLocale as ResendUserInviteOptionsLocale, ) +from .resend_user_invite_options_locale import ( + ResendUserInviteOptionsLocaleLiteral as ResendUserInviteOptionsLocaleLiteral, +) from .resource_export_completed import ( ResourceExportCompleted as ResourceExportCompleted, ) @@ -1724,6 +2220,9 @@ from .resource_export_created_data_resource_type import ( ResourceExportCreatedDataResourceType as ResourceExportCreatedDataResourceType, ) +from .resource_export_created_data_resource_type import ( + ResourceExportCreatedDataResourceTypeLiteral as ResourceExportCreatedDataResourceTypeLiteral, +) from .resource_export_downloaded import ( ResourceExportDownloaded as ResourceExportDownloaded, ) @@ -1733,6 +2232,9 @@ from .resource_export_downloaded_data_resource_type import ( ResourceExportDownloadedDataResourceType as ResourceExportDownloadedDataResourceType, ) +from .resource_export_downloaded_data_resource_type import ( + ResourceExportDownloadedDataResourceTypeLiteral as ResourceExportDownloadedDataResourceTypeLiteral, +) from .resource_export_failed import ResourceExportFailed as ResourceExportFailed from .resource_export_failed_data import ( ResourceExportFailedData as ResourceExportFailedData, @@ -1740,6 +2242,12 @@ from .resource_export_failed_data_resource_type import ( ResourceExportFailedDataResourceType as ResourceExportFailedDataResourceType, ) +from .resource_export_failed_data_resource_type import ( + ResourceExportFailedDataResourceTypeLiteral as ResourceExportFailedDataResourceTypeLiteral, +) +from .role_assignment_update_overlap_error_body import ( + RoleAssignmentUpdateOverlapErrorBody as RoleAssignmentUpdateOverlapErrorBody, +) from .role_created import RoleCreated as RoleCreated from .role_created_data import RoleCreatedData as RoleCreatedData from .role_deleted import RoleDeleted as RoleDeleted @@ -1749,9 +2257,15 @@ from .role_updated import RoleUpdated as RoleUpdated from .role_updated_data import RoleUpdatedData as RoleUpdatedData from .send_email_change_locale import SendEmailChangeLocale as SendEmailChangeLocale +from .send_email_change_locale import ( + SendEmailChangeLocaleLiteral as SendEmailChangeLocaleLiteral, +) from .send_verification_email_locale import ( SendVerificationEmailLocale as SendVerificationEmailLocale, ) +from .send_verification_email_locale import ( + SendVerificationEmailLocaleLiteral as SendVerificationEmailLocaleLiteral, +) from .session_created import SessionCreated as SessionCreated from .session_created_data import SessionCreatedData as SessionCreatedData from .session_created_data_auth_method import ( @@ -1766,17 +2280,27 @@ from .session_created_data_status import ( SessionCreatedDataStatus as SessionCreatedDataStatus, ) +from .session_created_data_status import ( + SessionCreatedDataStatusLiteral as SessionCreatedDataStatusLiteral, +) from .session_revoked import SessionRevoked as SessionRevoked from .session_revoked_data import SessionRevokedData as SessionRevokedData from .session_revoked_data_auth_method import ( SessionRevokedDataAuthMethod as SessionRevokedDataAuthMethod, ) +from .session_revoked_data_auth_method import ( + SessionRevokedDataAuthMethodLiteral as SessionRevokedDataAuthMethodLiteral, +) from .session_revoked_data_impersonator import ( SessionRevokedDataImpersonator as SessionRevokedDataImpersonator, ) from .session_revoked_data_status import ( SessionRevokedDataStatus as SessionRevokedDataStatus, ) +from .session_revoked_data_status import ( + SessionRevokedDataStatusLiteral as SessionRevokedDataStatusLiteral, +) +from .sign_up import SignUp as SignUp from .sign_up_not_allowed_oauth_error_body import ( SignUpNotAllowedOAuthErrorBody as SignUpNotAllowedOAuthErrorBody, ) @@ -1788,9 +2312,13 @@ from .sms_challenge_rate_limited_error_body import ( SmsChallengeRateLimitedErrorBody as SmsChallengeRateLimitedErrorBody, ) +from .sms_sign_in import SmsSignIn as SmsSignIn +from .sms_sign_in_trigger import SmsSignInTrigger as SmsSignInTrigger +from .sms_sign_in_trigger import SmsSignInTriggerLiteral as SmsSignInTriggerLiteral from .sso_required_oauth_error_body_with_connection_ids_list_email import ( SSORequiredOAuthErrorBodyWithConnectionIdsListEmail as SSORequiredOAuthErrorBodyWithConnectionIdsListEmail, ) +from .stale_account import StaleAccount as StaleAccount from .sub_resource_scoped_role_not_allowed_error_body_with_role_slug import ( SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug as SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug, ) @@ -1815,6 +2343,7 @@ UnauthorizedClientOAuthErrorBody as UnauthorizedClientOAuthErrorBody, ) from .unauthorized_error_body import UnauthorizedErrorBody as UnauthorizedErrorBody +from .unrecognized_device import UnrecognizedDevice as UnrecognizedDevice from .update_audit_logs_retention_retention_period import ( UpdateAuditLogsRetentionRetentionPeriod as UpdateAuditLogsRetentionRetentionPeriod, ) @@ -1830,9 +2359,15 @@ from .update_audit_logs_retention_with_retention_period_retention_period import ( UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriod as UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriod, ) +from .update_audit_logs_retention_with_retention_period_retention_period import ( + UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriodLiteral as UpdateAuditLogsRetentionWithRetentionPeriodRetentionPeriodLiteral, +) from .update_custom_provider_definition_authenticate_via import ( UpdateCustomProviderDefinitionAuthenticateVia as UpdateCustomProviderDefinitionAuthenticateVia, ) +from .update_custom_provider_definition_authenticate_via import ( + UpdateCustomProviderDefinitionAuthenticateViaLiteral as UpdateCustomProviderDefinitionAuthenticateViaLiteral, +) from .update_user_organization_membership_with_role_slug import ( UpdateUserOrganizationMembershipWithRoleSlug as UpdateUserOrganizationMembershipWithRoleSlug, ) @@ -1842,12 +2377,21 @@ from .update_user_password_hash_type import ( UpdateUserPasswordHashType as UpdateUserPasswordHashType, ) +from .update_user_password_hash_type import ( + UpdateUserPasswordHashTypeLiteral as UpdateUserPasswordHashTypeLiteral, +) from .update_user_password_salt_position import ( UpdateUserPasswordSaltPosition as UpdateUserPasswordSaltPosition, ) +from .update_user_password_salt_position import ( + UpdateUserPasswordSaltPositionLiteral as UpdateUserPasswordSaltPositionLiteral, +) from .update_webhook_endpoint_events import ( UpdateWebhookEndpointEvents as UpdateWebhookEndpointEvents, ) +from .update_webhook_endpoint_events import ( + UpdateWebhookEndpointEventsLiteral as UpdateWebhookEndpointEventsLiteral, +) from .update_webhook_endpoint_status import ( UpdateWebhookEndpointStatus as UpdateWebhookEndpointStatus, ) @@ -1888,6 +2432,7 @@ UserIdentitiesGetItemProviderLiteral as UserIdentitiesGetItemProviderLiteral, ) from .user_invite_state import UserInviteState as UserInviteState +from .user_invite_state import UserInviteStateLiteral as UserInviteStateLiteral from .user_mismatch_error_body import UserMismatchErrorBody as UserMismatchErrorBody from .user_organization_membership_base_list_data import ( UserOrganizationMembershipBaseListData as UserOrganizationMembershipBaseListData, @@ -1895,9 +2440,15 @@ from .user_organization_membership_base_list_data_status import ( UserOrganizationMembershipBaseListDataStatus as UserOrganizationMembershipBaseListDataStatus, ) +from .user_organization_membership_base_list_data_status import ( + UserOrganizationMembershipBaseListDataStatusLiteral as UserOrganizationMembershipBaseListDataStatusLiteral, +) from .user_organization_membership_status import ( UserOrganizationMembershipStatus as UserOrganizationMembershipStatus, ) +from .user_organization_membership_status import ( + UserOrganizationMembershipStatusLiteral as UserOrganizationMembershipStatusLiteral, +) from .user_role_assignment_source_type import ( UserRoleAssignmentSourceType as UserRoleAssignmentSourceType, ) @@ -1905,11 +2456,15 @@ UserRoleAssignmentSourceTypeLiteral as UserRoleAssignmentSourceTypeLiteral, ) from .user_sessions_auth_method import UserSessionsAuthMethod as UserSessionsAuthMethod +from .user_sessions_auth_method import ( + UserSessionsAuthMethodLiteral as UserSessionsAuthMethodLiteral, +) from .user_sessions_impersonator import ( UserSessionsImpersonator as UserSessionsImpersonator, ) from .user_sessions_list_item import UserSessionsListItem as UserSessionsListItem from .user_sessions_status import UserSessionsStatus as UserSessionsStatus +from .user_sessions_status import UserSessionsStatusLiteral as UserSessionsStatusLiteral from .user_updated import UserUpdated as UserUpdated from .vault_byok_key_deleted import VaultByokKeyDeleted as VaultByokKeyDeleted from .vault_byok_key_deleted_data import ( @@ -1938,61 +2493,96 @@ from .vault_data_deleted_data_actor_source import ( VaultDataDeletedDataActorSource as VaultDataDeletedDataActorSource, ) +from .vault_data_deleted_data_actor_source import ( + VaultDataDeletedDataActorSourceLiteral as VaultDataDeletedDataActorSourceLiteral, +) from .vault_data_read import VaultDataRead as VaultDataRead from .vault_data_read_data import VaultDataReadData as VaultDataReadData from .vault_data_read_data_actor_source import ( VaultDataReadDataActorSource as VaultDataReadDataActorSource, ) +from .vault_data_read_data_actor_source import ( + VaultDataReadDataActorSourceLiteral as VaultDataReadDataActorSourceLiteral, +) from .vault_data_updated import VaultDataUpdated as VaultDataUpdated from .vault_data_updated_data import VaultDataUpdatedData as VaultDataUpdatedData from .vault_data_updated_data_actor_source import ( VaultDataUpdatedDataActorSource as VaultDataUpdatedDataActorSource, ) +from .vault_data_updated_data_actor_source import ( + VaultDataUpdatedDataActorSourceLiteral as VaultDataUpdatedDataActorSourceLiteral, +) from .vault_dek_decrypted import VaultDekDecrypted as VaultDekDecrypted from .vault_dek_decrypted_data import VaultDekDecryptedData as VaultDekDecryptedData from .vault_dek_decrypted_data_actor_source import ( VaultDekDecryptedDataActorSource as VaultDekDecryptedDataActorSource, ) +from .vault_dek_decrypted_data_actor_source import ( + VaultDekDecryptedDataActorSourceLiteral as VaultDekDecryptedDataActorSourceLiteral, +) from .vault_dek_read import VaultDekRead as VaultDekRead from .vault_dek_read_data import VaultDekReadData as VaultDekReadData from .vault_dek_read_data_actor_source import ( VaultDekReadDataActorSource as VaultDekReadDataActorSource, ) +from .vault_dek_read_data_actor_source import ( + VaultDekReadDataActorSourceLiteral as VaultDekReadDataActorSourceLiteral, +) from .vault_dek_rekeyed import VaultDekRekeyed as VaultDekRekeyed from .vault_dek_rekeyed_data import VaultDekRekeyedData as VaultDekRekeyedData from .vault_dek_rekeyed_data_actor_source import ( VaultDekRekeyedDataActorSource as VaultDekRekeyedDataActorSource, ) +from .vault_dek_rekeyed_data_actor_source import ( + VaultDekRekeyedDataActorSourceLiteral as VaultDekRekeyedDataActorSourceLiteral, +) from .vault_kek_created import VaultKekCreated as VaultKekCreated from .vault_kek_created_data import VaultKekCreatedData as VaultKekCreatedData from .vault_kek_created_data_actor_source import ( VaultKekCreatedDataActorSource as VaultKekCreatedDataActorSource, ) +from .vault_kek_created_data_actor_source import ( + VaultKekCreatedDataActorSourceLiteral as VaultKekCreatedDataActorSourceLiteral, +) from .vault_kek_deleted import VaultKekDeleted as VaultKekDeleted from .vault_kek_deleted_data import VaultKekDeletedData as VaultKekDeletedData from .vault_kek_deleted_data_actor_source import ( VaultKekDeletedDataActorSource as VaultKekDeletedDataActorSource, ) +from .vault_kek_deleted_data_actor_source import ( + VaultKekDeletedDataActorSourceLiteral as VaultKekDeletedDataActorSourceLiteral, +) from .vault_metadata_read import VaultMetadataRead as VaultMetadataRead from .vault_metadata_read_data import VaultMetadataReadData as VaultMetadataReadData from .vault_metadata_read_data_actor_source import ( VaultMetadataReadDataActorSource as VaultMetadataReadDataActorSource, ) +from .vault_metadata_read_data_actor_source import ( + VaultMetadataReadDataActorSourceLiteral as VaultMetadataReadDataActorSourceLiteral, +) from .vault_names_listed import VaultNamesListed as VaultNamesListed from .vault_names_listed_data import VaultNamesListedData as VaultNamesListedData from .vault_names_listed_data_actor_source import ( VaultNamesListedDataActorSource as VaultNamesListedDataActorSource, ) +from .vault_names_listed_data_actor_source import ( + VaultNamesListedDataActorSourceLiteral as VaultNamesListedDataActorSourceLiteral, +) from .verification_id_required_error_body import ( VerificationIdRequiredErrorBody as VerificationIdRequiredErrorBody, ) from .waitlist_entry_state import WaitlistEntryState as WaitlistEntryState +from .waitlist_entry_state import WaitlistEntryStateLiteral as WaitlistEntryStateLiteral from .waitlist_user import WaitlistUser as WaitlistUser from .waitlist_user_approved import WaitlistUserApproved as WaitlistUserApproved from .waitlist_user_created import WaitlistUserCreated as WaitlistUserCreated from .waitlist_user_denied import WaitlistUserDenied as WaitlistUserDenied from .waitlist_user_state import WaitlistUserState as WaitlistUserState +from .waitlist_user_state import WaitlistUserStateLiteral as WaitlistUserStateLiteral from .webhook_endpoint_status import WebhookEndpointStatus as WebhookEndpointStatus +from .webhook_endpoint_status import ( + WebhookEndpointStatusLiteral as WebhookEndpointStatusLiteral, +) from .widget_session_token_scopes import ( WidgetSessionTokenScopes as WidgetSessionTokenScopes, ) diff --git a/src/workos/common/models/agent_blueprint_created_data.py b/src/workos/common/models/agent_blueprint_created_data.py index 6b83419c..907644c5 100644 --- a/src/workos/common/models/agent_blueprint_created_data.py +++ b/src/workos/common/models/agent_blueprint_created_data.py @@ -13,6 +13,9 @@ from .agent_blueprint_created_data_invocable_by import ( AgentBlueprintCreatedDataInvocableBy, ) +from .agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission, +) from .agent_blueprint_created_data_session_setting import ( AgentBlueprintCreatedDataSessionSetting, ) @@ -30,8 +33,6 @@ class AgentBlueprintCreatedData: """Human-readable name of the agent blueprint.""" description: str | None """Human-readable description of the agent blueprint.""" - permissions: list[str] - """Permission slugs forming the ceiling on what sessions minted from this blueprint may do.""" invocable_by: AgentBlueprintCreatedDataInvocableBy """Who may mint sessions from this blueprint.""" invocable_as: AgentBlueprintCreatedDataInvocableAs @@ -42,6 +43,12 @@ class AgentBlueprintCreatedData: """The timestamp when the agent blueprint was created.""" updated_at: str """The timestamp when the agent blueprint was last updated.""" + permissions: list[str] | None = None + """Deprecated: use `scoped_permissions`. Slugs of every permission in the ceiling, across all instance types. + + .. deprecated:: This field is deprecated.""" + scoped_permissions: list[AgentBlueprintCreatedDataScopedPermission] | None = None + """Permissions forming the ceiling on what sessions minted from this blueprint may do, with the instance types that receive each one. Absent from events emitted before this field was added.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> AgentBlueprintCreatedData: @@ -52,7 +59,6 @@ def from_dict(cls, data: dict[str, Any]) -> AgentBlueprintCreatedData: id=data["id"], name=data["name"], description=data["description"], - permissions=data["permissions"], invocable_by=AgentBlueprintCreatedDataInvocableBy.from_dict( cast(dict[str, Any], data["invocable_by"]) ), @@ -64,6 +70,15 @@ def from_dict(cls, data: dict[str, Any]) -> AgentBlueprintCreatedData: ), created_at=data["created_at"], updated_at=data["updated_at"], + permissions=data.get("permissions"), + scoped_permissions=[ + AgentBlueprintCreatedDataScopedPermission.from_dict( + cast(dict[str, Any], item) + ) + for item in cast(list[Any], _v_scoped_permissions) + ] + if (_v_scoped_permissions := data.get("scoped_permissions")) is not None + else None, ) except (KeyError, ValueError) as e: _raise_deserialize_error("AgentBlueprintCreatedData", e) @@ -78,10 +93,15 @@ def to_dict(self) -> dict[str, Any]: result["description"] = self.description else: result["description"] = None - result["permissions"] = self.permissions result["invocable_by"] = self.invocable_by.to_dict() result["invocable_as"] = self.invocable_as.to_dict() result["session_settings"] = self.session_settings.to_dict() result["created_at"] = self.created_at result["updated_at"] = self.updated_at + if self.permissions is not None: + result["permissions"] = self.permissions + if self.scoped_permissions is not None: + result["scoped_permissions"] = [ + item.to_dict() for item in self.scoped_permissions + ] return result diff --git a/src/workos/common/models/agent_blueprint_created_data_scoped_permission.py b/src/workos/common/models/agent_blueprint_created_data_scoped_permission.py new file mode 100644 index 00000000..ee88feab --- /dev/null +++ b/src/workos/common/models/agent_blueprint_created_data_scoped_permission.py @@ -0,0 +1,49 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .agent_blueprint_created_data_scoped_permission_instance_types import ( + AgentBlueprintCreatedDataScopedPermissionInstanceTypes, +) + + +@dataclass(slots=True) +class AgentBlueprintCreatedDataScopedPermission: + """Agent Blueprint Created Data Scoped Permission model.""" + + slug: str + """Slug of the permission.""" + instance_types: list[AgentBlueprintCreatedDataScopedPermissionInstanceTypes] + """Instance types whose sessions receive the permission: `delegated`, `autonomous`, or both.""" + + @classmethod + def from_dict( + cls, data: dict[str, Any] + ) -> AgentBlueprintCreatedDataScopedPermission: + """Deserialize from a dictionary.""" + try: + return cls( + slug=data["slug"], + instance_types=[ + AgentBlueprintCreatedDataScopedPermissionInstanceTypes(item) + for item in cast(list[Any], data["instance_types"]) + ], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("AgentBlueprintCreatedDataScopedPermission", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["slug"] = self.slug + result["instance_types"] = [ + item.value if isinstance(item, Enum) else item + for item in self.instance_types + ] + return result diff --git a/src/workos/common/models/agent_blueprint_created_data_scoped_permission_instance_types.py b/src/workos/common/models/agent_blueprint_created_data_scoped_permission_instance_types.py new file mode 100644 index 00000000..8c5cef4e --- /dev/null +++ b/src/workos/common/models/agent_blueprint_created_data_scoped_permission_instance_types.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .agent_blueprint_created_data_invocable_as_instance_types import ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes, +) + +AgentBlueprintCreatedDataScopedPermissionInstanceTypes: TypeAlias = ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes +) +AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral: TypeAlias = Literal[ + "delegated", "autonomous" +] +__all__ = [ + "AgentBlueprintCreatedDataScopedPermissionInstanceTypes", + "AgentBlueprintCreatedDataScopedPermissionInstanceTypesLiteral", +] diff --git a/src/workos/common/models/agent_blueprint_scoped_permission_instance_types.py b/src/workos/common/models/agent_blueprint_scoped_permission_instance_types.py new file mode 100644 index 00000000..d5d57633 --- /dev/null +++ b/src/workos/common/models/agent_blueprint_scoped_permission_instance_types.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .agent_blueprint_created_data_invocable_as_instance_types import ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes, +) + +AgentBlueprintScopedPermissionInstanceTypes: TypeAlias = ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes +) +AgentBlueprintScopedPermissionInstanceTypesLiteral: TypeAlias = Literal[ + "delegated", "autonomous" +] +__all__ = [ + "AgentBlueprintScopedPermissionInstanceTypes", + "AgentBlueprintScopedPermissionInstanceTypesLiteral", +] diff --git a/src/workos/common/models/agent_blueprint_updated_data_scoped_permission.py b/src/workos/common/models/agent_blueprint_updated_data_scoped_permission.py new file mode 100644 index 00000000..253ee2f6 --- /dev/null +++ b/src/workos/common/models/agent_blueprint_updated_data_scoped_permission.py @@ -0,0 +1,11 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from .agent_blueprint_created_data_scoped_permission import ( + AgentBlueprintCreatedDataScopedPermission, +) + +AgentBlueprintUpdatedDataScopedPermission: TypeAlias = ( + AgentBlueprintCreatedDataScopedPermission +) diff --git a/src/workos/common/models/agent_blueprint_updated_data_scoped_permission_instance_types.py b/src/workos/common/models/agent_blueprint_updated_data_scoped_permission_instance_types.py new file mode 100644 index 00000000..c71a323a --- /dev/null +++ b/src/workos/common/models/agent_blueprint_updated_data_scoped_permission_instance_types.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .agent_blueprint_created_data_invocable_as_instance_types import ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes, +) + +AgentBlueprintUpdatedDataScopedPermissionInstanceTypes: TypeAlias = ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes +) +AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral: TypeAlias = Literal[ + "delegated", "autonomous" +] +__all__ = [ + "AgentBlueprintUpdatedDataScopedPermissionInstanceTypes", + "AgentBlueprintUpdatedDataScopedPermissionInstanceTypesLiteral", +] diff --git a/src/workos/common/models/agent_blueprints_create_request_permission_instance_types.py b/src/workos/common/models/agent_blueprints_create_request_permission_instance_types.py new file mode 100644 index 00000000..3fc404ea --- /dev/null +++ b/src/workos/common/models/agent_blueprints_create_request_permission_instance_types.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .agent_blueprint_created_data_invocable_as_instance_types import ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes, +) + +AgentBlueprintsCreateRequestPermissionInstanceTypes: TypeAlias = ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes +) +AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral: TypeAlias = Literal[ + "delegated", "autonomous" +] +__all__ = [ + "AgentBlueprintsCreateRequestPermissionInstanceTypes", + "AgentBlueprintsCreateRequestPermissionInstanceTypesLiteral", +] diff --git a/src/workos/common/models/agent_blueprints_update_request_permission_instance_types.py b/src/workos/common/models/agent_blueprints_update_request_permission_instance_types.py new file mode 100644 index 00000000..514662a4 --- /dev/null +++ b/src/workos/common/models/agent_blueprints_update_request_permission_instance_types.py @@ -0,0 +1,18 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .agent_blueprint_created_data_invocable_as_instance_types import ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes, +) + +AgentBlueprintsUpdateRequestPermissionInstanceTypes: TypeAlias = ( + AgentBlueprintCreatedDataInvocableAsInstanceTypes +) +AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral: TypeAlias = Literal[ + "delegated", "autonomous" +] +__all__ = [ + "AgentBlueprintsUpdateRequestPermissionInstanceTypes", + "AgentBlueprintsUpdateRequestPermissionInstanceTypesLiteral", +] diff --git a/src/workos/common/models/application_token_exchange_failed.py b/src/workos/common/models/application_token_exchange_failed.py new file mode 100644 index 00000000..73e80f63 --- /dev/null +++ b/src/workos/common/models/application_token_exchange_failed.py @@ -0,0 +1,59 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .application_token_exchange_failed_data import ApplicationTokenExchangeFailedData +from .event_context import EventContext + + +@dataclass(slots=True) +class ApplicationTokenExchangeFailed: + """Application Token Exchange Failed model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["application.token_exchange_failed"] + data: ApplicationTokenExchangeFailedData + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ApplicationTokenExchangeFailed: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "application.token_exchange_failed"), + data=ApplicationTokenExchangeFailedData.from_dict( + cast(dict[str, Any], data["data"]) + ), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ApplicationTokenExchangeFailed", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/application_token_exchange_failed_data.py b/src/workos/common/models/application_token_exchange_failed_data.py new file mode 100644 index 00000000..fdf68b69 --- /dev/null +++ b/src/workos/common/models/application_token_exchange_failed_data.py @@ -0,0 +1,53 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .application_token_exchange_failed_data_error import ( + ApplicationTokenExchangeFailedDataError, +) + + +@dataclass(slots=True) +class ApplicationTokenExchangeFailedData: + """The event payload.""" + + grant_type: str + """The OAuth grant type of the token request that presented the token to exchange.""" + client_id: str + """The client ID of the application that made the token request.""" + issuer: str | None + """The issuer the presented token claims. It is not verified, and is `null` when the token could not be read.""" + error: ApplicationTokenExchangeFailedDataError + """Why the token exchange failed.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ApplicationTokenExchangeFailedData: + """Deserialize from a dictionary.""" + try: + return cls( + grant_type=data["grant_type"], + client_id=data["client_id"], + issuer=data["issuer"], + error=ApplicationTokenExchangeFailedDataError.from_dict( + cast(dict[str, Any], data["error"]) + ), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ApplicationTokenExchangeFailedData", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["grant_type"] = self.grant_type + result["client_id"] = self.client_id + if self.issuer is not None: + result["issuer"] = self.issuer + else: + result["issuer"] = None + result["error"] = self.error.to_dict() + return result diff --git a/src/workos/common/models/application_token_exchange_failed_data_error.py b/src/workos/common/models/application_token_exchange_failed_data_error.py new file mode 100644 index 00000000..207a8a9d --- /dev/null +++ b/src/workos/common/models/application_token_exchange_failed_data_error.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class ApplicationTokenExchangeFailedDataError: + """Why the token exchange failed.""" + + code: str + """The OAuth error code returned to the application.""" + message: str + """A human-readable description of the error.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ApplicationTokenExchangeFailedDataError: + """Deserialize from a dictionary.""" + try: + return cls( + code=data["code"], + message=data["message"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ApplicationTokenExchangeFailedDataError", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["code"] = self.code + result["message"] = self.message + return result diff --git a/src/workos/common/models/application_token_exchange_succeeded.py b/src/workos/common/models/application_token_exchange_succeeded.py new file mode 100644 index 00000000..d712ac4a --- /dev/null +++ b/src/workos/common/models/application_token_exchange_succeeded.py @@ -0,0 +1,61 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .application_token_exchange_succeeded_data import ( + ApplicationTokenExchangeSucceededData, +) +from .event_context import EventContext + + +@dataclass(slots=True) +class ApplicationTokenExchangeSucceeded: + """Application Token Exchange Succeeded model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["application.token_exchange_succeeded"] + data: ApplicationTokenExchangeSucceededData + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ApplicationTokenExchangeSucceeded: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "application.token_exchange_succeeded"), + data=ApplicationTokenExchangeSucceededData.from_dict( + cast(dict[str, Any], data["data"]) + ), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ApplicationTokenExchangeSucceeded", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/application_token_exchange_succeeded_data.py b/src/workos/common/models/application_token_exchange_succeeded_data.py new file mode 100644 index 00000000..76af7fa1 --- /dev/null +++ b/src/workos/common/models/application_token_exchange_succeeded_data.py @@ -0,0 +1,66 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class ApplicationTokenExchangeSucceededData: + """The event payload.""" + + grant_type: str + """The OAuth grant type of the token request that presented the token to exchange.""" + client_id: str + """The client ID of the application that made the token request.""" + user_id: str + """The ID of the user the access token was issued for.""" + email: str + """The email address of the user.""" + organization_id: str | None + """The ID of the organization the access token is scoped to.""" + issuer: str + """The issuer of the token that was exchanged.""" + connection_id: str | None + """The ID of the SSO connection whose identity provider issued the exchanged token. `null` when the AI client issued it.""" + jti: str + """The `jti` claim of the access token that was issued.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ApplicationTokenExchangeSucceededData: + """Deserialize from a dictionary.""" + try: + return cls( + grant_type=data["grant_type"], + client_id=data["client_id"], + user_id=data["user_id"], + email=data["email"], + organization_id=data["organization_id"], + issuer=data["issuer"], + connection_id=data["connection_id"], + jti=data["jti"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ApplicationTokenExchangeSucceededData", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["grant_type"] = self.grant_type + result["client_id"] = self.client_id + result["user_id"] = self.user_id + result["email"] = self.email + if self.organization_id is not None: + result["organization_id"] = self.organization_id + else: + result["organization_id"] = None + result["issuer"] = self.issuer + if self.connection_id is not None: + result["connection_id"] = self.connection_id + else: + result["connection_id"] = None + result["jti"] = self.jti + return result diff --git a/src/workos/common/models/authentication_email_verification_failed_data_error.py b/src/workos/common/models/authentication_email_verification_failed_data_error.py index 76d1db3a..37be2e5f 100644 --- a/src/workos/common/models/authentication_email_verification_failed_data_error.py +++ b/src/workos/common/models/authentication_email_verification_failed_data_error.py @@ -17,7 +17,7 @@ class AuthenticationEmailVerificationFailedDataError: message: str """A human-readable error message.""" radar_detection_id: str | None = None - """The ID of the Radar detection that blocked the authentication. Only set on `policy_denied` errors.""" + """The ID of the Radar detection that blocked the authentication. Retrieve the detection with `GET /radar/detections/:id` to see why Radar acted. Only set on `policy_denied` errors that a Radar detection caused.""" @classmethod def from_dict( diff --git a/src/workos/common/models/authentication_radar_risk_detected_data.py b/src/workos/common/models/authentication_radar_risk_detected_data.py index 97c505fa..23c5303d 100644 --- a/src/workos/common/models/authentication_radar_risk_detected_data.py +++ b/src/workos/common/models/authentication_radar_risk_detected_data.py @@ -21,7 +21,7 @@ class AuthenticationRadarRiskDetectedData: """The authentication method used.""" action: AuthenticationRadarRiskDetectedDataAction control: str | None - """The control action taken for the detected risk.""" + """The Radar control that detected the risk.""" blocklist_type: str | None """The type of blocklist that triggered the risk detection.""" ip_address: str | None @@ -33,7 +33,7 @@ class AuthenticationRadarRiskDetectedData: email: str """The email address of the user.""" radar_detection_id: str | None = None - """The ID of the Radar detection that challenged the authentication.""" + """The ID of the Radar detection that challenged the authentication. Retrieve the detection with `GET /radar/detections/:id` to see why Radar acted.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> AuthenticationRadarRiskDetectedData: diff --git a/src/workos/common/models/blocked_tld.py b/src/workos/common/models/blocked_tld.py new file mode 100644 index 00000000..d5ab36ca --- /dev/null +++ b/src/workos/common/models/blocked_tld.py @@ -0,0 +1,31 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class BlockedTld: + """Blocked Tld model.""" + + type: Literal["blocked_tld"] + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> BlockedTld: + """Deserialize from a dictionary.""" + try: + return cls( + type=data.get("type", "blocked_tld"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("BlockedTld", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type + return result diff --git a/src/workos/common/models/bot_detection.py b/src/workos/common/models/bot_detection.py new file mode 100644 index 00000000..afa9ae96 --- /dev/null +++ b/src/workos/common/models/bot_detection.py @@ -0,0 +1,54 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_bot_detection_details import RadarDetectionBotDetectionDetails + + +@dataclass(slots=True) +class BotDetection: + """Bot Detection model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["bot_detection"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionBotDetectionDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> BotDetection: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "bot_detection"), + details=RadarDetectionBotDetectionDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("BotDetection", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/brute_force_attack.py b/src/workos/common/models/brute_force_attack.py new file mode 100644 index 00000000..5670ee42 --- /dev/null +++ b/src/workos/common/models/brute_force_attack.py @@ -0,0 +1,56 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_brute_force_attack_details import ( + RadarDetectionBruteForceAttackDetails, +) + + +@dataclass(slots=True) +class BruteForceAttack: + """Brute Force Attack model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["brute_force_attack"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionBruteForceAttackDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> BruteForceAttack: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "brute_force_attack"), + details=RadarDetectionBruteForceAttackDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("BruteForceAttack", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/connect/models/create_application_secret.py b/src/workos/common/models/create_application_secret.py similarity index 100% rename from src/workos/connect/models/create_application_secret.py rename to src/workos/common/models/create_application_secret.py diff --git a/src/workos/common/models/domain_protections.py b/src/workos/common/models/domain_protections.py new file mode 100644 index 00000000..e4704dbc --- /dev/null +++ b/src/workos/common/models/domain_protections.py @@ -0,0 +1,56 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_domain_protections_details import ( + RadarDetectionDomainProtectionsDetails, +) + + +@dataclass(slots=True) +class DomainProtections: + """Domain Protections model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["domain_protections"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionDomainProtectionsDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> DomainProtections: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "domain_protections"), + details=RadarDetectionDomainProtectionsDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("DomainProtections", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/entity_not_found_error_body_with_entity_id.py b/src/workos/common/models/entity_not_found_error_body_with_entity_id.py new file mode 100644 index 00000000..2fe36ddf --- /dev/null +++ b/src/workos/common/models/entity_not_found_error_body_with_entity_id.py @@ -0,0 +1,40 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class EntityNotFoundErrorBodyWithEntityId: + """Entity Not Found Error Body With Entity Id model.""" + + code: Literal["entity_not_found"] + """The error code identifying the type of error.""" + message: str + """A human-readable description of the error.""" + entity_id: str + """The ID of the organization that was not found.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> EntityNotFoundErrorBodyWithEntityId: + """Deserialize from a dictionary.""" + try: + return cls( + code=data.get("code", "entity_not_found"), + message=data["message"], + entity_id=data["entity_id"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("EntityNotFoundErrorBodyWithEntityId", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["code"] = self.code + result["message"] = self.message + result["entity_id"] = self.entity_id + return result diff --git a/src/workos/common/models/entity_not_found_error_body_with_ids_list.py b/src/workos/common/models/entity_not_found_error_body_with_ids_list.py new file mode 100644 index 00000000..e10cad3e --- /dev/null +++ b/src/workos/common/models/entity_not_found_error_body_with_ids_list.py @@ -0,0 +1,40 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class EntityNotFoundErrorBodyWithIdsList: + """Entity Not Found Error Body With Ids List model.""" + + code: Literal["entities_not_found"] + """The error code identifying the type of error.""" + message: str + """A human-readable description of the error.""" + ids: list[str] + """The requested user and organization IDs, in that order.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> EntityNotFoundErrorBodyWithIdsList: + """Deserialize from a dictionary.""" + try: + return cls( + code=data.get("code", "entities_not_found"), + message=data["message"], + ids=data["ids"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("EntityNotFoundErrorBodyWithIdsList", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["code"] = self.code + result["message"] = self.message + result["ids"] = self.ids + return result diff --git a/src/workos/common/models/error_body_code.py b/src/workos/common/models/error_body_code.py index a02fb5ca..ee96c096 100644 --- a/src/workos/common/models/error_body_code.py +++ b/src/workos/common/models/error_body_code.py @@ -32,6 +32,7 @@ class ErrorBodyCode(str, Enum): CANNOT_REACTIVATE_PENDING_ORGANIZATION_MEMBERSHIP = ( "cannot_reactivate_pending_organization_membership" ) + CANNOT_REMOVE_GROUP_SOURCED_ROLE = "cannot_remove_group_sourced_role" CERTIFICATE_EXPIRED = "certificate_expired" CHAIN_DEPTH_EXCEEDED = "chain_depth_exceeded" CLAIM_DENIED = "claim_denied" @@ -55,6 +56,7 @@ class ErrorBodyCode(str, Enum): DIRECTORY_SYNC_RATE_LIMITED = "directory_sync_rate_limited" DIRECTORY_SYNC_UNSUPPORTED = "directory_sync_unsupported" DISCOVERY_ENDPOINT_MUST_USE_HTTPS = "discovery_endpoint_must_use_https" + DISCOVERY_ENDPOINT_TENANT_NOT_ALLOWED = "discovery_endpoint_tenant_not_allowed" DOMAIN_ALREADY_EXISTS = "domain_already_exists" DOMAIN_ALREADY_VERIFIED = "domain_already_verified" DUPLICATE_ENDPOINT = "duplicate_endpoint" @@ -79,6 +81,7 @@ class ErrorBodyCode(str, Enum): EMAIL_VERIFICATION_CODE_INCORRECT = "email_verification_code_incorrect" EMAIL_VERIFICATION_CODE_PREVIOUSLY_USED = "email_verification_code_previously_used" EMAIL_VERIFICATION_REQUIRED = "email_verification_required" + ENTITIES_NOT_FOUND = "entities_not_found" ENTITY_NOT_FOUND = "entity_not_found" EXPIRES_IN_DAYS_TOO_LONG = "expires_in_days_too_long" EXPIRES_IN_DAYS_TOO_SHORT = "expires_in_days_too_short" @@ -100,6 +103,8 @@ class ErrorBodyCode(str, Enum): INVALID_EMAIL = "invalid_email" INVALID_IDP_SSO_URL = "invalid_idp_sso_url" INVALID_INVITE = "invalid_invite" + INVALID_ISSUER_METADATA = "invalid_issuer_metadata" + INVALID_ISSUER_URL = "invalid_issuer_url" INVALID_LOCALE = "invalid_locale" INVALID_METADATA = "invalid_metadata" INVALID_ONE_TIME_CODE = "invalid_one_time_code" @@ -121,6 +126,7 @@ class ErrorBodyCode(str, Enum): INVITE_NOT_PENDING = "invite_not_pending" INVITE_REVOKED = "invite_revoked" IP_ADDRESS_REQUIRED = "ip_address_required" + ISSUER_ALREADY_TRUSTED = "issuer_already_trusted" IT_CONTACT_ALREADY_EXISTS = "it_contact_already_exists" IT_CONTACT_INVITATION_ALREADY_ACTIVE = "it_contact_invitation_already_active" KEY_PAIR_NOT_ACCEPTED = "key_pair_not_accepted" @@ -135,13 +141,16 @@ class ErrorBodyCode(str, Enum): MULTIPLE_ROLES_NOT_ENABLED = "multiple_roles_not_enabled" NAME_ALREADY_IN_USE = "name_already_in_use" NO_PENDING_EMAIL_CHANGE = "no_pending_email_change" + NOT_CLAUDE_ISSUER = "not_claude_issuer" OIDC_OPTIONS_REQUIRED = "oidc_options_required" ONE_TIME_CODE_EXPIRED = "one_time_code_expired" ONE_TIME_CODE_PREVIOUSLY_USED = "one_time_code_previously_used" ONE_TIME_CODE_TOO_MANY_ATTEMPTS = "one_time_code_too_many_attempts" + ORGANIZATION_ALREADY_HAS_TRUST = "organization_already_has_trust" ORGANIZATION_BLOCKED_FROM_SENDING_INVITES = ( "organization_blocked_from_sending_invites" ) + ORGANIZATION_HAS_IDP_MANAGED_EMA = "organization_has_idp_managed_ema" ORGANIZATION_MEMBERSHIP_DIRECTORY_MANAGED = ( "organization_membership_directory_managed" ) @@ -149,6 +158,7 @@ class ErrorBodyCode(str, Enum): ORGANIZATION_NOT_INVOCABLE = "organization_not_invocable" ORGANIZATION_ROLE_SLUG_CONFLICT = "organization_role_slug_conflict" ORGANIZATION_SELECTION_REQUIRED = "organization_selection_required" + ORGANIZATION_WITHOUT_VERIFIED_DOMAIN = "organization_without_verified_domain" PASSKEY_PROGRESSIVE_ENROLLMENT = "passkey_progressive_enrollment" PASSWORD_AND_PASSWORD_HASH_PROVIDED = "password_and_password_hash_provided" PASSWORD_AND_PASSWORD_HASH_TYPE_PROVIDED = ( @@ -166,11 +176,13 @@ class ErrorBodyCode(str, Enum): PRODUCTION_FEATURE_REQUIRES_BILLING = "production_feature_requires_billing" RADAR_CHALLENGE = "radar_challenge" RADAR_SIGN_UP_CHALLENGE = "radar_sign_up_challenge" + RADAR_SMS_CHALLENGE = "radar_sms_challenge" RADAR_SMS_SIGN_IN_CHALLENGE = "radar_sms_sign_in_challenge" RATE_LIMIT_EXCEEDED = "rate_limit_exceeded" RESOURCE_HAS_DEPENDENTS = "resource_has_dependents" RESOURCE_LIMIT_EXCEEDED = "resource_limit_exceeded" RESOURCE_TYPE_UPDATE_IN_PROGRESS = "resource_type_update_in_progress" + ROLE_ASSIGNMENT_UPDATE_OVERLAP = "role_assignment_update_overlap" ROLE_HAS_ASSIGNMENTS = "role_has_assignments" ROLE_HAS_GROUP_ROLE_MAPPINGS = "role_has_group_role_mappings" ROLE_NOT_FOUND = "role_not_found" @@ -229,6 +241,7 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "cannot_deactivate_pending_organization_membership", "cannot_delete_last_certificate", "cannot_reactivate_pending_organization_membership", + "cannot_remove_group_sourced_role", "certificate_expired", "chain_depth_exceeded", "claim_denied", @@ -252,6 +265,7 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "directory_sync_rate_limited", "directory_sync_unsupported", "discovery_endpoint_must_use_https", + "discovery_endpoint_tenant_not_allowed", "domain_already_exists", "domain_already_verified", "duplicate_endpoint", @@ -276,6 +290,7 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "email_verification_code_incorrect", "email_verification_code_previously_used", "email_verification_required", + "entities_not_found", "entity_not_found", "expires_in_days_too_long", "expires_in_days_too_short", @@ -295,6 +310,8 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "invalid_email", "invalid_idp_sso_url", "invalid_invite", + "invalid_issuer_metadata", + "invalid_issuer_url", "invalid_locale", "invalid_metadata", "invalid_one_time_code", @@ -316,6 +333,7 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "invite_not_pending", "invite_revoked", "ip_address_required", + "issuer_already_trusted", "it_contact_already_exists", "it_contact_invitation_already_active", "key_pair_not_accepted", @@ -328,16 +346,20 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "multiple_roles_not_enabled", "name_already_in_use", "no_pending_email_change", + "not_claude_issuer", "oidc_options_required", "one_time_code_expired", "one_time_code_previously_used", "one_time_code_too_many_attempts", + "organization_already_has_trust", "organization_blocked_from_sending_invites", + "organization_has_idp_managed_ema", "organization_membership_directory_managed", "organization_not_found", "organization_not_invocable", "organization_role_slug_conflict", "organization_selection_required", + "organization_without_verified_domain", "passkey_progressive_enrollment", "password_and_password_hash_provided", "password_and_password_hash_type_provided", @@ -351,11 +373,13 @@ def _missing_(cls, value: object) -> ErrorBodyCode | None: "production_feature_requires_billing", "radar_challenge", "radar_sign_up_challenge", + "radar_sms_challenge", "radar_sms_sign_in_challenge", "rate_limit_exceeded", "resource_has_dependents", "resource_limit_exceeded", "resource_type_update_in_progress", + "role_assignment_update_overlap", "role_has_assignments", "role_has_group_role_mappings", "role_not_found", diff --git a/src/workos/common/models/error_body_with_code.py b/src/workos/common/models/error_body_with_code.py index 4035c1ce..497fc55e 100644 --- a/src/workos/common/models/error_body_with_code.py +++ b/src/workos/common/models/error_body_with_code.py @@ -1,36 +1,9 @@ # This file is auto-generated by oagen. Do not edit. -from __future__ import annotations +from typing import TypeAlias -from dataclasses import dataclass -from typing import Any +from .application_token_exchange_failed_data_error import ( + ApplicationTokenExchangeFailedDataError, +) -from workos._types import _raise_deserialize_error - - -@dataclass(slots=True) -class ErrorBodyWithCode: - """Error Body With Code model.""" - - code: str - """The error code identifying the type of error.""" - message: str - """A human-readable description of the error.""" - - @classmethod - def from_dict(cls, data: dict[str, Any]) -> ErrorBodyWithCode: - """Deserialize from a dictionary.""" - try: - return cls( - code=data["code"], - message=data["message"], - ) - except (KeyError, ValueError) as e: - _raise_deserialize_error("ErrorBodyWithCode", e) - - def to_dict(self) -> dict[str, Any]: - """Serialize to a dictionary.""" - result: dict[str, Any] = {} - result["code"] = self.code - result["message"] = self.message - return result +ErrorBodyWithCode: TypeAlias = ApplicationTokenExchangeFailedDataError diff --git a/src/workos/common/models/impossible_travel.py b/src/workos/common/models/impossible_travel.py new file mode 100644 index 00000000..c12bc28e --- /dev/null +++ b/src/workos/common/models/impossible_travel.py @@ -0,0 +1,56 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_impossible_travel_details import ( + RadarDetectionImpossibleTravelDetails, +) + + +@dataclass(slots=True) +class ImpossibleTravel: + """Impossible Travel model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["impossible_travel"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionImpossibleTravelDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ImpossibleTravel: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "impossible_travel"), + details=RadarDetectionImpossibleTravelDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("ImpossibleTravel", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/issuer_trust.py b/src/workos/common/models/issuer_trust.py new file mode 100644 index 00000000..1d90bfe7 --- /dev/null +++ b/src/workos/common/models/issuer_trust.py @@ -0,0 +1,61 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + + +@dataclass(slots=True) +class IssuerTrust: + """Issuer Trust model.""" + + object: Literal["issuer_trust"] + """The Issuer Trust object.""" + id: str + """The unique ID of the Issuer Trust.""" + organization_id: str + """The ID of the Organization that trusts the issuer.""" + type: Literal["claude"] + """The type of issuer, which identifies who operates it.""" + issuer: str + """The issuer URL. ID-JAGs whose `iss` claim equals this URL are exchanged for access tokens scoped to the Organization.""" + enabled: bool + """Whether ID-JAGs from the issuer are accepted. A trust is created disabled.""" + created_at: datetime + """An ISO 8601 timestamp.""" + updated_at: datetime + """An ISO 8601 timestamp.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrust: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "issuer_trust"), + id=data["id"], + organization_id=data["organization_id"], + type=data.get("type", "claude"), + issuer=data["issuer"], + enabled=data["enabled"], + created_at=_parse_datetime(data["created_at"]), + updated_at=_parse_datetime(data["updated_at"]), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrust", 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["organization_id"] = self.organization_id + result["type"] = self.type + result["issuer"] = self.issuer + result["enabled"] = self.enabled + result["created_at"] = _format_datetime(self.created_at) + result["updated_at"] = _format_datetime(self.updated_at) + return result diff --git a/src/workos/common/models/issuer_trust_created.py b/src/workos/common/models/issuer_trust_created.py new file mode 100644 index 00000000..acd6d3f4 --- /dev/null +++ b/src/workos/common/models/issuer_trust_created.py @@ -0,0 +1,57 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .event_context import EventContext +from .issuer_trust import IssuerTrust + + +@dataclass(slots=True) +class IssuerTrustCreated: + """Issuer Trust Created model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["issuer_trust.created"] + data: IssuerTrust + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustCreated: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "issuer_trust.created"), + data=IssuerTrust.from_dict(cast(dict[str, Any], data["data"])), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustCreated", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/issuer_trust_deleted.py b/src/workos/common/models/issuer_trust_deleted.py new file mode 100644 index 00000000..637f45de --- /dev/null +++ b/src/workos/common/models/issuer_trust_deleted.py @@ -0,0 +1,57 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .event_context import EventContext +from .issuer_trust import IssuerTrust + + +@dataclass(slots=True) +class IssuerTrustDeleted: + """Issuer Trust Deleted model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["issuer_trust.deleted"] + data: IssuerTrust + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustDeleted: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "issuer_trust.deleted"), + data=IssuerTrust.from_dict(cast(dict[str, Any], data["data"])), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustDeleted", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/issuer_trust_updated.py b/src/workos/common/models/issuer_trust_updated.py new file mode 100644 index 00000000..260ccfc6 --- /dev/null +++ b/src/workos/common/models/issuer_trust_updated.py @@ -0,0 +1,57 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .event_context import EventContext +from .issuer_trust import IssuerTrust + + +@dataclass(slots=True) +class IssuerTrustUpdated: + """Issuer Trust Updated model.""" + + object: Literal["event"] + """Distinguishes the Event object.""" + id: str + """Unique identifier for the event.""" + event: Literal["issuer_trust.updated"] + data: IssuerTrust + """The event payload.""" + created_at: datetime + """An ISO 8601 timestamp.""" + context: EventContext | None = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustUpdated: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "event"), + id=data["id"], + event=data.get("event", "issuer_trust.updated"), + data=IssuerTrust.from_dict(cast(dict[str, Any], data["data"])), + created_at=_parse_datetime(data["created_at"]), + context=EventContext.from_dict(cast(dict[str, Any], _v_context)) + if (_v_context := data.get("context")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustUpdated", 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["event"] = self.event + result["data"] = self.data.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.context is not None: + result["context"] = self.context.to_dict() + return result diff --git a/src/workos/common/models/normalized_email.py b/src/workos/common/models/normalized_email.py new file mode 100644 index 00000000..f3354946 --- /dev/null +++ b/src/workos/common/models/normalized_email.py @@ -0,0 +1,35 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class NormalizedEmail: + """Normalized Email model.""" + + matched_on: Literal["normalized_email"] + matched_user_id: str + """The existing user whose email this sign-up is an alias of.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> NormalizedEmail: + """Deserialize from a dictionary.""" + try: + return cls( + matched_on=data.get("matched_on", "normalized_email"), + matched_user_id=data["matched_user_id"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("NormalizedEmail", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["matched_on"] = self.matched_on + result["matched_user_id"] = self.matched_user_id + return result diff --git a/src/workos/common/models/radar_detection_action.py b/src/workos/common/models/radar_detection_action.py new file mode 100644 index 00000000..51a539a2 --- /dev/null +++ b/src/workos/common/models/radar_detection_action.py @@ -0,0 +1,11 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .authentication_radar_risk_detected_data_action import ( + AuthenticationRadarRiskDetectedDataAction, +) + +RadarDetectionAction: TypeAlias = AuthenticationRadarRiskDetectedDataAction +RadarDetectionActionLiteral: TypeAlias = Literal["signup", "login"] +__all__ = ["RadarDetectionAction", "RadarDetectionActionLiteral"] diff --git a/src/workos/common/models/radar_detection_allowed_by.py b/src/workos/common/models/radar_detection_allowed_by.py new file mode 100644 index 00000000..84f0e82f --- /dev/null +++ b/src/workos/common/models/radar_detection_allowed_by.py @@ -0,0 +1,48 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_list import RadarDetectionList + + +@dataclass(slots=True) +class RadarDetectionAllowedBy: + """Radar Detection Allowed By model.""" + + list_id: str + """The ID of the matched list.""" + list: RadarDetectionList | None + """The list as it is now. `null` if the list has since been deleted.""" + entry: str | None = None + """The list entry that matched.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionAllowedBy: + """Deserialize from a dictionary.""" + try: + return cls( + list_id=data["list_id"], + list=RadarDetectionList.from_dict(cast(dict[str, Any], _v_list)) + if (_v_list := data["list"]) is not None + else None, + entry=data.get("entry"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionAllowedBy", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["list_id"] = self.list_id + if self.list is not None: + result["list"] = self.list.to_dict() + else: + result["list"] = None + if self.entry is not None: + result["entry"] = self.entry + return result diff --git a/src/workos/common/models/radar_detection_auth_method.py b/src/workos/common/models/radar_detection_auth_method.py new file mode 100644 index 00000000..b56f76f0 --- /dev/null +++ b/src/workos/common/models/radar_detection_auth_method.py @@ -0,0 +1,42 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection auth method values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionAuthMethod(str, Enum): + """Known values for RadarDetectionAuthMethod.""" + + PASSWORD = "password" + PASSKEY = "passkey" + MAGIC_AUTH = "magic_auth" + OAUTH = "oauth" + SSO = "sso" + AUTHENTICATOR = "authenticator" + SMS_OTP = "sms_otp" + OTHER = "other" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionAuthMethod | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionAuthMethodLiteral: TypeAlias = Literal[ + "password", + "passkey", + "magic_auth", + "oauth", + "sso", + "authenticator", + "sms_otp", + "other", +] diff --git a/src/workos/common/models/radar_detection_bot_detection_details.py b/src/workos/common/models/radar_detection_bot_detection_details.py new file mode 100644 index 00000000..dee4a32a --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_details.py @@ -0,0 +1,121 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_bot_detection_details_browser_signals import ( + RadarDetectionBotDetectionDetailsBrowserSignals, +) +from .radar_detection_bot_detection_details_decided_by import ( + RadarDetectionBotDetectionDetailsDecidedBy, +) +from .radar_detection_bot_detection_details_email_pattern import ( + RadarDetectionBotDetectionDetailsEmailPattern, +) +from .radar_detection_bot_detection_details_ip_risk import ( + RadarDetectionBotDetectionDetailsIpRisk, +) +from .radar_detection_bot_detection_signal import RadarDetectionBotDetectionSignal +from .radar_detection_domain_sign_ups import RadarDetectionDomainSignUps +from .radar_detection_ip_sign_ups import RadarDetectionIpSignUps + + +@dataclass(slots=True) +class RadarDetectionBotDetectionDetails: + """Radar Detection Bot Detection Details model.""" + + signals: list[RadarDetectionBotDetectionSignal] + """Every bot detection signal that fired.""" + decided_by: RadarDetectionBotDetectionDetailsDecidedBy | None = None + """The signal that determined the verdict.""" + ip_risk: list[RadarDetectionBotDetectionDetailsIpRisk] | None = None + """Why the IP address is risky.""" + email_pattern: list[RadarDetectionBotDetectionDetailsEmailPattern] | None = None + """Why the email address looks suspicious.""" + browser_signals: list[RadarDetectionBotDetectionDetailsBrowserSignals] | None = None + """Why the browser looks automated.""" + ip_sign_ups: RadarDetectionIpSignUps | None = None + """Recent sign-ups from this IP address.""" + domain_sign_ups: RadarDetectionDomainSignUps | None = None + """Recent sign-ups from this email domain.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionBotDetectionDetails: + """Deserialize from a dictionary.""" + try: + return cls( + signals=[ + RadarDetectionBotDetectionSignal.from_dict( + cast(dict[str, Any], item) + ) + for item in cast(list[Any], data["signals"]) + ], + decided_by=RadarDetectionBotDetectionDetailsDecidedBy(_v_decided_by) + if (_v_decided_by := data.get("decided_by")) is not None + else None, + ip_risk=[ + RadarDetectionBotDetectionDetailsIpRisk(item) + for item in cast(list[Any], _v_ip_risk) + ] + if (_v_ip_risk := data.get("ip_risk")) is not None + else None, + email_pattern=[ + RadarDetectionBotDetectionDetailsEmailPattern(item) + for item in cast(list[Any], _v_email_pattern) + ] + if (_v_email_pattern := data.get("email_pattern")) is not None + else None, + browser_signals=[ + RadarDetectionBotDetectionDetailsBrowserSignals(item) + for item in cast(list[Any], _v_browser_signals) + ] + if (_v_browser_signals := data.get("browser_signals")) is not None + else None, + ip_sign_ups=RadarDetectionIpSignUps.from_dict( + cast(dict[str, Any], _v_ip_sign_ups) + ) + if (_v_ip_sign_ups := data.get("ip_sign_ups")) is not None + else None, + domain_sign_ups=RadarDetectionDomainSignUps.from_dict( + cast(dict[str, Any], _v_domain_sign_ups) + ) + if (_v_domain_sign_ups := data.get("domain_sign_ups")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionBotDetectionDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["signals"] = [item.to_dict() for item in self.signals] + if self.decided_by is not None: + result["decided_by"] = ( + self.decided_by.value + if isinstance(self.decided_by, Enum) + else self.decided_by + ) + if self.ip_risk is not None: + result["ip_risk"] = [ + item.value if isinstance(item, Enum) else item for item in self.ip_risk + ] + if self.email_pattern is not None: + result["email_pattern"] = [ + item.value if isinstance(item, Enum) else item + for item in self.email_pattern + ] + if self.browser_signals is not None: + result["browser_signals"] = [ + item.value if isinstance(item, Enum) else item + for item in self.browser_signals + ] + if self.ip_sign_ups is not None: + result["ip_sign_ups"] = self.ip_sign_ups.to_dict() + if self.domain_sign_ups is not None: + result["domain_sign_ups"] = self.domain_sign_ups.to_dict() + return result diff --git a/src/workos/common/models/radar_detection_bot_detection_details_browser_signals.py b/src/workos/common/models/radar_detection_bot_detection_details_browser_signals.py new file mode 100644 index 00000000..2cb08996 --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_details_browser_signals.py @@ -0,0 +1,40 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection bot detection details browser signals values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBotDetectionDetailsBrowserSignals(str, Enum): + """Known values for RadarDetectionBotDetectionDetailsBrowserSignals.""" + + AUTOMATION_FRAMEWORK = "automation_framework" + HEADLESS_BROWSER = "headless_browser" + TAMPERED_SIGNALS = "tampered_signals" + INCONSISTENT_HARDWARE = "inconsistent_hardware" + MISSING_SIGNALS = "missing_signals" + MISSING_EXPECTED_SIGNALS = "missing_expected_signals" + + @classmethod + def _missing_( + cls, value: object + ) -> RadarDetectionBotDetectionDetailsBrowserSignals | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBotDetectionDetailsBrowserSignalsLiteral: TypeAlias = Literal[ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals", +] diff --git a/src/workos/common/models/radar_detection_bot_detection_details_decided_by.py b/src/workos/common/models/radar_detection_bot_detection_details_decided_by.py new file mode 100644 index 00000000..937c95bd --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_details_decided_by.py @@ -0,0 +1,44 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection bot detection details decided by values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBotDetectionDetailsDecidedBy(str, Enum): + """Known values for RadarDetectionBotDetectionDetailsDecidedBy.""" + + RISKY_IP = "risky_ip" + ANOMALOUS_IP = "anomalous_ip" + EXCESSIVE_DOMAIN_SIGN_UPS = "excessive_domain_sign_ups" + SUSPICIOUS_BROWSER_SIGNALS = "suspicious_browser_signals" + MISSING_DEVICE_FINGERPRINT = "missing_device_fingerprint" + SUSPICIOUS_EMAIL_PATTERN = "suspicious_email_pattern" + AUTOMATED_CLIENT = "automated_client" + WORKOS_RISK_MODEL = "workos_risk_model" + + @classmethod + def _missing_( + cls, value: object + ) -> RadarDetectionBotDetectionDetailsDecidedBy | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBotDetectionDetailsDecidedByLiteral: TypeAlias = Literal[ + "risky_ip", + "anomalous_ip", + "excessive_domain_sign_ups", + "suspicious_browser_signals", + "missing_device_fingerprint", + "suspicious_email_pattern", + "automated_client", + "workos_risk_model", +] diff --git a/src/workos/common/models/radar_detection_bot_detection_details_email_pattern.py b/src/workos/common/models/radar_detection_bot_detection_details_email_pattern.py new file mode 100644 index 00000000..d3aa42cc --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_details_email_pattern.py @@ -0,0 +1,32 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection bot detection details email pattern values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBotDetectionDetailsEmailPattern(str, Enum): + """Known values for RadarDetectionBotDetectionDetailsEmailPattern.""" + + GENERATED_LOOKING = "generated_looking" + REPEATED_FORMAT = "repeated_format" + SUSPICIOUS_DOMAIN = "suspicious_domain" + + @classmethod + def _missing_( + cls, value: object + ) -> RadarDetectionBotDetectionDetailsEmailPattern | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBotDetectionDetailsEmailPatternLiteral: TypeAlias = Literal[ + "generated_looking", "repeated_format", "suspicious_domain" +] diff --git a/src/workos/common/models/radar_detection_bot_detection_details_ip_risk.py b/src/workos/common/models/radar_detection_bot_detection_details_ip_risk.py new file mode 100644 index 00000000..c4a2082e --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_details_ip_risk.py @@ -0,0 +1,32 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection bot detection details ip risk values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBotDetectionDetailsIpRisk(str, Enum): + """Known values for RadarDetectionBotDetectionDetailsIpRisk.""" + + ABUSER = "abuser" + ANONYMOUS = "anonymous" + VPN = "vpn" + TOR = "tor" + PROXY = "proxy" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionBotDetectionDetailsIpRisk | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBotDetectionDetailsIpRiskLiteral: TypeAlias = Literal[ + "abuser", "anonymous", "vpn", "tor", "proxy" +] diff --git a/src/workos/common/models/radar_detection_bot_detection_signal.py b/src/workos/common/models/radar_detection_bot_detection_signal.py new file mode 100644 index 00000000..920cab75 --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_signal.py @@ -0,0 +1,50 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any + +from workos._types import _raise_deserialize_error + +from .radar_detection_bot_detection_signal_action import ( + RadarDetectionBotDetectionSignalAction, +) +from .radar_detection_bot_detection_signal_signal import ( + RadarDetectionBotDetectionSignalSignal, +) + + +@dataclass(slots=True) +class RadarDetectionBotDetectionSignal: + """Radar Detection Bot Detection Signal model.""" + + signal: RadarDetectionBotDetectionSignalSignal + action: RadarDetectionBotDetectionSignalAction | None = None + """The action this signal would take on its own.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionBotDetectionSignal: + """Deserialize from a dictionary.""" + try: + return cls( + signal=RadarDetectionBotDetectionSignalSignal(data["signal"]), + action=RadarDetectionBotDetectionSignalAction(_v_action) + if (_v_action := data.get("action")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionBotDetectionSignal", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["signal"] = ( + self.signal.value if isinstance(self.signal, Enum) else self.signal + ) + if self.action is not None: + result["action"] = ( + self.action.value if isinstance(self.action, Enum) else self.action + ) + return result diff --git a/src/workos/common/models/radar_detection_bot_detection_signal_action.py b/src/workos/common/models/radar_detection_bot_detection_signal_action.py new file mode 100644 index 00000000..4928818e --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_signal_action.py @@ -0,0 +1,27 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection bot detection signal action values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBotDetectionSignalAction(str, Enum): + """Known values for RadarDetectionBotDetectionSignalAction.""" + + BLOCK = "block" + CHALLENGE = "challenge" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionBotDetectionSignalAction | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBotDetectionSignalActionLiteral: TypeAlias = Literal["block", "challenge"] diff --git a/src/workos/common/models/radar_detection_bot_detection_signal_signal.py b/src/workos/common/models/radar_detection_bot_detection_signal_signal.py new file mode 100644 index 00000000..fad0972f --- /dev/null +++ b/src/workos/common/models/radar_detection_bot_detection_signal_signal.py @@ -0,0 +1,25 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .radar_detection_bot_detection_details_decided_by import ( + RadarDetectionBotDetectionDetailsDecidedBy, +) + +RadarDetectionBotDetectionSignalSignal: TypeAlias = ( + RadarDetectionBotDetectionDetailsDecidedBy +) +RadarDetectionBotDetectionSignalSignalLiteral: TypeAlias = Literal[ + "risky_ip", + "anomalous_ip", + "excessive_domain_sign_ups", + "suspicious_browser_signals", + "missing_device_fingerprint", + "suspicious_email_pattern", + "automated_client", + "workos_risk_model", +] +__all__ = [ + "RadarDetectionBotDetectionSignalSignal", + "RadarDetectionBotDetectionSignalSignalLiteral", +] diff --git a/src/workos/common/models/radar_detection_brute_force_attack_details.py b/src/workos/common/models/radar_detection_brute_force_attack_details.py new file mode 100644 index 00000000..49605d10 --- /dev/null +++ b/src/workos/common/models/radar_detection_brute_force_attack_details.py @@ -0,0 +1,50 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any + +from workos._types import _raise_deserialize_error + +from .radar_detection_brute_force_attack_details_matched_on import ( + RadarDetectionBruteForceAttackDetailsMatchedOn, +) + + +@dataclass(slots=True) +class RadarDetectionBruteForceAttackDetails: + """Radar Detection Brute Force Attack Details model.""" + + attempts: int + """The number of sign-in attempts.""" + window_minutes: int + """The window the attempts were counted in.""" + matched_on: RadarDetectionBruteForceAttackDetailsMatchedOn + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionBruteForceAttackDetails: + """Deserialize from a dictionary.""" + try: + return cls( + attempts=data["attempts"], + window_minutes=data["window_minutes"], + matched_on=RadarDetectionBruteForceAttackDetailsMatchedOn( + data["matched_on"] + ), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionBruteForceAttackDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["attempts"] = self.attempts + result["window_minutes"] = self.window_minutes + result["matched_on"] = ( + self.matched_on.value + if isinstance(self.matched_on, Enum) + else self.matched_on + ) + return result diff --git a/src/workos/common/models/radar_detection_brute_force_attack_details_matched_on.py b/src/workos/common/models/radar_detection_brute_force_attack_details_matched_on.py new file mode 100644 index 00000000..34fb6948 --- /dev/null +++ b/src/workos/common/models/radar_detection_brute_force_attack_details_matched_on.py @@ -0,0 +1,31 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection brute force attack details matched on values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionBruteForceAttackDetailsMatchedOn(str, Enum): + """Known values for RadarDetectionBruteForceAttackDetailsMatchedOn.""" + + DEVICE_FINGERPRINT_AND_EMAIL = "device_fingerprint_and_email" + IP_AND_EMAIL = "ip_and_email" + + @classmethod + def _missing_( + cls, value: object + ) -> RadarDetectionBruteForceAttackDetailsMatchedOn | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionBruteForceAttackDetailsMatchedOnLiteral: TypeAlias = Literal[ + "device_fingerprint_and_email", "ip_and_email" +] diff --git a/src/workos/common/models/radar_detection_challenge_type.py b/src/workos/common/models/radar_detection_challenge_type.py new file mode 100644 index 00000000..a99c0280 --- /dev/null +++ b/src/workos/common/models/radar_detection_challenge_type.py @@ -0,0 +1,27 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection challenge type values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionChallengeType(str, Enum): + """Known values for RadarDetectionChallengeType.""" + + EMAIL = "email" + SMS = "sms" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionChallengeType | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionChallengeTypeLiteral: TypeAlias = Literal["email", "sms"] diff --git a/src/workos/common/models/radar_detection_control.py b/src/workos/common/models/radar_detection_control.py new file mode 100644 index 00000000..24898058 --- /dev/null +++ b/src/workos/common/models/radar_detection_control.py @@ -0,0 +1,42 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection control values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionControl(str, Enum): + """Known values for RadarDetectionControl.""" + + BOT_DETECTION = "bot_detection" + BRUTE_FORCE_ATTACK = "brute_force_attack" + DOMAIN_PROTECTIONS = "domain_protections" + IMPOSSIBLE_TRAVEL = "impossible_travel" + REPEAT_SIGN_UP = "repeat_sign_up" + STALE_ACCOUNT = "stale_account" + UNRECOGNIZED_DEVICE = "unrecognized_device" + RESTRICTION = "restriction" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionControl | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionControlLiteral: TypeAlias = Literal[ + "bot_detection", + "brute_force_attack", + "domain_protections", + "impossible_travel", + "repeat_sign_up", + "stale_account", + "unrecognized_device", + "restriction", +] diff --git a/src/workos/common/models/radar_detection_domain_protections_details.py b/src/workos/common/models/radar_detection_domain_protections_details.py new file mode 100644 index 00000000..81854819 --- /dev/null +++ b/src/workos/common/models/radar_detection_domain_protections_details.py @@ -0,0 +1,58 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_list import RadarDetectionList + + +@dataclass(slots=True) +class RadarDetectionDomainProtectionsDetails: + """Radar Detection Domain Protections Details model.""" + + list_id: str + """The ID of the matched list.""" + list: RadarDetectionList | None + """The list as it is now. `null` if the list has since been deleted.""" + also_matched_list_ids: list[str] | None = None + """The IDs of other lists the domain is on.""" + also_matched_lists: list[RadarDetectionList | None] | None = None + """Other lists the domain is on.""" + matched_domain: str | None = None + """The domain that matched the list.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionDomainProtectionsDetails: + """Deserialize from a dictionary.""" + try: + return cls( + list_id=data["list_id"], + list=RadarDetectionList.from_dict(cast(dict[str, Any], _v_list)) + if (_v_list := data["list"]) is not None + else None, + also_matched_list_ids=data.get("also_matched_list_ids"), + also_matched_lists=data.get("also_matched_lists"), + matched_domain=data.get("matched_domain"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionDomainProtectionsDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["list_id"] = self.list_id + if self.list is not None: + result["list"] = self.list.to_dict() + else: + result["list"] = None + if self.also_matched_list_ids is not None: + result["also_matched_list_ids"] = self.also_matched_list_ids + if self.also_matched_lists is not None: + result["also_matched_lists"] = self.also_matched_lists + if self.matched_domain is not None: + result["matched_domain"] = self.matched_domain + return result diff --git a/src/workos/common/models/radar_detection_domain_sign_ups.py b/src/workos/common/models/radar_detection_domain_sign_ups.py new file mode 100644 index 00000000..3deed032 --- /dev/null +++ b/src/workos/common/models/radar_detection_domain_sign_ups.py @@ -0,0 +1,37 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RadarDetectionDomainSignUps: + """Radar Detection Domain Sign Ups model.""" + + root_domain: str + """The root domain of the email address.""" + count: int | None = None + """The number of sign-ups.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionDomainSignUps: + """Deserialize from a dictionary.""" + try: + return cls( + root_domain=data["root_domain"], + count=data.get("count"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionDomainSignUps", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["root_domain"] = self.root_domain + if self.count is not None: + result["count"] = self.count + return result diff --git a/src/workos/common/models/radar_detection_evidence_restriction.py b/src/workos/common/models/radar_detection_evidence_restriction.py new file mode 100644 index 00000000..bc6b4b24 --- /dev/null +++ b/src/workos/common/models/radar_detection_evidence_restriction.py @@ -0,0 +1,57 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_restriction_details import ( + RadarDetectionRestrictionDetails, + RadarDetectionRestrictionDetailsVariant, +) + + +@dataclass(slots=True) +class RadarDetectionEvidenceRestriction: + """Radar Detection Evidence Restriction model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["restriction"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionRestrictionDetailsVariant + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionEvidenceRestriction: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "restriction"), + details=RadarDetectionRestrictionDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionEvidenceRestriction", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/radar_detection_impossible_travel_details.py b/src/workos/common/models/radar_detection_impossible_travel_details.py new file mode 100644 index 00000000..9de49944 --- /dev/null +++ b/src/workos/common/models/radar_detection_impossible_travel_details.py @@ -0,0 +1,44 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_previous_attempt import RadarDetectionPreviousAttempt + + +@dataclass(slots=True) +class RadarDetectionImpossibleTravelDetails: + """Radar Detection Impossible Travel Details model.""" + + previous: RadarDetectionPreviousAttempt + """The previous successful sign-in.""" + distance_km: float + """The distance from the previous sign-in, in kilometers.""" + speed_km_per_s: float + """The speed needed to travel that distance, in km per second.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionImpossibleTravelDetails: + """Deserialize from a dictionary.""" + try: + return cls( + previous=RadarDetectionPreviousAttempt.from_dict( + cast(dict[str, Any], data["previous"]) + ), + distance_km=data["distance_km"], + speed_km_per_s=data["speed_km_per_s"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionImpossibleTravelDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["previous"] = self.previous.to_dict() + result["distance_km"] = self.distance_km + result["speed_km_per_s"] = self.speed_km_per_s + return result diff --git a/src/workos/common/models/radar_detection_ip_sign_ups.py b/src/workos/common/models/radar_detection_ip_sign_ups.py new file mode 100644 index 00000000..76f088a4 --- /dev/null +++ b/src/workos/common/models/radar_detection_ip_sign_ups.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RadarDetectionIpSignUps: + """Radar Detection Ip Sign Ups model.""" + + count: int + """The number of sign-ups.""" + window_minutes: int + """The window the sign-ups were counted in.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionIpSignUps: + """Deserialize from a dictionary.""" + try: + return cls( + count=data["count"], + window_minutes=data["window_minutes"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionIpSignUps", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["count"] = self.count + result["window_minutes"] = self.window_minutes + return result diff --git a/src/workos/common/models/radar_detection_list.py b/src/workos/common/models/radar_detection_list.py new file mode 100644 index 00000000..02be01bc --- /dev/null +++ b/src/workos/common/models/radar_detection_list.py @@ -0,0 +1,58 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any + +from workos._types import _raise_deserialize_error + +from .radar_detection_list_action import RadarDetectionListAction +from .radar_detection_list_type import RadarDetectionListType + + +@dataclass(slots=True) +class RadarDetectionList: + """Radar Detection List model.""" + + type: RadarDetectionListType + """The type of values the list holds.""" + action: RadarDetectionListAction | None + """The action the list applies to matching values. `null` for WorkOS-managed lists.""" + name: str | None + """The name of the list.""" + workos_managed: bool + """Whether WorkOS maintains the list.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionList: + """Deserialize from a dictionary.""" + try: + return cls( + type=RadarDetectionListType(data["type"]), + action=RadarDetectionListAction(_v_action) + if (_v_action := data["action"]) is not None + else None, + name=data["name"], + workos_managed=data["workos_managed"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionList", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type.value if isinstance(self.type, Enum) else self.type + if self.action is not None: + result["action"] = ( + self.action.value if isinstance(self.action, Enum) else self.action + ) + else: + result["action"] = None + if self.name is not None: + result["name"] = self.name + else: + result["name"] = None + result["workos_managed"] = self.workos_managed + return result diff --git a/src/workos/common/models/radar_detection_list_action.py b/src/workos/common/models/radar_detection_list_action.py new file mode 100644 index 00000000..6b21030d --- /dev/null +++ b/src/workos/common/models/radar_detection_list_action.py @@ -0,0 +1,31 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection list action values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionListAction(str, Enum): + """Known values for RadarDetectionListAction.""" + + ALLOW = "allow" + BLOCK = "block" + CHALLENGE = "challenge" + LOG = "log" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionListAction | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionListActionLiteral: TypeAlias = Literal[ + "allow", "block", "challenge", "log" +] diff --git a/src/workos/common/models/radar_detection_list_type.py b/src/workos/common/models/radar_detection_list_type.py new file mode 100644 index 00000000..48a8fa28 --- /dev/null +++ b/src/workos/common/models/radar_detection_list_type.py @@ -0,0 +1,40 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of radar detection list type values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class RadarDetectionListType(str, Enum): + """Known values for RadarDetectionListType.""" + + IP_ADDRESS = "ip_address" + DOMAIN = "domain" + EMAIL = "email" + DEVICE = "device" + USER_AGENT = "user_agent" + DEVICE_FINGERPRINT = "device_fingerprint" + COUNTRY = "country" + + @classmethod + def _missing_(cls, value: object) -> RadarDetectionListType | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +RadarDetectionListTypeLiteral: TypeAlias = Literal[ + "ip_address", + "domain", + "email", + "device", + "user_agent", + "device_fingerprint", + "country", +] diff --git a/src/workos/common/models/radar_detection_location.py b/src/workos/common/models/radar_detection_location.py new file mode 100644 index 00000000..373ce74a --- /dev/null +++ b/src/workos/common/models/radar_detection_location.py @@ -0,0 +1,42 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RadarDetectionLocation: + """Where the IP address is located.""" + + city: str | None + """The city the IP address is located in.""" + country: str | None + """ISO 3166-1 alpha-2 country code.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionLocation: + """Deserialize from a dictionary.""" + try: + return cls( + city=data["city"], + country=data["country"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionLocation", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + if self.city is not None: + result["city"] = self.city + else: + result["city"] = None + if self.country is not None: + result["country"] = self.country + else: + result["country"] = None + return result diff --git a/src/workos/common/models/radar_detection_previous_attempt.py b/src/workos/common/models/radar_detection_previous_attempt.py new file mode 100644 index 00000000..fc000ef9 --- /dev/null +++ b/src/workos/common/models/radar_detection_previous_attempt.py @@ -0,0 +1,59 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + +from .radar_detection_previous_attempt_location import ( + RadarDetectionPreviousAttemptLocation, +) + + +@dataclass(slots=True) +class RadarDetectionPreviousAttempt: + """Radar Detection Previous Attempt model.""" + + attempt_id: str + """The ID of the authentication attempt.""" + location: RadarDetectionPreviousAttemptLocation + """Where the IP address of the earlier attempt is located.""" + created_at: datetime + """When that earlier sign-in happened.""" + ip_address: str | None = None + """The IP address of the earlier attempt.""" + user_agent: str | None = None + """The user agent of the earlier attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionPreviousAttempt: + """Deserialize from a dictionary.""" + try: + return cls( + attempt_id=data["attempt_id"], + location=RadarDetectionPreviousAttemptLocation.from_dict( + cast(dict[str, Any], data["location"]) + ), + created_at=_parse_datetime(data["created_at"]), + ip_address=data.get("ip_address"), + user_agent=data.get("user_agent"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionPreviousAttempt", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["attempt_id"] = self.attempt_id + result["location"] = self.location.to_dict() + result["created_at"] = _format_datetime(self.created_at) + if self.ip_address is not None: + result["ip_address"] = self.ip_address + if self.user_agent is not None: + result["user_agent"] = self.user_agent + else: + result["user_agent"] = None + return result diff --git a/src/workos/common/models/radar_detection_previous_attempt_location.py b/src/workos/common/models/radar_detection_previous_attempt_location.py new file mode 100644 index 00000000..7ae2155e --- /dev/null +++ b/src/workos/common/models/radar_detection_previous_attempt_location.py @@ -0,0 +1,7 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import TypeAlias + +from .radar_detection_location import RadarDetectionLocation + +RadarDetectionPreviousAttemptLocation: TypeAlias = RadarDetectionLocation diff --git a/src/workos/common/models/radar_detection_repeat_sign_up_details.py b/src/workos/common/models/radar_detection_repeat_sign_up_details.py new file mode 100644 index 00000000..c857bdc4 --- /dev/null +++ b/src/workos/common/models/radar_detection_repeat_sign_up_details.py @@ -0,0 +1,71 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, ClassVar, Union, cast + +from workos._types import _raise_deserialize_error + +from .normalized_email import NormalizedEmail +from .radar_detection_repeat_sign_up_details_email import ( + RadarDetectionRepeatSignUpDetailsEmail, +) + + +@dataclass(slots=True) +class RadarDetectionRepeatSignUpDetailsUnknown: + """Unknown variant of RadarDetectionRepeatSignUpDetails not yet recognized by this SDK version.""" + + raw_data: dict[str, Any] + """The raw payload, preserved so callers can still inspect the data.""" + + @classmethod + def from_dict( + cls, data: dict[str, Any] + ) -> RadarDetectionRepeatSignUpDetailsUnknown: + """Wrap raw data in an unknown variant.""" + return cls(raw_data=data) + + def to_dict(self) -> dict[str, Any]: + """Return the original raw data.""" + return dict(self.raw_data) + + +RadarDetectionRepeatSignUpDetailsVariant = Union[ + NormalizedEmail, + RadarDetectionRepeatSignUpDetailsEmail, + RadarDetectionRepeatSignUpDetailsUnknown, +] + + +class RadarDetectionRepeatSignUpDetails: + """Discriminated union dispatcher (discriminated by 'matched_on').""" + + _DISPATCH: ClassVar[dict[str, type]] = { + "email": RadarDetectionRepeatSignUpDetailsEmail, + "normalized_email": NormalizedEmail, + } + + @classmethod + def from_dict( + cls, data: dict[str, Any] + ) -> RadarDetectionRepeatSignUpDetailsVariant: + """Deserialize from a dictionary, dispatching to the correct variant.""" + if "matched_on" not in data: + _raise_deserialize_error( + "RadarDetectionRepeatSignUpDetails", + ValueError("Missing required field 'matched_on'"), + ) + disc_value = data["matched_on"] + if disc_value is None: + _raise_deserialize_error( + "RadarDetectionRepeatSignUpDetails", + ValueError("matched_on must not be None"), + ) + dispatch_cls = cls._DISPATCH.get(disc_value) + if dispatch_cls is not None: + return cast( + "RadarDetectionRepeatSignUpDetailsVariant", dispatch_cls.from_dict(data) + ) + return RadarDetectionRepeatSignUpDetailsUnknown.from_dict(data) diff --git a/src/workos/common/models/radar_detection_repeat_sign_up_details_email.py b/src/workos/common/models/radar_detection_repeat_sign_up_details_email.py new file mode 100644 index 00000000..f6d80666 --- /dev/null +++ b/src/workos/common/models/radar_detection_repeat_sign_up_details_email.py @@ -0,0 +1,39 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RadarDetectionRepeatSignUpDetailsEmail: + """Radar Detection Repeat Sign Up Details Email model.""" + + matched_on: Literal["email"] + prior_sign_ups: int + """The number of earlier sign-ups.""" + window_days: int + """The window the sign-ups were counted in.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionRepeatSignUpDetailsEmail: + """Deserialize from a dictionary.""" + try: + return cls( + matched_on=data.get("matched_on", "email"), + prior_sign_ups=data["prior_sign_ups"], + window_days=data["window_days"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionRepeatSignUpDetailsEmail", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["matched_on"] = self.matched_on + result["prior_sign_ups"] = self.prior_sign_ups + result["window_days"] = self.window_days + return result diff --git a/src/workos/common/models/radar_detection_restriction_details.py b/src/workos/common/models/radar_detection_restriction_details.py new file mode 100644 index 00000000..daabc5a3 --- /dev/null +++ b/src/workos/common/models/radar_detection_restriction_details.py @@ -0,0 +1,72 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, ClassVar, Union, cast + +from workos._types import _raise_deserialize_error + +from .blocked_tld import BlockedTld +from .radar_detection_restriction_details_list import ( + RadarDetectionRestrictionDetailsList, +) +from .sign_up import SignUp +from .sms_sign_in import SmsSignIn + + +@dataclass(slots=True) +class RadarDetectionRestrictionDetailsUnknown: + """Unknown variant of RadarDetectionRestrictionDetails not yet recognized by this SDK version.""" + + raw_data: dict[str, Any] + """The raw payload, preserved so callers can still inspect the data.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionRestrictionDetailsUnknown: + """Wrap raw data in an unknown variant.""" + return cls(raw_data=data) + + def to_dict(self) -> dict[str, Any]: + """Return the original raw data.""" + return dict(self.raw_data) + + +RadarDetectionRestrictionDetailsVariant = Union[ + BlockedTld, + RadarDetectionRestrictionDetailsList, + SignUp, + SmsSignIn, + RadarDetectionRestrictionDetailsUnknown, +] + + +class RadarDetectionRestrictionDetails: + """Discriminated union dispatcher (discriminated by 'type').""" + + _DISPATCH: ClassVar[dict[str, type]] = { + "blocked_tld": BlockedTld, + "list": RadarDetectionRestrictionDetailsList, + "sign_up": SignUp, + "sms_sign_in": SmsSignIn, + } + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionRestrictionDetailsVariant: + """Deserialize from a dictionary, dispatching to the correct variant.""" + if "type" not in data: + _raise_deserialize_error( + "RadarDetectionRestrictionDetails", + ValueError("Missing required field 'type'"), + ) + disc_value = data["type"] + if disc_value is None: + _raise_deserialize_error( + "RadarDetectionRestrictionDetails", ValueError("type must not be None") + ) + dispatch_cls = cls._DISPATCH.get(disc_value) + if dispatch_cls is not None: + return cast( + "RadarDetectionRestrictionDetailsVariant", dispatch_cls.from_dict(data) + ) + return RadarDetectionRestrictionDetailsUnknown.from_dict(data) diff --git a/src/workos/common/models/radar_detection_restriction_details_list.py b/src/workos/common/models/radar_detection_restriction_details_list.py new file mode 100644 index 00000000..f598af5f --- /dev/null +++ b/src/workos/common/models/radar_detection_restriction_details_list.py @@ -0,0 +1,51 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_list import RadarDetectionList + + +@dataclass(slots=True) +class RadarDetectionRestrictionDetailsList: + """Radar Detection Restriction Details List model.""" + + type: Literal["list"] + list_id: str + """The ID of the matched list.""" + list: RadarDetectionList | None + """The list as it is now. `null` if the list has since been deleted.""" + entry: str | None = None + """The list entry that matched.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionRestrictionDetailsList: + """Deserialize from a dictionary.""" + try: + return cls( + type=data.get("type", "list"), + list_id=data["list_id"], + list=RadarDetectionList.from_dict(cast(dict[str, Any], _v_list)) + if (_v_list := data["list"]) is not None + else None, + entry=data.get("entry"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionRestrictionDetailsList", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type + result["list_id"] = self.list_id + if self.list is not None: + result["list"] = self.list.to_dict() + else: + result["list"] = None + if self.entry is not None: + result["entry"] = self.entry + return result diff --git a/src/workos/common/models/radar_detection_stale_account_details.py b/src/workos/common/models/radar_detection_stale_account_details.py new file mode 100644 index 00000000..eef6f675 --- /dev/null +++ b/src/workos/common/models/radar_detection_stale_account_details.py @@ -0,0 +1,38 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from typing import Any + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error + + +@dataclass(slots=True) +class RadarDetectionStaleAccountDetails: + """Radar Detection Stale Account Details model.""" + + last_activity_at: datetime | None + """When the user was last active. `null` if unknown.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionStaleAccountDetails: + """Deserialize from a dictionary.""" + try: + return cls( + last_activity_at=_parse_datetime(_v_last_activity_at) + if (_v_last_activity_at := data["last_activity_at"]) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionStaleAccountDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + if self.last_activity_at is not None: + result["last_activity_at"] = _format_datetime(self.last_activity_at) + else: + result["last_activity_at"] = None + return result diff --git a/src/workos/common/models/radar_detection_unrecognized_device_details.py b/src/workos/common/models/radar_detection_unrecognized_device_details.py new file mode 100644 index 00000000..b56c1a65 --- /dev/null +++ b/src/workos/common/models/radar_detection_unrecognized_device_details.py @@ -0,0 +1,41 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_previous_attempt import RadarDetectionPreviousAttempt + + +@dataclass(slots=True) +class RadarDetectionUnrecognizedDeviceDetails: + """Radar Detection Unrecognized Device Details model.""" + + previous_device: RadarDetectionPreviousAttempt | None + """The device the user last signed in from.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionUnrecognizedDeviceDetails: + """Deserialize from a dictionary.""" + try: + return cls( + previous_device=RadarDetectionPreviousAttempt.from_dict( + cast(dict[str, Any], _v_previous_device) + ) + if (_v_previous_device := data["previous_device"]) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetectionUnrecognizedDeviceDetails", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + if self.previous_device is not None: + result["previous_device"] = self.previous_device.to_dict() + else: + result["previous_device"] = None + return result diff --git a/src/workos/common/models/radar_detection_verdict.py b/src/workos/common/models/radar_detection_verdict.py new file mode 100644 index 00000000..28983aac --- /dev/null +++ b/src/workos/common/models/radar_detection_verdict.py @@ -0,0 +1,9 @@ +# This file is auto-generated by oagen. Do not edit. + +from typing import Literal, TypeAlias + +from .radar_detection_list_action import RadarDetectionListAction + +RadarDetectionVerdict: TypeAlias = RadarDetectionListAction +RadarDetectionVerdictLiteral: TypeAlias = Literal["allow", "block", "challenge", "log"] +__all__ = ["RadarDetectionVerdict", "RadarDetectionVerdictLiteral"] diff --git a/src/workos/common/models/radar_sms_challenge_error_body.py b/src/workos/common/models/radar_sms_challenge_error_body.py new file mode 100644 index 00000000..3d273fa0 --- /dev/null +++ b/src/workos/common/models/radar_sms_challenge_error_body.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RadarSmsChallengeErrorBody: + """Radar Sms Challenge Error Body model.""" + + code: Literal["radar_sms_challenge"] + """The error code identifying the type of error.""" + message: str + """A human-readable description of the error.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarSmsChallengeErrorBody: + """Deserialize from a dictionary.""" + try: + return cls( + code=data.get("code", "radar_sms_challenge"), + message=data["message"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarSmsChallengeErrorBody", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["code"] = self.code + result["message"] = self.message + return result diff --git a/src/workos/common/models/radar_standalone_response_blocklist_type.py b/src/workos/common/models/radar_standalone_response_blocklist_type.py index 7afca037..1fd56fef 100644 --- a/src/workos/common/models/radar_standalone_response_blocklist_type.py +++ b/src/workos/common/models/radar_standalone_response_blocklist_type.py @@ -1,21 +1,10 @@ # This file is auto-generated by oagen. Do not edit. -from typing import TYPE_CHECKING, Literal, TypeAlias - -if TYPE_CHECKING: - from workos.radar.models.radar_list_type import ( - RadarListType as RadarStandaloneResponseBlocklistType, - ) -else: - - def __getattr__(name: str): - if name == "RadarStandaloneResponseBlocklistType": - from workos.radar.models.radar_list_type import RadarListType - - return RadarListType - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") +from typing import Literal, TypeAlias +from .radar_detection_list_type import RadarDetectionListType +RadarStandaloneResponseBlocklistType: TypeAlias = RadarDetectionListType RadarStandaloneResponseBlocklistTypeLiteral: TypeAlias = Literal[ "ip_address", "domain", diff --git a/src/workos/common/models/repeat_sign_up.py b/src/workos/common/models/repeat_sign_up.py new file mode 100644 index 00000000..c4ac349d --- /dev/null +++ b/src/workos/common/models/repeat_sign_up.py @@ -0,0 +1,57 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_repeat_sign_up_details import ( + RadarDetectionRepeatSignUpDetails, + RadarDetectionRepeatSignUpDetailsVariant, +) + + +@dataclass(slots=True) +class RepeatSignUp: + """Repeat Sign Up model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["repeat_sign_up"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionRepeatSignUpDetailsVariant + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RepeatSignUp: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "repeat_sign_up"), + details=RadarDetectionRepeatSignUpDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RepeatSignUp", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/role_assignment_update_overlap_error_body.py b/src/workos/common/models/role_assignment_update_overlap_error_body.py new file mode 100644 index 00000000..873f941f --- /dev/null +++ b/src/workos/common/models/role_assignment_update_overlap_error_body.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class RoleAssignmentUpdateOverlapErrorBody: + """Role Assignment Update Overlap Error Body model.""" + + code: Literal["role_assignment_update_overlap"] + """The error code identifying the type of error.""" + message: str + """A human-readable description of the error.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RoleAssignmentUpdateOverlapErrorBody: + """Deserialize from a dictionary.""" + try: + return cls( + code=data.get("code", "role_assignment_update_overlap"), + message=data["message"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RoleAssignmentUpdateOverlapErrorBody", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["code"] = self.code + result["message"] = self.message + return result diff --git a/src/workos/common/models/sign_up.py b/src/workos/common/models/sign_up.py new file mode 100644 index 00000000..9287ab71 --- /dev/null +++ b/src/workos/common/models/sign_up.py @@ -0,0 +1,31 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class SignUp: + """Sign Up model.""" + + type: Literal["sign_up"] + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> SignUp: + """Deserialize from a dictionary.""" + try: + return cls( + type=data.get("type", "sign_up"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("SignUp", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type + return result diff --git a/src/workos/common/models/sms_sign_in.py b/src/workos/common/models/sms_sign_in.py new file mode 100644 index 00000000..24592298 --- /dev/null +++ b/src/workos/common/models/sms_sign_in.py @@ -0,0 +1,55 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + +from .sms_sign_in_trigger import SmsSignInTrigger + + +@dataclass(slots=True) +class SmsSignIn: + """Sms Sign In model.""" + + type: Literal["sms_sign_in"] + trigger: SmsSignInTrigger + """Why SMS sign-in was restricted.""" + phone_country: str | None = None + """The country of the phone number. Only when `trigger` is `country_mismatch`.""" + line_type: str | None = None + """The line type of the phone number. Only when `trigger` is `non_mobile_line`.""" + masked_phone_number: str | None = None + """The phone number, masked to its last four digits.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> SmsSignIn: + """Deserialize from a dictionary.""" + try: + return cls( + type=data.get("type", "sms_sign_in"), + trigger=SmsSignInTrigger(data["trigger"]), + phone_country=data.get("phone_country"), + line_type=data.get("line_type"), + masked_phone_number=data.get("masked_phone_number"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("SmsSignIn", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type + result["trigger"] = ( + self.trigger.value if isinstance(self.trigger, Enum) else self.trigger + ) + if self.phone_country is not None: + result["phone_country"] = self.phone_country + if self.line_type is not None: + result["line_type"] = self.line_type + if self.masked_phone_number is not None: + result["masked_phone_number"] = self.masked_phone_number + return result diff --git a/src/workos/common/models/sms_sign_in_trigger.py b/src/workos/common/models/sms_sign_in_trigger.py new file mode 100644 index 00000000..838db9ac --- /dev/null +++ b/src/workos/common/models/sms_sign_in_trigger.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Enumeration of sms sign in trigger values.""" + +from __future__ import annotations + +from enum import Enum +from typing import Literal, TypeAlias + + +class SmsSignInTrigger(str, Enum): + """Known values for SmsSignInTrigger.""" + + COUNTRY_MISMATCH = "country_mismatch" + NON_MOBILE_LINE = "non_mobile_line" + PREVIOUSLY_SELECTED = "previously_selected" + UNKNOWN_LINE_TYPE = "unknown_line_type" + MISSING_SIGNALS = "missing_signals" + + @classmethod + def _missing_(cls, value: object) -> SmsSignInTrigger | None: + if not isinstance(value, str): + return None + unknown = str.__new__(cls, value) + unknown._name_ = value.upper() + unknown._value_ = value + return unknown + + +SmsSignInTriggerLiteral: TypeAlias = Literal[ + "country_mismatch", + "non_mobile_line", + "previously_selected", + "unknown_line_type", + "missing_signals", +] diff --git a/src/workos/common/models/stale_account.py b/src/workos/common/models/stale_account.py new file mode 100644 index 00000000..37699bb8 --- /dev/null +++ b/src/workos/common/models/stale_account.py @@ -0,0 +1,54 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_stale_account_details import RadarDetectionStaleAccountDetails + + +@dataclass(slots=True) +class StaleAccount: + """Stale Account model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["stale_account"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionStaleAccountDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> StaleAccount: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "stale_account"), + details=RadarDetectionStaleAccountDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("StaleAccount", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/common/models/unrecognized_device.py b/src/workos/common/models/unrecognized_device.py new file mode 100644 index 00000000..58852a86 --- /dev/null +++ b/src/workos/common/models/unrecognized_device.py @@ -0,0 +1,56 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error + +from .radar_detection_allowed_by import RadarDetectionAllowedBy +from .radar_detection_unrecognized_device_details import ( + RadarDetectionUnrecognizedDeviceDetails, +) + + +@dataclass(slots=True) +class UnrecognizedDevice: + """Unrecognized Device model.""" + + summary: str + """A human-readable explanation of why Radar fired.""" + control: Literal["unrecognized_device"] + """The control the evidence is for. Always the same as the detection's `control`.""" + details: RadarDetectionUnrecognizedDeviceDetails + """Facts specific to the control. See the [Radar detection object](https://workos.com/docs/reference/radar/detections#evidence-details) for the fields each control reports.""" + allowed_by: RadarDetectionAllowedBy | None = None + """The allowlist that overrode the verdict. Only present when an allowlist allowed the attempt.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> UnrecognizedDevice: + """Deserialize from a dictionary.""" + try: + return cls( + summary=data["summary"], + control=data.get("control", "unrecognized_device"), + details=RadarDetectionUnrecognizedDeviceDetails.from_dict( + cast(dict[str, Any], data["details"]) + ), + allowed_by=RadarDetectionAllowedBy.from_dict( + cast(dict[str, Any], _v_allowed_by) + ) + if (_v_allowed_by := data.get("allowed_by")) is not None + else None, + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("UnrecognizedDevice", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["summary"] = self.summary + result["control"] = self.control + result["details"] = self.details.to_dict() + if self.allowed_by is not None: + result["allowed_by"] = self.allowed_by.to_dict() + return result diff --git a/src/workos/connect/_resource.py b/src/workos/connect/_resource.py index b5289912..9ad2bc32 100644 --- a/src/workos/connect/_resource.py +++ b/src/workos/connect/_resource.py @@ -44,16 +44,13 @@ def complete_oauth2( ) -> ExternalAuthCompleteResponse: """Complete external authentication - Completes an external authentication flow and returns control to AuthKit. This endpoint is used with [Standalone Connect](https://workos.com/docs/authkit/connect/standalone) to bridge your existing authentication system with the Connect OAuth API infrastructure. + Completes a [Standalone Connect](https://workos.com/docs/authkit/connect/standalone) login by creating or updating the AuthKit user and returning a `redirect_uri` your application should redirect to so AuthKit can finish the flow. - After successfully authenticating a user in your application, calling this endpoint will: + The user is matched by `id`, stored as its `external_id`, and updated if found. Otherwise: - - Create or update the user in AuthKit, using the given `id` as its `external_id`. - - Return a `redirect_uri` your application should redirect to in order for AuthKit to complete the flow - - Users are automatically created or updated based on the `id` and `email` provided. If a user with the same `id` exists, their information is updated. Otherwise, a new user is created. - - If you provide a new `id` with an `email` that already belongs to an existing user, the request will fail with an error as email addresses are unique to a user. + - If a user with the given `email` has no `external_id`, it is linked to `id`. + - If a user with the given `email` has a different `external_id`, the request fails. + - If no user has the given `email`, a new user is created. Args: external_auth_id: Identifier provided when AuthKit redirected to your login page. @@ -490,16 +487,13 @@ async def complete_oauth2( ) -> ExternalAuthCompleteResponse: """Complete external authentication - Completes an external authentication flow and returns control to AuthKit. This endpoint is used with [Standalone Connect](https://workos.com/docs/authkit/connect/standalone) to bridge your existing authentication system with the Connect OAuth API infrastructure. - - After successfully authenticating a user in your application, calling this endpoint will: - - - Create or update the user in AuthKit, using the given `id` as its `external_id`. - - Return a `redirect_uri` your application should redirect to in order for AuthKit to complete the flow + Completes a [Standalone Connect](https://workos.com/docs/authkit/connect/standalone) login by creating or updating the AuthKit user and returning a `redirect_uri` your application should redirect to so AuthKit can finish the flow. - Users are automatically created or updated based on the `id` and `email` provided. If a user with the same `id` exists, their information is updated. Otherwise, a new user is created. + The user is matched by `id`, stored as its `external_id`, and updated if found. Otherwise: - If you provide a new `id` with an `email` that already belongs to an existing user, the request will fail with an error as email addresses are unique to a user. + - If a user with the given `email` has no `external_id`, it is linked to `id`. + - If a user with the given `email` has a different `external_id`, the request fails. + - If no user has the given `email`, a new user is created. Args: external_auth_id: Identifier provided when AuthKit redirected to your login page. diff --git a/src/workos/connect/models/__init__.py b/src/workos/connect/models/__init__.py index 740870c6..01c1ce84 100644 --- a/src/workos/connect/models/__init__.py +++ b/src/workos/connect/models/__init__.py @@ -9,6 +9,9 @@ from workos.common.models.connect_application import ( ConnectApplicationVariant as ConnectApplicationVariant, ) +from workos.common.models.create_application_secret import ( + CreateApplicationSecret as CreateApplicationSecret, +) from .application_credentials_list_item import ( ApplicationCredentialsListItem as ApplicationCredentialsListItem, @@ -19,9 +22,6 @@ from .applications_registration_types import ( ApplicationsRegistrationTypesLiteral as ApplicationsRegistrationTypesLiteral, ) -from .create_application_secret import ( - CreateApplicationSecret as CreateApplicationSecret, -) from .create_m2m_application import CreateM2MApplication as CreateM2MApplication from .create_oauth_application import CreateOAuthApplication as CreateOAuthApplication from .external_auth_complete_response import ( diff --git a/src/workos/organization_membership/models/__init__.py b/src/workos/organization_membership/models/__init__.py index ba0a66cb..f6f62493 100644 --- a/src/workos/organization_membership/models/__init__.py +++ b/src/workos/organization_membership/models/__init__.py @@ -10,6 +10,9 @@ from .user_management_organization_membership_statuses import ( UserManagementOrganizationMembershipStatuses as UserManagementOrganizationMembershipStatuses, ) +from .user_management_organization_membership_statuses import ( + UserManagementOrganizationMembershipStatusesLiteral as UserManagementOrganizationMembershipStatusesLiteral, +) from .user_organization_membership import ( UserOrganizationMembership as UserOrganizationMembership, ) diff --git a/src/workos/organizations/models/it_contact_list_list_metadata.py b/src/workos/organizations/models/it_contact_list_list_metadata.py index a86aa8d5..7ac14ab9 100644 --- a/src/workos/organizations/models/it_contact_list_list_metadata.py +++ b/src/workos/organizations/models/it_contact_list_list_metadata.py @@ -1,42 +1,9 @@ # This file is auto-generated by oagen. Do not edit. -from __future__ import annotations +from typing import TypeAlias -from dataclasses import dataclass -from typing import Any +from workos.organizations_issuer_trusts.models.issuer_trust_list_list_metadata import ( + IssuerTrustListListMetadata, +) -from workos._types import _raise_deserialize_error - - -@dataclass(slots=True) -class ItContactListListMetadata: - """Pagination cursors for navigating between pages of results.""" - - before: str | None - """An object ID that defines your place in the list. When the ID is not present, you are at the start of the list.""" - after: str | None - """An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.""" - - @classmethod - def from_dict(cls, data: dict[str, Any]) -> ItContactListListMetadata: - """Deserialize from a dictionary.""" - try: - return cls( - before=data["before"], - after=data["after"], - ) - except (KeyError, ValueError) as e: - _raise_deserialize_error("ItContactListListMetadata", e) - - def to_dict(self) -> dict[str, Any]: - """Serialize to a dictionary.""" - result: dict[str, Any] = {} - if self.before is not None: - result["before"] = self.before - else: - result["before"] = None - if self.after is not None: - result["after"] = self.after - else: - result["after"] = None - return result +ItContactListListMetadata: TypeAlias = IssuerTrustListListMetadata diff --git a/src/workos/organizations_issuer_trusts/__init__.py b/src/workos/organizations_issuer_trusts/__init__.py new file mode 100644 index 00000000..8ed5bae0 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/__init__.py @@ -0,0 +1,5 @@ +# This file is auto-generated by oagen. Do not edit. + +from ._resource import AsyncOrganizationsIssuerTrusts as AsyncOrganizationsIssuerTrusts +from ._resource import OrganizationsIssuerTrusts as OrganizationsIssuerTrusts +from .models import * diff --git a/src/workos/organizations_issuer_trusts/_resource.py b/src/workos/organizations_issuer_trusts/_resource.py new file mode 100644 index 00000000..88d0a5a0 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/_resource.py @@ -0,0 +1,385 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +if TYPE_CHECKING: + from .._client import AsyncWorkOSClient, WorkOSClient + +from workos.common.models.issuer_trust import IssuerTrust + +from .._types import RequestOptions +from .models import ( + IssuerTrustList, +) + + +class OrganizationsIssuerTrusts: + """Organizations Issuer Trusts API resources.""" + + def __init__(self, client: WorkOSClient) -> None: + self._client = client + + def list_organization_issuer_trusts( + self, + organization_id: str, + *, + request_options: RequestOptions | None = None, + ) -> IssuerTrustList: + """List issuer trusts + + Get the issuers an organization trusts. + + Args: + organization_id: The ID of the organization. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrustList + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return self._client.request( + method="get", + path=("organizations", str(organization_id), "issuer_trusts"), + model=IssuerTrustList, + request_options=request_options, + ) + + def create_organization_issuer_trust( + self, + organization_id: str, + *, + type: Literal["claude"], + issuer: str, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Create an issuer trust + + Trust an issuer for an organization. WorkOS checks the issuer's OpenID configuration and that the organization has a verified domain. The trust is created disabled; enable it to start accepting ID-JAGs from the issuer. + + Args: + organization_id: The ID of the organization. + type: The type of issuer, which identifies who operates it. + issuer: The issuer URL. WorkOS fetches the issuer's OpenID configuration to confirm it before creating the trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + 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). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + "type": type, + "issuer": issuer, + } + return self._client.request( + method="post", + path=("organizations", str(organization_id), "issuer_trusts"), + body=body, + model=IssuerTrust, + request_options=request_options, + ) + + def get_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Get an issuer trust + + Get an issuer trust by its ID. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return self._client.request( + method="get", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + model=IssuerTrust, + request_options=request_options, + ) + + def update_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + enabled: bool | None = None, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Update an issuer trust + + Enable or disable an issuer trust. ID-JAGs from a disabled issuer are rejected. `enabled` is the only field that can be changed, and an omitted field is left unchanged. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + enabled: Whether ID-JAGs from the issuer are accepted. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + 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). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + k: v + for k, v in { + "enabled": enabled, + }.items() + if v is not None + } + return self._client.request( + method="patch", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + body=body, + model=IssuerTrust, + request_options=request_options, + ) + + def delete_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> None: + """Delete an issuer trust + + Stop trusting an issuer. ID-JAGs from the issuer are rejected from then on. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + AuthorizationError: If the request is forbidden (403). + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + self._client.request( + method="delete", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + request_options=request_options, + ) + + +class AsyncOrganizationsIssuerTrusts: + """Organizations Issuer Trusts API resources (async).""" + + def __init__(self, client: AsyncWorkOSClient) -> None: + self._client = client + + async def list_organization_issuer_trusts( + self, + organization_id: str, + *, + request_options: RequestOptions | None = None, + ) -> IssuerTrustList: + """List issuer trusts + + Get the issuers an organization trusts. + + Args: + organization_id: The ID of the organization. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrustList + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return await self._client.request( + method="get", + path=("organizations", str(organization_id), "issuer_trusts"), + model=IssuerTrustList, + request_options=request_options, + ) + + async def create_organization_issuer_trust( + self, + organization_id: str, + *, + type: Literal["claude"], + issuer: str, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Create an issuer trust + + Trust an issuer for an organization. WorkOS checks the issuer's OpenID configuration and that the organization has a verified domain. The trust is created disabled; enable it to start accepting ID-JAGs from the issuer. + + Args: + organization_id: The ID of the organization. + type: The type of issuer, which identifies who operates it. + issuer: The issuer URL. WorkOS fetches the issuer's OpenID configuration to confirm it before creating the trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + 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). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + "type": type, + "issuer": issuer, + } + return await self._client.request( + method="post", + path=("organizations", str(organization_id), "issuer_trusts"), + body=body, + model=IssuerTrust, + request_options=request_options, + ) + + async def get_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Get an issuer trust + + Get an issuer trust by its ID. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return await self._client.request( + method="get", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + model=IssuerTrust, + request_options=request_options, + ) + + async def update_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + enabled: bool | None = None, + request_options: RequestOptions | None = None, + ) -> IssuerTrust: + """Update an issuer trust + + Enable or disable an issuer trust. ID-JAGs from a disabled issuer are rejected. `enabled` is the only field that can be changed, and an omitted field is left unchanged. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + enabled: Whether ID-JAGs from the issuer are accepted. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + IssuerTrust + + 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). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + body: dict[str, Any] = { + k: v + for k, v in { + "enabled": enabled, + }.items() + if v is not None + } + return await self._client.request( + method="patch", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + body=body, + model=IssuerTrust, + request_options=request_options, + ) + + async def delete_organization_issuer_trust( + self, + organization_id: str, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> None: + """Delete an issuer trust + + Stop trusting an issuer. ID-JAGs from the issuer are rejected from then on. + + Args: + organization_id: The ID of the organization. + id: The ID of the issuer trust. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + AuthorizationError: If the request is forbidden (403). + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + await self._client.request( + method="delete", + path=("organizations", str(organization_id), "issuer_trusts", str(id)), + request_options=request_options, + ) diff --git a/src/workos/organizations_issuer_trusts/models/__init__.py b/src/workos/organizations_issuer_trusts/models/__init__.py new file mode 100644 index 00000000..459b56ef --- /dev/null +++ b/src/workos/organizations_issuer_trusts/models/__init__.py @@ -0,0 +1,14 @@ +# This file is auto-generated by oagen. Do not edit. + +from workos.common.models.issuer_trust import IssuerTrust as IssuerTrust + +from .issuer_trust_list import IssuerTrustList as IssuerTrustList +from .issuer_trust_list_list_metadata import ( + IssuerTrustListListMetadata as IssuerTrustListListMetadata, +) +from .issuer_trusts_create_request import ( + IssuerTrustsCreateRequest as IssuerTrustsCreateRequest, +) +from .issuer_trusts_update_request import ( + IssuerTrustsUpdateRequest as IssuerTrustsUpdateRequest, +) diff --git a/src/workos/organizations_issuer_trusts/models/issuer_trust_list.py b/src/workos/organizations_issuer_trusts/models/issuer_trust_list.py new file mode 100644 index 00000000..a46d6004 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/models/issuer_trust_list.py @@ -0,0 +1,48 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal, cast + +from workos._types import _raise_deserialize_error +from workos.common.models.issuer_trust import IssuerTrust + +from .issuer_trust_list_list_metadata import IssuerTrustListListMetadata + + +@dataclass(slots=True) +class IssuerTrustList: + """Issuer Trust List model.""" + + object: Literal["list"] + """Indicates this is a list response.""" + data: list[IssuerTrust] + """The list of records for the current page.""" + list_metadata: IssuerTrustListListMetadata + """Pagination cursors for navigating between pages of results.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustList: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "list"), + data=[ + IssuerTrust.from_dict(cast(dict[str, Any], item)) + for item in cast(list[Any], data["data"]) + ], + list_metadata=IssuerTrustListListMetadata.from_dict( + cast(dict[str, Any], data["list_metadata"]) + ), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustList", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["object"] = self.object + result["data"] = [item.to_dict() for item in self.data] + result["list_metadata"] = self.list_metadata.to_dict() + return result diff --git a/src/workos/organizations_issuer_trusts/models/issuer_trust_list_list_metadata.py b/src/workos/organizations_issuer_trusts/models/issuer_trust_list_list_metadata.py new file mode 100644 index 00000000..b64bda75 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/models/issuer_trust_list_list_metadata.py @@ -0,0 +1,42 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class IssuerTrustListListMetadata: + """Pagination cursors for navigating between pages of results.""" + + before: str | None + """An object ID that defines your place in the list. When the ID is not present, you are at the start of the list.""" + after: str | None + """An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustListListMetadata: + """Deserialize from a dictionary.""" + try: + return cls( + before=data["before"], + after=data["after"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustListListMetadata", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + if self.before is not None: + result["before"] = self.before + else: + result["before"] = None + if self.after is not None: + result["after"] = self.after + else: + result["after"] = None + return result diff --git a/src/workos/organizations_issuer_trusts/models/issuer_trusts_create_request.py b/src/workos/organizations_issuer_trusts/models/issuer_trusts_create_request.py new file mode 100644 index 00000000..058b40a4 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/models/issuer_trusts_create_request.py @@ -0,0 +1,36 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Literal + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class IssuerTrustsCreateRequest: + """Issuer Trusts Create Request model.""" + + type: Literal["claude"] + """The type of issuer, which identifies who operates it.""" + issuer: str + """The issuer URL. WorkOS fetches the issuer's OpenID configuration to confirm it before creating the trust.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustsCreateRequest: + """Deserialize from a dictionary.""" + try: + return cls( + type=data.get("type", "claude"), + issuer=data["issuer"], + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustsCreateRequest", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + result["type"] = self.type + result["issuer"] = self.issuer + return result diff --git a/src/workos/organizations_issuer_trusts/models/issuer_trusts_update_request.py b/src/workos/organizations_issuer_trusts/models/issuer_trusts_update_request.py new file mode 100644 index 00000000..4ca92027 --- /dev/null +++ b/src/workos/organizations_issuer_trusts/models/issuer_trusts_update_request.py @@ -0,0 +1,33 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from workos._types import _raise_deserialize_error + + +@dataclass(slots=True) +class IssuerTrustsUpdateRequest: + """Fields to update on the issuer trust. Omitted fields are left unchanged.""" + + enabled: bool | None = None + """Whether ID-JAGs from the issuer are accepted.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> IssuerTrustsUpdateRequest: + """Deserialize from a dictionary.""" + try: + return cls( + enabled=data.get("enabled"), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("IssuerTrustsUpdateRequest", e) + + def to_dict(self) -> dict[str, Any]: + """Serialize to a dictionary.""" + result: dict[str, Any] = {} + if self.enabled is not None: + result["enabled"] = self.enabled + return result diff --git a/src/workos/pipes/models/__init__.py b/src/workos/pipes/models/__init__.py index 1e57d84f..5574e41d 100644 --- a/src/workos/pipes/models/__init__.py +++ b/src/workos/pipes/models/__init__.py @@ -92,6 +92,7 @@ OrganizationConnectedAccount as OrganizationConnectedAccount, ) from .pipes_ownership import PipesOwnership as PipesOwnership +from .pipes_ownership import PipesOwnershipLiteral as PipesOwnershipLiteral from .update_custom_provider_definition import ( UpdateCustomProviderDefinition as UpdateCustomProviderDefinition, ) diff --git a/src/workos/pipes_provider/models/__init__.py b/src/workos/pipes_provider/models/__init__.py index dea34256..466c87df 100644 --- a/src/workos/pipes_provider/models/__init__.py +++ b/src/workos/pipes_provider/models/__init__.py @@ -13,3 +13,6 @@ DataIntegrationCredentials as DataIntegrationCredentials, ) from .pipes_provider_ownership import PipesProviderOwnership as PipesProviderOwnership +from .pipes_provider_ownership import ( + PipesProviderOwnershipLiteral as PipesProviderOwnershipLiteral, +) diff --git a/src/workos/radar/_resource.py b/src/workos/radar/_resource.py index 571f1ba8..3d339820 100644 --- a/src/workos/radar/_resource.py +++ b/src/workos/radar/_resource.py @@ -19,6 +19,7 @@ from .._types import RequestOptions, enum_value from .models import ( + RadarDetection, RadarListAction, RadarListType, RadarStandaloneResponse, @@ -124,6 +125,36 @@ def update_attempt( request_options=request_options, ) + def get_detection( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> RadarDetection: + """Get a Radar detection + + Get a Radar detection from the last 30 days, including the evidence for why Radar fired. + + Args: + id: The unique ID of the Radar detection. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + RadarDetection + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return self._client.request( + method="get", + path=("radar", "detections", str(id)), + model=RadarDetection, + request_options=request_options, + ) + def add_list_entry( self, type: RadarListType | str, @@ -297,6 +328,36 @@ async def update_attempt( request_options=request_options, ) + async def get_detection( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> RadarDetection: + """Get a Radar detection + + Get a Radar detection from the last 30 days, including the evidence for why Radar fired. + + Args: + id: The unique ID of the Radar detection. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Returns: + RadarDetection + + Raises: + NotFoundError: If the resource is not found (404). + AuthenticationError: If the API key is invalid (401). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + return await self._client.request( + method="get", + path=("radar", "detections", str(id)), + model=RadarDetection, + request_options=request_options, + ) + async def add_list_entry( self, type: RadarListType | str, diff --git a/src/workos/radar/models/__init__.py b/src/workos/radar/models/__init__.py index 395a00da..1be40dfb 100644 --- a/src/workos/radar/models/__init__.py +++ b/src/workos/radar/models/__init__.py @@ -1,9 +1,26 @@ # This file is auto-generated by oagen. Do not edit. +from workos.common.models.radar_detection_allowed_by import ( + RadarDetectionAllowedBy as RadarDetectionAllowedBy, +) +from workos.common.models.radar_detection_list import ( + RadarDetectionList as RadarDetectionList, +) +from workos.common.models.radar_detection_location import ( + RadarDetectionLocation as RadarDetectionLocation, +) from workos.common.models.radar_list_entry_already_present_response import ( RadarListEntryAlreadyPresentResponse as RadarListEntryAlreadyPresentResponse, ) +from .radar_detection import RadarDetection as RadarDetection +from .radar_detection_evidence import RadarDetectionEvidence as RadarDetectionEvidence +from .radar_detection_evidence import ( + RadarDetectionEvidenceUnknown as RadarDetectionEvidenceUnknown, +) +from .radar_detection_evidence import ( + RadarDetectionEvidenceVariant as RadarDetectionEvidenceVariant, +) from .radar_list_action import RadarListAction as RadarListAction from .radar_list_action import RadarListActionLiteral as RadarListActionLiteral from .radar_list_type import RadarListType as RadarListType diff --git a/src/workos/radar/models/radar_detection.py b/src/workos/radar/models/radar_detection.py new file mode 100644 index 00000000..2e4e2f28 --- /dev/null +++ b/src/workos/radar/models/radar_detection.py @@ -0,0 +1,148 @@ +# 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 Any, Literal, cast + +from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error +from workos.common.models.radar_detection_action import RadarDetectionAction +from workos.common.models.radar_detection_auth_method import RadarDetectionAuthMethod +from workos.common.models.radar_detection_challenge_type import ( + RadarDetectionChallengeType, +) +from workos.common.models.radar_detection_control import RadarDetectionControl +from workos.common.models.radar_detection_location import RadarDetectionLocation +from workos.common.models.radar_detection_verdict import RadarDetectionVerdict + +from .radar_detection_evidence import ( + RadarDetectionEvidence, + RadarDetectionEvidenceVariant, +) + + +@dataclass(slots=True) +class RadarDetection: + """Radar Detection model.""" + + object: Literal["radar_detection"] + """Distinguishes the Radar detection object.""" + id: str + """The unique ID of the detection.""" + attempt_id: str + """The ID of the authentication attempt.""" + control: RadarDetectionControl + """The Radar control that determined the verdict.""" + verdict: RadarDetectionVerdict + """The verdict Radar reached for the attempt.""" + challenge_type: RadarDetectionChallengeType | None + """The challenge Radar issued, if the verdict is `challenge`.""" + evidence: RadarDetectionEvidenceVariant | None + """Why Radar fired. `null` for detections recorded before evidence was captured.""" + ip_address: str + """The IP address of the attempt.""" + location: RadarDetectionLocation + """Where the IP address is located.""" + user_agent: str + """The user agent of the attempt.""" + email: str + """The email address used in the attempt.""" + user_id: str | None + """The ID of the user, if one exists.""" + action: RadarDetectionAction | None + """Whether the attempt was a sign-up or a sign-in, as on the `authentication.radar_risk_detected` event. `null` if unknown.""" + auth_method: RadarDetectionAuthMethod | None + """The authentication method used for the attempt.""" + created_at: datetime + """An ISO 8601 timestamp.""" + updated_at: datetime + """An ISO 8601 timestamp.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetection: + """Deserialize from a dictionary.""" + try: + return cls( + object=data.get("object", "radar_detection"), + id=data["id"], + attempt_id=data["attempt_id"], + control=RadarDetectionControl(data["control"]), + verdict=RadarDetectionVerdict(data["verdict"]), + challenge_type=RadarDetectionChallengeType(_v_challenge_type) + if (_v_challenge_type := data["challenge_type"]) is not None + else None, + evidence=RadarDetectionEvidence.from_dict( + cast(dict[str, Any], _v_evidence) + ) + if (_v_evidence := data["evidence"]) is not None + else None, + ip_address=data["ip_address"], + location=RadarDetectionLocation.from_dict( + cast(dict[str, Any], data["location"]) + ), + user_agent=data["user_agent"], + email=data["email"], + user_id=data["user_id"], + action=RadarDetectionAction(_v_action) + if (_v_action := data["action"]) is not None + else None, + auth_method=RadarDetectionAuthMethod(_v_auth_method) + if (_v_auth_method := data["auth_method"]) is not None + else None, + created_at=_parse_datetime(data["created_at"]), + updated_at=_parse_datetime(data["updated_at"]), + ) + except (KeyError, ValueError) as e: + _raise_deserialize_error("RadarDetection", 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["attempt_id"] = self.attempt_id + result["control"] = ( + self.control.value if isinstance(self.control, Enum) else self.control + ) + result["verdict"] = ( + self.verdict.value if isinstance(self.verdict, Enum) else self.verdict + ) + if self.challenge_type is not None: + result["challenge_type"] = ( + self.challenge_type.value + if isinstance(self.challenge_type, Enum) + else self.challenge_type + ) + else: + result["challenge_type"] = None + if self.evidence is not None: + result["evidence"] = self.evidence.to_dict() + else: + result["evidence"] = None + result["ip_address"] = self.ip_address + result["location"] = self.location.to_dict() + result["user_agent"] = self.user_agent + result["email"] = self.email + if self.user_id is not None: + result["user_id"] = self.user_id + else: + result["user_id"] = None + if self.action is not None: + result["action"] = ( + self.action.value if isinstance(self.action, Enum) else self.action + ) + else: + result["action"] = None + if self.auth_method is not None: + result["auth_method"] = ( + self.auth_method.value + if isinstance(self.auth_method, Enum) + else self.auth_method + ) + else: + result["auth_method"] = None + result["created_at"] = _format_datetime(self.created_at) + result["updated_at"] = _format_datetime(self.updated_at) + return result diff --git a/src/workos/radar/models/radar_detection_evidence.py b/src/workos/radar/models/radar_detection_evidence.py new file mode 100644 index 00000000..985cbb5b --- /dev/null +++ b/src/workos/radar/models/radar_detection_evidence.py @@ -0,0 +1,80 @@ +# This file is auto-generated by oagen. Do not edit. + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, ClassVar, Union, cast + +from workos._types import _raise_deserialize_error +from workos.common.models.bot_detection import BotDetection +from workos.common.models.brute_force_attack import BruteForceAttack +from workos.common.models.domain_protections import DomainProtections +from workos.common.models.impossible_travel import ImpossibleTravel +from workos.common.models.radar_detection_evidence_restriction import ( + RadarDetectionEvidenceRestriction, +) +from workos.common.models.repeat_sign_up import RepeatSignUp +from workos.common.models.stale_account import StaleAccount +from workos.common.models.unrecognized_device import UnrecognizedDevice + + +@dataclass(slots=True) +class RadarDetectionEvidenceUnknown: + """Unknown variant of RadarDetectionEvidence not yet recognized by this SDK version.""" + + raw_data: dict[str, Any] + """The raw payload, preserved so callers can still inspect the data.""" + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionEvidenceUnknown: + """Wrap raw data in an unknown variant.""" + return cls(raw_data=data) + + def to_dict(self) -> dict[str, Any]: + """Return the original raw data.""" + return dict(self.raw_data) + + +RadarDetectionEvidenceVariant = Union[ + BotDetection, + BruteForceAttack, + DomainProtections, + ImpossibleTravel, + RadarDetectionEvidenceRestriction, + RepeatSignUp, + StaleAccount, + UnrecognizedDevice, + RadarDetectionEvidenceUnknown, +] + + +class RadarDetectionEvidence: + """Discriminated union dispatcher (discriminated by 'control').""" + + _DISPATCH: ClassVar[dict[str, type]] = { + "bot_detection": BotDetection, + "brute_force_attack": BruteForceAttack, + "domain_protections": DomainProtections, + "impossible_travel": ImpossibleTravel, + "repeat_sign_up": RepeatSignUp, + "restriction": RadarDetectionEvidenceRestriction, + "stale_account": StaleAccount, + "unrecognized_device": UnrecognizedDevice, + } + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> RadarDetectionEvidenceVariant: + """Deserialize from a dictionary, dispatching to the correct variant.""" + if "control" not in data: + _raise_deserialize_error( + "RadarDetectionEvidence", ValueError("Missing required field 'control'") + ) + disc_value = data["control"] + if disc_value is None: + _raise_deserialize_error( + "RadarDetectionEvidence", ValueError("control must not be None") + ) + dispatch_cls = cls._DISPATCH.get(disc_value) + if dispatch_cls is not None: + return cast("RadarDetectionEvidenceVariant", dispatch_cls.from_dict(data)) + return RadarDetectionEvidenceUnknown.from_dict(data) diff --git a/src/workos/radar/models/radar_list_type.py b/src/workos/radar/models/radar_list_type.py index 62ced2a7..4716fe0b 100644 --- a/src/workos/radar/models/radar_list_type.py +++ b/src/workos/radar/models/radar_list_type.py @@ -1,32 +1,21 @@ # This file is auto-generated by oagen. Do not edit. -"""Enumeration of radar list type values.""" +from typing import TYPE_CHECKING, Literal, TypeAlias -from __future__ import annotations +if TYPE_CHECKING: + from workos.common.models.radar_detection_list_type import ( + RadarDetectionListType as RadarListType, + ) +else: -from enum import Enum -from typing import Literal, TypeAlias + def __getattr__(name: str): + if name == "RadarListType": + from workos.common.models.radar_detection_list_type import ( + RadarDetectionListType, + ) - -class RadarListType(str, Enum): - """Known values for RadarListType.""" - - IP_ADDRESS = "ip_address" - DOMAIN = "domain" - EMAIL = "email" - DEVICE = "device" - USER_AGENT = "user_agent" - DEVICE_FINGERPRINT = "device_fingerprint" - COUNTRY = "country" - - @classmethod - def _missing_(cls, value: object) -> RadarListType | None: - if not isinstance(value, str): - return None - unknown = str.__new__(cls, value) - unknown._name_ = value.upper() - unknown._value_ = value - return unknown + return RadarDetectionListType + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") RadarListTypeLiteral: TypeAlias = Literal[ @@ -38,3 +27,4 @@ def _missing_(cls, value: object) -> RadarListType | None: "device_fingerprint", "country", ] +__all__ = ["RadarListType", "RadarListTypeLiteral"] diff --git a/src/workos/types/organizations_issuer_trusts/__init__.py b/src/workos/types/organizations_issuer_trusts/__init__.py new file mode 100644 index 00000000..257b5d26 --- /dev/null +++ b/src/workos/types/organizations_issuer_trusts/__init__.py @@ -0,0 +1,3 @@ +# This file is auto-generated by oagen. Do not edit. + +from workos.organizations_issuer_trusts.models import * diff --git a/src/workos/user_management/_resource.py b/src/workos/user_management/_resource.py index bfc1ae83..4a2828a7 100644 --- a/src/workos/user_management/_resource.py +++ b/src/workos/user_management/_resource.py @@ -1023,6 +1023,32 @@ def create_cors_origin( request_options=request_options, ) + def delete_cors_origin( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> None: + """Delete a CORS origin + + Deletes a CORS origin from the API key's application. + + Args: + id: The ID of the CORS origin to delete. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + AuthenticationError: If the API key is invalid (401). + NotFoundError: If the resource is not found (404). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + self._client.request( + method="delete", + path=("user_management", "cors_origins", str(id)), + request_options=request_options, + ) + def get_email_verification( self, id: str, @@ -3783,6 +3809,32 @@ async def create_cors_origin( request_options=request_options, ) + async def delete_cors_origin( + self, + id: str, + *, + request_options: RequestOptions | None = None, + ) -> None: + """Delete a CORS origin + + Deletes a CORS origin from the API key's application. + + Args: + id: The ID of the CORS origin to delete. + request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. + + Raises: + AuthenticationError: If the API key is invalid (401). + NotFoundError: If the resource is not found (404). + RateLimitExceededError: If rate limited (429). + ServerError: If the server returns a 5xx error. + """ + await self._client.request( + method="delete", + path=("user_management", "cors_origins", str(id)), + request_options=request_options, + ) + async def get_email_verification( self, id: str, diff --git a/src/workos/user_management/models/__init__.py b/src/workos/user_management/models/__init__.py index d62fe5bb..7edec3fb 100644 --- a/src/workos/user_management/models/__init__.py +++ b/src/workos/user_management/models/__init__.py @@ -131,6 +131,9 @@ from .user_management_authentication_screen_hint import ( UserManagementAuthenticationScreenHint as UserManagementAuthenticationScreenHint, ) +from .user_management_authentication_screen_hint import ( + UserManagementAuthenticationScreenHintLiteral as UserManagementAuthenticationScreenHintLiteral, +) from .user_management_waitlists_state import ( UserManagementWaitlistsState as UserManagementWaitlistsState, ) diff --git a/src/workos/user_management/models/waitlist_list_response_list_metadata.py b/src/workos/user_management/models/waitlist_list_response_list_metadata.py index c7f0a464..8243e804 100644 --- a/src/workos/user_management/models/waitlist_list_response_list_metadata.py +++ b/src/workos/user_management/models/waitlist_list_response_list_metadata.py @@ -2,8 +2,8 @@ from typing import TypeAlias -from workos.organizations.models.it_contact_list_list_metadata import ( - ItContactListListMetadata, +from workos.organizations_issuer_trusts.models.issuer_trust_list_list_metadata import ( + IssuerTrustListListMetadata, ) -WaitlistListResponseListMetadata: TypeAlias = ItContactListListMetadata +WaitlistListResponseListMetadata: TypeAlias = IssuerTrustListListMetadata diff --git a/tests/fixtures/agent_blueprint.json b/tests/fixtures/agent_blueprint.json index 0f4e69cd..05399d91 100644 --- a/tests/fixtures/agent_blueprint.json +++ b/tests/fixtures/agent_blueprint.json @@ -7,6 +7,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/agent_blueprint_created.json b/tests/fixtures/agent_blueprint_created.json index cea3f937..5dd8e84f 100644 --- a/tests/fixtures/agent_blueprint_created.json +++ b/tests/fixtures/agent_blueprint_created.json @@ -11,6 +11,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/agent_blueprint_created_data.json b/tests/fixtures/agent_blueprint_created_data.json index 0f4e69cd..05399d91 100644 --- a/tests/fixtures/agent_blueprint_created_data.json +++ b/tests/fixtures/agent_blueprint_created_data.json @@ -7,6 +7,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/agent_blueprint_created_data_scoped_permission.json b/tests/fixtures/agent_blueprint_created_data_scoped_permission.json new file mode 100644 index 00000000..ecb5fe3c --- /dev/null +++ b/tests/fixtures/agent_blueprint_created_data_scoped_permission.json @@ -0,0 +1,6 @@ +{ + "slug": "email:send", + "instance_types": [ + "delegated" + ] +} diff --git a/tests/fixtures/agent_blueprint_scoped_permission.json b/tests/fixtures/agent_blueprint_scoped_permission.json new file mode 100644 index 00000000..ecb5fe3c --- /dev/null +++ b/tests/fixtures/agent_blueprint_scoped_permission.json @@ -0,0 +1,6 @@ +{ + "slug": "email:send", + "instance_types": [ + "delegated" + ] +} diff --git a/tests/fixtures/agent_blueprint_updated.json b/tests/fixtures/agent_blueprint_updated.json index 1c0e8bbf..5fcc6623 100644 --- a/tests/fixtures/agent_blueprint_updated.json +++ b/tests/fixtures/agent_blueprint_updated.json @@ -11,6 +11,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/agent_blueprint_updated_data.json b/tests/fixtures/agent_blueprint_updated_data.json index 0f4e69cd..05399d91 100644 --- a/tests/fixtures/agent_blueprint_updated_data.json +++ b/tests/fixtures/agent_blueprint_updated_data.json @@ -7,6 +7,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/agent_blueprint_updated_data_scoped_permission.json b/tests/fixtures/agent_blueprint_updated_data_scoped_permission.json new file mode 100644 index 00000000..ecb5fe3c --- /dev/null +++ b/tests/fixtures/agent_blueprint_updated_data_scoped_permission.json @@ -0,0 +1,6 @@ +{ + "slug": "email:send", + "instance_types": [ + "delegated" + ] +} diff --git a/tests/fixtures/agent_blueprints_create_request.json b/tests/fixtures/agent_blueprints_create_request.json index 8d83cb7e..e71711aa 100644 --- a/tests/fixtures/agent_blueprints_create_request.json +++ b/tests/fixtures/agent_blueprints_create_request.json @@ -2,8 +2,19 @@ "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": [ - "crm:read", - "email:send" + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } ], "invocable_by": { "role_slugs": [ diff --git a/tests/fixtures/agent_blueprints_create_request_permission.json b/tests/fixtures/agent_blueprints_create_request_permission.json new file mode 100644 index 00000000..ecb5fe3c --- /dev/null +++ b/tests/fixtures/agent_blueprints_create_request_permission.json @@ -0,0 +1,6 @@ +{ + "slug": "email:send", + "instance_types": [ + "delegated" + ] +} diff --git a/tests/fixtures/agent_blueprints_update_request.json b/tests/fixtures/agent_blueprints_update_request.json index 8d83cb7e..e71711aa 100644 --- a/tests/fixtures/agent_blueprints_update_request.json +++ b/tests/fixtures/agent_blueprints_update_request.json @@ -2,8 +2,19 @@ "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": [ - "crm:read", - "email:send" + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } ], "invocable_by": { "role_slugs": [ diff --git a/tests/fixtures/agent_blueprints_update_request_permission.json b/tests/fixtures/agent_blueprints_update_request_permission.json new file mode 100644 index 00000000..ecb5fe3c --- /dev/null +++ b/tests/fixtures/agent_blueprints_update_request_permission.json @@ -0,0 +1,6 @@ +{ + "slug": "email:send", + "instance_types": [ + "delegated" + ] +} diff --git a/tests/fixtures/application_token_exchange_failed.json b/tests/fixtures/application_token_exchange_failed.json new file mode 100644 index 00000000..880819c3 --- /dev/null +++ b/tests/fixtures/application_token_exchange_failed.json @@ -0,0 +1,35 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "application.token_exchange_failed", + "data": { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": "https://example.okta.com", + "error": { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment." + } + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/application_token_exchange_failed_data.json b/tests/fixtures/application_token_exchange_failed_data.json new file mode 100644 index 00000000..ad2b439a --- /dev/null +++ b/tests/fixtures/application_token_exchange_failed_data.json @@ -0,0 +1,9 @@ +{ + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": "https://example.okta.com", + "error": { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment." + } +} diff --git a/tests/fixtures/application_token_exchange_failed_data_error.json b/tests/fixtures/application_token_exchange_failed_data_error.json new file mode 100644 index 00000000..c823bb3a --- /dev/null +++ b/tests/fixtures/application_token_exchange_failed_data_error.json @@ -0,0 +1,4 @@ +{ + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment." +} diff --git a/tests/fixtures/application_token_exchange_succeeded.json b/tests/fixtures/application_token_exchange_succeeded.json new file mode 100644 index 00000000..74829a2e --- /dev/null +++ b/tests/fixtures/application_token_exchange_succeeded.json @@ -0,0 +1,36 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "application.token_exchange_succeeded", + "data": { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "issuer": "https://example.okta.com", + "connection_id": "conn_01E4ZCR3C56J083X43JQXF3JK5", + "jti": "01HXYZ123456789ABCDEFGHIJ" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/application_token_exchange_succeeded_data.json b/tests/fixtures/application_token_exchange_succeeded_data.json new file mode 100644 index 00000000..22e1df6e --- /dev/null +++ b/tests/fixtures/application_token_exchange_succeeded_data.json @@ -0,0 +1,10 @@ +{ + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "issuer": "https://example.okta.com", + "connection_id": "conn_01E4ZCR3C56J083X43JQXF3JK5", + "jti": "01HXYZ123456789ABCDEFGHIJ" +} diff --git a/tests/fixtures/authentication_radar_risk_detected.json b/tests/fixtures/authentication_radar_risk_detected.json index a90da4ec..c16dff5f 100644 --- a/tests/fixtures/authentication_radar_risk_detected.json +++ b/tests/fixtures/authentication_radar_risk_detected.json @@ -5,8 +5,8 @@ "data": { "auth_method": "password", "action": "signup", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", diff --git a/tests/fixtures/authentication_radar_risk_detected_data.json b/tests/fixtures/authentication_radar_risk_detected_data.json index 8b975276..20bc8631 100644 --- a/tests/fixtures/authentication_radar_risk_detected_data.json +++ b/tests/fixtures/authentication_radar_risk_detected_data.json @@ -1,8 +1,8 @@ { "auth_method": "password", "action": "signup", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", diff --git a/tests/fixtures/blocked_tld.json b/tests/fixtures/blocked_tld.json new file mode 100644 index 00000000..674e890b --- /dev/null +++ b/tests/fixtures/blocked_tld.json @@ -0,0 +1,3 @@ +{ + "type": "blocked_tld" +} diff --git a/tests/fixtures/bot_detection.json b/tests/fixtures/bot_detection.json new file mode 100644 index 00000000..074f6f2b --- /dev/null +++ b/tests/fixtures/bot_detection.json @@ -0,0 +1,51 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "bot_detection", + "details": { + "signals": [ + { + "signal": "risky_ip", + "action": "block" + } + ], + "decided_by": "risky_ip", + "ip_risk": [ + "abuser", + "anonymous", + "vpn", + "tor", + "proxy" + ], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain" + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals" + ], + "ip_sign_ups": { + "count": 6, + "window_minutes": 5 + }, + "domain_sign_ups": { + "root_domain": "example.com", + "count": 44 + } + } +} diff --git a/tests/fixtures/brute_force_attack.json b/tests/fixtures/brute_force_attack.json new file mode 100644 index 00000000..4b33e2f3 --- /dev/null +++ b/tests/fixtures/brute_force_attack.json @@ -0,0 +1,19 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "brute_force_attack", + "details": { + "attempts": 11, + "window_minutes": 1, + "matched_on": "device_fingerprint_and_email" + } +} diff --git a/tests/fixtures/domain_protections.json b/tests/fixtures/domain_protections.json new file mode 100644 index 00000000..b11b8203 --- /dev/null +++ b/tests/fixtures/domain_protections.json @@ -0,0 +1,35 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "domain_protections", + "details": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "also_matched_list_ids": [ + "also_matched_list_ids_01234" + ], + "also_matched_lists": [ + { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + } + ], + "matched_domain": "example.com" + } +} diff --git a/tests/fixtures/entity_not_found_error_body_with_entity_id.json b/tests/fixtures/entity_not_found_error_body_with_entity_id.json new file mode 100644 index 00000000..20307393 --- /dev/null +++ b/tests/fixtures/entity_not_found_error_body_with_entity_id.json @@ -0,0 +1,5 @@ +{ + "code": "entity_not_found", + "message": "Request could not be processed.", + "entity_id": "org_01E4ZCR3C56J083X43JQXF3JK5" +} diff --git a/tests/fixtures/entity_not_found_error_body_with_ids_list.json b/tests/fixtures/entity_not_found_error_body_with_ids_list.json new file mode 100644 index 00000000..dae39d98 --- /dev/null +++ b/tests/fixtures/entity_not_found_error_body_with_ids_list.json @@ -0,0 +1,8 @@ +{ + "code": "entities_not_found", + "message": "Request could not be processed.", + "ids": [ + "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E", + "org_01E4ZCR3C56J083X43JQXF3JK5" + ] +} diff --git a/tests/fixtures/error_body_with_error.json b/tests/fixtures/error_body_with_error.json index 9b87bd83..8ceb101f 100644 --- a/tests/fixtures/error_body_with_error.json +++ b/tests/fixtures/error_body_with_error.json @@ -1,4 +1,4 @@ { "error": "Bad Request", - "message": "Claim \"sub\" is reserved and cannot be used." + "message": "Request could not be processed." } diff --git a/tests/fixtures/impossible_travel.json b/tests/fixtures/impossible_travel.json new file mode 100644 index 00000000..fdb80f33 --- /dev/null +++ b/tests/fixtures/impossible_travel.json @@ -0,0 +1,28 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "impossible_travel", + "details": { + "previous": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": { + "city": "San Francisco", + "country": "US" + }, + "created_at": "2026-01-15T12:00:00.000Z" + }, + "distance_km": 8543, + "speed_km_per_s": 4.07 + } +} diff --git a/tests/fixtures/issuer_trust.json b/tests/fixtures/issuer_trust.json new file mode 100644 index 00000000..124c54e2 --- /dev/null +++ b/tests/fixtures/issuer_trust.json @@ -0,0 +1,10 @@ +{ + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": true, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/issuer_trust_created.json b/tests/fixtures/issuer_trust_created.json new file mode 100644 index 00000000..9c61ac92 --- /dev/null +++ b/tests/fixtures/issuer_trust_created.json @@ -0,0 +1,36 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "issuer_trust.created", + "data": { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": true, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/issuer_trust_deleted.json b/tests/fixtures/issuer_trust_deleted.json new file mode 100644 index 00000000..7ac36121 --- /dev/null +++ b/tests/fixtures/issuer_trust_deleted.json @@ -0,0 +1,36 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "issuer_trust.deleted", + "data": { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": true, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/issuer_trust_list.json b/tests/fixtures/issuer_trust_list.json new file mode 100644 index 00000000..554a6716 --- /dev/null +++ b/tests/fixtures/issuer_trust_list.json @@ -0,0 +1,19 @@ +{ + "object": "list", + "data": [ + { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": true, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" + } + ], + "list_metadata": { + "before": "issuer_trust_01HXYZ123456789ABCDEFGHIJ", + "after": "issuer_trust_01HXYZ987654321KJIHGFEDCBA" + } +} diff --git a/tests/fixtures/issuer_trust_list_list_metadata.json b/tests/fixtures/issuer_trust_list_list_metadata.json new file mode 100644 index 00000000..ce1587bd --- /dev/null +++ b/tests/fixtures/issuer_trust_list_list_metadata.json @@ -0,0 +1,4 @@ +{ + "before": "issuer_trust_01HXYZ123456789ABCDEFGHIJ", + "after": "issuer_trust_01HXYZ987654321KJIHGFEDCBA" +} diff --git a/tests/fixtures/issuer_trust_updated.json b/tests/fixtures/issuer_trust_updated.json new file mode 100644 index 00000000..bba902f8 --- /dev/null +++ b/tests/fixtures/issuer_trust_updated.json @@ -0,0 +1,36 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "issuer_trust.updated", + "data": { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": true, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/fixtures/issuer_trusts_create_request.json b/tests/fixtures/issuer_trusts_create_request.json new file mode 100644 index 00000000..780920a2 --- /dev/null +++ b/tests/fixtures/issuer_trusts_create_request.json @@ -0,0 +1,4 @@ +{ + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A" +} diff --git a/tests/fixtures/issuer_trusts_update_request.json b/tests/fixtures/issuer_trusts_update_request.json new file mode 100644 index 00000000..4e609c71 --- /dev/null +++ b/tests/fixtures/issuer_trusts_update_request.json @@ -0,0 +1,3 @@ +{ + "enabled": true +} diff --git a/tests/fixtures/list_agent_blueprint.json b/tests/fixtures/list_agent_blueprint.json index ef288267..94eb0418 100644 --- a/tests/fixtures/list_agent_blueprint.json +++ b/tests/fixtures/list_agent_blueprint.json @@ -9,6 +9,21 @@ "crm:read", "email:send" ], + "scoped_permissions": [ + { + "slug": "crm:read", + "instance_types": [ + "delegated", + "autonomous" + ] + }, + { + "slug": "email:send", + "instance_types": [ + "delegated" + ] + } + ], "invocable_by": { "role_slugs": [ "manager" diff --git a/tests/fixtures/normalized_email.json b/tests/fixtures/normalized_email.json new file mode 100644 index 00000000..0748b1ae --- /dev/null +++ b/tests/fixtures/normalized_email.json @@ -0,0 +1,4 @@ +{ + "matched_on": "normalized_email", + "matched_user_id": "user_01E4ZCR3C56J083X43JQXF3JK5" +} diff --git a/tests/fixtures/patch_role_assignment_entry.json b/tests/fixtures/patch_role_assignment_entry.json new file mode 100644 index 00000000..66cab23c --- /dev/null +++ b/tests/fixtures/patch_role_assignment_entry.json @@ -0,0 +1,6 @@ +{ + "role_slug": "editor", + "resource_id": "authz_resource_01HXYZ123456789ABCDEFGH", + "resource_external_id": "project-ext-456", + "resource_type_slug": "project" +} diff --git a/tests/fixtures/patch_role_assignments.json b/tests/fixtures/patch_role_assignments.json new file mode 100644 index 00000000..0d58f68c --- /dev/null +++ b/tests/fixtures/patch_role_assignments.json @@ -0,0 +1,18 @@ +{ + "add": [ + { + "role_slug": "editor", + "resource_id": "authz_resource_01HXYZ123456789ABCDEFGH", + "resource_external_id": "project-ext-456", + "resource_type_slug": "project" + } + ], + "remove": [ + { + "role_slug": "viewer", + "resource_id": "authz_resource_01HXYZ123456789ABCDEFGH", + "resource_external_id": "project-ext-456", + "resource_type_slug": "project" + } + ] +} diff --git a/tests/fixtures/radar_detection.json b/tests/fixtures/radar_detection.json new file mode 100644 index 00000000..f1ea6f5f --- /dev/null +++ b/tests/fixtures/radar_detection.json @@ -0,0 +1,71 @@ +{ + "object": "radar_detection", + "id": "detection_01HZBC6N1EB1ZY7KG32X", + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "control": "bot_detection", + "verdict": "challenge", + "challenge_type": "email", + "evidence": { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "bot_detection", + "details": { + "signals": [ + { + "signal": "risky_ip", + "action": "block" + } + ], + "decided_by": "risky_ip", + "ip_risk": [ + "abuser", + "anonymous", + "vpn", + "tor", + "proxy" + ], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain" + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals" + ], + "ip_sign_ups": { + "count": 6, + "window_minutes": 5 + }, + "domain_sign_ups": { + "root_domain": "example.com", + "count": 44 + } + } + }, + "ip_address": "203.0.113.42", + "location": { + "city": "San Francisco", + "country": "US" + }, + "user_agent": "Mozilla/5.0", + "email": "user@example.com", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "action": "signup", + "auth_method": "password", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/radar_detection_allowed_by.json b/tests/fixtures/radar_detection_allowed_by.json new file mode 100644 index 00000000..39827c73 --- /dev/null +++ b/tests/fixtures/radar_detection_allowed_by.json @@ -0,0 +1,10 @@ +{ + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" +} diff --git a/tests/fixtures/radar_detection_bot_detection_details.json b/tests/fixtures/radar_detection_bot_detection_details.json new file mode 100644 index 00000000..4b18512e --- /dev/null +++ b/tests/fixtures/radar_detection_bot_detection_details.json @@ -0,0 +1,37 @@ +{ + "signals": [ + { + "signal": "risky_ip", + "action": "block" + } + ], + "decided_by": "risky_ip", + "ip_risk": [ + "abuser", + "anonymous", + "vpn", + "tor", + "proxy" + ], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain" + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals" + ], + "ip_sign_ups": { + "count": 6, + "window_minutes": 5 + }, + "domain_sign_ups": { + "root_domain": "example.com", + "count": 44 + } +} diff --git a/tests/fixtures/radar_detection_bot_detection_signal.json b/tests/fixtures/radar_detection_bot_detection_signal.json new file mode 100644 index 00000000..1f456e3b --- /dev/null +++ b/tests/fixtures/radar_detection_bot_detection_signal.json @@ -0,0 +1,4 @@ +{ + "signal": "risky_ip", + "action": "block" +} diff --git a/tests/fixtures/radar_detection_brute_force_attack_details.json b/tests/fixtures/radar_detection_brute_force_attack_details.json new file mode 100644 index 00000000..653a4bd9 --- /dev/null +++ b/tests/fixtures/radar_detection_brute_force_attack_details.json @@ -0,0 +1,5 @@ +{ + "attempts": 11, + "window_minutes": 1, + "matched_on": "device_fingerprint_and_email" +} diff --git a/tests/fixtures/radar_detection_domain_protections_details.json b/tests/fixtures/radar_detection_domain_protections_details.json new file mode 100644 index 00000000..6298cdca --- /dev/null +++ b/tests/fixtures/radar_detection_domain_protections_details.json @@ -0,0 +1,21 @@ +{ + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "also_matched_list_ids": [ + "also_matched_list_ids_01234" + ], + "also_matched_lists": [ + { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + } + ], + "matched_domain": "example.com" +} diff --git a/tests/fixtures/radar_detection_domain_sign_ups.json b/tests/fixtures/radar_detection_domain_sign_ups.json new file mode 100644 index 00000000..08555bac --- /dev/null +++ b/tests/fixtures/radar_detection_domain_sign_ups.json @@ -0,0 +1,4 @@ +{ + "root_domain": "example.com", + "count": 44 +} diff --git a/tests/fixtures/radar_detection_evidence.json b/tests/fixtures/radar_detection_evidence.json new file mode 100644 index 00000000..074f6f2b --- /dev/null +++ b/tests/fixtures/radar_detection_evidence.json @@ -0,0 +1,51 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "bot_detection", + "details": { + "signals": [ + { + "signal": "risky_ip", + "action": "block" + } + ], + "decided_by": "risky_ip", + "ip_risk": [ + "abuser", + "anonymous", + "vpn", + "tor", + "proxy" + ], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain" + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals" + ], + "ip_sign_ups": { + "count": 6, + "window_minutes": 5 + }, + "domain_sign_ups": { + "root_domain": "example.com", + "count": 44 + } + } +} diff --git a/tests/fixtures/radar_detection_evidence_restriction.json b/tests/fixtures/radar_detection_evidence_restriction.json new file mode 100644 index 00000000..24680c5e --- /dev/null +++ b/tests/fixtures/radar_detection_evidence_restriction.json @@ -0,0 +1,25 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "restriction", + "details": { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + } +} diff --git a/tests/fixtures/radar_detection_impossible_travel_details.json b/tests/fixtures/radar_detection_impossible_travel_details.json new file mode 100644 index 00000000..d19d991e --- /dev/null +++ b/tests/fixtures/radar_detection_impossible_travel_details.json @@ -0,0 +1,14 @@ +{ + "previous": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": { + "city": "San Francisco", + "country": "US" + }, + "created_at": "2026-01-15T12:00:00.000Z" + }, + "distance_km": 8543, + "speed_km_per_s": 4.07 +} diff --git a/tests/fixtures/radar_detection_ip_sign_ups.json b/tests/fixtures/radar_detection_ip_sign_ups.json new file mode 100644 index 00000000..7106dcfe --- /dev/null +++ b/tests/fixtures/radar_detection_ip_sign_ups.json @@ -0,0 +1,4 @@ +{ + "count": 6, + "window_minutes": 5 +} diff --git a/tests/fixtures/radar_detection_list.json b/tests/fixtures/radar_detection_list.json new file mode 100644 index 00000000..26f36002 --- /dev/null +++ b/tests/fixtures/radar_detection_list.json @@ -0,0 +1,6 @@ +{ + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true +} diff --git a/tests/fixtures/radar_detection_location.json b/tests/fixtures/radar_detection_location.json new file mode 100644 index 00000000..139fe173 --- /dev/null +++ b/tests/fixtures/radar_detection_location.json @@ -0,0 +1,4 @@ +{ + "city": "San Francisco", + "country": "US" +} diff --git a/tests/fixtures/radar_detection_previous_attempt.json b/tests/fixtures/radar_detection_previous_attempt.json new file mode 100644 index 00000000..cfbd65c0 --- /dev/null +++ b/tests/fixtures/radar_detection_previous_attempt.json @@ -0,0 +1,10 @@ +{ + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": { + "city": "San Francisco", + "country": "US" + }, + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/radar_detection_previous_attempt_location.json b/tests/fixtures/radar_detection_previous_attempt_location.json new file mode 100644 index 00000000..139fe173 --- /dev/null +++ b/tests/fixtures/radar_detection_previous_attempt_location.json @@ -0,0 +1,4 @@ +{ + "city": "San Francisco", + "country": "US" +} diff --git a/tests/fixtures/radar_detection_repeat_sign_up_details_email.json b/tests/fixtures/radar_detection_repeat_sign_up_details_email.json new file mode 100644 index 00000000..b535ee91 --- /dev/null +++ b/tests/fixtures/radar_detection_repeat_sign_up_details_email.json @@ -0,0 +1,5 @@ +{ + "matched_on": "email", + "prior_sign_ups": 8, + "window_days": 60 +} diff --git a/tests/fixtures/radar_detection_restriction_details_list.json b/tests/fixtures/radar_detection_restriction_details_list.json new file mode 100644 index 00000000..b8497bdd --- /dev/null +++ b/tests/fixtures/radar_detection_restriction_details_list.json @@ -0,0 +1,11 @@ +{ + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" +} diff --git a/tests/fixtures/radar_detection_stale_account_details.json b/tests/fixtures/radar_detection_stale_account_details.json new file mode 100644 index 00000000..fd808876 --- /dev/null +++ b/tests/fixtures/radar_detection_stale_account_details.json @@ -0,0 +1,3 @@ +{ + "last_activity_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/radar_detection_unrecognized_device_details.json b/tests/fixtures/radar_detection_unrecognized_device_details.json new file mode 100644 index 00000000..cc405961 --- /dev/null +++ b/tests/fixtures/radar_detection_unrecognized_device_details.json @@ -0,0 +1,12 @@ +{ + "previous_device": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": { + "city": "San Francisco", + "country": "US" + }, + "created_at": "2026-01-15T12:00:00.000Z" + } +} diff --git a/tests/fixtures/radar_sms_challenge_error_body.json b/tests/fixtures/radar_sms_challenge_error_body.json new file mode 100644 index 00000000..c6763e11 --- /dev/null +++ b/tests/fixtures/radar_sms_challenge_error_body.json @@ -0,0 +1,4 @@ +{ + "code": "radar_sms_challenge", + "message": "Request could not be processed." +} diff --git a/tests/fixtures/repeat_sign_up.json b/tests/fixtures/repeat_sign_up.json new file mode 100644 index 00000000..a6be5879 --- /dev/null +++ b/tests/fixtures/repeat_sign_up.json @@ -0,0 +1,19 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "repeat_sign_up", + "details": { + "matched_on": "email", + "prior_sign_ups": 8, + "window_days": 60 + } +} diff --git a/tests/fixtures/role_assignment_update_overlap_error_body.json b/tests/fixtures/role_assignment_update_overlap_error_body.json new file mode 100644 index 00000000..8f6280f6 --- /dev/null +++ b/tests/fixtures/role_assignment_update_overlap_error_body.json @@ -0,0 +1,4 @@ +{ + "code": "role_assignment_update_overlap", + "message": "Request could not be processed." +} diff --git a/tests/fixtures/sign_up.json b/tests/fixtures/sign_up.json new file mode 100644 index 00000000..b07ab156 --- /dev/null +++ b/tests/fixtures/sign_up.json @@ -0,0 +1,3 @@ +{ + "type": "sign_up" +} diff --git a/tests/fixtures/sms_sign_in.json b/tests/fixtures/sms_sign_in.json new file mode 100644 index 00000000..92624bf2 --- /dev/null +++ b/tests/fixtures/sms_sign_in.json @@ -0,0 +1,7 @@ +{ + "type": "sms_sign_in", + "trigger": "country_mismatch", + "phone_country": "US", + "line_type": "voip", + "masked_phone_number": "••••0123" +} diff --git a/tests/fixtures/stale_account.json b/tests/fixtures/stale_account.json new file mode 100644 index 00000000..7819a980 --- /dev/null +++ b/tests/fixtures/stale_account.json @@ -0,0 +1,17 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "stale_account", + "details": { + "last_activity_at": "2026-01-15T12:00:00.000Z" + } +} diff --git a/tests/fixtures/unrecognized_device.json b/tests/fixtures/unrecognized_device.json new file mode 100644 index 00000000..4d781eb4 --- /dev/null +++ b/tests/fixtures/unrecognized_device.json @@ -0,0 +1,26 @@ +{ + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": true + }, + "entry": "example.com" + }, + "control": "unrecognized_device", + "details": { + "previous_device": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": { + "city": "San Francisco", + "country": "US" + }, + "created_at": "2026-01-15T12:00:00.000Z" + } + } +} diff --git a/tests/test_agents_models_round_trip.py b/tests/test_agents_models_round_trip.py index 84ab071f..a71d2048 100644 --- a/tests/test_agents_models_round_trip.py +++ b/tests/test_agents_models_round_trip.py @@ -8,12 +8,15 @@ AgentBlueprint, AgentBlueprintInvocableAs, AgentBlueprintInvocableBy, + AgentBlueprintScopedPermission, AgentBlueprintsCreateRequestInvocableAs, AgentBlueprintsCreateRequestInvocableBy, + AgentBlueprintsCreateRequestPermission, AgentBlueprintsCreateRequestSessionSetting, AgentBlueprintSessionSetting, AgentBlueprintsUpdateRequestInvocableAs, AgentBlueprintsUpdateRequestInvocableBy, + AgentBlueprintsUpdateRequestPermission, AgentBlueprintsUpdateRequestSessionSetting, AgentCredentialValidation, AgentInstance, @@ -216,6 +219,10 @@ def test_agent_blueprint_minimal_payload(self): "name": "Prospecting Agent", "description": None, "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -236,6 +243,7 @@ def test_agent_blueprint_minimal_payload(self): assert serialized["name"] == data["name"] assert serialized["description"] == data["description"] assert serialized["permissions"] == data["permissions"] + assert serialized["scoped_permissions"] == data["scoped_permissions"] assert serialized["invocable_by"] == data["invocable_by"] assert serialized["invocable_as"] == data["invocable_as"] assert serialized["session_settings"] == data["session_settings"] @@ -249,6 +257,10 @@ def test_agent_blueprint_preserves_nullable_fields(self): "name": "Prospecting Agent", "description": None, "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -467,6 +479,21 @@ def test_agent_instance_session_round_trips_unknown_enum_values(self): instance = AgentInstanceSession.from_dict(data) assert instance.to_dict() == data + def test_agent_blueprint_scoped_permission_round_trip(self): + data = load_fixture("agent_blueprint_scoped_permission.json") + instance = AgentBlueprintScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AgentBlueprintScopedPermission.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_agent_blueprint_scoped_permission_minimal_payload(self): + data = {"slug": "email:send", "instance_types": ["delegated"]} + instance = AgentBlueprintScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized["slug"] == data["slug"] + assert serialized["instance_types"] == data["instance_types"] + def test_agent_blueprint_invocable_by_round_trip(self): data = load_fixture("agent_blueprint_invocable_by.json") instance = AgentBlueprintInvocableBy.from_dict(data) @@ -607,6 +634,21 @@ def test_agent_registration_claim_preserves_nullable_fields(self): serialized = instance.to_dict() assert serialized["claim_completion"] is None + def test_agent_blueprints_create_request_permission_round_trip(self): + data = load_fixture("agent_blueprints_create_request_permission.json") + instance = AgentBlueprintsCreateRequestPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AgentBlueprintsCreateRequestPermission.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_agent_blueprints_create_request_permission_minimal_payload(self): + data = {"slug": "email:send", "instance_types": ["delegated"]} + instance = AgentBlueprintsCreateRequestPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized["slug"] == data["slug"] + assert serialized["instance_types"] == data["instance_types"] + def test_agent_blueprints_create_request_invocable_by_round_trip(self): data = load_fixture("agent_blueprints_create_request_invocable_by.json") instance = AgentBlueprintsCreateRequestInvocableBy.from_dict(data) @@ -674,6 +716,21 @@ def test_agent_blueprints_create_request_session_setting_minimal_payload(self): serialized["refresh_token_ttl_seconds"] == data["refresh_token_ttl_seconds"] ) + def test_agent_blueprints_update_request_permission_round_trip(self): + data = load_fixture("agent_blueprints_update_request_permission.json") + instance = AgentBlueprintsUpdateRequestPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AgentBlueprintsUpdateRequestPermission.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_agent_blueprints_update_request_permission_minimal_payload(self): + data = {"slug": "email:send", "instance_types": ["delegated"]} + instance = AgentBlueprintsUpdateRequestPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized["slug"] == data["slug"] + assert serialized["instance_types"] == data["instance_types"] + def test_agent_blueprints_update_request_invocable_by_round_trip(self): data = load_fixture("agent_blueprints_update_request_invocable_by.json") instance = AgentBlueprintsUpdateRequestInvocableBy.from_dict(data) diff --git a/tests/test_audit_logs_models_round_trip.py b/tests/test_audit_logs_models_round_trip.py index 904cfda2..0430e2d3 100644 --- a/tests/test_audit_logs_models_round_trip.py +++ b/tests/test_audit_logs_models_round_trip.py @@ -95,7 +95,6 @@ def test_audit_log_event_round_trip(self): def test_audit_log_event_minimal_payload(self): data = { "action": "user.signed_in", - "occurred_at": "2026-02-02T16:35:39.000Z", "actor": { "id": "user_TF4C5938", "type": "user", @@ -118,7 +117,6 @@ def test_audit_log_event_minimal_payload(self): instance = AuditLogEvent.from_dict(data) serialized = instance.to_dict() assert serialized["action"] == data["action"] - assert serialized["occurred_at"] == data["occurred_at"] assert serialized["actor"] == data["actor"] assert serialized["targets"] == data["targets"] assert serialized["context"] == data["context"] @@ -126,7 +124,6 @@ def test_audit_log_event_minimal_payload(self): def test_audit_log_event_omits_absent_optional_non_nullable_fields(self): data = { "action": "user.signed_in", - "occurred_at": "2026-02-02T16:35:39.000Z", "actor": { "id": "user_TF4C5938", "type": "user", @@ -148,6 +145,7 @@ def test_audit_log_event_omits_absent_optional_non_nullable_fields(self): } instance = AuditLogEvent.from_dict(data) serialized = instance.to_dict() + assert "occurred_at" not in serialized assert "metadata" not in serialized assert "version" not in serialized diff --git a/tests/test_authorization.py b/tests/test_authorization.py index 775af7be..d125e696 100644 --- a/tests/test_authorization.py +++ b/tests/test_authorization.py @@ -368,6 +368,15 @@ def test_assign_role(self, workos, httpx_mock): body = json.loads(request.content) assert body["role_slug"] == "test_role_slug" + def test_update_role_assignments(self, workos, httpx_mock): + httpx_mock.add_response(json={}) + workos.authorization.update_role_assignments("test_organization_membership_id") + request = httpx_mock.get_request() + assert request.method == "PATCH" + assert request.url.path.endswith( + "/authorization/organization_memberships/test_organization_membership_id/role_assignments" + ) + def test_remove_role(self, workos, httpx_mock): httpx_mock.add_response(status_code=204) result = workos.authorization.remove_role( @@ -1452,6 +1461,18 @@ async def test_assign_role(self, async_workos, httpx_mock): "/authorization/organization_memberships/test_organization_membership_id/role_assignments" ) + @pytest.mark.asyncio + async def test_update_role_assignments(self, async_workos, httpx_mock): + httpx_mock.add_response(json={}) + await async_workos.authorization.update_role_assignments( + "test_organization_membership_id" + ) + request = httpx_mock.get_request() + assert request.method == "PATCH" + assert request.url.path.endswith( + "/authorization/organization_memberships/test_organization_membership_id/role_assignments" + ) + @pytest.mark.asyncio async def test_remove_role(self, async_workos, httpx_mock): httpx_mock.add_response(status_code=204) diff --git a/tests/test_authorization_models_round_trip.py b/tests/test_authorization_models_round_trip.py index 1c6d024d..c94a863a 100644 --- a/tests/test_authorization_models_round_trip.py +++ b/tests/test_authorization_models_round_trip.py @@ -10,6 +10,7 @@ GroupRoleAssignment, GroupRoleAssignmentList, GroupRoleAssignmentResource, + PatchRoleAssignmentEntry, Permission, ReplaceGroupRoleAssignmentEntry, Role, @@ -47,6 +48,30 @@ def test_replace_group_role_assignment_entry_omits_absent_optional_non_nullable_ assert "resource_external_id" not in serialized assert "resource_type_slug" not in serialized + def test_patch_role_assignment_entry_round_trip(self): + data = load_fixture("patch_role_assignment_entry.json") + instance = PatchRoleAssignmentEntry.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = PatchRoleAssignmentEntry.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_patch_role_assignment_entry_minimal_payload(self): + data = {"role_slug": "editor"} + instance = PatchRoleAssignmentEntry.from_dict(data) + serialized = instance.to_dict() + assert serialized["role_slug"] == data["role_slug"] + + def test_patch_role_assignment_entry_omits_absent_optional_non_nullable_fields( + self, + ): + data = {"role_slug": "editor"} + instance = PatchRoleAssignmentEntry.from_dict(data) + serialized = instance.to_dict() + assert "resource_id" not in serialized + assert "resource_external_id" not in serialized + assert "resource_type_slug" not in serialized + def test_authorization_check_round_trip(self): data = load_fixture("authorization_check.json") instance = AuthorizationCheck.from_dict(data) diff --git a/tests/test_common_models_round_trip.py b/tests/test_common_models_round_trip.py index 64b44b76..7eaa2da0 100644 --- a/tests/test_common_models_round_trip.py +++ b/tests/test_common_models_round_trip.py @@ -2,6 +2,8 @@ """Model round-trip tests: from_dict(to_dict()) preserves data.""" +import pytest + from tests.generated_helpers import load_fixture from workos.common.models import ( AccessDeniedOAuthErrorBody, @@ -17,6 +19,7 @@ AgentBlueprintCreatedData, AgentBlueprintCreatedDataInvocableAs, AgentBlueprintCreatedDataInvocableBy, + AgentBlueprintCreatedDataScopedPermission, AgentBlueprintCreatedDataSessionSetting, AgentBlueprintDeleted, AgentBlueprintDeletedData, @@ -24,6 +27,7 @@ AgentBlueprintUpdatedData, AgentBlueprintUpdatedDataInvocableAs, AgentBlueprintUpdatedDataInvocableBy, + AgentBlueprintUpdatedDataScopedPermission, AgentBlueprintUpdatedDataSessionSetting, AgentInstanceCreated, AgentInstanceCreatedData, @@ -67,6 +71,11 @@ ApiKeyUpdatedDataOwner, ApiKeyUpdatedDataPreviousAttribute, ApplicationConsentRequiredErrorBody, + ApplicationTokenExchangeFailed, + ApplicationTokenExchangeFailedData, + ApplicationTokenExchangeFailedDataError, + ApplicationTokenExchangeSucceeded, + ApplicationTokenExchangeSucceededData, AuthenticationEmailVerificationFailed, AuthenticationEmailVerificationFailedData, AuthenticationEmailVerificationFailedDataError, @@ -122,6 +131,9 @@ AuthorizationPendingOAuthErrorBody, AuthorizationUrlNotFoundErrorBody, AuthorizationUrlRequestErrorBody, + BlockedTld, + BotDetection, + BruteForceAttack, ClientCredentialsDataIntegrationVendedCredential, CodeChallengeNotFoundErrorBody, ConnectApplicationM2M, @@ -148,6 +160,10 @@ ConnectionSAMLCertificateRenewedData, ConnectionSAMLCertificateRenewedDataCertificate, ConnectionSAMLCertificateRenewedDataConnection, + ConnectionSAMLCertificateReplaced, + ConnectionSAMLCertificateReplacedData, + ConnectionSAMLCertificateReplacedDataCertificate, + ConnectionSAMLCertificateReplacedDataConnection, ConnectionTypeNotUpdatableErrorBody, DailyQuotaExceededErrorBody, DataIntegrationAccessTokenResponseWithAccessToken, @@ -156,6 +172,7 @@ DataIntegrationCredentialsResponseWithCredential, DataIntegrationCredentialsResponseWithError, DirectorySyncRateLimitError, + DomainProtections, DsyncActivated, DsyncActivatedData, DsyncActivatedDataDomain, @@ -189,6 +206,8 @@ EmailVerificationCreatedData, EmailVerificationRequiredErrorBody, EntityNotFoundErrorBody, + EntityNotFoundErrorBodyWithEntityId, + EntityNotFoundErrorBodyWithIdsList, ErrorBody, ErrorBodyWithCode, ErrorBodyWithCodeErrors, @@ -289,6 +308,7 @@ GroupMemberRemovedData, GroupUpdated, IdpMetadataFetchFailedErrorBody, + ImpossibleTravel, InvalidClientOAuthErrorBody, InvalidConnectionOAuthErrorBody, InvalidCredentialsErrorBody, @@ -319,6 +339,9 @@ InvitationResentData, InvitationRevoked, InvitationRevokedData, + IssuerTrustCreated, + IssuerTrustDeleted, + IssuerTrustUpdated, MagicAuthCreated, MagicAuthCreatedData, MFAChallengeErrorBody, @@ -326,6 +349,7 @@ MFAEnrollmentOAuthErrorBody, MultipleRolesNotEnabledErrorBody, MustUseSSOForSelectedOrganizationMessageErrorBody, + NormalizedEmail, OAuthDataIntegrationVendedCredential, OAuthErrorBody, OneTimeCodeExpiredErrorBody, @@ -365,6 +389,8 @@ OrganizationRoleUpdated, OrganizationRoleUpdatedData, OrganizationSelectionRequiredErrorBody, + OrganizationSelectionRequiredErrorBodyWithOrganization, + OrganizationSelectionRequiredErrorBodyWithOrganizations, OrganizationUpdated, OrganizationUpdatedData, OrganizationUpdatedDataDomain, @@ -402,9 +428,29 @@ RadarChallengeCreated, RadarChallengeCreatedData, RadarChallengeErrorBody, + RadarDetectionBotDetectionDetails, + RadarDetectionBotDetectionSignal, + RadarDetectionBruteForceAttackDetails, + RadarDetectionDomainProtectionsDetails, + RadarDetectionDomainSignUps, + RadarDetectionEvidenceRestriction, + RadarDetectionImpossibleTravelDetails, + RadarDetectionIpSignUps, + RadarDetectionPreviousAttempt, + RadarDetectionPreviousAttemptLocation, + RadarDetectionRepeatSignUpDetails, + RadarDetectionRepeatSignUpDetailsEmail, + RadarDetectionRepeatSignUpDetailsUnknown, + RadarDetectionRestrictionDetails, + RadarDetectionRestrictionDetailsList, + RadarDetectionRestrictionDetailsUnknown, + RadarDetectionStaleAccountDetails, + RadarDetectionUnrecognizedDeviceDetails, RadarSignUpChallengeErrorBody, + RadarSmsChallengeErrorBody, RadarSmsSignInChallengeErrorBody, RateLimitExceededErrorBodyWithRetryAfter, + RepeatSignUp, ResourceExportCompleted, ResourceExportCompletedData, ResourceExportCreated, @@ -413,6 +459,7 @@ ResourceExportDownloadedData, ResourceExportFailed, ResourceExportFailedData, + RoleAssignmentUpdateOverlapErrorBody, RoleCreated, RoleCreatedData, RoleDeleted, @@ -425,17 +472,21 @@ SessionRevoked, SessionRevokedData, SessionRevokedDataImpersonator, + SignUp, SignUpNotAllowedOAuthErrorBody, SlowDownOAuthErrorBody, SmsChallengeQuotaReachedErrorBody, SmsChallengeRateLimitedErrorBody, + SmsSignIn, SSORequiredOAuthErrorBodyWithConnectionIdsListEmail, + StaleAccount, SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug, TokenTooBigOAuthErrorBody, TooManyFailedVerificationAttemptsErrorBodyWithRetryAfter, TooManyRequestsOAuthErrorBody, UnauthorizedClientOAuthErrorBody, UnauthorizedErrorBody, + UnrecognizedDevice, UpdateAuditLogsRetentionWithRetentionPeriod, UpdateAuditLogsRetentionWithRetentionPeriodInDays, UpdateUserOrganizationMembershipWithRoleSlug, @@ -582,10 +633,7 @@ def test_error_body_with_error_round_trip(self): assert restored.to_dict() == serialized def test_error_body_with_error_minimal_payload(self): - data = { - "error": "Bad Request", - "message": 'Claim "sub" is reserved and cannot be used.', - } + data = {"error": "Bad Request", "message": "Request could not be processed."} instance = ErrorBodyWithError.from_dict(data) serialized = instance.to_dict() assert serialized["error"] == data["error"] @@ -605,6 +653,67 @@ def test_error_body_minimal_payload(self): serialized = instance.to_dict() assert serialized["message"] == data["message"] + def test_organization_selection_required_error_body_with_organizations_round_trip( + self, + ): + data = load_fixture( + "organization_selection_required_error_body_with_organizations.json" + ) + instance = OrganizationSelectionRequiredErrorBodyWithOrganizations.from_dict( + data + ) + serialized = instance.to_dict() + assert serialized == data + restored = OrganizationSelectionRequiredErrorBodyWithOrganizations.from_dict( + serialized + ) + assert restored.to_dict() == serialized + + def test_organization_selection_required_error_body_with_organizations_minimal_payload( + self, + ): + data = { + "code": "organization_selection_required", + "message": "Request could not be processed.", + "organizations": [ + {"id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "name": "Acme Corp"} + ], + } + instance = OrganizationSelectionRequiredErrorBodyWithOrganizations.from_dict( + data + ) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + assert serialized["organizations"] == data["organizations"] + + def test_organization_selection_required_error_body_with_organization_round_trip( + self, + ): + data = load_fixture( + "organization_selection_required_error_body_with_organization.json" + ) + instance = OrganizationSelectionRequiredErrorBodyWithOrganization.from_dict( + data + ) + serialized = instance.to_dict() + assert serialized == data + restored = OrganizationSelectionRequiredErrorBodyWithOrganization.from_dict( + serialized + ) + assert restored.to_dict() == serialized + + def test_organization_selection_required_error_body_with_organization_minimal_payload( + self, + ): + data = {"id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "name": "Acme Corp"} + instance = OrganizationSelectionRequiredErrorBodyWithOrganization.from_dict( + data + ) + serialized = instance.to_dict() + assert serialized["id"] == data["id"] + assert serialized["name"] == data["name"] + def test_error_body_with_code_field_errors_round_trip(self): data = load_fixture("error_body_with_code_field_errors.json") instance = ErrorBodyWithCodeFieldErrors.from_dict(data) @@ -806,6 +915,39 @@ def test_error_body_with_code_status_code_omits_absent_optional_non_nullable_fie assert "code" not in serialized assert "statusCode" not in serialized + def test_error_body_with_code_errors_round_trip(self): + data = load_fixture("error_body_with_code_errors.json") + instance = ErrorBodyWithCodeErrors.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ErrorBodyWithCodeErrors.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_error_body_with_code_errors_minimal_payload(self): + data = { + "code": "account_selection_required", + "message": "Validation failed.", + "errors": [ + {"code": "action_denied", "message": "Request could not be processed."} + ], + } + instance = ErrorBodyWithCodeErrors.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + assert serialized["errors"] == data["errors"] + + def test_error_body_with_code_errors_round_trips_unknown_enum_values(self): + data = { + "code": "unexpected_error_body_with_code_errors_code", + "message": "Validation failed.", + "errors": [ + {"code": "action_denied", "message": "Request could not be processed."} + ], + } + instance = ErrorBodyWithCodeErrors.from_dict(data) + assert instance.to_dict() == data + def test_connection_finish_error_body_round_trip(self): data = load_fixture("connection_finish_error_body.json") instance = ConnectionFinishErrorBody.from_dict(data) @@ -992,39 +1134,6 @@ def test_connection_creation_conflict_error_body_round_trips_unknown_enum_values instance = ConnectionCreationConflictErrorBody.from_dict(data) assert instance.to_dict() == data - def test_error_body_with_code_errors_round_trip(self): - data = load_fixture("error_body_with_code_errors.json") - instance = ErrorBodyWithCodeErrors.from_dict(data) - serialized = instance.to_dict() - assert serialized == data - restored = ErrorBodyWithCodeErrors.from_dict(serialized) - assert restored.to_dict() == serialized - - def test_error_body_with_code_errors_minimal_payload(self): - data = { - "code": "account_selection_required", - "message": "Validation failed.", - "errors": [ - {"code": "action_denied", "message": "Request could not be processed."} - ], - } - instance = ErrorBodyWithCodeErrors.from_dict(data) - serialized = instance.to_dict() - assert serialized["code"] == data["code"] - assert serialized["message"] == data["message"] - assert serialized["errors"] == data["errors"] - - def test_error_body_with_code_errors_round_trips_unknown_enum_values(self): - data = { - "code": "unexpected_error_body_with_code_errors_code", - "message": "Validation failed.", - "errors": [ - {"code": "action_denied", "message": "Request could not be processed."} - ], - } - instance = ErrorBodyWithCodeErrors.from_dict(data) - assert instance.to_dict() == data - def test_organization_connected_account_import_error_body_round_trip(self): data = load_fixture("organization_connected_account_import_error_body.json") instance = OrganizationConnectedAccountImportErrorBody.from_dict(data) @@ -1148,6 +1257,49 @@ def test_sub_resource_scoped_role_not_allowed_error_body_with_role_slug_minimal_ assert serialized["code"] == data["code"] assert serialized["role_slug"] == data["role_slug"] + def test_entity_not_found_error_body_with_ids_list_round_trip(self): + data = load_fixture("entity_not_found_error_body_with_ids_list.json") + instance = EntityNotFoundErrorBodyWithIdsList.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = EntityNotFoundErrorBodyWithIdsList.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_entity_not_found_error_body_with_ids_list_minimal_payload(self): + data = { + "code": "entities_not_found", + "message": "Request could not be processed.", + "ids": [ + "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E", + "org_01E4ZCR3C56J083X43JQXF3JK5", + ], + } + instance = EntityNotFoundErrorBodyWithIdsList.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + assert serialized["ids"] == data["ids"] + + def test_entity_not_found_error_body_with_entity_id_round_trip(self): + data = load_fixture("entity_not_found_error_body_with_entity_id.json") + instance = EntityNotFoundErrorBodyWithEntityId.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = EntityNotFoundErrorBodyWithEntityId.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_entity_not_found_error_body_with_entity_id_minimal_payload(self): + data = { + "code": "entity_not_found", + "message": "Request could not be processed.", + "entity_id": "org_01E4ZCR3C56J083X43JQXF3JK5", + } + instance = EntityNotFoundErrorBodyWithEntityId.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + assert serialized["entity_id"] == data["entity_id"] + def test_email_completion_required_error_body_with_email_completion_token_round_trip( self, ): @@ -1350,6 +1502,24 @@ def test_sms_challenge_quota_reached_error_body_minimal_payload(self): assert serialized["code"] == data["code"] assert serialized["message"] == data["message"] + def test_role_assignment_update_overlap_error_body_round_trip(self): + data = load_fixture("role_assignment_update_overlap_error_body.json") + instance = RoleAssignmentUpdateOverlapErrorBody.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RoleAssignmentUpdateOverlapErrorBody.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_role_assignment_update_overlap_error_body_minimal_payload(self): + data = { + "code": "role_assignment_update_overlap", + "message": "Request could not be processed.", + } + instance = RoleAssignmentUpdateOverlapErrorBody.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + def test_idp_metadata_fetch_failed_error_body_round_trip(self): data = load_fixture("idp_metadata_fetch_failed_error_body.json") instance = IdpMetadataFetchFailedErrorBody.from_dict(data) @@ -2534,6 +2704,24 @@ def test_radar_sign_up_challenge_error_body_minimal_payload(self): assert serialized["code"] == data["code"] assert serialized["message"] == data["message"] + def test_radar_sms_challenge_error_body_round_trip(self): + data = load_fixture("radar_sms_challenge_error_body.json") + instance = RadarSmsChallengeErrorBody.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarSmsChallengeErrorBody.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_sms_challenge_error_body_minimal_payload(self): + data = { + "code": "radar_sms_challenge", + "message": "Request could not be processed.", + } + instance = RadarSmsChallengeErrorBody.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + def test_radar_sms_sign_in_challenge_error_body_round_trip(self): data = load_fixture("radar_sms_sign_in_challenge_error_body.json") instance = RadarSmsSignInChallengeErrorBody.from_dict(data) @@ -3443,6 +3631,10 @@ def test_agent_blueprint_created_minimal_payload(self): "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3477,6 +3669,10 @@ def test_agent_blueprint_created_omits_absent_optional_non_nullable_fields(self) "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3537,6 +3733,32 @@ def test_agent_blueprint_created_data_minimal_payload(self): assert serialized["created_at"] == data["created_at"] assert serialized["updated_at"] == data["updated_at"] + def test_agent_blueprint_created_data_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "object": "agent_blueprint", + "id": "agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY", + "name": "Prospecting Agent", + "description": "Finds and qualifies sales prospects.", + "permissions": ["crm:read", "email:send"], + "invocable_by": { + "role_slugs": ["manager"], + "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], + }, + "invocable_as": {"instance_types": ["delegated", "autonomous"]}, + "session_settings": { + "max_age_seconds": 3600, + "access_token_ttl_seconds": 300, + "refresh_token_ttl_seconds": 3600, + }, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = AgentBlueprintCreatedData.from_dict(data) + serialized = instance.to_dict() + assert "scoped_permissions" not in serialized + def test_agent_blueprint_created_data_preserves_nullable_fields(self): data = { "object": "agent_blueprint", @@ -3544,6 +3766,10 @@ def test_agent_blueprint_created_data_preserves_nullable_fields(self): "name": "Prospecting Agent", "description": None, "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3561,6 +3787,21 @@ def test_agent_blueprint_created_data_preserves_nullable_fields(self): serialized = instance.to_dict() assert serialized["description"] is None + def test_agent_blueprint_created_data_scoped_permission_round_trip(self): + data = load_fixture("agent_blueprint_created_data_scoped_permission.json") + instance = AgentBlueprintCreatedDataScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AgentBlueprintCreatedDataScopedPermission.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_agent_blueprint_created_data_scoped_permission_minimal_payload(self): + data = {"slug": "email:send", "instance_types": ["delegated"]} + instance = AgentBlueprintCreatedDataScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized["slug"] == data["slug"] + assert serialized["instance_types"] == data["instance_types"] + def test_agent_blueprint_created_data_invocable_by_round_trip(self): data = load_fixture("agent_blueprint_created_data_invocable_by.json") instance = AgentBlueprintCreatedDataInvocableBy.from_dict(data) @@ -3708,6 +3949,10 @@ def test_agent_blueprint_updated_minimal_payload(self): "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3742,6 +3987,10 @@ def test_agent_blueprint_updated_omits_absent_optional_non_nullable_fields(self) "name": "Prospecting Agent", "description": "Finds and qualifies sales prospects.", "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3802,6 +4051,32 @@ def test_agent_blueprint_updated_data_minimal_payload(self): assert serialized["created_at"] == data["created_at"] assert serialized["updated_at"] == data["updated_at"] + def test_agent_blueprint_updated_data_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "object": "agent_blueprint", + "id": "agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY", + "name": "Prospecting Agent", + "description": "Finds and qualifies sales prospects.", + "permissions": ["crm:read", "email:send"], + "invocable_by": { + "role_slugs": ["manager"], + "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], + }, + "invocable_as": {"instance_types": ["delegated", "autonomous"]}, + "session_settings": { + "max_age_seconds": 3600, + "access_token_ttl_seconds": 300, + "refresh_token_ttl_seconds": 3600, + }, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = AgentBlueprintUpdatedData.from_dict(data) + serialized = instance.to_dict() + assert "scoped_permissions" not in serialized + def test_agent_blueprint_updated_data_preserves_nullable_fields(self): data = { "object": "agent_blueprint", @@ -3809,6 +4084,10 @@ def test_agent_blueprint_updated_data_preserves_nullable_fields(self): "name": "Prospecting Agent", "description": None, "permissions": ["crm:read", "email:send"], + "scoped_permissions": [ + {"slug": "crm:read", "instance_types": ["delegated", "autonomous"]}, + {"slug": "email:send", "instance_types": ["delegated"]}, + ], "invocable_by": { "role_slugs": ["manager"], "organization_ids": ["org_01EHWNCE74X7JSDV0X3SZ3KJNY"], @@ -3826,6 +4105,21 @@ def test_agent_blueprint_updated_data_preserves_nullable_fields(self): serialized = instance.to_dict() assert serialized["description"] is None + def test_agent_blueprint_updated_data_scoped_permission_round_trip(self): + data = load_fixture("agent_blueprint_updated_data_scoped_permission.json") + instance = AgentBlueprintUpdatedDataScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AgentBlueprintUpdatedDataScopedPermission.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_agent_blueprint_updated_data_scoped_permission_minimal_payload(self): + data = {"slug": "email:send", "instance_types": ["delegated"]} + instance = AgentBlueprintUpdatedDataScopedPermission.from_dict(data) + serialized = instance.to_dict() + assert serialized["slug"] == data["slug"] + assert serialized["instance_types"] == data["instance_types"] + def test_agent_blueprint_updated_data_invocable_by_round_trip(self): data = load_fixture("agent_blueprint_updated_data_invocable_by.json") instance = AgentBlueprintUpdatedDataInvocableBy.from_dict(data) @@ -5561,35 +5855,31 @@ def test_api_key_updated_data_previous_attribute_preserves_nullable_fields(self) serialized = instance.to_dict() assert serialized["expires_at"] is None - def test_authentication_email_verification_failed_round_trip(self): - data = load_fixture("authentication_email_verification_failed.json") - instance = AuthenticationEmailVerificationFailed.from_dict(data) + def test_application_token_exchange_failed_round_trip(self): + data = load_fixture("application_token_exchange_failed.json") + instance = ApplicationTokenExchangeFailed.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = AuthenticationEmailVerificationFailed.from_dict(serialized) + restored = ApplicationTokenExchangeFailed.from_dict(serialized) assert restored.to_dict() == serialized - def test_authentication_email_verification_failed_minimal_payload(self): + def test_application_token_exchange_failed_minimal_payload(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "authentication.email_verification_failed", + "event": "application.token_exchange_failed", "data": { - "type": "email_verification", - "status": "failed", - "ip_address": "203.0.113.42", - "user_agent": "Mozilla/5.0", - "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", - "email": "user@example.com", + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": "https://example.okta.com", "error": { - "code": "mfa_challenge_failed", - "message": "The MFA challenge has failed.", - "radar_detection_id": "detection_01HZBC6N1EB1ZY7KG32X", + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment.", }, }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = AuthenticationEmailVerificationFailed.from_dict(data) + instance = ApplicationTokenExchangeFailed.from_dict(data) serialized = instance.to_dict() assert serialized["object"] == data["object"] assert serialized["id"] == data["id"] @@ -5597,20 +5887,237 @@ def test_authentication_email_verification_failed_minimal_payload(self): assert serialized["data"] == data["data"] assert serialized["created_at"] == data["created_at"] - def test_authentication_email_verification_failed_omits_absent_optional_non_nullable_fields( + def test_application_token_exchange_failed_omits_absent_optional_non_nullable_fields( self, ): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "authentication.email_verification_failed", + "event": "application.token_exchange_failed", "data": { - "type": "email_verification", - "status": "failed", - "ip_address": "203.0.113.42", - "user_agent": "Mozilla/5.0", - "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", - "email": "user@example.com", + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": "https://example.okta.com", + "error": { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment.", + }, + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = ApplicationTokenExchangeFailed.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_application_token_exchange_failed_data_round_trip(self): + data = load_fixture("application_token_exchange_failed_data.json") + instance = ApplicationTokenExchangeFailedData.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ApplicationTokenExchangeFailedData.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_application_token_exchange_failed_data_minimal_payload(self): + data = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": None, + "error": { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment.", + }, + } + instance = ApplicationTokenExchangeFailedData.from_dict(data) + serialized = instance.to_dict() + assert serialized["grant_type"] == data["grant_type"] + assert serialized["client_id"] == data["client_id"] + assert serialized["issuer"] == data["issuer"] + assert serialized["error"] == data["error"] + + def test_application_token_exchange_failed_data_preserves_nullable_fields(self): + data = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "issuer": None, + "error": { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment.", + }, + } + instance = ApplicationTokenExchangeFailedData.from_dict(data) + serialized = instance.to_dict() + assert serialized["issuer"] is None + + def test_application_token_exchange_failed_data_error_round_trip(self): + data = load_fixture("application_token_exchange_failed_data_error.json") + instance = ApplicationTokenExchangeFailedDataError.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ApplicationTokenExchangeFailedDataError.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_application_token_exchange_failed_data_error_minimal_payload(self): + data = { + "code": "invalid_grant", + "message": "The assertion issuer is not trusted in this environment.", + } + instance = ApplicationTokenExchangeFailedDataError.from_dict(data) + serialized = instance.to_dict() + assert serialized["code"] == data["code"] + assert serialized["message"] == data["message"] + + def test_application_token_exchange_succeeded_round_trip(self): + data = load_fixture("application_token_exchange_succeeded.json") + instance = ApplicationTokenExchangeSucceeded.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ApplicationTokenExchangeSucceeded.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_application_token_exchange_succeeded_minimal_payload(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "application.token_exchange_succeeded", + "data": { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "issuer": "https://example.okta.com", + "connection_id": "conn_01E4ZCR3C56J083X43JQXF3JK5", + "jti": "01HXYZ123456789ABCDEFGHIJ", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = ApplicationTokenExchangeSucceeded.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] + assert serialized["created_at"] == data["created_at"] + + def test_application_token_exchange_succeeded_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "application.token_exchange_succeeded", + "data": { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "issuer": "https://example.okta.com", + "connection_id": "conn_01E4ZCR3C56J083X43JQXF3JK5", + "jti": "01HXYZ123456789ABCDEFGHIJ", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = ApplicationTokenExchangeSucceeded.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_application_token_exchange_succeeded_data_round_trip(self): + data = load_fixture("application_token_exchange_succeeded_data.json") + instance = ApplicationTokenExchangeSucceededData.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ApplicationTokenExchangeSucceededData.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_application_token_exchange_succeeded_data_minimal_payload(self): + data = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": None, + "issuer": "https://example.okta.com", + "connection_id": None, + "jti": "01HXYZ123456789ABCDEFGHIJ", + } + instance = ApplicationTokenExchangeSucceededData.from_dict(data) + serialized = instance.to_dict() + assert serialized["grant_type"] == data["grant_type"] + assert serialized["client_id"] == data["client_id"] + assert serialized["user_id"] == data["user_id"] + assert serialized["email"] == data["email"] + assert serialized["organization_id"] == data["organization_id"] + assert serialized["issuer"] == data["issuer"] + assert serialized["connection_id"] == data["connection_id"] + assert serialized["jti"] == data["jti"] + + def test_application_token_exchange_succeeded_data_preserves_nullable_fields(self): + data = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "client_id": "client_01HXYZ123456789ABCDEFGHIJ", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "organization_id": None, + "issuer": "https://example.okta.com", + "connection_id": None, + "jti": "01HXYZ123456789ABCDEFGHIJ", + } + instance = ApplicationTokenExchangeSucceededData.from_dict(data) + serialized = instance.to_dict() + assert serialized["organization_id"] is None + assert serialized["connection_id"] is None + + def test_authentication_email_verification_failed_round_trip(self): + data = load_fixture("authentication_email_verification_failed.json") + instance = AuthenticationEmailVerificationFailed.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = AuthenticationEmailVerificationFailed.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_authentication_email_verification_failed_minimal_payload(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "authentication.email_verification_failed", + "data": { + "type": "email_verification", + "status": "failed", + "ip_address": "203.0.113.42", + "user_agent": "Mozilla/5.0", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", + "error": { + "code": "mfa_challenge_failed", + "message": "The MFA challenge has failed.", + "radar_detection_id": "detection_01HZBC6N1EB1ZY7KG32X", + }, + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = AuthenticationEmailVerificationFailed.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] + assert serialized["created_at"] == data["created_at"] + + def test_authentication_email_verification_failed_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "authentication.email_verification_failed", + "data": { + "type": "email_verification", + "status": "failed", + "ip_address": "203.0.113.42", + "user_agent": "Mozilla/5.0", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "user@example.com", "error": { "code": "mfa_challenge_failed", "message": "The MFA challenge has failed.", @@ -7037,8 +7544,8 @@ def test_authentication_radar_risk_detected_minimal_payload(self): "data": { "auth_method": "password", "action": "signup", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", @@ -7065,8 +7572,8 @@ def test_authentication_radar_risk_detected_omits_absent_optional_non_nullable_f "data": { "auth_method": "password", "action": "signup", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", @@ -7115,8 +7622,8 @@ def test_authentication_radar_risk_detected_data_omits_absent_optional_non_nulla data = { "auth_method": "password", "action": "signup", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", @@ -7151,8 +7658,8 @@ def test_authentication_radar_risk_detected_data_round_trips_unknown_enum_values data = { "auth_method": "password", "action": "unexpected_authentication_radar_risk_detected_data_action", - "control": "block", - "blocklist_type": "ip", + "control": "bot_detection", + "blocklist_type": "ip_address", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0", "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", @@ -8677,40 +9184,34 @@ def test_connection_saml_certificate_renewed_data_certificate_round_trips_unknow instance = ConnectionSAMLCertificateRenewedDataCertificate.from_dict(data) assert instance.to_dict() == data - def test_dsync_activated_round_trip(self): - data = load_fixture("dsync_activated.json") - instance = DsyncActivated.from_dict(data) + def test_connection_saml_certificate_replaced_round_trip(self): + data = load_fixture("connection_saml_certificate_replaced.json") + instance = ConnectionSAMLCertificateReplaced.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = DsyncActivated.from_dict(serialized) + restored = ConnectionSAMLCertificateReplaced.from_dict(serialized) assert restored.to_dict() == serialized - def test_dsync_activated_minimal_payload(self): + def test_connection_saml_certificate_replaced_minimal_payload(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "dsync.activated", + "event": "connection.saml_certificate_replaced", "data": { - "object": "directory", - "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", - "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", - "type": "okta scim v2.0", - "state": "active", - "name": "Acme Directory", - "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z", - "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domains": [ - { - "object": "organization_domain", - "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domain": "acme.com", - } - ], + "connection": { + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + }, + "certificate": { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z", + }, + "replaced_at": "2026-01-15T12:00:00.000Z", }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = DsyncActivated.from_dict(data) + instance = ConnectionSAMLCertificateReplaced.from_dict(data) serialized = instance.to_dict() assert serialized["object"] == data["object"] assert serialized["id"] == data["id"] @@ -8718,78 +9219,239 @@ def test_dsync_activated_minimal_payload(self): assert serialized["data"] == data["data"] assert serialized["created_at"] == data["created_at"] - def test_dsync_activated_omits_absent_optional_non_nullable_fields(self): + def test_connection_saml_certificate_replaced_omits_absent_optional_non_nullable_fields( + self, + ): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "dsync.activated", + "event": "connection.saml_certificate_replaced", "data": { - "object": "directory", - "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", - "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", - "type": "okta scim v2.0", - "state": "active", - "name": "Acme Directory", - "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z", - "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domains": [ - { - "object": "organization_domain", - "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domain": "acme.com", - } - ], + "connection": { + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + }, + "certificate": { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z", + }, + "replaced_at": "2026-01-15T12:00:00.000Z", }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = DsyncActivated.from_dict(data) + instance = ConnectionSAMLCertificateReplaced.from_dict(data) serialized = instance.to_dict() assert "context" not in serialized - def test_dsync_activated_data_round_trip(self): - data = load_fixture("dsync_activated_data.json") - instance = DsyncActivatedData.from_dict(data) + def test_connection_saml_certificate_replaced_data_round_trip(self): + data = load_fixture("connection_saml_certificate_replaced_data.json") + instance = ConnectionSAMLCertificateReplacedData.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = DsyncActivatedData.from_dict(serialized) + restored = ConnectionSAMLCertificateReplacedData.from_dict(serialized) assert restored.to_dict() == serialized - def test_dsync_activated_data_minimal_payload(self): + def test_connection_saml_certificate_replaced_data_minimal_payload(self): data = { - "object": "directory", - "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", - "type": "okta scim v2.0", - "state": "active", - "name": "Acme Directory", - "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z", - "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domains": [ - { - "object": "organization_domain", - "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", - "domain": "acme.com", - } - ], + "connection": { + "id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + }, + "certificate": { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z", + }, + "replaced_at": "2026-01-15T12:00:00.000Z", } - instance = DsyncActivatedData.from_dict(data) + instance = ConnectionSAMLCertificateReplacedData.from_dict(data) serialized = instance.to_dict() - assert serialized["object"] == data["object"] - assert serialized["id"] == data["id"] - assert serialized["type"] == data["type"] - assert serialized["state"] == data["state"] - assert serialized["name"] == data["name"] - assert serialized["created_at"] == data["created_at"] - assert serialized["updated_at"] == data["updated_at"] - assert serialized["external_key"] == data["external_key"] - assert serialized["domains"] == data["domains"] + assert serialized["connection"] == data["connection"] + assert serialized["certificate"] == data["certificate"] + assert serialized["replaced_at"] == data["replaced_at"] - def test_dsync_activated_data_omits_absent_optional_non_nullable_fields(self): - data = { - "object": "directory", - "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", - "type": "okta scim v2.0", + def test_connection_saml_certificate_replaced_data_connection_round_trip(self): + data = load_fixture("connection_saml_certificate_replaced_data_connection.json") + instance = ConnectionSAMLCertificateReplacedDataConnection.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ConnectionSAMLCertificateReplacedDataConnection.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_connection_saml_certificate_replaced_data_connection_minimal_payload(self): + data = {"id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY"} + instance = ConnectionSAMLCertificateReplacedDataConnection.from_dict(data) + serialized = instance.to_dict() + assert serialized["id"] == data["id"] + + def test_connection_saml_certificate_replaced_data_connection_omits_absent_optional_non_nullable_fields( + self, + ): + data = {"id": "conn_01EHWNCE74X7JSDV0X3SZ3KJNY"} + instance = ConnectionSAMLCertificateReplacedDataConnection.from_dict(data) + serialized = instance.to_dict() + assert "organization_id" not in serialized + + def test_connection_saml_certificate_replaced_data_certificate_round_trip(self): + data = load_fixture( + "connection_saml_certificate_replaced_data_certificate.json" + ) + instance = ConnectionSAMLCertificateReplacedDataCertificate.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ConnectionSAMLCertificateReplacedDataCertificate.from_dict( + serialized + ) + assert restored.to_dict() == serialized + + def test_connection_saml_certificate_replaced_data_certificate_minimal_payload( + self, + ): + data = { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + } + instance = ConnectionSAMLCertificateReplacedDataCertificate.from_dict(data) + serialized = instance.to_dict() + assert serialized["certificate_type"] == data["certificate_type"] + assert serialized["expiry_date"] == data["expiry_date"] + + def test_connection_saml_certificate_replaced_data_certificate_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "certificate_type": "RequestSigning", + "expiry_date": "2026-01-15T12:00:00.000Z", + } + instance = ConnectionSAMLCertificateReplacedDataCertificate.from_dict(data) + serialized = instance.to_dict() + assert "previous_expiry_date" not in serialized + + def test_connection_saml_certificate_replaced_data_certificate_round_trips_unknown_enum_values( + self, + ): + data = { + "certificate_type": "unexpected_connection_saml_certificate_replaced_data_certificate_certificate_type", + "expiry_date": "2026-01-15T12:00:00.000Z", + "previous_expiry_date": "2026-01-15T12:00:00.000Z", + } + instance = ConnectionSAMLCertificateReplacedDataCertificate.from_dict(data) + assert instance.to_dict() == data + + def test_dsync_activated_round_trip(self): + data = load_fixture("dsync_activated.json") + instance = DsyncActivated.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = DsyncActivated.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_dsync_activated_minimal_payload(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "dsync.activated", + "data": { + "object": "directory", + "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "type": "okta scim v2.0", + "state": "active", + "name": "Acme Directory", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domains": [ + { + "object": "organization_domain", + "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domain": "acme.com", + } + ], + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = DsyncActivated.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] + assert serialized["created_at"] == data["created_at"] + + def test_dsync_activated_omits_absent_optional_non_nullable_fields(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "dsync.activated", + "data": { + "object": "directory", + "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "type": "okta scim v2.0", + "state": "active", + "name": "Acme Directory", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domains": [ + { + "object": "organization_domain", + "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domain": "acme.com", + } + ], + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = DsyncActivated.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_dsync_activated_data_round_trip(self): + data = load_fixture("dsync_activated_data.json") + instance = DsyncActivatedData.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = DsyncActivatedData.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_dsync_activated_data_minimal_payload(self): + data = { + "object": "directory", + "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "type": "okta scim v2.0", + "state": "active", + "name": "Acme Directory", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + "external_key": "ext_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domains": [ + { + "object": "organization_domain", + "id": "org_domain_01EHWNCE74X7JSDV0X3SZ3KJNY", + "domain": "acme.com", + } + ], + } + instance = DsyncActivatedData.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["type"] == data["type"] + assert serialized["state"] == data["state"] + assert serialized["name"] == data["name"] + assert serialized["created_at"] == data["created_at"] + assert serialized["updated_at"] == data["updated_at"] + assert serialized["external_key"] == data["external_key"] + assert serialized["domains"] == data["domains"] + + def test_dsync_activated_data_omits_absent_optional_non_nullable_fields(self): + data = { + "object": "directory", + "id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "type": "okta scim v2.0", "state": "active", "name": "Acme Directory", "created_at": "2026-01-15T12:00:00.000Z", @@ -13608,31 +14270,32 @@ def test_invitation_revoked_data_round_trips_unknown_enum_values(self): instance = InvitationRevokedData.from_dict(data) assert instance.to_dict() == data - def test_magic_auth_created_round_trip(self): - data = load_fixture("magic_auth_created.json") - instance = MagicAuthCreated.from_dict(data) + def test_issuer_trust_created_round_trip(self): + data = load_fixture("issuer_trust_created.json") + instance = IssuerTrustCreated.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = MagicAuthCreated.from_dict(serialized) + restored = IssuerTrustCreated.from_dict(serialized) assert restored.to_dict() == serialized - def test_magic_auth_created_minimal_payload(self): + def test_issuer_trust_created_minimal_payload(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "magic_auth.created", + "event": "issuer_trust.created", "data": { - "object": "magic_auth", - "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", - "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", - "email": "marcelina.davis@example.com", - "expires_at": "2026-01-15T12:00:00.000Z", + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = MagicAuthCreated.from_dict(data) + instance = IssuerTrustCreated.from_dict(data) serialized = instance.to_dict() assert serialized["object"] == data["object"] assert serialized["id"] == data["id"] @@ -13640,94 +14303,107 @@ def test_magic_auth_created_minimal_payload(self): assert serialized["data"] == data["data"] assert serialized["created_at"] == data["created_at"] - def test_magic_auth_created_omits_absent_optional_non_nullable_fields(self): + def test_issuer_trust_created_omits_absent_optional_non_nullable_fields(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "magic_auth.created", + "event": "issuer_trust.created", "data": { - "object": "magic_auth", - "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", - "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", - "email": "marcelina.davis@example.com", - "expires_at": "2026-01-15T12:00:00.000Z", + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = MagicAuthCreated.from_dict(data) + instance = IssuerTrustCreated.from_dict(data) serialized = instance.to_dict() assert "context" not in serialized - def test_magic_auth_created_data_round_trip(self): - data = load_fixture("magic_auth_created_data.json") - instance = MagicAuthCreatedData.from_dict(data) + def test_issuer_trust_deleted_round_trip(self): + data = load_fixture("issuer_trust_deleted.json") + instance = IssuerTrustDeleted.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = MagicAuthCreatedData.from_dict(serialized) + restored = IssuerTrustDeleted.from_dict(serialized) assert restored.to_dict() == serialized - def test_magic_auth_created_data_minimal_payload(self): + def test_issuer_trust_deleted_minimal_payload(self): data = { - "object": "magic_auth", - "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", - "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", - "email": "marcelina.davis@example.com", - "expires_at": "2026-01-15T12:00:00.000Z", + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "issuer_trust.deleted", + "data": { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z", } - instance = MagicAuthCreatedData.from_dict(data) + instance = IssuerTrustDeleted.from_dict(data) serialized = instance.to_dict() assert serialized["object"] == data["object"] assert serialized["id"] == data["id"] - assert serialized["user_id"] == data["user_id"] - assert serialized["email"] == data["email"] - assert serialized["expires_at"] == data["expires_at"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] assert serialized["created_at"] == data["created_at"] - assert serialized["updated_at"] == data["updated_at"] - def test_organization_created_round_trip(self): - data = load_fixture("organization_created.json") - instance = OrganizationCreated.from_dict(data) + def test_issuer_trust_deleted_omits_absent_optional_non_nullable_fields(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "issuer_trust.deleted", + "data": { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = IssuerTrustDeleted.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_issuer_trust_updated_round_trip(self): + data = load_fixture("issuer_trust_updated.json") + instance = IssuerTrustUpdated.from_dict(data) serialized = instance.to_dict() assert serialized == data - restored = OrganizationCreated.from_dict(serialized) + restored = IssuerTrustUpdated.from_dict(serialized) assert restored.to_dict() == serialized - def test_organization_created_minimal_payload(self): + def test_issuer_trust_updated_minimal_payload(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "organization.created", + "event": "issuer_trust.updated", "data": { - "object": "organization", - "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", - "name": "Acme Inc.", - "domains": [ - { - "object": "organization_domain", - "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", - "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", - "domain": "foo-corp.com", - "state": "pending", - "verification_prefix": "superapp-domain-verification-z3kjny", - "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", - "verification_strategy": "dns", - "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z", - } - ], - "metadata": {"tier": "diamond"}, - "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", - "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", }, "created_at": "2026-01-15T12:00:00.000Z", } - instance = OrganizationCreated.from_dict(data) + instance = IssuerTrustUpdated.from_dict(data) serialized = instance.to_dict() assert serialized["object"] == data["object"] assert serialized["id"] == data["id"] @@ -13735,20 +14411,168 @@ def test_organization_created_minimal_payload(self): assert serialized["data"] == data["data"] assert serialized["created_at"] == data["created_at"] - def test_organization_created_omits_absent_optional_non_nullable_fields(self): + def test_issuer_trust_updated_omits_absent_optional_non_nullable_fields(self): data = { "object": "event", "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", - "event": "organization.created", + "event": "issuer_trust.updated", "data": { - "object": "organization", - "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", - "name": "Acme Inc.", - "domains": [ - { - "object": "organization_domain", - "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", - "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = IssuerTrustUpdated.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_magic_auth_created_round_trip(self): + data = load_fixture("magic_auth_created.json") + instance = MagicAuthCreated.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = MagicAuthCreated.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_magic_auth_created_minimal_payload(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "magic_auth.created", + "data": { + "object": "magic_auth", + "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "marcelina.davis@example.com", + "expires_at": "2026-01-15T12:00:00.000Z", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = MagicAuthCreated.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] + assert serialized["created_at"] == data["created_at"] + + def test_magic_auth_created_omits_absent_optional_non_nullable_fields(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "magic_auth.created", + "data": { + "object": "magic_auth", + "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "marcelina.davis@example.com", + "expires_at": "2026-01-15T12:00:00.000Z", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = MagicAuthCreated.from_dict(data) + serialized = instance.to_dict() + assert "context" not in serialized + + def test_magic_auth_created_data_round_trip(self): + data = load_fixture("magic_auth_created_data.json") + instance = MagicAuthCreatedData.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = MagicAuthCreatedData.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_magic_auth_created_data_minimal_payload(self): + data = { + "object": "magic_auth", + "id": "magic_auth_01HWZBQZY2M3AMQW166Q22K88F", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "email": "marcelina.davis@example.com", + "expires_at": "2026-01-15T12:00:00.000Z", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = MagicAuthCreatedData.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["user_id"] == data["user_id"] + assert serialized["email"] == data["email"] + assert serialized["expires_at"] == data["expires_at"] + assert serialized["created_at"] == data["created_at"] + assert serialized["updated_at"] == data["updated_at"] + + def test_organization_created_round_trip(self): + data = load_fixture("organization_created.json") + instance = OrganizationCreated.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = OrganizationCreated.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_organization_created_minimal_payload(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "organization.created", + "data": { + "object": "organization", + "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "name": "Acme Inc.", + "domains": [ + { + "object": "organization_domain", + "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", + "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", + "domain": "foo-corp.com", + "state": "pending", + "verification_prefix": "superapp-domain-verification-z3kjny", + "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", + "verification_strategy": "dns", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + ], + "metadata": {"tier": "diamond"}, + "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", + "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + }, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = OrganizationCreated.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["event"] == data["event"] + assert serialized["data"] == data["data"] + assert serialized["created_at"] == data["created_at"] + + def test_organization_created_omits_absent_optional_non_nullable_fields(self): + data = { + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "organization.created", + "data": { + "object": "organization", + "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", + "name": "Acme Inc.", + "domains": [ + { + "object": "organization_domain", + "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", + "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", @@ -19790,6 +20614,868 @@ def test_data_integration_credentials_response_with_error_round_trips_unknown_en instance = DataIntegrationCredentialsResponseWithError.from_dict(data) assert instance.to_dict() == data + def test_radar_detection_bot_detection_signal_round_trip(self): + data = load_fixture("radar_detection_bot_detection_signal.json") + instance = RadarDetectionBotDetectionSignal.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionBotDetectionSignal.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_bot_detection_signal_minimal_payload(self): + data = {"signal": "risky_ip"} + instance = RadarDetectionBotDetectionSignal.from_dict(data) + serialized = instance.to_dict() + assert serialized["signal"] == data["signal"] + + def test_radar_detection_bot_detection_signal_omits_absent_optional_non_nullable_fields( + self, + ): + data = {"signal": "risky_ip"} + instance = RadarDetectionBotDetectionSignal.from_dict(data) + serialized = instance.to_dict() + assert "action" not in serialized + + def test_radar_detection_bot_detection_signal_round_trips_unknown_enum_values(self): + data = { + "signal": "unexpected_radar_detection_bot_detection_signal_signal", + "action": "block", + } + instance = RadarDetectionBotDetectionSignal.from_dict(data) + assert instance.to_dict() == data + + def test_radar_detection_ip_sign_ups_round_trip(self): + data = load_fixture("radar_detection_ip_sign_ups.json") + instance = RadarDetectionIpSignUps.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionIpSignUps.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_ip_sign_ups_minimal_payload(self): + data = {"count": 6, "window_minutes": 5} + instance = RadarDetectionIpSignUps.from_dict(data) + serialized = instance.to_dict() + assert serialized["count"] == data["count"] + assert serialized["window_minutes"] == data["window_minutes"] + + def test_radar_detection_domain_sign_ups_round_trip(self): + data = load_fixture("radar_detection_domain_sign_ups.json") + instance = RadarDetectionDomainSignUps.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionDomainSignUps.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_domain_sign_ups_minimal_payload(self): + data = {"root_domain": "example.com"} + instance = RadarDetectionDomainSignUps.from_dict(data) + serialized = instance.to_dict() + assert serialized["root_domain"] == data["root_domain"] + + def test_radar_detection_domain_sign_ups_omits_absent_optional_non_nullable_fields( + self, + ): + data = {"root_domain": "example.com"} + instance = RadarDetectionDomainSignUps.from_dict(data) + serialized = instance.to_dict() + assert "count" not in serialized + + def test_radar_detection_bot_detection_details_round_trip(self): + data = load_fixture("radar_detection_bot_detection_details.json") + instance = RadarDetectionBotDetectionDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionBotDetectionDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_bot_detection_details_minimal_payload(self): + data = {"signals": [{"signal": "risky_ip", "action": "block"}]} + instance = RadarDetectionBotDetectionDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["signals"] == data["signals"] + + def test_radar_detection_bot_detection_details_omits_absent_optional_non_nullable_fields( + self, + ): + data = {"signals": [{"signal": "risky_ip", "action": "block"}]} + instance = RadarDetectionBotDetectionDetails.from_dict(data) + serialized = instance.to_dict() + assert "decided_by" not in serialized + assert "ip_risk" not in serialized + assert "email_pattern" not in serialized + assert "browser_signals" not in serialized + assert "ip_sign_ups" not in serialized + assert "domain_sign_ups" not in serialized + + def test_radar_detection_bot_detection_details_round_trips_unknown_enum_values( + self, + ): + data = { + "signals": [{"signal": "risky_ip", "action": "block"}], + "decided_by": "unexpected_radar_detection_bot_detection_details_decided_by", + "ip_risk": ["abuser", "anonymous", "vpn", "tor", "proxy"], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain", + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals", + ], + "ip_sign_ups": {"count": 6, "window_minutes": 5}, + "domain_sign_ups": {"root_domain": "example.com", "count": 44}, + } + instance = RadarDetectionBotDetectionDetails.from_dict(data) + assert instance.to_dict() == data + + def test_radar_detection_brute_force_attack_details_round_trip(self): + data = load_fixture("radar_detection_brute_force_attack_details.json") + instance = RadarDetectionBruteForceAttackDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionBruteForceAttackDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_brute_force_attack_details_minimal_payload(self): + data = { + "attempts": 11, + "window_minutes": 1, + "matched_on": "device_fingerprint_and_email", + } + instance = RadarDetectionBruteForceAttackDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["attempts"] == data["attempts"] + assert serialized["window_minutes"] == data["window_minutes"] + assert serialized["matched_on"] == data["matched_on"] + + def test_radar_detection_brute_force_attack_details_round_trips_unknown_enum_values( + self, + ): + data = { + "attempts": 11, + "window_minutes": 1, + "matched_on": "unexpected_radar_detection_brute_force_attack_details_matched_on", + } + instance = RadarDetectionBruteForceAttackDetails.from_dict(data) + assert instance.to_dict() == data + + def test_radar_detection_domain_protections_details_round_trip(self): + data = load_fixture("radar_detection_domain_protections_details.json") + instance = RadarDetectionDomainProtectionsDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionDomainProtectionsDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_domain_protections_details_minimal_payload(self): + data = {"list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", "list": None} + instance = RadarDetectionDomainProtectionsDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["list_id"] == data["list_id"] + assert serialized["list"] == data["list"] + + def test_radar_detection_domain_protections_details_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + } + instance = RadarDetectionDomainProtectionsDetails.from_dict(data) + serialized = instance.to_dict() + assert "also_matched_list_ids" not in serialized + assert "also_matched_lists" not in serialized + assert "matched_domain" not in serialized + + def test_radar_detection_domain_protections_details_preserves_nullable_fields(self): + data = { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": None, + "also_matched_list_ids": ["also_matched_list_ids_01234"], + "also_matched_lists": [ + { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + } + ], + "matched_domain": "example.com", + } + instance = RadarDetectionDomainProtectionsDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["list"] is None + + def test_radar_detection_previous_attempt_round_trip(self): + data = load_fixture("radar_detection_previous_attempt.json") + instance = RadarDetectionPreviousAttempt.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionPreviousAttempt.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_previous_attempt_minimal_payload(self): + data = { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetectionPreviousAttempt.from_dict(data) + serialized = instance.to_dict() + assert serialized["attempt_id"] == data["attempt_id"] + assert serialized["location"] == data["location"] + assert serialized["created_at"] == data["created_at"] + + def test_radar_detection_previous_attempt_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetectionPreviousAttempt.from_dict(data) + serialized = instance.to_dict() + assert "ip_address" not in serialized + + def test_radar_detection_previous_attempt_preserves_nullable_fields(self): + data = { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": None, + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetectionPreviousAttempt.from_dict(data) + serialized = instance.to_dict() + assert serialized["user_agent"] is None + + def test_radar_detection_impossible_travel_details_round_trip(self): + data = load_fixture("radar_detection_impossible_travel_details.json") + instance = RadarDetectionImpossibleTravelDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionImpossibleTravelDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_impossible_travel_details_minimal_payload(self): + data = { + "previous": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + }, + "distance_km": 8543, + "speed_km_per_s": 4.07, + } + instance = RadarDetectionImpossibleTravelDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["previous"] == data["previous"] + assert serialized["distance_km"] == data["distance_km"] + assert serialized["speed_km_per_s"] == data["speed_km_per_s"] + + def test_radar_detection_repeat_sign_up_details_email_round_trip(self): + data = load_fixture("radar_detection_repeat_sign_up_details_email.json") + instance = RadarDetectionRepeatSignUpDetailsEmail.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionRepeatSignUpDetailsEmail.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_repeat_sign_up_details_email_minimal_payload(self): + data = {"matched_on": "email", "prior_sign_ups": 8, "window_days": 60} + instance = RadarDetectionRepeatSignUpDetailsEmail.from_dict(data) + serialized = instance.to_dict() + assert serialized["matched_on"] == data["matched_on"] + assert serialized["prior_sign_ups"] == data["prior_sign_ups"] + assert serialized["window_days"] == data["window_days"] + + def test_normalized_email_round_trip(self): + data = load_fixture("normalized_email.json") + instance = NormalizedEmail.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = NormalizedEmail.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_normalized_email_minimal_payload(self): + data = { + "matched_on": "normalized_email", + "matched_user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + } + instance = NormalizedEmail.from_dict(data) + serialized = instance.to_dict() + assert serialized["matched_on"] == data["matched_on"] + assert serialized["matched_user_id"] == data["matched_user_id"] + + def test_radar_detection_stale_account_details_round_trip(self): + data = load_fixture("radar_detection_stale_account_details.json") + instance = RadarDetectionStaleAccountDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionStaleAccountDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_stale_account_details_minimal_payload(self): + data = {"last_activity_at": None} + instance = RadarDetectionStaleAccountDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["last_activity_at"] == data["last_activity_at"] + + def test_radar_detection_stale_account_details_preserves_nullable_fields(self): + data = {"last_activity_at": None} + instance = RadarDetectionStaleAccountDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["last_activity_at"] is None + + def test_radar_detection_unrecognized_device_details_round_trip(self): + data = load_fixture("radar_detection_unrecognized_device_details.json") + instance = RadarDetectionUnrecognizedDeviceDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionUnrecognizedDeviceDetails.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_unrecognized_device_details_minimal_payload(self): + data = {"previous_device": None} + instance = RadarDetectionUnrecognizedDeviceDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["previous_device"] == data["previous_device"] + + def test_radar_detection_unrecognized_device_details_preserves_nullable_fields( + self, + ): + data = {"previous_device": None} + instance = RadarDetectionUnrecognizedDeviceDetails.from_dict(data) + serialized = instance.to_dict() + assert serialized["previous_device"] is None + + def test_radar_detection_restriction_details_list_round_trip(self): + data = load_fixture("radar_detection_restriction_details_list.json") + instance = RadarDetectionRestrictionDetailsList.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionRestrictionDetailsList.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_restriction_details_list_minimal_payload(self): + data = { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": None, + } + instance = RadarDetectionRestrictionDetailsList.from_dict(data) + serialized = instance.to_dict() + assert serialized["type"] == data["type"] + assert serialized["list_id"] == data["list_id"] + assert serialized["list"] == data["list"] + + def test_radar_detection_restriction_details_list_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + } + instance = RadarDetectionRestrictionDetailsList.from_dict(data) + serialized = instance.to_dict() + assert "entry" not in serialized + + def test_radar_detection_restriction_details_list_preserves_nullable_fields(self): + data = { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": None, + "entry": "example.com", + } + instance = RadarDetectionRestrictionDetailsList.from_dict(data) + serialized = instance.to_dict() + assert serialized["list"] is None + + def test_blocked_tld_round_trip(self): + data = load_fixture("blocked_tld.json") + instance = BlockedTld.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = BlockedTld.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_blocked_tld_minimal_payload(self): + data = {"type": "blocked_tld"} + instance = BlockedTld.from_dict(data) + serialized = instance.to_dict() + assert serialized["type"] == data["type"] + + def test_sign_up_round_trip(self): + data = load_fixture("sign_up.json") + instance = SignUp.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = SignUp.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_sign_up_minimal_payload(self): + data = {"type": "sign_up"} + instance = SignUp.from_dict(data) + serialized = instance.to_dict() + assert serialized["type"] == data["type"] + + def test_sms_sign_in_round_trip(self): + data = load_fixture("sms_sign_in.json") + instance = SmsSignIn.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = SmsSignIn.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_sms_sign_in_minimal_payload(self): + data = {"type": "sms_sign_in", "trigger": "country_mismatch"} + instance = SmsSignIn.from_dict(data) + serialized = instance.to_dict() + assert serialized["type"] == data["type"] + assert serialized["trigger"] == data["trigger"] + + def test_sms_sign_in_omits_absent_optional_non_nullable_fields(self): + data = {"type": "sms_sign_in", "trigger": "country_mismatch"} + instance = SmsSignIn.from_dict(data) + serialized = instance.to_dict() + assert "phone_country" not in serialized + assert "line_type" not in serialized + assert "masked_phone_number" not in serialized + + def test_sms_sign_in_round_trips_unknown_enum_values(self): + data = { + "type": "sms_sign_in", + "trigger": "unexpected_sms_sign_in_trigger", + "phone_country": "US", + "line_type": "voip", + "masked_phone_number": "••••0123", + } + instance = SmsSignIn.from_dict(data) + assert instance.to_dict() == data + + def test_bot_detection_round_trip(self): + data = load_fixture("bot_detection.json") + instance = BotDetection.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = BotDetection.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_bot_detection_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "bot_detection", + "details": { + "signals": [{"signal": "risky_ip", "action": "block"}], + "decided_by": "risky_ip", + "ip_risk": ["abuser", "anonymous", "vpn", "tor", "proxy"], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain", + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals", + ], + "ip_sign_ups": {"count": 6, "window_minutes": 5}, + "domain_sign_ups": {"root_domain": "example.com", "count": 44}, + }, + } + instance = BotDetection.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_bot_detection_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "bot_detection", + "details": { + "signals": [{"signal": "risky_ip", "action": "block"}], + "decided_by": "risky_ip", + "ip_risk": ["abuser", "anonymous", "vpn", "tor", "proxy"], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain", + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals", + ], + "ip_sign_ups": {"count": 6, "window_minutes": 5}, + "domain_sign_ups": {"root_domain": "example.com", "count": 44}, + }, + } + instance = BotDetection.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_brute_force_attack_round_trip(self): + data = load_fixture("brute_force_attack.json") + instance = BruteForceAttack.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = BruteForceAttack.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_brute_force_attack_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "brute_force_attack", + "details": { + "attempts": 11, + "window_minutes": 1, + "matched_on": "device_fingerprint_and_email", + }, + } + instance = BruteForceAttack.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_brute_force_attack_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "brute_force_attack", + "details": { + "attempts": 11, + "window_minutes": 1, + "matched_on": "device_fingerprint_and_email", + }, + } + instance = BruteForceAttack.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_domain_protections_round_trip(self): + data = load_fixture("domain_protections.json") + instance = DomainProtections.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = DomainProtections.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_domain_protections_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "domain_protections", + "details": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + "also_matched_list_ids": ["also_matched_list_ids_01234"], + "also_matched_lists": [ + { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + } + ], + "matched_domain": "example.com", + }, + } + instance = DomainProtections.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_domain_protections_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "domain_protections", + "details": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + "also_matched_list_ids": ["also_matched_list_ids_01234"], + "also_matched_lists": [ + { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + } + ], + "matched_domain": "example.com", + }, + } + instance = DomainProtections.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_impossible_travel_round_trip(self): + data = load_fixture("impossible_travel.json") + instance = ImpossibleTravel.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = ImpossibleTravel.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_impossible_travel_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "impossible_travel", + "details": { + "previous": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + }, + "distance_km": 8543, + "speed_km_per_s": 4.07, + }, + } + instance = ImpossibleTravel.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_impossible_travel_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "impossible_travel", + "details": { + "previous": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + }, + "distance_km": 8543, + "speed_km_per_s": 4.07, + }, + } + instance = ImpossibleTravel.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_repeat_sign_up_round_trip(self): + data = load_fixture("repeat_sign_up.json") + instance = RepeatSignUp.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RepeatSignUp.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_repeat_sign_up_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "repeat_sign_up", + "details": {"matched_on": "email", "prior_sign_ups": 8, "window_days": 60}, + } + instance = RepeatSignUp.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_repeat_sign_up_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "repeat_sign_up", + "details": {"matched_on": "email", "prior_sign_ups": 8, "window_days": 60}, + } + instance = RepeatSignUp.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_stale_account_round_trip(self): + data = load_fixture("stale_account.json") + instance = StaleAccount.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = StaleAccount.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_stale_account_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "stale_account", + "details": {"last_activity_at": "2026-01-15T12:00:00.000Z"}, + } + instance = StaleAccount.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_stale_account_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "stale_account", + "details": {"last_activity_at": "2026-01-15T12:00:00.000Z"}, + } + instance = StaleAccount.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_unrecognized_device_round_trip(self): + data = load_fixture("unrecognized_device.json") + instance = UnrecognizedDevice.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = UnrecognizedDevice.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_unrecognized_device_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "unrecognized_device", + "details": { + "previous_device": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + } + }, + } + instance = UnrecognizedDevice.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_unrecognized_device_omits_absent_optional_non_nullable_fields(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "unrecognized_device", + "details": { + "previous_device": { + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "ip_address": "198.51.100.7", + "user_agent": "Mozilla/5.0", + "location": {"city": "San Francisco", "country": "US"}, + "created_at": "2026-01-15T12:00:00.000Z", + } + }, + } + instance = UnrecognizedDevice.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_radar_detection_evidence_restriction_round_trip(self): + data = load_fixture("radar_detection_evidence_restriction.json") + instance = RadarDetectionEvidenceRestriction.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionEvidenceRestriction.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_evidence_restriction_minimal_payload(self): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "restriction", + "details": { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + "entry": "example.com", + }, + } + instance = RadarDetectionEvidenceRestriction.from_dict(data) + serialized = instance.to_dict() + assert serialized["summary"] == data["summary"] + assert serialized["control"] == data["control"] + assert serialized["details"] == data["details"] + + def test_radar_detection_evidence_restriction_omits_absent_optional_non_nullable_fields( + self, + ): + data = { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "control": "restriction", + "details": { + "type": "list", + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + "entry": "example.com", + }, + } + instance = RadarDetectionEvidenceRestriction.from_dict(data) + serialized = instance.to_dict() + assert "allowed_by" not in serialized + + def test_radar_detection_previous_attempt_location_round_trip(self): + data = load_fixture("radar_detection_previous_attempt_location.json") + instance = RadarDetectionPreviousAttemptLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionPreviousAttemptLocation.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_previous_attempt_location_minimal_payload(self): + data = {"city": None, "country": None} + instance = RadarDetectionPreviousAttemptLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized["city"] == data["city"] + assert serialized["country"] == data["country"] + + def test_radar_detection_previous_attempt_location_preserves_nullable_fields(self): + data = {"city": None, "country": None} + instance = RadarDetectionPreviousAttemptLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized["city"] is None + assert serialized["country"] is None + def test_event_context_google_analytics_session_round_trip(self): data = load_fixture("event_context_google_analytics_session.json") instance = EventContextGoogleAnalyticsSession.from_dict(data) @@ -19855,3 +21541,59 @@ def test_sso_required_oauth_error_body_with_connection_ids_list_email_omits_abse instance = SSORequiredOAuthErrorBodyWithConnectionIdsListEmail.from_dict(data) serialized = instance.to_dict() assert "pending_authentication_token" not in serialized + + +class TestDiscriminatorDispatch: + def test_radar_detection_repeat_sign_up_details_dispatches_known_variant(self): + data = load_fixture("radar_detection_repeat_sign_up_details_email.json") + result = RadarDetectionRepeatSignUpDetails.from_dict(data) + assert isinstance(result, RadarDetectionRepeatSignUpDetailsEmail) + + def test_radar_detection_repeat_sign_up_details_returns_unknown_for_unrecognized_type( + self, + ): + data = load_fixture("radar_detection_repeat_sign_up_details_email.json") + data = {**data, "matched_on": "future.unrecognized.type"} + result = RadarDetectionRepeatSignUpDetails.from_dict(data) + assert isinstance(result, RadarDetectionRepeatSignUpDetailsUnknown) + assert result.raw_data == data + + def test_radar_detection_repeat_sign_up_details_raises_on_missing_discriminator( + self, + ): + data = load_fixture("radar_detection_repeat_sign_up_details_email.json") + data = {k: v for k, v in data.items() if k != "matched_on"} + with pytest.raises(Exception): + RadarDetectionRepeatSignUpDetails.from_dict(data) + + def test_radar_detection_repeat_sign_up_details_raises_on_none_discriminator(self): + data = load_fixture("radar_detection_repeat_sign_up_details_email.json") + data = {**data, "matched_on": None} + with pytest.raises(Exception): + RadarDetectionRepeatSignUpDetails.from_dict(data) + + def test_radar_detection_restriction_details_dispatches_known_variant(self): + data = load_fixture("blocked_tld.json") + result = RadarDetectionRestrictionDetails.from_dict(data) + assert isinstance(result, BlockedTld) + + def test_radar_detection_restriction_details_returns_unknown_for_unrecognized_type( + self, + ): + data = load_fixture("blocked_tld.json") + data = {**data, "type": "future.unrecognized.type"} + result = RadarDetectionRestrictionDetails.from_dict(data) + assert isinstance(result, RadarDetectionRestrictionDetailsUnknown) + assert result.raw_data == data + + def test_radar_detection_restriction_details_raises_on_missing_discriminator(self): + data = load_fixture("blocked_tld.json") + data = {k: v for k, v in data.items() if k != "type"} + with pytest.raises(Exception): + RadarDetectionRestrictionDetails.from_dict(data) + + def test_radar_detection_restriction_details_raises_on_none_discriminator(self): + data = load_fixture("blocked_tld.json") + data = {**data, "type": None} + with pytest.raises(Exception): + RadarDetectionRestrictionDetails.from_dict(data) diff --git a/tests/test_organizations_issuer_trusts.py b/tests/test_organizations_issuer_trusts.py new file mode 100644 index 00000000..c52e6e4b --- /dev/null +++ b/tests/test_organizations_issuer_trusts.py @@ -0,0 +1,368 @@ +# This file is auto-generated by oagen. Do not edit. + +import json + +import pytest + +from tests.generated_helpers import load_fixture +from workos import AsyncWorkOSClient, WorkOSClient +from workos._errors import ( + AuthenticationError, + BadRequestError, + NotFoundError, + RateLimitExceededError, + ServerError, + UnprocessableEntityError, +) +from workos.common.models import IssuerTrust +from workos.organizations_issuer_trusts.models import IssuerTrustList + + +class TestOrganizationsIssuerTrusts: + def test_list_organization_issuer_trusts(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("issuer_trust_list.json"), + ) + result = workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + assert isinstance(result, IssuerTrustList) + assert result.object == "list" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts" + ) + + def test_create_organization_issuer_trust(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("issuer_trust.json"), + ) + result = workos.organizations_issuer_trusts.create_organization_issuer_trust( + "test_organization_id", type="claude", issuer="test_issuer" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "POST" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts" + ) + body = json.loads(request.content) + assert body["type"] == "claude" + assert body["issuer"] == "test_issuer" + + def test_get_organization_issuer_trust(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("issuer_trust.json"), + ) + result = workos.organizations_issuer_trusts.get_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + def test_update_organization_issuer_trust(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("issuer_trust.json"), + ) + result = workos.organizations_issuer_trusts.update_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "PATCH" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + def test_delete_organization_issuer_trust(self, workos, httpx_mock): + httpx_mock.add_response(status_code=204) + result = workos.organizations_issuer_trusts.delete_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert result is None + request = httpx_mock.get_request() + assert request.method == "DELETE" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + def test_list_organization_issuer_trusts_with_request_options( + self, workos, httpx_mock + ): + httpx_mock.add_response(json=load_fixture("issuer_trust_list.json")) + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id", + request_options={"extra_headers": {"X-Custom": "value"}}, + ) + request = httpx_mock.get_request() + assert request.headers["X-Custom"] == "value" + + def test_list_organization_issuer_trusts_unauthorized(self, workos, httpx_mock): + httpx_mock.add_response( + status_code=401, + json={"message": "Unauthorized"}, + ) + with pytest.raises(AuthenticationError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + + def test_list_organization_issuer_trusts_not_found(self, httpx_mock): + workos = WorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=404, json={"message": "Not found"}) + with pytest.raises(NotFoundError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + finally: + workos.close() + + def test_list_organization_issuer_trusts_rate_limited(self, httpx_mock): + workos = WorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response( + status_code=429, + headers={"Retry-After": "0"}, + json={"message": "Slow down"}, + ) + with pytest.raises(RateLimitExceededError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + finally: + workos.close() + + def test_list_organization_issuer_trusts_server_error(self, httpx_mock): + workos = WorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=500, json={"message": "Server error"}) + with pytest.raises(ServerError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + finally: + workos.close() + + def test_list_organization_issuer_trusts_bad_request(self, httpx_mock): + workos = WorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=400, json={"message": "Bad request"}) + with pytest.raises(BadRequestError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + finally: + workos.close() + + def test_list_organization_issuer_trusts_unprocessable(self, httpx_mock): + workos = WorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"}) + with pytest.raises(UnprocessableEntityError): + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + finally: + workos.close() + + +class TestAsyncOrganizationsIssuerTrusts: + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("issuer_trust_list.json")) + result = await async_workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + assert isinstance(result, IssuerTrustList) + assert result.object == "list" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts" + ) + + @pytest.mark.asyncio + async def test_create_organization_issuer_trust(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("issuer_trust.json")) + result = await async_workos.organizations_issuer_trusts.create_organization_issuer_trust( + "test_organization_id", type="claude", issuer="test_issuer" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "POST" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts" + ) + + @pytest.mark.asyncio + async def test_get_organization_issuer_trust(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("issuer_trust.json")) + result = await async_workos.organizations_issuer_trusts.get_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + @pytest.mark.asyncio + async def test_update_organization_issuer_trust(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("issuer_trust.json")) + result = await async_workos.organizations_issuer_trusts.update_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert isinstance(result, IssuerTrust) + assert result.object == "issuer_trust" + assert result.id == "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" + request = httpx_mock.get_request() + assert request.method == "PATCH" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + @pytest.mark.asyncio + async def test_delete_organization_issuer_trust(self, async_workos, httpx_mock): + httpx_mock.add_response(status_code=204) + result = await async_workos.organizations_issuer_trusts.delete_organization_issuer_trust( + "test_organization_id", "test_id" + ) + assert result is None + request = httpx_mock.get_request() + assert request.method == "DELETE" + assert request.url.path.endswith( + "/organizations/test_organization_id/issuer_trusts/test_id" + ) + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_with_request_options( + self, async_workos, httpx_mock + ): + httpx_mock.add_response(json=load_fixture("issuer_trust_list.json")) + await async_workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id", + request_options={"extra_headers": {"X-Custom": "value"}}, + ) + request = httpx_mock.get_request() + assert request.headers["X-Custom"] == "value" + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_unauthorized( + self, async_workos, httpx_mock + ): + httpx_mock.add_response(status_code=401, json={"message": "Unauthorized"}) + with pytest.raises(AuthenticationError): + await async_workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_not_found(self, httpx_mock): + workos = AsyncWorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=404, json={"message": "Not found"}) + with pytest.raises(NotFoundError): + await ( + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + ) + finally: + await workos.close() + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_rate_limited(self, httpx_mock): + workos = AsyncWorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response( + status_code=429, + headers={"Retry-After": "0"}, + json={"message": "Slow down"}, + ) + with pytest.raises(RateLimitExceededError): + await ( + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + ) + finally: + await workos.close() + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_server_error(self, httpx_mock): + workos = AsyncWorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=500, json={"message": "Server error"}) + with pytest.raises(ServerError): + await ( + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + ) + finally: + await workos.close() + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_bad_request(self, httpx_mock): + workos = AsyncWorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=400, json={"message": "Bad request"}) + with pytest.raises(BadRequestError): + await ( + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + ) + finally: + await workos.close() + + @pytest.mark.asyncio + async def test_list_organization_issuer_trusts_unprocessable(self, httpx_mock): + workos = AsyncWorkOSClient( + api_key="sk_test_123", client_id="client_test", max_retries=0 + ) + try: + httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"}) + with pytest.raises(UnprocessableEntityError): + await ( + workos.organizations_issuer_trusts.list_organization_issuer_trusts( + "test_organization_id" + ) + ) + finally: + await workos.close() diff --git a/tests/test_organizations_issuer_trusts_models_round_trip.py b/tests/test_organizations_issuer_trusts_models_round_trip.py new file mode 100644 index 00000000..c67ac61d --- /dev/null +++ b/tests/test_organizations_issuer_trusts_models_round_trip.py @@ -0,0 +1,98 @@ +# This file is auto-generated by oagen. Do not edit. + +"""Model round-trip tests: from_dict(to_dict()) preserves data.""" + +from tests.generated_helpers import load_fixture +from workos.organizations_issuer_trusts.models import ( + IssuerTrust, + IssuerTrustList, + IssuerTrustListListMetadata, +) + + +class TestModelRoundTrip: + def test_issuer_trust_round_trip(self): + data = load_fixture("issuer_trust.json") + instance = IssuerTrust.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = IssuerTrust.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_issuer_trust_minimal_payload(self): + data = { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = IssuerTrust.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["organization_id"] == data["organization_id"] + assert serialized["type"] == data["type"] + assert serialized["issuer"] == data["issuer"] + assert serialized["enabled"] == data["enabled"] + assert serialized["created_at"] == data["created_at"] + assert serialized["updated_at"] == data["updated_at"] + + def test_issuer_trust_list_round_trip(self): + data = load_fixture("issuer_trust_list.json") + instance = IssuerTrustList.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = IssuerTrustList.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_issuer_trust_list_minimal_payload(self): + data = { + "object": "list", + "data": [ + { + "object": "issuer_trust", + "id": "issuer_trust_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "type": "claude", + "issuer": "https://claude.ai/v1/ema/t/01JZ8X4N2R7Q9M3K5T6V8W0Y1A", + "enabled": True, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + ], + "list_metadata": { + "before": "issuer_trust_01HXYZ123456789ABCDEFGHIJ", + "after": "issuer_trust_01HXYZ987654321KJIHGFEDCBA", + }, + } + instance = IssuerTrustList.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["data"] == data["data"] + assert serialized["list_metadata"] == data["list_metadata"] + + def test_issuer_trust_list_list_metadata_round_trip(self): + data = load_fixture("issuer_trust_list_list_metadata.json") + instance = IssuerTrustListListMetadata.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = IssuerTrustListListMetadata.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_issuer_trust_list_list_metadata_minimal_payload(self): + data = {"before": None, "after": None} + instance = IssuerTrustListListMetadata.from_dict(data) + serialized = instance.to_dict() + assert serialized["before"] == data["before"] + assert serialized["after"] == data["after"] + + def test_issuer_trust_list_list_metadata_preserves_nullable_fields(self): + data = {"before": None, "after": None} + instance = IssuerTrustListListMetadata.from_dict(data) + serialized = instance.to_dict() + assert serialized["before"] is None + assert serialized["after"] is None diff --git a/tests/test_radar.py b/tests/test_radar.py index 6d7e0ec1..15b7e70a 100644 --- a/tests/test_radar.py +++ b/tests/test_radar.py @@ -19,7 +19,7 @@ RadarStandaloneAssessRequestAction, RadarStandaloneAssessRequestAuthMethod, ) -from workos.radar.models import RadarStandaloneResponse +from workos.radar.models import RadarDetection, RadarStandaloneResponse class TestRadar: @@ -54,6 +54,18 @@ def test_update_attempt(self, workos, httpx_mock): assert request.method == "PUT" assert request.url.path.endswith("/radar/attempts/test_id") + def test_get_detection(self, workos, httpx_mock): + httpx_mock.add_response( + json=load_fixture("radar_detection.json"), + ) + result = workos.radar.get_detection("test_id") + assert isinstance(result, RadarDetection) + assert result.object == "radar_detection" + assert result.id == "detection_01HZBC6N1EB1ZY7KG32X" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith("/radar/detections/test_id") + def test_add_list_entry(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("radar_list_entry_already_present_response.json"), @@ -222,6 +234,17 @@ async def test_update_attempt(self, async_workos, httpx_mock): assert request.method == "PUT" assert request.url.path.endswith("/radar/attempts/test_id") + @pytest.mark.asyncio + async def test_get_detection(self, async_workos, httpx_mock): + httpx_mock.add_response(json=load_fixture("radar_detection.json")) + result = await async_workos.radar.get_detection("test_id") + assert isinstance(result, RadarDetection) + assert result.object == "radar_detection" + assert result.id == "detection_01HZBC6N1EB1ZY7KG32X" + request = httpx_mock.get_request() + assert request.method == "GET" + assert request.url.path.endswith("/radar/detections/test_id") + @pytest.mark.asyncio async def test_add_list_entry(self, async_workos, httpx_mock): httpx_mock.add_response( diff --git a/tests/test_radar_models_round_trip.py b/tests/test_radar_models_round_trip.py index cf4a78fd..6b060bae 100644 --- a/tests/test_radar_models_round_trip.py +++ b/tests/test_radar_models_round_trip.py @@ -2,14 +2,224 @@ """Model round-trip tests: from_dict(to_dict()) preserves data.""" +import pytest + from tests.generated_helpers import load_fixture +from workos.common.models import BotDetection from workos.radar.models import ( + RadarDetection, + RadarDetectionAllowedBy, + RadarDetectionEvidence, + RadarDetectionEvidenceUnknown, + RadarDetectionList, + RadarDetectionLocation, RadarListEntryAlreadyPresentResponse, RadarStandaloneResponse, ) class TestModelRoundTrip: + def test_radar_detection_list_round_trip(self): + data = load_fixture("radar_detection_list.json") + instance = RadarDetectionList.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionList.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_list_minimal_payload(self): + data = {"type": "domain", "action": None, "name": None, "workos_managed": True} + instance = RadarDetectionList.from_dict(data) + serialized = instance.to_dict() + assert serialized["type"] == data["type"] + assert serialized["action"] == data["action"] + assert serialized["name"] == data["name"] + assert serialized["workos_managed"] == data["workos_managed"] + + def test_radar_detection_list_preserves_nullable_fields(self): + data = {"type": "domain", "action": None, "name": None, "workos_managed": True} + instance = RadarDetectionList.from_dict(data) + serialized = instance.to_dict() + assert serialized["action"] is None + assert serialized["name"] is None + + def test_radar_detection_list_round_trips_unknown_enum_values(self): + data = { + "type": "unexpected_radar_detection_list_type", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + } + instance = RadarDetectionList.from_dict(data) + assert instance.to_dict() == data + + def test_radar_detection_allowed_by_round_trip(self): + data = load_fixture("radar_detection_allowed_by.json") + instance = RadarDetectionAllowedBy.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionAllowedBy.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_allowed_by_minimal_payload(self): + data = {"list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", "list": None} + instance = RadarDetectionAllowedBy.from_dict(data) + serialized = instance.to_dict() + assert serialized["list_id"] == data["list_id"] + assert serialized["list"] == data["list"] + + def test_radar_detection_allowed_by_omits_absent_optional_non_nullable_fields(self): + data = { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + } + instance = RadarDetectionAllowedBy.from_dict(data) + serialized = instance.to_dict() + assert "entry" not in serialized + + def test_radar_detection_allowed_by_preserves_nullable_fields(self): + data = { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": None, + "entry": "example.com", + } + instance = RadarDetectionAllowedBy.from_dict(data) + serialized = instance.to_dict() + assert serialized["list"] is None + + def test_radar_detection_round_trip(self): + data = load_fixture("radar_detection.json") + instance = RadarDetection.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetection.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_minimal_payload(self): + data = { + "object": "radar_detection", + "id": "detection_01HZBC6N1EB1ZY7KG32X", + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "control": "bot_detection", + "verdict": "challenge", + "challenge_type": None, + "evidence": None, + "ip_address": "203.0.113.42", + "location": {"city": "San Francisco", "country": "US"}, + "user_agent": "Mozilla/5.0", + "email": "user@example.com", + "user_id": None, + "action": None, + "auth_method": None, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetection.from_dict(data) + serialized = instance.to_dict() + assert serialized["object"] == data["object"] + assert serialized["id"] == data["id"] + assert serialized["attempt_id"] == data["attempt_id"] + assert serialized["control"] == data["control"] + assert serialized["verdict"] == data["verdict"] + assert serialized["challenge_type"] == data["challenge_type"] + assert serialized["evidence"] == data["evidence"] + assert serialized["ip_address"] == data["ip_address"] + assert serialized["location"] == data["location"] + assert serialized["user_agent"] == data["user_agent"] + assert serialized["email"] == data["email"] + assert serialized["user_id"] == data["user_id"] + assert serialized["action"] == data["action"] + assert serialized["auth_method"] == data["auth_method"] + assert serialized["created_at"] == data["created_at"] + assert serialized["updated_at"] == data["updated_at"] + + def test_radar_detection_preserves_nullable_fields(self): + data = { + "object": "radar_detection", + "id": "detection_01HZBC6N1EB1ZY7KG32X", + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "control": "bot_detection", + "verdict": "challenge", + "challenge_type": None, + "evidence": None, + "ip_address": "203.0.113.42", + "location": {"city": "San Francisco", "country": "US"}, + "user_agent": "Mozilla/5.0", + "email": "user@example.com", + "user_id": None, + "action": None, + "auth_method": None, + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetection.from_dict(data) + serialized = instance.to_dict() + assert serialized["challenge_type"] is None + assert serialized["evidence"] is None + assert serialized["user_id"] is None + assert serialized["action"] is None + assert serialized["auth_method"] is None + + def test_radar_detection_round_trips_unknown_enum_values(self): + data = { + "object": "radar_detection", + "id": "detection_01HZBC6N1EB1ZY7KG32X", + "attempt_id": "radar_att_01HZBC6N1EB1ZY7KG32X", + "control": "unexpected_radar_detection_control", + "verdict": "challenge", + "challenge_type": "email", + "evidence": { + "summary": "Sign-up from a Tor exit node with an email format shared by many recent sign-ups. The action was decided by the risky IP. The email pattern would also have challenged.", + "allowed_by": { + "list_id": "radar_list_01HZBC6N1EB1ZY7KG32X", + "list": { + "type": "domain", + "action": "block", + "name": "Disposable email domains", + "workos_managed": True, + }, + "entry": "example.com", + }, + "control": "bot_detection", + "details": { + "signals": [{"signal": "risky_ip", "action": "block"}], + "decided_by": "risky_ip", + "ip_risk": ["abuser", "anonymous", "vpn", "tor", "proxy"], + "email_pattern": [ + "generated_looking", + "repeated_format", + "suspicious_domain", + ], + "browser_signals": [ + "automation_framework", + "headless_browser", + "tampered_signals", + "inconsistent_hardware", + "missing_signals", + "missing_expected_signals", + ], + "ip_sign_ups": {"count": 6, "window_minutes": 5}, + "domain_sign_ups": {"root_domain": "example.com", "count": 44}, + }, + }, + "ip_address": "203.0.113.42", + "location": {"city": "San Francisco", "country": "US"}, + "user_agent": "Mozilla/5.0", + "email": "user@example.com", + "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", + "action": "signup", + "auth_method": "password", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + } + instance = RadarDetection.from_dict(data) + assert instance.to_dict() == data + def test_radar_standalone_response_round_trip(self): data = load_fixture("radar_standalone_response.json") instance = RadarStandaloneResponse.from_dict(data) @@ -65,3 +275,51 @@ def test_radar_list_entry_already_present_response_minimal_payload(self): instance = RadarListEntryAlreadyPresentResponse.from_dict(data) serialized = instance.to_dict() assert serialized["message"] == data["message"] + + def test_radar_detection_location_round_trip(self): + data = load_fixture("radar_detection_location.json") + instance = RadarDetectionLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized == data + restored = RadarDetectionLocation.from_dict(serialized) + assert restored.to_dict() == serialized + + def test_radar_detection_location_minimal_payload(self): + data = {"city": None, "country": None} + instance = RadarDetectionLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized["city"] == data["city"] + assert serialized["country"] == data["country"] + + def test_radar_detection_location_preserves_nullable_fields(self): + data = {"city": None, "country": None} + instance = RadarDetectionLocation.from_dict(data) + serialized = instance.to_dict() + assert serialized["city"] is None + assert serialized["country"] is None + + +class TestDiscriminatorDispatch: + def test_radar_detection_evidence_dispatches_known_variant(self): + data = load_fixture("bot_detection.json") + result = RadarDetectionEvidence.from_dict(data) + assert isinstance(result, BotDetection) + + def test_radar_detection_evidence_returns_unknown_for_unrecognized_type(self): + data = load_fixture("bot_detection.json") + data = {**data, "control": "future.unrecognized.type"} + result = RadarDetectionEvidence.from_dict(data) + assert isinstance(result, RadarDetectionEvidenceUnknown) + assert result.raw_data == data + + def test_radar_detection_evidence_raises_on_missing_discriminator(self): + data = load_fixture("bot_detection.json") + data = {k: v for k, v in data.items() if k != "control"} + with pytest.raises(Exception): + RadarDetectionEvidence.from_dict(data) + + def test_radar_detection_evidence_raises_on_none_discriminator(self): + data = load_fixture("bot_detection.json") + data = {**data, "control": None} + with pytest.raises(Exception): + RadarDetectionEvidence.from_dict(data) diff --git a/tests/test_user_management.py b/tests/test_user_management.py index 15255dcd..6c91cc5c 100644 --- a/tests/test_user_management.py +++ b/tests/test_user_management.py @@ -258,6 +258,14 @@ def test_create_cors_origin(self, workos, httpx_mock): body = json.loads(request.content) assert body["origin"] == "test_origin" + def test_delete_cors_origin(self, workos, httpx_mock): + httpx_mock.add_response(status_code=204) + result = workos.user_management.delete_cors_origin("test_id") + assert result is None + request = httpx_mock.get_request() + assert request.method == "DELETE" + assert request.url.path.endswith("/user_management/cors_origins/test_id") + def test_get_email_verification(self, workos, httpx_mock): httpx_mock.add_response( json=load_fixture("email_verification.json"), @@ -1333,6 +1341,15 @@ async def test_create_cors_origin(self, async_workos, httpx_mock): assert request.method == "POST" assert request.url.path.endswith("/user_management/cors_origins") + @pytest.mark.asyncio + async def test_delete_cors_origin(self, async_workos, httpx_mock): + httpx_mock.add_response(status_code=204) + result = await async_workos.user_management.delete_cors_origin("test_id") + assert result is None + request = httpx_mock.get_request() + assert request.method == "DELETE" + assert request.url.path.endswith("/user_management/cors_origins/test_id") + @pytest.mark.asyncio async def test_get_email_verification(self, async_workos, httpx_mock): httpx_mock.add_response(json=load_fixture("email_verification.json")) From 76b355c8a8eb66ed3a5077555a1c9665b2d7f726 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 18:45:21 +0000 Subject: [PATCH 6/6] chore(generated): add release notes fragment --- ...dc06481aca9c2b90876594bdd032227455301fd.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .changelog-pending/2026-11-24T18-45-21-ddc06481aca9c2b90876594bdd032227455301fd.md diff --git a/.changelog-pending/2026-11-24T18-45-21-ddc06481aca9c2b90876594bdd032227455301fd.md b/.changelog-pending/2026-11-24T18-45-21-ddc06481aca9c2b90876594bdd032227455301fd.md new file mode 100644 index 00000000..e66e4213 --- /dev/null +++ b/.changelog-pending/2026-11-24T18-45-21-ddc06481aca9c2b90876594bdd032227455301fd.md @@ -0,0 +1,91 @@ +* [#783](https://github.com/workos/workos-python/pull/783) feat(generated)!: regenerate from spec (5 changes) + + **Features** + * **[agents](https://workos.com/docs/reference/agents)**: + * Added model `AgentBlueprintScopedPermission` + * Added model `AgentBlueprintsCreateRequestPermission` + * Added model `AgentBlueprintsUpdateRequestPermission` + * Added `scoped_permissions` to `AgentBlueprint` + * Changed access for `AgentBlueprint.permissions` + * Changed access for `AgentBlueprintsCreateRequest.permissions` + * Changed access for `AgentBlueprintsUpdateRequest.permissions` + * Added enum `AgentBlueprintScopedPermissionInstanceTypes` + * Added enum `AgentBlueprintsCreateRequestPermissionInstanceTypes` + * Added enum `AgentBlueprintsUpdateRequestPermissionInstanceTypes` + * **[audit_logs](https://workos.com/docs/reference/audit-logs)**: + * Made `AuditLogEvent.occurred_at` optional + * **[authorization](https://workos.com/docs/reference/fga)**: + * Added model `PatchRoleAssignmentEntry` + * Added model `PatchRoleAssignments` + * Added model `RoleAssignmentUpdateOverlapErrorBody` + * Added endpoint `PATCH /authorization/organization_memberships/{organization_membership_id}/role_assignments` + * **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: + * Added model `EntityNotFoundErrorBodyWithIdsList` + * Added model `EntityNotFoundErrorBodyWithEntityId` + * **[organizations](https://workos.com/docs/reference/organization)**: + * Added model `IssuerTrustsCreateRequest` + * Added model `IssuerTrustsUpdateRequest` + * Added `invalid_issuer_metadata` to `ErrorBodyCode` + * Added `invalid_issuer_url` to `ErrorBodyCode` + * Added `issuer_already_trusted` to `ErrorBodyCode` + * Added `not_claude_issuer` to `ErrorBodyCode` + * Added `organization_already_has_trust` to `ErrorBodyCode` + * Added `organization_has_idp_managed_ema` to `ErrorBodyCode` + * Added `organization_without_verified_domain` to `ErrorBodyCode` + * Added endpoint `POST /organizations/{organization_id}/issuer_trusts` + * Added endpoint `PATCH /organizations/{organization_id}/issuer_trusts/{id}` + * Added endpoint `DELETE /organizations/{organization_id}/issuer_trusts/{id}` + * Added model `IssuerTrustList` + * Added model `IssuerTrustListListMetadata` + * Added service `OrganizationsIssuerTrusts` + * **[events](https://workos.com/docs/reference/events)**: + * Added model `IssuerTrust` + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Added `radar_sms_challenge` to `ErrorBodyCode` + * Added `entities_not_found` to `ErrorBodyCode` + * Added `discovery_endpoint_tenant_not_allowed` to `ErrorBodyCode` + * Added `cannot_remove_group_sourced_role` to `ErrorBodyCode` + * Added `role_assignment_update_overlap` to `ErrorBodyCode` + * **[radar](https://workos.com/docs/reference/radar)**: + * Added model `RadarDetectionList` + * Added model `RadarDetectionAllowedBy` + * Added model `RadarDetectionEvidence` + * Added model `RadarDetection` + * Added model `RadarDetectionLocation` + * Added enum `RadarDetectionListType` + * Added enum `RadarDetectionListAction` + * Added enum `RadarDetectionControl` + * Added enum `RadarDetectionVerdict` + * Added enum `RadarDetectionChallengeType` + * Added enum `RadarDetectionAction` + * Added enum `RadarDetectionAuthMethod` + * Added endpoint `GET /radar/detections/{id}` + * Added model `RadarSmsChallengeErrorBody` + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Added endpoint `DELETE /user_management/cors_origins/{id}` + * **[webhooks](https://workos.com/docs/reference/webhooks)**: + * Added `connection.saml_certificate_replaced` to `CreateWebhookEndpointEvents` + * Added `connection.saml_certificate_replaced` to `UpdateWebhookEndpointEvents` + * Added `issuer_trust.created` to `CreateWebhookEndpointEvents` + * Added `issuer_trust.deleted` to `CreateWebhookEndpointEvents` + * Added `issuer_trust.updated` to `CreateWebhookEndpointEvents` + * Added `issuer_trust.created` to `UpdateWebhookEndpointEvents` + * Added `issuer_trust.deleted` to `UpdateWebhookEndpointEvents` + * Added `issuer_trust.updated` to `UpdateWebhookEndpointEvents` + * Added endpoint `GET /webhook_endpoints/{id}` + * Added `application.token_exchange_failed` to `CreateWebhookEndpointEvents` + * Added `application.token_exchange_succeeded` to `CreateWebhookEndpointEvents` + * Added `application.token_exchange_failed` to `UpdateWebhookEndpointEvents` + * Added `application.token_exchange_succeeded` to `UpdateWebhookEndpointEvents` + + **Fixes** + * **[agents](https://workos.com/docs/reference/agents)**: + * Changed the type of `AgentBlueprintsCreateRequest.permissions` + * Changed the type of `AgentBlueprintsUpdateRequest.permissions` + * **[events](https://workos.com/docs/reference/events)**: + * Updated model `EventSchema` + * **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: + * Changed errors for endpoint `POST /user_management/organization_memberships` + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `POST /user_management/authenticate` + * Changed errors for endpoint `POST /user_management/users`