From 23f76231a406490f269a6b3394ef0a32b675b1e8 Mon Sep 17 00:00:00 2001 From: BinoyOza-okta Date: Fri, 6 Mar 2026 23:11:32 +0530 Subject: [PATCH] - Added MFA_AS_SERVICE as Application SignOn mode for the list_applications() operation. - Added generic solution to the model_generic.mustache and generated SDK for the issue of deserialization of application. --- docs/ApplicationSignOnMode.md | 2 +- okta/models/action_provider.py | 3 ++ okta/models/app_config.py | 3 ++ okta/models/application.py | 38 +++++++++++++- okta/models/application_feature.py | 6 +++ okta/models/application_sign_on_mode.py | 4 +- okta/models/authenticator_base.py | 51 +++++++++++++++++++ okta/models/authenticator_method_base.py | 42 +++++++++++++++ ...cator_method_with_verifiable_properties.py | 42 +++++++++++++++ okta/models/authenticator_simple.py | 48 +++++++++++++++++ okta/models/available_action_provider.py | 3 ++ okta/models/behavior_rule.py | 15 ++++++ okta/models/device_assurance.py | 15 ++++++ ...lment_policy_authenticator_grace_period.py | 3 ++ okta/models/inline_hook_channel.py | 6 +++ okta/models/inline_hook_channel_create.py | 6 +++ okta/models/log_stream.py | 6 +++ okta/models/log_stream_put_schema.py | 6 +++ okta/models/network_zone.py | 9 ++++ ..._auth2_client_json_signing_key_response.py | 6 +++ okta/models/policy.py | 27 ++++++++++ okta/models/policy_rule.py | 27 ++++++++++ okta/models/privileged_resource.py | 9 ++++ okta/models/push_provider.py | 6 +++ .../registration_inline_hook_request.py | 6 +++ okta/models/service_account.py | 6 +++ okta/models/user_factor.py | 36 +++++++++++++ okta/models/user_factor_push_transaction.py | 15 ++++++ okta/models/user_risk_get_response.py | 12 +++++ okta/models/validation_detail_provider.py | 3 ++ okta/models/verification_method.py | 9 ++++ openapi/api.yaml | 3 ++ openapi/templates/model_generic.mustache | 3 ++ 33 files changed, 473 insertions(+), 3 deletions(-) diff --git a/docs/ApplicationSignOnMode.md b/docs/ApplicationSignOnMode.md index a8bb096b..505d1bd2 100644 --- a/docs/ApplicationSignOnMode.md +++ b/docs/ApplicationSignOnMode.md @@ -1,6 +1,6 @@ # ApplicationSignOnMode -Authentication mode for the app | signOnMode | Description | | ---------- | ----------- | | AUTO_LOGIN | Secure Web Authentication (SWA) | | BASIC_AUTH | HTTP Basic Authentication with Okta Browser Plugin | | BOOKMARK | Just a bookmark (no-authentication) | | BROWSER_PLUGIN | Secure Web Authentication (SWA) with Okta Browser Plugin | | OPENID_CONNECT | Federated Authentication with OpenID Connect (OIDC) | | SAML_1_1 | Federated Authentication with SAML 1.1 WebSSO (not supported for custom apps) | | SAML_2_0 | Federated Authentication with SAML 2.0 WebSSO | | SECURE_PASSWORD_STORE | Secure Web Authentication (SWA) with POST (plugin not required) | | WS_FEDERATION | Federated Authentication with WS-Federation Passive Requestor Profile | Select the `signOnMode` for your custom app: +Authentication mode for the app | signOnMode | Description | | ---------- | ----------- | | AUTO_LOGIN | Secure Web Authentication (SWA) | | BASIC_AUTH | HTTP Basic Authentication with Okta Browser Plugin | | BOOKMARK | Just a bookmark (no-authentication) | | BROWSER_PLUGIN | Secure Web Authentication (SWA) with Okta Browser Plugin | | OPENID_CONNECT | Federated Authentication with OpenID Connect (OIDC) | | SAML_1_1 | Federated Authentication with SAML 1.1 WebSSO (not supported for custom apps) | | SAML_2_0 | Federated Authentication with SAML 2.0 WebSSO | | SECURE_PASSWORD_STORE | Secure Web Authentication (SWA) with POST (plugin not required) | | WS_FEDERATION | Federated Authentication with WS-Federation Passive Requestor Profile | | MFA_AS_SERVICE | Application to use Okta's MFA as a service for RDP | Select the `signOnMode` for your custom app: ## Properties diff --git a/okta/models/action_provider.py b/okta/models/action_provider.py index 5f31f31f..657b6fd5 100644 --- a/okta/models/action_provider.py +++ b/okta/models/action_provider.py @@ -115,6 +115,9 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[WorkflowActionProvider # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "WorkflowActionProvider": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.WorkflowActionProvider.from_dict(obj) raise ValueError( diff --git a/okta/models/app_config.py b/okta/models/app_config.py index 2cdc0271..d8d01076 100644 --- a/okta/models/app_config.py +++ b/okta/models/app_config.py @@ -110,6 +110,9 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AppConfigActiveDirectory": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AppConfigActiveDirectory.from_dict(obj) raise ValueError( diff --git a/okta/models/application.py b/okta/models/application.py index f7de5ce4..5c3641b7 100644 --- a/okta/models/application.py +++ b/okta/models/application.py @@ -50,6 +50,7 @@ from okta.models.basic_auth_application import BasicAuthApplication from okta.models.bookmark_application import BookmarkApplication from okta.models.browser_plugin_application import BrowserPluginApplication + from okta.models.application import Application from okta.models.open_id_connect_application import OpenIdConnectApplication from okta.models.saml11_application import Saml11Application from okta.models.saml_application import SamlApplication @@ -59,7 +60,7 @@ from okta.models.ws_federation_application import WsFederationApplication -class Application(BaseModel): +class Application(BaseModel): # noqa: F811 """ Application """ # noqa: E501 @@ -209,6 +210,7 @@ def features_validate_enum(cls, value): "BASIC_AUTH": "BasicAuthApplication", "BOOKMARK": "BookmarkApplication", "BROWSER_PLUGIN": "BrowserPluginApplication", + "MFA_AS_SERVICE": "Application", "OPENID_CONNECT": "OpenIdConnectApplication", "SAML_1_1": "Saml11Application", "SAML_2_0": "SamlApplication", @@ -241,6 +243,7 @@ def from_json(cls, json_str: str) -> Optional[ BasicAuthApplication, BookmarkApplication, BrowserPluginApplication, + Application, OpenIdConnectApplication, Saml11Application, SamlApplication, @@ -339,6 +342,7 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ BasicAuthApplication, BookmarkApplication, BrowserPluginApplication, + Application, OpenIdConnectApplication, Saml11Application, SamlApplication, @@ -352,22 +356,54 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AutoLoginApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AutoLoginApplication.from_dict(obj) if object_type == "BasicAuthApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BasicAuthApplication.from_dict(obj) if object_type == "BookmarkApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BookmarkApplication.from_dict(obj) if object_type == "BrowserPluginApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BrowserPluginApplication.from_dict(obj) + if object_type == "Application": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) + return models.Application.from_dict(obj) if object_type == "OpenIdConnectApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.OpenIdConnectApplication.from_dict(obj) if object_type == "Saml11Application": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.Saml11Application.from_dict(obj) if object_type == "SamlApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.SamlApplication.from_dict(obj) if object_type == "SecurePasswordStoreApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.SecurePasswordStoreApplication.from_dict(obj) if object_type == "WsFederationApplication": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.WsFederationApplication.from_dict(obj) raise ValueError( diff --git a/okta/models/application_feature.py b/okta/models/application_feature.py index d1c00abd..456ca92f 100644 --- a/okta/models/application_feature.py +++ b/okta/models/application_feature.py @@ -143,8 +143,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "InboundProvisioningApplicationFeature": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.InboundProvisioningApplicationFeature.from_dict(obj) if object_type == "UserProvisioningApplicationFeature": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserProvisioningApplicationFeature.from_dict(obj) raise ValueError( diff --git a/okta/models/application_sign_on_mode.py b/okta/models/application_sign_on_mode.py index 65c73fc1..011925f7 100644 --- a/okta/models/application_sign_on_mode.py +++ b/okta/models/application_sign_on_mode.py @@ -36,7 +36,8 @@ class ApplicationSignOnMode(str, Enum): Federated Authentication with OpenID Connect (OIDC) | | SAML_1_1 | Federated Authentication with SAML 1.1 WebSSO (not supported for custom apps) | | SAML_2_0 | Federated Authentication with SAML 2.0 WebSSO | | SECURE_PASSWORD_STORE | Secure Web Authentication (SWA) with POST (plugin not required) | | WS_FEDERATION | Federated Authentication with - WS-Federation Passive Requestor Profile | Select the `signOnMode` for your custom app: + WS-Federation Passive Requestor Profile | | MFA_AS_SERVICE | Application to use Okta's MFA as a service for RDP | + Select the `signOnMode` for your custom app: """ """ @@ -51,6 +52,7 @@ class ApplicationSignOnMode(str, Enum): SAML_2_0 = "SAML_2_0" SECURE_PASSWORD_STORE = "SECURE_PASSWORD_STORE" WS_FEDERATION = "WS_FEDERATION" + MFA_AS_SERVICE = "MFA_AS_SERVICE" @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/okta/models/authenticator_base.py b/okta/models/authenticator_base.py index 989a245b..1519eecc 100644 --- a/okta/models/authenticator_base.py +++ b/okta/models/authenticator_base.py @@ -230,38 +230,89 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AuthenticatorKeyCustomApp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyCustomApp.from_dict(obj) if object_type == "AuthenticatorKeyDuo": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyDuo.from_dict(obj) if object_type == "AuthenticatorKeyExternalIdp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyExternalIdp.from_dict(obj) if object_type == "AuthenticatorKeyGoogleOtp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyGoogleOtp.from_dict(obj) if object_type == "AuthenticatorKeyEmail": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyEmail.from_dict(obj) if object_type == "AuthenticatorKeyPassword": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyPassword.from_dict(obj) if object_type == "AuthenticatorKeyOktaVerify": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyOktaVerify.from_dict(obj) if object_type == "AuthenticatorKeyOnprem": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyOnprem.from_dict(obj) if object_type == "AuthenticatorKeyPhone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyPhone.from_dict(obj) if object_type == "AuthenticatorKeySecurityKey": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySecurityKey.from_dict(obj) if object_type == "AuthenticatorKeySecurityQuestion": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySecurityQuestion.from_dict(obj) if object_type == "AuthenticatorKeySmartCard": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySmartCard.from_dict(obj) if object_type == "AuthenticatorKeySymantecVip": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySymantecVip.from_dict(obj) if object_type == "AuthenticatorKeyTac": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyTac.from_dict(obj) if object_type == "AuthenticatorKeyWebauthn": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyWebauthn.from_dict(obj) if object_type == "AuthenticatorKeyYubikey": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyYubikey.from_dict(obj) if object_type == "AuthenticatorSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorSimple.from_dict(obj) raise ValueError( diff --git a/okta/models/authenticator_method_base.py b/okta/models/authenticator_method_base.py index ee35ecdb..1bdb93c1 100644 --- a/okta/models/authenticator_method_base.py +++ b/okta/models/authenticator_method_base.py @@ -179,32 +179,74 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodOtp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodOtp.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodPush": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodPush.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodSignedNonce": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSignedNonce.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodTac": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodTac.from_dict(obj) if object_type == "AuthenticatorMethodTotp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodTotp.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodWebAuthn": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWebAuthn.from_dict(obj) raise ValueError( diff --git a/okta/models/authenticator_method_with_verifiable_properties.py b/okta/models/authenticator_method_with_verifiable_properties.py index 2cb8979c..4bc2f639 100644 --- a/okta/models/authenticator_method_with_verifiable_properties.py +++ b/okta/models/authenticator_method_with_verifiable_properties.py @@ -183,32 +183,74 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodWithVerifiableProperties": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWithVerifiableProperties.from_dict(obj) if object_type == "AuthenticatorMethodOtp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodOtp.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodPush": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodPush.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodSignedNonce": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSignedNonce.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodTac": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodTac.from_dict(obj) if object_type == "AuthenticatorMethodTotp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodTotp.from_dict(obj) if object_type == "AuthenticatorMethodSimple": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodSimple.from_dict(obj) if object_type == "AuthenticatorMethodWebAuthn": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorMethodWebAuthn.from_dict(obj) raise ValueError( diff --git a/okta/models/authenticator_simple.py b/okta/models/authenticator_simple.py index 6c8b62f6..84c98d9a 100644 --- a/okta/models/authenticator_simple.py +++ b/okta/models/authenticator_simple.py @@ -195,36 +195,84 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AuthenticatorKeyCustomApp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyCustomApp.from_dict(obj) if object_type == "AuthenticatorKeyDuo": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyDuo.from_dict(obj) if object_type == "AuthenticatorKeyExternalIdp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyExternalIdp.from_dict(obj) if object_type == "AuthenticatorKeyGoogleOtp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyGoogleOtp.from_dict(obj) if object_type == "AuthenticatorKeyEmail": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyEmail.from_dict(obj) if object_type == "AuthenticatorKeyPassword": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyPassword.from_dict(obj) if object_type == "AuthenticatorKeyOktaVerify": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyOktaVerify.from_dict(obj) if object_type == "AuthenticatorKeyOnprem": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyOnprem.from_dict(obj) if object_type == "AuthenticatorKeyPhone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyPhone.from_dict(obj) if object_type == "AuthenticatorKeySecurityKey": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySecurityKey.from_dict(obj) if object_type == "AuthenticatorKeySecurityQuestion": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySecurityQuestion.from_dict(obj) if object_type == "AuthenticatorKeySmartCard": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySmartCard.from_dict(obj) if object_type == "AuthenticatorKeySymantecVip": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeySymantecVip.from_dict(obj) if object_type == "AuthenticatorKeyTac": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyTac.from_dict(obj) if object_type == "AuthenticatorKeyWebauthn": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyWebauthn.from_dict(obj) if object_type == "AuthenticatorKeyYubikey": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorKeyYubikey.from_dict(obj) raise ValueError( diff --git a/okta/models/available_action_provider.py b/okta/models/available_action_provider.py index 9e5f149d..13640be0 100644 --- a/okta/models/available_action_provider.py +++ b/okta/models/available_action_provider.py @@ -124,6 +124,9 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "WorkflowAvailableActionProvider": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.WorkflowAvailableActionProvider.from_dict(obj) raise ValueError( diff --git a/okta/models/behavior_rule.py b/okta/models/behavior_rule.py index 592e9d58..644a887b 100644 --- a/okta/models/behavior_rule.py +++ b/okta/models/behavior_rule.py @@ -180,14 +180,29 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "BehaviorRuleASN": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BehaviorRuleASN.from_dict(obj) if object_type == "BehaviorRuleAnomalousDevice": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BehaviorRuleAnomalousDevice.from_dict(obj) if object_type == "BehaviorRuleAnomalousIP": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BehaviorRuleAnomalousIP.from_dict(obj) if object_type == "BehaviorRuleAnomalousLocation": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BehaviorRuleAnomalousLocation.from_dict(obj) if object_type == "BehaviorRuleVelocity": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.BehaviorRuleVelocity.from_dict(obj) raise ValueError( diff --git a/okta/models/device_assurance.py b/okta/models/device_assurance.py index 797b0435..8521543e 100644 --- a/okta/models/device_assurance.py +++ b/okta/models/device_assurance.py @@ -221,14 +221,29 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "DeviceAssuranceAndroidPlatform": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceAssuranceAndroidPlatform.from_dict(obj) if object_type == "DeviceAssuranceChromeOSPlatform": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceAssuranceChromeOSPlatform.from_dict(obj) if object_type == "DeviceAssuranceIOSPlatform": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceAssuranceIOSPlatform.from_dict(obj) if object_type == "DeviceAssuranceMacOSPlatform": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceAssuranceMacOSPlatform.from_dict(obj) if object_type == "DeviceAssuranceWindowsPlatform": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceAssuranceWindowsPlatform.from_dict(obj) raise ValueError( diff --git a/okta/models/enrollment_policy_authenticator_grace_period.py b/okta/models/enrollment_policy_authenticator_grace_period.py index dbfadbf9..f15ff4d4 100644 --- a/okta/models/enrollment_policy_authenticator_grace_period.py +++ b/okta/models/enrollment_policy_authenticator_grace_period.py @@ -125,6 +125,9 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "ByDateTimeAuthenticatorGracePeriodExpiry": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.ByDateTimeAuthenticatorGracePeriodExpiry.from_dict(obj) raise ValueError( diff --git a/okta/models/inline_hook_channel.py b/okta/models/inline_hook_channel.py index 63494479..974c6793 100644 --- a/okta/models/inline_hook_channel.py +++ b/okta/models/inline_hook_channel.py @@ -120,8 +120,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "InlineHookChannelHttp": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.InlineHookChannelHttp.from_dict(obj) if object_type == "InlineHookChannelOAuth": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.InlineHookChannelOAuth.from_dict(obj) raise ValueError( diff --git a/okta/models/inline_hook_channel_create.py b/okta/models/inline_hook_channel_create.py index 3733edd0..584f1632 100644 --- a/okta/models/inline_hook_channel_create.py +++ b/okta/models/inline_hook_channel_create.py @@ -122,8 +122,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "InlineHookChannelHttpCreate": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.InlineHookChannelHttpCreate.from_dict(obj) if object_type == "InlineHookChannelOAuthCreate": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.InlineHookChannelOAuthCreate.from_dict(obj) raise ValueError( diff --git a/okta/models/log_stream.py b/okta/models/log_stream.py index a46508aa..3c31a514 100644 --- a/okta/models/log_stream.py +++ b/okta/models/log_stream.py @@ -162,8 +162,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "LogStreamAws": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.LogStreamAws.from_dict(obj) if object_type == "LogStreamSplunk": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.LogStreamSplunk.from_dict(obj) raise ValueError( diff --git a/okta/models/log_stream_put_schema.py b/okta/models/log_stream_put_schema.py index 48b4d6a8..7093deae 100644 --- a/okta/models/log_stream_put_schema.py +++ b/okta/models/log_stream_put_schema.py @@ -117,8 +117,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "LogStreamAwsPutSchema": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.LogStreamAwsPutSchema.from_dict(obj) if object_type == "LogStreamSplunkPutSchema": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.LogStreamSplunkPutSchema.from_dict(obj) raise ValueError( diff --git a/okta/models/network_zone.py b/okta/models/network_zone.py index c89a60f7..d05a1810 100644 --- a/okta/models/network_zone.py +++ b/okta/models/network_zone.py @@ -175,10 +175,19 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "DynamicNetworkZone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DynamicNetworkZone.from_dict(obj) if object_type == "EnhancedDynamicNetworkZone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.EnhancedDynamicNetworkZone.from_dict(obj) if object_type == "IPNetworkZone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.IPNetworkZone.from_dict(obj) raise ValueError( diff --git a/okta/models/o_auth2_client_json_signing_key_response.py b/okta/models/o_auth2_client_json_signing_key_response.py index 7ed1965c..f5b939eb 100644 --- a/okta/models/o_auth2_client_json_signing_key_response.py +++ b/okta/models/o_auth2_client_json_signing_key_response.py @@ -201,8 +201,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "OAuth2ClientJsonWebKeyECResponse": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.OAuth2ClientJsonWebKeyECResponse.from_dict(obj) if object_type == "OAuth2ClientJsonWebKeyRsaResponse": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.OAuth2ClientJsonWebKeyRsaResponse.from_dict(obj) raise ValueError( diff --git a/okta/models/policy.py b/okta/models/policy.py index e255f003..dc508702 100644 --- a/okta/models/policy.py +++ b/okta/models/policy.py @@ -212,22 +212,49 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AccessPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AccessPolicy.from_dict(obj) if object_type == "DeviceSignalCollectionPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceSignalCollectionPolicy.from_dict(obj) if object_type == "EntityRiskPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.EntityRiskPolicy.from_dict(obj) if object_type == "IdpDiscoveryPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.IdpDiscoveryPolicy.from_dict(obj) if object_type == "AuthenticatorEnrollmentPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorEnrollmentPolicy.from_dict(obj) if object_type == "OktaSignOnPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.OktaSignOnPolicy.from_dict(obj) if object_type == "PasswordPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PasswordPolicy.from_dict(obj) if object_type == "PostAuthSessionPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PostAuthSessionPolicy.from_dict(obj) if object_type == "ProfileEnrollmentPolicy": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.ProfileEnrollmentPolicy.from_dict(obj) raise ValueError( diff --git a/okta/models/policy_rule.py b/okta/models/policy_rule.py index 38a6f0ae..5a208a1e 100644 --- a/okta/models/policy_rule.py +++ b/okta/models/policy_rule.py @@ -218,22 +218,49 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AccessPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AccessPolicyRule.from_dict(obj) if object_type == "DeviceSignalCollectionPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.DeviceSignalCollectionPolicyRule.from_dict(obj) if object_type == "EntityRiskPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.EntityRiskPolicyRule.from_dict(obj) if object_type == "IdpDiscoveryPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.IdpDiscoveryPolicyRule.from_dict(obj) if object_type == "AuthenticatorEnrollmentPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticatorEnrollmentPolicyRule.from_dict(obj) if object_type == "PasswordPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PasswordPolicyRule.from_dict(obj) if object_type == "PostAuthSessionPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PostAuthSessionPolicyRule.from_dict(obj) if object_type == "ProfileEnrollmentPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.ProfileEnrollmentPolicyRule.from_dict(obj) if object_type == "OktaSignOnPolicyRule": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.OktaSignOnPolicyRule.from_dict(obj) raise ValueError( diff --git a/okta/models/privileged_resource.py b/okta/models/privileged_resource.py index cf7517fb..65cca4e2 100644 --- a/okta/models/privileged_resource.py +++ b/okta/models/privileged_resource.py @@ -173,10 +173,19 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "PrivilegedResourceAccountAppRequest": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PrivilegedResourceAccountAppRequest.from_dict(obj) if object_type == "PrivilegedResourceAccountOkta": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PrivilegedResourceAccountOkta.from_dict(obj) if object_type == "PrivilegedResourceAccountAppResponse": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.PrivilegedResourceAccountAppResponse.from_dict(obj) raise ValueError( diff --git a/okta/models/push_provider.py b/okta/models/push_provider.py index 47d18dd0..01d53612 100644 --- a/okta/models/push_provider.py +++ b/okta/models/push_provider.py @@ -149,8 +149,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "APNSPushProvider": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.APNSPushProvider.from_dict(obj) if object_type == "FCMPushProvider": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.FCMPushProvider.from_dict(obj) raise ValueError( diff --git a/okta/models/registration_inline_hook_request.py b/okta/models/registration_inline_hook_request.py index bf7ee18a..365054b3 100644 --- a/okta/models/registration_inline_hook_request.py +++ b/okta/models/registration_inline_hook_request.py @@ -132,8 +132,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "RegistrationInlineHookPPData": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.RegistrationInlineHookPPData.from_dict(obj) if object_type == "RegistrationInlineHookSSRData": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.RegistrationInlineHookSSRData.from_dict(obj) raise ValueError( diff --git a/okta/models/service_account.py b/okta/models/service_account.py index 960ff0b8..1a5cd48d 100644 --- a/okta/models/service_account.py +++ b/okta/models/service_account.py @@ -206,8 +206,14 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "ServiceAccountDetailsAppAccount": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.ServiceAccountDetailsAppAccount.from_dict(obj) if object_type == "ServiceAccountDetailsOktaUserAccount": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.ServiceAccountDetailsOktaUserAccount.from_dict(obj) raise ValueError( diff --git a/okta/models/user_factor.py b/okta/models/user_factor.py index 5784c833..05911c07 100644 --- a/okta/models/user_factor.py +++ b/okta/models/user_factor.py @@ -223,28 +223,64 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "UserFactorCall": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorCall.from_dict(obj) if object_type == "UserFactorEmail": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorEmail.from_dict(obj) if object_type == "UserFactorPush": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPush.from_dict(obj) if object_type == "UserFactorSecurityQuestion": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorSecurityQuestion.from_dict(obj) if object_type == "UserFactorSMS": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorSMS.from_dict(obj) if object_type == "UserFactorToken": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorToken.from_dict(obj) if object_type == "UserFactorTokenHardware": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorTokenHardware.from_dict(obj) if object_type == "UserFactorTokenHOTP": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorTokenHOTP.from_dict(obj) if object_type == "UserFactorTokenSoftwareTOTP": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorTokenSoftwareTOTP.from_dict(obj) if object_type == "UserFactorU2F": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorU2F.from_dict(obj) if object_type == "UserFactorWeb": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorWeb.from_dict(obj) if object_type == "UserFactorWebAuthn": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorWebAuthn.from_dict(obj) raise ValueError( diff --git a/okta/models/user_factor_push_transaction.py b/okta/models/user_factor_push_transaction.py index f593a625..c5172c7a 100644 --- a/okta/models/user_factor_push_transaction.py +++ b/okta/models/user_factor_push_transaction.py @@ -165,14 +165,29 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "UserFactorPushTransactionRejected": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPushTransactionRejected.from_dict(obj) if object_type == "UserFactorPushTransaction": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPushTransaction.from_dict(obj) if object_type == "UserFactorPushTransactionTimeout": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPushTransactionTimeout.from_dict(obj) if object_type == "UserFactorPushTransactionWaitingNoNMC": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPushTransactionWaitingNoNMC.from_dict(obj) if object_type == "UserFactorPushTransactionWaitingNMC": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserFactorPushTransactionWaitingNMC.from_dict(obj) raise ValueError( diff --git a/okta/models/user_risk_get_response.py b/okta/models/user_risk_get_response.py index 3c5bb7b4..58c87f78 100644 --- a/okta/models/user_risk_get_response.py +++ b/okta/models/user_risk_get_response.py @@ -137,12 +137,24 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[ # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "UserRiskLevelExists": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserRiskLevelExists.from_dict(obj) if object_type == "UserRiskLevelExists": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserRiskLevelExists.from_dict(obj) if object_type == "UserRiskLevelExists": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserRiskLevelExists.from_dict(obj) if object_type == "UserRiskLevelNone": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.UserRiskLevelNone.from_dict(obj) raise ValueError( diff --git a/okta/models/validation_detail_provider.py b/okta/models/validation_detail_provider.py index d6f536c0..9ebbac15 100644 --- a/okta/models/validation_detail_provider.py +++ b/okta/models/validation_detail_provider.py @@ -120,6 +120,9 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "WorkflowsValidationDetailProvider": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.WorkflowsValidationDetailProvider.from_dict(obj) raise ValueError( diff --git a/okta/models/verification_method.py b/okta/models/verification_method.py index 3319c4bc..d5e8edcb 100644 --- a/okta/models/verification_method.py +++ b/okta/models/verification_method.py @@ -126,10 +126,19 @@ def from_dict( # Import from okta.models to ensure class identity consistency with lazy imports models = import_module("okta.models") if object_type == "AssuranceMethod": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AssuranceMethod.from_dict(obj) if object_type == "AuthenticationMethodChainMethod": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.AuthenticationMethodChainMethod.from_dict(obj) if object_type == "IdProofingMethod": + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.IdProofingMethod.from_dict(obj) raise ValueError( diff --git a/openapi/api.yaml b/openapi/api.yaml index 5170fdd7..57396744 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -59271,6 +59271,7 @@ components: SAML_2_0: '#/components/schemas/SamlApplication' SECURE_PASSWORD_STORE: '#/components/schemas/SecurePasswordStoreApplication' WS_FEDERATION: '#/components/schemas/WsFederationApplication' + MFA_AS_SERVICE: '#/components/schemas/Application' ApplicationAccessibility: description: Specifies access settings for the app type: object @@ -59733,6 +59734,7 @@ components: | SAML_2_0 | Federated Authentication with SAML 2.0 WebSSO | | SECURE_PASSWORD_STORE | Secure Web Authentication (SWA) with POST (plugin not required) | | WS_FEDERATION | Federated Authentication with WS-Federation Passive Requestor Profile | + | MFA_AS_SERVICE | Application to use Okta's MFA as a service for RDP | Select the `signOnMode` for your custom app: type: string @@ -59746,6 +59748,7 @@ components: - SAML_2_0 - SECURE_PASSWORD_STORE - WS_FEDERATION + - MFA_AS_SERVICE ApplicationType: description: 'The type of client application. Default value: `web`.' type: string diff --git a/openapi/templates/model_generic.mustache b/openapi/templates/model_generic.mustache index 030448d6..68fc3743 100644 --- a/openapi/templates/model_generic.mustache +++ b/openapi/templates/model_generic.mustache @@ -259,6 +259,9 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} models = import_module("{{packageName}}.models") {{#mappedModels}} if object_type == '{{{modelName}}}': + # Check if the discriminator maps to the same class to avoid infinite recursion + if object_type == cls.__name__: + return cls.model_validate(obj) return models.{{modelName}}.from_dict(obj) {{/mappedModels}}