From 7ac607cf0df15f1dd13fff72d49df2088d746ff8 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Tue, 29 Apr 2025 11:00:27 +0530 Subject: [PATCH 1/7] fix: updated dependencies to latest version --- onelogin/api/api_auth_claims_api.py | 18 +++--- onelogin/api/api_auth_client_apps_api.py | 18 +++--- onelogin/api/api_auth_scopes_api.py | 18 +++--- onelogin/api/api_authorization_server_api.py | 22 +++---- onelogin/api/app_rules_api.py | 46 +++++++------- onelogin/api/apps_api.py | 34 +++++----- onelogin/api/branding_service_api.py | 26 ++++---- onelogin/api/branding_service_smtp_api.py | 14 ++--- .../api/branding_service_templates_api.py | 34 +++++----- onelogin/api/events_api.py | 14 ++--- onelogin/api/groups_api.py | 10 +-- onelogin/api/invite_links_api.py | 10 +-- .../api/multi_factor_authentication_api.py | 42 ++++++------- .../api/multi_factor_authentication_v1_api.py | 30 ++++----- onelogin/api/o_auth2_api.py | 14 ++--- onelogin/api/privileges_api.py | 46 +++++++------- onelogin/api/roles_api.py | 62 +++++++++---------- onelogin/api/saml_assertions_api.py | 18 +++--- onelogin/api/smart_hooks_api.py | 46 +++++++------- onelogin/api/user_mappings_api.py | 46 +++++++------- onelogin/api/users_v1_api.py | 62 +++++++++---------- onelogin/api/users_v2_api.py | 26 ++++---- onelogin/api/vigilance_ai_api.py | 34 +++++----- onelogin/models/action_obj.py | 11 ++-- .../models/activate_mfa_factors_request.py | 10 +-- onelogin/models/add_client_app201_response.py | 10 +-- onelogin/models/add_client_app_request.py | 10 +-- .../add_privilege_to_role201_response.py | 10 +-- .../models/add_privilege_to_role_request.py | 10 +-- onelogin/models/add_roles_to_user_request.py | 10 +-- onelogin/models/alt_err.py | 10 +-- onelogin/models/app_parameters.py | 12 ++-- onelogin/models/app_rule.py | 15 +++-- .../assign_users_to_privilege_request.py | 10 +-- onelogin/models/auth_claim.py | 10 +-- onelogin/models/auth_id.py | 10 +-- onelogin/models/auth_scope.py | 10 +-- onelogin/models/auth_server.py | 10 +-- onelogin/models/auth_server_configuration.py | 10 +-- onelogin/models/brand.py | 10 +-- onelogin/models/brand_app.py | 10 +-- onelogin/models/brand_background.py | 10 +-- onelogin/models/brand_background_urls.py | 10 +-- onelogin/models/brand_logo.py | 10 +-- onelogin/models/brand_logo_urls.py | 10 +-- onelogin/models/brand_req.py | 10 +-- onelogin/models/client_app_full.py | 10 +-- onelogin/models/clock_counter.py | 10 +-- onelogin/models/condition.py | 10 +-- onelogin/models/configuration_oidc.py | 18 +++--- onelogin/models/configuration_saml.py | 10 +-- onelogin/models/connector.py | 10 +-- onelogin/models/create_app200_response.py | 17 ++--- onelogin/models/create_app_request.py | 15 +++-- .../create_device_verification201_response.py | 10 +-- .../create_device_verification_request.py | 10 +-- .../create_factor_registration201_response.py | 10 +-- .../create_factor_registration_request.py | 10 +-- .../models/create_privilege200_response.py | 9 ++- .../models/create_role201_response_inner.py | 10 +-- onelogin/models/device.py | 10 +-- onelogin/models/email_config.py | 10 +-- onelogin/models/enforcement_point.py | 15 +++-- .../enforcement_point_resources_inner.py | 15 +++-- .../models/enroll_mfa_factor200_response.py | 10 +-- onelogin/models/error.py | 10 +-- onelogin/models/event.py | 15 +++-- .../models/generate_mf_atoken200_response.py | 10 +-- onelogin/models/generate_mf_atoken_request.py | 10 +-- onelogin/models/generate_otp201_response.py | 10 +-- onelogin/models/generate_otp_request.py | 10 +-- .../generate_saml_assert200_response.py | 10 +-- onelogin/models/generate_token_request.py | 10 +-- onelogin/models/generic_app.py | 12 ++-- onelogin/models/generic_app_provisioning.py | 10 +-- .../models/get_assigned_user200_response.py | 10 +-- .../models/get_auth_factors200_response.py | 10 +-- ...uthentication_devices200_response_inner.py | 10 +-- .../get_custom_attributes200_response.py | 10 +-- .../models/get_email_settings200_response.py | 15 +++-- .../get_email_settings200_response_one_of.py | 10 +-- .../get_enrolled_factors200_response.py | 10 +-- .../get_enrolled_factors200_response_data.py | 10 +-- ...tors200_response_data_otp_devices_inner.py | 10 +-- .../models/get_event_by_id200_response.py | 10 +-- .../models/get_event_types200_response.py | 10 +-- .../get_event_types200_response_data_inner.py | 10 +-- onelogin/models/get_events200_response.py | 10 +-- .../get_events200_response_pagination.py | 10 +-- onelogin/models/get_groups200_response.py | 10 +-- .../models/get_invite_link200_response.py | 10 +-- onelogin/models/get_invite_link_request.py | 10 +-- .../models/get_mfa_factors200_response.py | 10 +-- .../get_mfa_factors200_response_data.py | 10 +-- ...ors200_response_data_auth_factors_inner.py | 10 +-- onelogin/models/get_rate_limit200_response.py | 10 +-- onelogin/models/get_risk_score200_response.py | 10 +-- onelogin/models/get_risk_score_request.py | 10 +-- .../models/get_risk_scores200_response.py | 10 +-- .../get_risk_scores200_response_scores.py | 10 +-- .../models/get_role_apps200_response_inner.py | 10 +-- onelogin/models/get_role_by_id200_response.py | 10 +-- .../get_role_by_id200_response_data_inner.py | 10 +-- .../models/get_role_by_name200_response.py | 10 +-- ...get_role_by_name200_response_data_inner.py | 10 +-- ...get_role_by_name200_response_pagination.py | 10 +-- .../models/get_user_apps200_response_inner.py | 18 +++--- onelogin/models/get_user_roles200_response.py | 10 +-- .../get_user_verification200_response.py | 10 +-- onelogin/models/group.py | 10 +-- onelogin/models/hook.py | 15 +++-- onelogin/models/hook_envvar.py | 10 +-- onelogin/models/hook_log.py | 10 +-- onelogin/models/hook_options.py | 10 +-- onelogin/models/hook_status.py | 10 +-- .../list_conditions200_response_inner.py | 10 +-- ...mapping_action_values200_response_inner.py | 10 +-- .../list_mapping_conditions200_response.py | 10 +-- ..._conditions_operators200_response_inner.py | 10 +-- ...apping_contion_values200_response_inner.py | 10 +-- ...list_mappings_actions200_response_inner.py | 10 +-- ...ist_message_templates200_response_inner.py | 10 +-- .../list_privelege_roles200_response.py | 9 ++- .../list_privilege_roles200_response.py | 10 +-- onelogin/models/locale.py | 10 +-- onelogin/models/lock_account_user_request.py | 10 +-- onelogin/models/mapping.py | 15 +++-- onelogin/models/message_template.py | 18 +++--- onelogin/models/message_template_template.py | 17 ++--- .../message_template_template_one_of.py | 10 +-- .../message_template_template_one_of1.py | 10 +-- onelogin/models/oauth_token.py | 10 +-- onelogin/models/oidc_app.py | 10 +-- onelogin/models/oidc_app_all_of.py | 10 +-- onelogin/models/otp_device.py | 10 +-- onelogin/models/privilege.py | 10 +-- onelogin/models/privilege_privilege.py | 10 +-- .../privilege_privilege_statement_inner.py | 15 +++-- onelogin/models/rate_limit.py | 10 +-- onelogin/models/remove_role_users_request.py | 10 +-- onelogin/models/remove_user_role_request.py | 10 +-- ...e_user_role_request_role_id_array_inner.py | 10 +-- onelogin/models/request_brand.py | 10 +-- onelogin/models/revoke_tokens_request.py | 10 +-- onelogin/models/risk_device.py | 10 +-- onelogin/models/risk_rule.py | 18 +++--- onelogin/models/risk_user.py | 10 +-- onelogin/models/role.py | 10 +-- onelogin/models/rule_action.py | 10 +-- onelogin/models/rule_condition.py | 10 +-- onelogin/models/saml_app.py | 10 +-- onelogin/models/saml_app_all_of.py | 10 +-- onelogin/models/saml_app_all_of_parameters.py | 10 +-- ...aml_app_all_of_parameters_saml_username.py | 10 +-- onelogin/models/saml_assert.py | 10 +-- onelogin/models/saml_factor.py | 10 +-- onelogin/models/scope.py | 10 +-- .../models/send_invite_link200_response.py | 10 +-- onelogin/models/send_invite_link_request.py | 10 +-- onelogin/models/session.py | 10 +-- onelogin/models/set_user_state_request.py | 15 +++-- onelogin/models/source.py | 10 +-- onelogin/models/sso_oidc.py | 10 +-- onelogin/models/sso_saml.py | 10 +-- onelogin/models/sso_saml_certificate.py | 10 +-- onelogin/models/token_claim.py | 10 +-- onelogin/models/track_risk_event_request.py | 10 +-- onelogin/models/update_client_app_request.py | 10 +-- .../update_environment_variable_request.py | 10 +-- .../update_password_insecure_request.py | 10 +-- .../models/update_password_secure_request.py | 10 +-- .../models/update_privilege200_response.py | 10 +-- onelogin/models/update_risk_rule_request.py | 10 +-- onelogin/models/update_role200_response.py | 10 +-- onelogin/models/user.py | 18 +++--- .../models/ver_factor_saml200_response.py | 10 +-- onelogin/models/verify_mfa_factor_request.py | 10 +-- .../verify_user_registration200_response.py | 10 +-- .../verify_user_registration_request.py | 10 +-- .../verify_user_verification_request.py | 10 +-- sample_script.py | 11 ++-- 181 files changed, 1359 insertions(+), 1019 deletions(-) diff --git a/onelogin/api/api_auth_claims_api.py b/onelogin/api/api_auth_claims_api.py index 07788b78..a84805d3 100644 --- a/onelogin/api/api_auth_claims_api.py +++ b/onelogin/api/api_auth_claims_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictInt, StrictStr @@ -47,7 +47,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_auth_claim(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_claim : Optional[AuthClaim] = None, **kwargs) -> int: # noqa: E501 """Create Api Auth Server Claim # noqa: E501 @@ -80,7 +80,7 @@ def create_auth_claim(self, api_auth_id : StrictStr, content_type : Optional[Str raise ValueError("Error! Please call the create_auth_claim_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_auth_claim_with_http_info(api_auth_id, content_type, auth_claim, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_auth_claim_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_claim : Optional[AuthClaim] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Api Auth Server Claim # noqa: E501 @@ -212,7 +212,7 @@ def create_auth_claim_with_http_info(self, api_auth_id : StrictStr, content_type collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_auth_claim(self, api_auth_id : StrictStr, claim_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> None: # noqa: E501 """Delete Api Auth Server Claim # noqa: E501 @@ -245,7 +245,7 @@ def delete_auth_claim(self, api_auth_id : StrictStr, claim_id : StrictInt, conte raise ValueError("Error! Please call the delete_auth_claim_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_auth_claim_with_http_info(api_auth_id, claim_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_auth_claim_with_http_info(self, api_auth_id : StrictStr, claim_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Api Auth Server Claim # noqa: E501 @@ -365,7 +365,7 @@ def delete_auth_claim_with_http_info(self, api_auth_id : StrictStr, claim_id : S collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_authclaims(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> List[TokenClaim]: # noqa: E501 """Get Api Auth Server claims # noqa: E501 @@ -396,7 +396,7 @@ def get_authclaims(self, api_auth_id : StrictStr, content_type : Optional[Strict raise ValueError("Error! Please call the get_authclaims_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_authclaims_with_http_info(api_auth_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_authclaims_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Api Auth Server claims # noqa: E501 @@ -514,7 +514,7 @@ def get_authclaims_with_http_info(self, api_auth_id : StrictStr, content_type : collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_claim(self, api_auth_id : StrictStr, claim_id : StrictInt, content_type : Optional[StrictStr] = None, auth_claim : Optional[AuthClaim] = None, **kwargs) -> AuthId: # noqa: E501 """Update Api Auth Server Claim # noqa: E501 @@ -549,7 +549,7 @@ def update_claim(self, api_auth_id : StrictStr, claim_id : StrictInt, content_ty raise ValueError("Error! Please call the update_claim_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_claim_with_http_info(api_auth_id, claim_id, content_type, auth_claim, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_claim_with_http_info(self, api_auth_id : StrictStr, claim_id : StrictInt, content_type : Optional[StrictStr] = None, auth_claim : Optional[AuthClaim] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Api Auth Server Claim # noqa: E501 diff --git a/onelogin/api/api_auth_client_apps_api.py b/onelogin/api/api_auth_client_apps_api.py index 4d7039c3..8a6059e8 100644 --- a/onelogin/api/api_auth_client_apps_api.py +++ b/onelogin/api/api_auth_client_apps_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictInt, StrictStr @@ -48,7 +48,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def add_client_app(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, add_client_app_request : Optional[AddClientAppRequest] = None, **kwargs) -> AddClientApp201Response: # noqa: E501 """Add Client App # noqa: E501 @@ -81,7 +81,7 @@ def add_client_app(self, api_auth_id : StrictStr, content_type : Optional[Strict raise ValueError("Error! Please call the add_client_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.add_client_app_with_http_info(api_auth_id, content_type, add_client_app_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def add_client_app_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, add_client_app_request : Optional[AddClientAppRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Add Client App # noqa: E501 @@ -213,7 +213,7 @@ def add_client_app_with_http_info(self, api_auth_id : StrictStr, content_type : collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_client_app(self, api_auth_id : StrictStr, client_app_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> AddClientApp201Response: # noqa: E501 """Remove Client App # noqa: E501 @@ -246,7 +246,7 @@ def delete_client_app(self, api_auth_id : StrictStr, client_app_id : StrictInt, raise ValueError("Error! Please call the delete_client_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_client_app_with_http_info(api_auth_id, client_app_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_client_app_with_http_info(self, api_auth_id : StrictStr, client_app_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Remove Client App # noqa: E501 @@ -371,7 +371,7 @@ def delete_client_app_with_http_info(self, api_auth_id : StrictStr, client_app_i collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_client_apps(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ClientAppFull: # noqa: E501 """List Clients Apps # noqa: E501 @@ -402,7 +402,7 @@ def list_client_apps(self, api_auth_id : StrictStr, content_type : Optional[Stri raise ValueError("Error! Please call the list_client_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_client_apps_with_http_info(api_auth_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_client_apps_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Clients Apps # noqa: E501 @@ -520,7 +520,7 @@ def list_client_apps_with_http_info(self, api_auth_id : StrictStr, content_type collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_client_app(self, api_auth_id : StrictStr, client_app_id : StrictInt, content_type : Optional[StrictStr] = None, update_client_app_request : Optional[UpdateClientAppRequest] = None, **kwargs) -> AddClientApp201Response: # noqa: E501 """Update Client App # noqa: E501 @@ -555,7 +555,7 @@ def update_client_app(self, api_auth_id : StrictStr, client_app_id : StrictInt, raise ValueError("Error! Please call the update_client_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_client_app_with_http_info(api_auth_id, client_app_id, content_type, update_client_app_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_client_app_with_http_info(self, api_auth_id : StrictStr, client_app_id : StrictInt, content_type : Optional[StrictStr] = None, update_client_app_request : Optional[UpdateClientAppRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Client App # noqa: E501 diff --git a/onelogin/api/api_auth_scopes_api.py b/onelogin/api/api_auth_scopes_api.py index a9d499da..74a94e71 100644 --- a/onelogin/api/api_auth_scopes_api.py +++ b/onelogin/api/api_auth_scopes_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictInt, StrictStr @@ -46,7 +46,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_scope(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_scope : Optional[AuthScope] = None, **kwargs) -> AuthScope: # noqa: E501 """Create Api Auth Server Scope # noqa: E501 @@ -79,7 +79,7 @@ def create_scope(self, api_auth_id : StrictStr, content_type : Optional[StrictSt raise ValueError("Error! Please call the create_scope_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_scope_with_http_info(api_auth_id, content_type, auth_scope, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_scope_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_scope : Optional[AuthScope] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Api Auth Server Scope # noqa: E501 @@ -211,7 +211,7 @@ def create_scope_with_http_info(self, api_auth_id : StrictStr, content_type : Op collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_scope(self, api_auth_id : StrictStr, scope_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> None: # noqa: E501 """Delete Api Auth Server Scope # noqa: E501 @@ -244,7 +244,7 @@ def delete_scope(self, api_auth_id : StrictStr, scope_id : StrictInt, content_ty raise ValueError("Error! Please call the delete_scope_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_scope_with_http_info(api_auth_id, scope_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_scope_with_http_info(self, api_auth_id : StrictStr, scope_id : StrictInt, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Api Auth Server Scope # noqa: E501 @@ -364,7 +364,7 @@ def delete_scope_with_http_info(self, api_auth_id : StrictStr, scope_id : Strict collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_scopes(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> List[AuthScope]: # noqa: E501 """Get Api Auth Server Scopes # noqa: E501 @@ -395,7 +395,7 @@ def get_scopes(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] raise ValueError("Error! Please call the get_scopes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_scopes_with_http_info(api_auth_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_scopes_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Api Auth Server Scopes # noqa: E501 @@ -512,7 +512,7 @@ def get_scopes_with_http_info(self, api_auth_id : StrictStr, content_type : Opti collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_scope(self, api_auth_id : StrictStr, scope_id : StrictInt, content_type : Optional[StrictStr] = None, auth_scope : Optional[AuthScope] = None, **kwargs) -> AuthId: # noqa: E501 """Update Api Auth Server Scope # noqa: E501 @@ -547,7 +547,7 @@ def update_scope(self, api_auth_id : StrictStr, scope_id : StrictInt, content_ty raise ValueError("Error! Please call the update_scope_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_scope_with_http_info(api_auth_id, scope_id, content_type, auth_scope, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_scope_with_http_info(self, api_auth_id : StrictStr, scope_id : StrictInt, content_type : Optional[StrictStr] = None, auth_scope : Optional[AuthScope] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Api Auth Server Scope # noqa: E501 diff --git a/onelogin/api/api_authorization_server_api.py b/onelogin/api/api_authorization_server_api.py index a5c7d976..22682230 100644 --- a/onelogin/api/api_authorization_server_api.py +++ b/onelogin/api/api_authorization_server_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictStr @@ -45,7 +45,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_auth_server(self, content_type : Optional[StrictStr] = None, auth_server : Optional[AuthServer] = None, **kwargs) -> AuthServer: # noqa: E501 """Create Api Auth Server # noqa: E501 @@ -76,7 +76,7 @@ def create_auth_server(self, content_type : Optional[StrictStr] = None, auth_ser raise ValueError("Error! Please call the create_auth_server_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_auth_server_with_http_info(content_type, auth_server, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_auth_server_with_http_info(self, content_type : Optional[StrictStr] = None, auth_server : Optional[AuthServer] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Api Auth Server # noqa: E501 @@ -201,7 +201,7 @@ def create_auth_server_with_http_info(self, content_type : Optional[StrictStr] = collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_auth_server(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> None: # noqa: E501 """Delete Api Auth Server # noqa: E501 @@ -232,7 +232,7 @@ def delete_auth_server(self, api_auth_id : StrictStr, content_type : Optional[St raise ValueError("Error! Please call the delete_auth_server_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_auth_server_with_http_info(api_auth_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_auth_server_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Delete Api Auth Server # noqa: E501 @@ -346,7 +346,7 @@ def delete_auth_server_with_http_info(self, api_auth_id : StrictStr, content_typ collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_auth_server(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> AuthServer: # noqa: E501 """Get Api Auth Server # noqa: E501 @@ -377,7 +377,7 @@ def get_auth_server(self, api_auth_id : StrictStr, content_type : Optional[Stric raise ValueError("Error! Please call the get_auth_server_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_auth_server_with_http_info(api_auth_id, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_auth_server_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Api Auth Server # noqa: E501 @@ -494,7 +494,7 @@ def get_auth_server_with_http_info(self, api_auth_id : StrictStr, content_type : collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_auth_servers(self, **kwargs) -> List[AuthServer]: # noqa: E501 """List Api Auth Servers # noqa: E501 @@ -521,7 +521,7 @@ def list_auth_servers(self, **kwargs) -> List[AuthServer]: # noqa: E501 raise ValueError("Error! Please call the list_auth_servers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_auth_servers_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_auth_servers_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Api Auth Servers # noqa: E501 @@ -626,7 +626,7 @@ def list_auth_servers_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E5 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_auth_server(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_server : Optional[AuthServer] = None, **kwargs) -> AuthServer: # noqa: E501 """Update Api Auth Server # noqa: E501 @@ -659,7 +659,7 @@ def update_auth_server(self, api_auth_id : StrictStr, content_type : Optional[St raise ValueError("Error! Please call the update_auth_server_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_auth_server_with_http_info(api_auth_id, content_type, auth_server, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_auth_server_with_http_info(self, api_auth_id : StrictStr, content_type : Optional[StrictStr] = None, auth_server : Optional[AuthServer] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Api Auth Server # noqa: E501 diff --git a/onelogin/api/app_rules_api.py b/onelogin/api/app_rules_api.py index 2a737acb..9d86b7dd 100644 --- a/onelogin/api/app_rules_api.py +++ b/onelogin/api/app_rules_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, conlist @@ -48,7 +48,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_app_rule(self, app_id : StrictInt, app_rule : Optional[AppRule] = None, **kwargs) -> AppRule: # noqa: E501 """create_app_rule # noqa: E501 @@ -79,7 +79,7 @@ def create_app_rule(self, app_id : StrictInt, app_rule : Optional[AppRule] = Non raise ValueError("Error! Please call the create_app_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_app_rule_with_http_info(app_id, app_rule, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_app_rule_with_http_info(self, app_id : StrictInt, app_rule : Optional[AppRule] = None, **kwargs) -> ApiResponse: # noqa: E501 """create_app_rule # noqa: E501 @@ -204,7 +204,7 @@ def create_app_rule_with_http_info(self, app_id : StrictInt, app_rule : Optional collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_rule(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> None: # noqa: E501 """Delete Rule # noqa: E501 @@ -235,7 +235,7 @@ def delete_rule(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> None raise ValueError("Error! Please call the delete_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_rule_with_http_info(app_id, rule_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_rule_with_http_info(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Delete Rule # noqa: E501 @@ -349,7 +349,7 @@ def delete_rule_with_http_info(self, app_id : StrictInt, rule_id : StrictStr, ** collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_app_rule(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> AppRule: # noqa: E501 """Get Rule # noqa: E501 @@ -380,7 +380,7 @@ def get_app_rule(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> App raise ValueError("Error! Please call the get_app_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_app_rule_with_http_info(app_id, rule_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_app_rule_with_http_info(self, app_id : StrictInt, rule_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Get Rule # noqa: E501 @@ -498,7 +498,7 @@ def get_app_rule_with_http_info(self, app_id : StrictInt, rule_id : StrictStr, * collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_action_valies(self, app_id : StrictInt, rule_action_value : StrictStr, **kwargs) -> List[RuleAction]: # noqa: E501 """List Actions Values # noqa: E501 @@ -529,7 +529,7 @@ def list_action_valies(self, app_id : StrictInt, rule_action_value : StrictStr, raise ValueError("Error! Please call the list_action_valies_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_action_valies_with_http_info(app_id, rule_action_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_action_valies_with_http_info(self, app_id : StrictInt, rule_action_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Actions Values # noqa: E501 @@ -646,7 +646,7 @@ def list_action_valies_with_http_info(self, app_id : StrictInt, rule_action_valu collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_actions(self, app_id : StrictInt, **kwargs) -> List[RuleAction]: # noqa: E501 """List Actions # noqa: E501 @@ -675,7 +675,7 @@ def list_actions(self, app_id : StrictInt, **kwargs) -> List[RuleAction]: # noq raise ValueError("Error! Please call the list_actions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_actions_with_http_info(app_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_actions_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """List Actions # noqa: E501 @@ -786,7 +786,7 @@ def list_actions_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiRespon collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_app_rules(self, app_id : StrictInt, has_condition : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_condition_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_action : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Actions. Values formatted as :, where name is the Action to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_action=set_licenses:123456 Multiple filters. has_action=set_groups:123456,set_usertype:* Wildcard for actions. has_action=*:123456 Wildcard for action values. has_action=set_userprincipalname:*")] = None, has_action_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their action types. Allowed values are: builtin - actions that involve standard attributes custom - actions that involve custom attributes none - no actions are defined For example: Find Rules with no actions has_action_type=none")] = None, enabled : Annotated[Optional[StrictBool], Field(description="Defaults to true. When set to `false` will return all disabled mappings.")] = None, **kwargs) -> List[AppRule]: # noqa: E501 """List Rules # noqa: E501 @@ -825,7 +825,7 @@ def list_app_rules(self, app_id : StrictInt, has_condition : Annotated[Optional[ raise ValueError("Error! Please call the list_app_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_app_rules_with_http_info(app_id, has_condition, has_condition_type, has_action, has_action_type, enabled, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_app_rules_with_http_info(self, app_id : StrictInt, has_condition : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_condition_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_action : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Actions. Values formatted as :, where name is the Action to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_action=set_licenses:123456 Multiple filters. has_action=set_groups:123456,set_usertype:* Wildcard for actions. has_action=*:123456 Wildcard for action values. has_action=set_userprincipalname:*")] = None, has_action_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their action types. Allowed values are: builtin - actions that involve standard attributes custom - actions that involve custom attributes none - no actions are defined For example: Find Rules with no actions has_action_type=none")] = None, enabled : Annotated[Optional[StrictBool], Field(description="Defaults to true. When set to `false` will return all disabled mappings.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Rules # noqa: E501 @@ -966,7 +966,7 @@ def list_app_rules_with_http_info(self, app_id : StrictInt, has_condition : Anno collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_condition_operators(self, app_id : StrictInt, rule_condition_value : StrictStr, **kwargs) -> List[RuleCondition]: # noqa: E501 """List Conditions Operators # noqa: E501 @@ -997,7 +997,7 @@ def list_condition_operators(self, app_id : StrictInt, rule_condition_value : St raise ValueError("Error! Please call the list_condition_operators_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_condition_operators_with_http_info(app_id, rule_condition_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_condition_operators_with_http_info(self, app_id : StrictInt, rule_condition_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions Operators # noqa: E501 @@ -1114,7 +1114,7 @@ def list_condition_operators_with_http_info(self, app_id : StrictInt, rule_condi collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_condition_values(self, app_id : StrictInt, rule_condition_value : StrictStr, **kwargs) -> RuleCondition: # noqa: E501 """List Conditions Values # noqa: E501 @@ -1145,7 +1145,7 @@ def list_condition_values(self, app_id : StrictInt, rule_condition_value : Stric raise ValueError("Error! Please call the list_condition_values_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_condition_values_with_http_info(app_id, rule_condition_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_condition_values_with_http_info(self, app_id : StrictInt, rule_condition_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions Values # noqa: E501 @@ -1262,7 +1262,7 @@ def list_condition_values_with_http_info(self, app_id : StrictInt, rule_conditio collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_conditions(self, app_id : StrictInt, **kwargs) -> List[ListConditions200ResponseInner]: # noqa: E501 """List Conditions # noqa: E501 @@ -1291,7 +1291,7 @@ def list_conditions(self, app_id : StrictInt, **kwargs) -> List[ListConditions20 raise ValueError("Error! Please call the list_conditions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_conditions_with_http_info(app_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_conditions_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions # noqa: E501 @@ -1402,7 +1402,7 @@ def list_conditions_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiRes collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def sort_app_rules(self, app_id : StrictInt, request_body : Optional[conlist(StrictInt)] = None, **kwargs) -> List[int]: # noqa: E501 """Bulk Sort # noqa: E501 @@ -1433,7 +1433,7 @@ def sort_app_rules(self, app_id : StrictInt, request_body : Optional[conlist(Str raise ValueError("Error! Please call the sort_app_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.sort_app_rules_with_http_info(app_id, request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def sort_app_rules_with_http_info(self, app_id : StrictInt, request_body : Optional[conlist(StrictInt)] = None, **kwargs) -> ApiResponse: # noqa: E501 """Bulk Sort # noqa: E501 @@ -1558,7 +1558,7 @@ def sort_app_rules_with_http_info(self, app_id : StrictInt, request_body : Optio collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_app_rule(self, app_id : StrictInt, rule_id : StrictStr, app_rule : Optional[AppRule] = None, **kwargs) -> AppRule: # noqa: E501 """Update Rule # noqa: E501 @@ -1591,7 +1591,7 @@ def update_app_rule(self, app_id : StrictInt, rule_id : StrictStr, app_rule : Op raise ValueError("Error! Please call the update_app_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_app_rule_with_http_info(app_id, rule_id, app_rule, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_app_rule_with_http_info(self, app_id : StrictInt, rule_id : StrictStr, app_rule : Optional[AppRule] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Rule # noqa: E501 diff --git a/onelogin/api/apps_api.py b/onelogin/api/apps_api.py index 28aeade5..8de14354 100644 --- a/onelogin/api/apps_api.py +++ b/onelogin/api/apps_api.py @@ -17,7 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictInt, StrictStr @@ -50,7 +50,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_app(self, content_type : Optional[StrictStr] = None, create_app_request : Optional[CreateAppRequest] = None, **kwargs) -> CreateApp200Response: # noqa: E501 """Create App # noqa: E501 @@ -81,7 +81,7 @@ def create_app(self, content_type : Optional[StrictStr] = None, create_app_reque raise ValueError("Error! Please call the create_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_app_with_http_info(content_type, create_app_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_app_with_http_info(self, content_type : Optional[StrictStr] = None, create_app_request : Optional[CreateAppRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create App # noqa: E501 @@ -206,7 +206,7 @@ def create_app_with_http_info(self, content_type : Optional[StrictStr] = None, c collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_app(self, app_id : StrictInt, **kwargs) -> None: # noqa: E501 """Delete App # noqa: E501 @@ -235,7 +235,7 @@ def delete_app(self, app_id : StrictInt, **kwargs) -> None: # noqa: E501 raise ValueError("Error! Please call the delete_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_app_with_http_info(app_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_app_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """Delete App # noqa: E501 @@ -343,7 +343,7 @@ def delete_app_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_app_parameter(self, app_id : StrictInt, parameter_id : StrictStr, **kwargs) -> None: # noqa: E501 """Delete Parameter from App # noqa: E501 @@ -374,7 +374,7 @@ def delete_app_parameter(self, app_id : StrictInt, parameter_id : StrictStr, **k raise ValueError("Error! Please call the delete_app_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_app_parameter_with_http_info(app_id, parameter_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_app_parameter_with_http_info(self, app_id : StrictInt, parameter_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Delete Parameter from App # noqa: E501 @@ -488,7 +488,7 @@ def delete_app_parameter_with_http_info(self, app_id : StrictInt, parameter_id : collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_app(self, app_id : StrictInt, **kwargs) -> GenericApp: # noqa: E501 """Get App # noqa: E501 @@ -517,7 +517,7 @@ def get_app(self, app_id : StrictInt, **kwargs) -> GenericApp: # noqa: E501 raise ValueError("Error! Please call the get_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_app_with_http_info(app_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_app_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """Get App # noqa: E501 @@ -629,7 +629,7 @@ def get_app_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_app_users(self, app_id : StrictInt, **kwargs) -> List[User]: # noqa: E501 """Get App Users # noqa: E501 @@ -658,7 +658,7 @@ def get_app_users(self, app_id : StrictInt, **kwargs) -> List[User]: # noqa: E5 raise ValueError("Error! Please call the get_app_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_app_users_with_http_info(app_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_app_users_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """Get App Users # noqa: E501 @@ -769,7 +769,7 @@ def get_app_users_with_http_info(self, app_id : StrictInt, **kwargs) -> ApiRespo collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_apps(self, **kwargs) -> List[GenericApp]: # noqa: E501 """List Apps # noqa: E501 @@ -796,7 +796,7 @@ def list_apps(self, **kwargs) -> List[GenericApp]: # noqa: E501 raise ValueError("Error! Please call the list_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_apps_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_apps_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Apps # noqa: E501 @@ -902,7 +902,7 @@ def list_apps_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_connectors(self, name : Optional[StrictStr] = None, **kwargs) -> Connector: # noqa: E501 """List Connectors # noqa: E501 @@ -931,7 +931,7 @@ def list_connectors(self, name : Optional[StrictStr] = None, **kwargs) -> Connec raise ValueError("Error! Please call the list_connectors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_connectors_with_http_info(name, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_connectors_with_http_info(self, name : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Connectors # noqa: E501 @@ -1043,7 +1043,7 @@ def list_connectors_with_http_info(self, name : Optional[StrictStr] = None, **kw collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_app(self, app_id : StrictInt, request_body : Optional[Dict[str, Any]] = None, **kwargs) -> GenericApp: # noqa: E501 """Update App # noqa: E501 @@ -1074,7 +1074,7 @@ def update_app(self, app_id : StrictInt, request_body : Optional[Dict[str, Any]] raise ValueError("Error! Please call the update_app_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_app_with_http_info(app_id, request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_app_with_http_info(self, app_id : StrictInt, request_body : Optional[Dict[str, Any]] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update App # noqa: E501 diff --git a/onelogin/api/branding_service_api.py b/onelogin/api/branding_service_api.py index 980bcf22..27063d87 100644 --- a/onelogin/api/branding_service_api.py +++ b/onelogin/api/branding_service_api.py @@ -17,7 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt @@ -49,7 +49,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_brand(self, brand : Optional[Brand] = None, **kwargs) -> Brand: # noqa: E501 """Create Brand # noqa: E501 @@ -78,7 +78,7 @@ def create_brand(self, brand : Optional[Brand] = None, **kwargs) -> Brand: # no raise ValueError("Error! Please call the create_brand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_brand_with_http_info(brand, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_brand_with_http_info(self, brand : Optional[Brand] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Brand # noqa: E501 @@ -197,7 +197,7 @@ def create_brand_with_http_info(self, brand : Optional[Brand] = None, **kwargs) collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_brand(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> None: # noqa: E501 """Delete Brand # noqa: E501 @@ -226,7 +226,7 @@ def delete_brand(self, brand_id : Annotated[StrictInt, Field(..., description="U raise ValueError("Error! Please call the delete_brand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_brand_with_http_info(brand_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_brand_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Brand # noqa: E501 @@ -334,7 +334,7 @@ def delete_brand_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_brand(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> Brand: # noqa: E501 """Get Brand # noqa: E501 @@ -363,7 +363,7 @@ def get_brand(self, brand_id : Annotated[StrictInt, Field(..., description="Uniq raise ValueError("Error! Please call the get_brand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_brand_with_http_info(brand_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_brand_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Brand # noqa: E501 @@ -475,7 +475,7 @@ def get_brand_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., de collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_brand_apps(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> List[BrandApp]: # noqa: E501 """Get Brand Apps # noqa: E501 @@ -504,7 +504,7 @@ def get_brand_apps(self, brand_id : Annotated[StrictInt, Field(..., description= raise ValueError("Error! Please call the get_brand_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_brand_apps_with_http_info(brand_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_brand_apps_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Brand Apps # noqa: E501 @@ -616,7 +616,7 @@ def get_brand_apps_with_http_info(self, brand_id : Annotated[StrictInt, Field(.. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_brands(self, **kwargs) -> List[BrandReq]: # noqa: E501 """List Account Brands # noqa: E501 @@ -643,7 +643,7 @@ def list_brands(self, **kwargs) -> List[BrandReq]: # noqa: E501 raise ValueError("Error! Please call the list_brands_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_brands_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_brands_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Account Brands # noqa: E501 @@ -747,7 +747,7 @@ def list_brands_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_brand(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], request_brand : Optional[RequestBrand] = None, **kwargs) -> Brand: # noqa: E501 """Update Brand # noqa: E501 @@ -778,7 +778,7 @@ def update_brand(self, brand_id : Annotated[StrictInt, Field(..., description="U raise ValueError("Error! Please call the update_brand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_brand_with_http_info(brand_id, request_brand, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_brand_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], request_brand : Optional[RequestBrand] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Brand # noqa: E501 diff --git a/onelogin/api/branding_service_smtp_api.py b/onelogin/api/branding_service_smtp_api.py index 75d25797..2e3c6dcb 100644 --- a/onelogin/api/branding_service_smtp_api.py +++ b/onelogin/api/branding_service_smtp_api.py @@ -17,7 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from typing import Optional @@ -46,7 +46,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def delete_email_settings(self, **kwargs) -> AltErr: # noqa: E501 """Delete Custom Email Settings # noqa: E501 @@ -73,7 +73,7 @@ def delete_email_settings(self, **kwargs) -> AltErr: # noqa: E501 raise ValueError("Error! Please call the delete_email_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_email_settings_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_email_settings_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Delete Custom Email Settings # noqa: E501 @@ -178,7 +178,7 @@ def delete_email_settings_with_http_info(self, **kwargs) -> ApiResponse: # noqa collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_email_settings(self, **kwargs) -> GetEmailSettings200Response: # noqa: E501 """Get Email Settings # noqa: E501 @@ -205,7 +205,7 @@ def get_email_settings(self, **kwargs) -> GetEmailSettings200Response: # noqa: raise ValueError("Error! Please call the get_email_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_email_settings_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_email_settings_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Get Email Settings # noqa: E501 @@ -310,7 +310,7 @@ def get_email_settings_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_email_settings(self, email_config : Optional[EmailConfig] = None, **kwargs) -> AltErr: # noqa: E501 """Update Email Settings # noqa: E501 @@ -339,7 +339,7 @@ def update_email_settings(self, email_config : Optional[EmailConfig] = None, **k raise ValueError("Error! Please call the update_email_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_email_settings_with_http_info(email_config, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_email_settings_with_http_info(self, email_config : Optional[EmailConfig] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Email Settings # noqa: E501 diff --git a/onelogin/api/branding_service_templates_api.py b/onelogin/api/branding_service_templates_api.py index 81bc9158..6aeb0af9 100644 --- a/onelogin/api/branding_service_templates_api.py +++ b/onelogin/api/branding_service_templates_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, constr, validator @@ -46,7 +46,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_message_template(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], locale : Annotated[Optional[constr(strict=True)], Field(description="The 2 character language locale for the template. e.g. en = English, es = Spanish")] = None, message_template : Optional[MessageTemplate] = None, **kwargs) -> MessageTemplate: # noqa: E501 """Create Message Template # noqa: E501 @@ -79,7 +79,7 @@ def create_message_template(self, brand_id : Annotated[StrictInt, Field(..., des raise ValueError("Error! Please call the create_message_template_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_message_template_with_http_info(brand_id, locale, message_template, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_message_template_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], locale : Annotated[Optional[constr(strict=True)], Field(description="The 2 character language locale for the template. e.g. en = English, es = Spanish")] = None, message_template : Optional[MessageTemplate] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Message Template # noqa: E501 @@ -210,7 +210,7 @@ def create_message_template_with_http_info(self, brand_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_message_template(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> None: # noqa: E501 """Delete Message Template # noqa: E501 @@ -241,7 +241,7 @@ def delete_message_template(self, brand_id : Annotated[StrictInt, Field(..., des raise ValueError("Error! Please call the delete_message_template_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_message_template_with_http_info(brand_id, template_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_message_template_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Message Template # noqa: E501 @@ -355,7 +355,7 @@ def delete_message_template_with_http_info(self, brand_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_master_by_type(self, template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], **kwargs) -> MessageTemplate: # noqa: E501 """Get Master Template by Type # noqa: E501 @@ -384,7 +384,7 @@ def get_master_by_type(self, template_type : Annotated[StrictStr, Field(..., des raise ValueError("Error! Please call the get_master_by_type_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_master_by_type_with_http_info(template_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_master_by_type_with_http_info(self, template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Master Template by Type # noqa: E501 @@ -496,7 +496,7 @@ def get_master_by_type_with_http_info(self, template_type : Annotated[StrictStr, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_message_template_by_id(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> MessageTemplate: # noqa: E501 """Get Message Template # noqa: E501 @@ -527,7 +527,7 @@ def get_message_template_by_id(self, brand_id : Annotated[StrictInt, Field(..., raise ValueError("Error! Please call the get_message_template_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_message_template_by_id_with_http_info(brand_id, template_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_message_template_by_id_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Message Template # noqa: E501 @@ -645,7 +645,7 @@ def get_message_template_by_id_with_http_info(self, brand_id : Annotated[StrictI collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_template_by_locale(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], locale : Annotated[constr(strict=True), Field(..., description="The 2 character language locale for the template. e.g. en = English, es = Spanish")], **kwargs) -> MessageTemplate: # noqa: E501 """Get Template by Type & Locale # noqa: E501 @@ -678,7 +678,7 @@ def get_template_by_locale(self, brand_id : Annotated[StrictInt, Field(..., desc raise ValueError("Error! Please call the get_template_by_locale_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_template_by_locale_with_http_info(brand_id, template_type, locale, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_template_by_locale_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], locale : Annotated[constr(strict=True), Field(..., description="The 2 character language locale for the template. e.g. en = English, es = Spanish")], **kwargs) -> ApiResponse: # noqa: E501 """Get Template by Type & Locale # noqa: E501 @@ -802,7 +802,7 @@ def get_template_by_locale_with_http_info(self, brand_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_message_templates(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], locale : Annotated[Optional[constr(strict=True)], Field(description="The 2 character language locale for the template. e.g. en = English, es = Spanish")] = None, **kwargs) -> List[ListMessageTemplates200ResponseInner]: # noqa: E501 """List Message Templates # noqa: E501 @@ -833,7 +833,7 @@ def list_message_templates(self, brand_id : Annotated[StrictInt, Field(..., desc raise ValueError("Error! Please call the list_message_templates_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_message_templates_with_http_info(brand_id, locale, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_message_templates_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], locale : Annotated[Optional[constr(strict=True)], Field(description="The 2 character language locale for the template. e.g. en = English, es = Spanish")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Message Templates # noqa: E501 @@ -951,7 +951,7 @@ def list_message_templates_with_http_info(self, brand_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_message_template_by_id(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> MessageTemplate: # noqa: E501 """Update Message Template # noqa: E501 @@ -982,7 +982,7 @@ def update_message_template_by_id(self, brand_id : Annotated[StrictInt, Field(.. raise ValueError("Error! Please call the update_message_template_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_message_template_by_id_with_http_info(brand_id, template_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_message_template_by_id_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_id : Annotated[StrictInt, Field(..., description="Unique identifier for the template to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Update Message Template # noqa: E501 @@ -1100,7 +1100,7 @@ def update_message_template_by_id_with_http_info(self, brand_id : Annotated[Stri collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_template_by_locale(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], locale : Annotated[constr(strict=True), Field(..., description="The 2 character language locale for the template. e.g. en = English, es = Spanish")], **kwargs) -> MessageTemplate: # noqa: E501 """Update Template by Type & Locale # noqa: E501 @@ -1133,7 +1133,7 @@ def update_template_by_locale(self, brand_id : Annotated[StrictInt, Field(..., d raise ValueError("Error! Please call the update_template_by_locale_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_template_by_locale_with_http_info(brand_id, template_type, locale, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_template_by_locale_with_http_info(self, brand_id : Annotated[StrictInt, Field(..., description="Unique identifier for the branding object.")], template_type : Annotated[StrictStr, Field(..., description="The message template type to return.")], locale : Annotated[constr(strict=True), Field(..., description="The 2 character language locale for the template. e.g. en = English, es = Spanish")], **kwargs) -> ApiResponse: # noqa: E501 """Update Template by Type & Locale # noqa: E501 diff --git a/onelogin/api/events_api.py b/onelogin/api/events_api.py index 768a0033..027ab345 100644 --- a/onelogin/api/events_api.py +++ b/onelogin/api/events_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, conlist @@ -47,7 +47,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def get_event_by_id(self, event_id : StrictInt, **kwargs) -> GetEventById200Response: # noqa: E501 """Get Event by ID # noqa: E501 @@ -76,7 +76,7 @@ def get_event_by_id(self, event_id : StrictInt, **kwargs) -> GetEventById200Resp raise ValueError("Error! Please call the get_event_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_event_by_id_with_http_info(event_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_event_by_id_with_http_info(self, event_id : StrictInt, **kwargs) -> ApiResponse: # noqa: E501 """Get Event by ID # noqa: E501 @@ -189,7 +189,7 @@ def get_event_by_id_with_http_info(self, event_id : StrictInt, **kwargs) -> ApiR collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_event_types(self, content_type : Optional[StrictStr] = None, **kwargs) -> GetEventTypes200Response: # noqa: E501 """Get Event Types # noqa: E501 @@ -218,7 +218,7 @@ def get_event_types(self, content_type : Optional[StrictStr] = None, **kwargs) - raise ValueError("Error! Please call the get_event_types_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_event_types_with_http_info(content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_event_types_with_http_info(self, content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Event Types # noqa: E501 @@ -328,7 +328,7 @@ def get_event_types_with_http_info(self, content_type : Optional[StrictStr] = No collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_events(self, event_type_id : Optional[conlist(StrictInt)] = None, client_id : Optional[StrictInt] = None, directory_id : Optional[StrictInt] = None, id : Optional[StrictInt] = None, created_at : Optional[StrictStr] = None, resolution : Optional[StrictStr] = None, since : Optional[StrictStr] = None, until : Optional[StrictStr] = None, user_id : Annotated[Optional[StrictInt], Field(description="Set to the id of the user that you want to return.")] = None, **kwargs) -> GetEvents200Response: # noqa: E501 """Get Events # noqa: E501 @@ -373,7 +373,7 @@ def get_events(self, event_type_id : Optional[conlist(StrictInt)] = None, client raise ValueError("Error! Please call the get_events_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_events_with_http_info(event_type_id, client_id, directory_id, id, created_at, resolution, since, until, user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_events_with_http_info(self, event_type_id : Optional[conlist(StrictInt)] = None, client_id : Optional[StrictInt] = None, directory_id : Optional[StrictInt] = None, id : Optional[StrictInt] = None, created_at : Optional[StrictStr] = None, resolution : Optional[StrictStr] = None, since : Optional[StrictStr] = None, until : Optional[StrictStr] = None, user_id : Annotated[Optional[StrictInt], Field(description="Set to the id of the user that you want to return.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Events # noqa: E501 diff --git a/onelogin/api/groups_api.py b/onelogin/api/groups_api.py index b015809e..e7e8fc67 100644 --- a/onelogin/api/groups_api.py +++ b/onelogin/api/groups_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictStr @@ -43,7 +43,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def get_group_by_id(self, group_id : StrictStr, **kwargs) -> GetGroups200Response: # noqa: E501 """Get Group by ID # noqa: E501 @@ -72,7 +72,7 @@ def get_group_by_id(self, group_id : StrictStr, **kwargs) -> GetGroups200Respons raise ValueError("Error! Please call the get_group_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_group_by_id_with_http_info(group_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_group_by_id_with_http_info(self, group_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Get Group by ID # noqa: E501 @@ -185,7 +185,7 @@ def get_group_by_id_with_http_info(self, group_id : StrictStr, **kwargs) -> ApiR collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_groups(self, **kwargs) -> GetGroups200Response: # noqa: E501 """Get Groups # noqa: E501 @@ -212,7 +212,7 @@ def get_groups(self, **kwargs) -> GetGroups200Response: # noqa: E501 raise ValueError("Error! Please call the get_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_groups_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_groups_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Get Groups # noqa: E501 diff --git a/onelogin/api/invite_links_api.py b/onelogin/api/invite_links_api.py index 95ee553b..75f71140 100644 --- a/onelogin/api/invite_links_api.py +++ b/onelogin/api/invite_links_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from typing import Optional @@ -46,7 +46,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def get_invite_link(self, get_invite_link_request : Optional[GetInviteLinkRequest] = None, **kwargs) -> GetInviteLink200Response: # noqa: E501 """Generate Invite Link # noqa: E501 @@ -75,7 +75,7 @@ def get_invite_link(self, get_invite_link_request : Optional[GetInviteLinkReques raise ValueError("Error! Please call the get_invite_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_invite_link_with_http_info(get_invite_link_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_invite_link_with_http_info(self, get_invite_link_request : Optional[GetInviteLinkRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate Invite Link # noqa: E501 @@ -194,7 +194,7 @@ def get_invite_link_with_http_info(self, get_invite_link_request : Optional[GetI collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def send_invite_link(self, send_invite_link_request : Optional[SendInviteLinkRequest] = None, **kwargs) -> SendInviteLink200Response: # noqa: E501 """Send Invite Link # noqa: E501 @@ -223,7 +223,7 @@ def send_invite_link(self, send_invite_link_request : Optional[SendInviteLinkReq raise ValueError("Error! Please call the send_invite_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.send_invite_link_with_http_info(send_invite_link_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def send_invite_link_with_http_info(self, send_invite_link_request : Optional[SendInviteLinkRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Send Invite Link # noqa: E501 diff --git a/onelogin/api/multi_factor_authentication_api.py b/onelogin/api/multi_factor_authentication_api.py index eab5aaaf..1d3e925c 100644 --- a/onelogin/api/multi_factor_authentication_api.py +++ b/onelogin/api/multi_factor_authentication_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr @@ -57,7 +57,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_device_verification(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, create_device_verification_request : Optional[CreateDeviceVerificationRequest] = None, **kwargs) -> CreateDeviceVerification201Response: # noqa: E501 """Create Device Verification # noqa: E501 @@ -90,7 +90,7 @@ def create_device_verification(self, user_id : Annotated[StrictInt, Field(..., d raise ValueError("Error! Please call the create_device_verification_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_device_verification_with_http_info(user_id, content_type, create_device_verification_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_device_verification_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, create_device_verification_request : Optional[CreateDeviceVerificationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Device Verification # noqa: E501 @@ -220,7 +220,7 @@ def create_device_verification_with_http_info(self, user_id : Annotated[StrictIn collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def create_factor_registration(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, create_factor_registration_request : Optional[CreateFactorRegistrationRequest] = None, **kwargs) -> CreateFactorRegistration201Response: # noqa: E501 """Create Factor Registration # noqa: E501 @@ -253,7 +253,7 @@ def create_factor_registration(self, user_id : Annotated[StrictInt, Field(..., d raise ValueError("Error! Please call the create_factor_registration_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_factor_registration_with_http_info(user_id, content_type, create_factor_registration_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_factor_registration_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, create_factor_registration_request : Optional[CreateFactorRegistrationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Factor Registration # noqa: E501 @@ -383,7 +383,7 @@ def create_factor_registration_with_http_info(self, user_id : Annotated[StrictIn collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_enrolled_factor(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, **kwargs) -> None: # noqa: E501 """Delete Enrolled Factor # noqa: E501 @@ -414,7 +414,7 @@ def delete_enrolled_factor(self, user_id : Annotated[StrictInt, Field(..., descr raise ValueError("Error! Please call the delete_enrolled_factor_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_enrolled_factor_with_http_info(user_id, device_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_enrolled_factor_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Delete Enrolled Factor # noqa: E501 @@ -524,7 +524,7 @@ def delete_enrolled_factor_with_http_info(self, user_id : Annotated[StrictInt, F collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def generate_otp(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, generate_otp_request : Optional[GenerateOTPRequest] = None, **kwargs) -> GenerateOTP201Response: # noqa: E501 """Generate MFA token # noqa: E501 @@ -557,7 +557,7 @@ def generate_otp(self, user_id : Annotated[StrictInt, Field(..., description="Se raise ValueError("Error! Please call the generate_otp_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.generate_otp_with_http_info(user_id, content_type, generate_otp_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def generate_otp_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], content_type : Optional[StrictStr] = None, generate_otp_request : Optional[GenerateOTPRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate MFA token # noqa: E501 @@ -688,7 +688,7 @@ def generate_otp_with_http_info(self, user_id : Annotated[StrictInt, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_auth_factors(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> GetAuthFactors200Response: # noqa: E501 """Get User Factors # noqa: E501 @@ -717,7 +717,7 @@ def get_auth_factors(self, user_id : Annotated[StrictInt, Field(..., description raise ValueError("Error! Please call the get_auth_factors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_auth_factors_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_auth_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get User Factors # noqa: E501 @@ -828,7 +828,7 @@ def get_auth_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_authentication_devices(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> List[GetAuthenticationDevices200ResponseInner]: # noqa: E501 """Get User Devices # noqa: E501 @@ -857,7 +857,7 @@ def get_authentication_devices(self, user_id : Annotated[StrictInt, Field(..., d raise ValueError("Error! Please call the get_authentication_devices_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_authentication_devices_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_authentication_devices_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get User Devices # noqa: E501 @@ -968,7 +968,7 @@ def get_authentication_devices_with_http_info(self, user_id : Annotated[StrictIn collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_registration(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], registration_id : Annotated[StrictStr, Field(..., description="The id of a registration")], **kwargs) -> object: # noqa: E501 """Get User Registration # noqa: E501 @@ -999,7 +999,7 @@ def get_user_registration(self, user_id : Annotated[StrictInt, Field(..., descri raise ValueError("Error! Please call the get_user_registration_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_registration_with_http_info(user_id, registration_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_registration_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], registration_id : Annotated[StrictStr, Field(..., description="The id of a registration")], **kwargs) -> ApiResponse: # noqa: E501 """Get User Registration # noqa: E501 @@ -1116,7 +1116,7 @@ def get_user_registration_with_http_info(self, user_id : Annotated[StrictInt, Fi collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_verification(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], verification_id : Annotated[StrictStr, Field(..., description="The verification_id is returned on activation of the factor or you can get the device_id using the Activate Factor API call.")], **kwargs) -> GetUserVerification200Response: # noqa: E501 """Get User Verification # noqa: E501 @@ -1147,7 +1147,7 @@ def get_user_verification(self, user_id : Annotated[StrictInt, Field(..., descri raise ValueError("Error! Please call the get_user_verification_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_verification_with_http_info(user_id, verification_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_verification_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], verification_id : Annotated[StrictStr, Field(..., description="The verification_id is returned on activation of the factor or you can get the device_id using the Activate Factor API call.")], **kwargs) -> ApiResponse: # noqa: E501 """Get User Verification # noqa: E501 @@ -1265,7 +1265,7 @@ def get_user_verification_with_http_info(self, user_id : Annotated[StrictInt, Fi collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def verify_user_registration(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], registration_id : Annotated[StrictStr, Field(..., description="The id of a registration")], content_type : Optional[StrictStr] = None, verify_user_registration_request : Optional[VerifyUserRegistrationRequest] = None, **kwargs) -> VerifyUserRegistration200Response: # noqa: E501 """Verify User Registration # noqa: E501 @@ -1300,7 +1300,7 @@ def verify_user_registration(self, user_id : Annotated[StrictInt, Field(..., des raise ValueError("Error! Please call the verify_user_registration_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.verify_user_registration_with_http_info(user_id, registration_id, content_type, verify_user_registration_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def verify_user_registration_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], registration_id : Annotated[StrictStr, Field(..., description="The id of a registration")], content_type : Optional[StrictStr] = None, verify_user_registration_request : Optional[VerifyUserRegistrationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Verify User Registration # noqa: E501 @@ -1436,7 +1436,7 @@ def verify_user_registration_with_http_info(self, user_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def verify_user_verification(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], verification_id : Annotated[StrictStr, Field(..., description="The verification_id is returned on activation of the factor or you can get the device_id using the Activate Factor API call.")], content_type : Optional[StrictStr] = None, verify_user_verification_request : Optional[VerifyUserVerificationRequest] = None, **kwargs) -> Error: # noqa: E501 """Verify User Verification # noqa: E501 @@ -1471,7 +1471,7 @@ def verify_user_verification(self, user_id : Annotated[StrictInt, Field(..., des raise ValueError("Error! Please call the verify_user_verification_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.verify_user_verification_with_http_info(user_id, verification_id, content_type, verify_user_verification_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def verify_user_verification_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], verification_id : Annotated[StrictStr, Field(..., description="The verification_id is returned on activation of the factor or you can get the device_id using the Activate Factor API call.")], content_type : Optional[StrictStr] = None, verify_user_verification_request : Optional[VerifyUserVerificationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Verify User Verification # noqa: E501 diff --git a/onelogin/api/multi_factor_authentication_v1_api.py b/onelogin/api/multi_factor_authentication_v1_api.py index 8253d363..f6086336 100644 --- a/onelogin/api/multi_factor_authentication_v1_api.py +++ b/onelogin/api/multi_factor_authentication_v1_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr @@ -53,7 +53,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def activate_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, activate_mfa_factors_request : Optional[ActivateMfaFactorsRequest] = None, **kwargs) -> GetEnrolledFactors200Response: # noqa: E501 """Activate a Factor # noqa: E501 @@ -86,7 +86,7 @@ def activate_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., descrip raise ValueError("Error! Please call the activate_mfa_factors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.activate_mfa_factors_with_http_info(user_id, device_id, activate_mfa_factors_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def activate_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, activate_mfa_factors_request : Optional[ActivateMfaFactorsRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Activate a Factor # noqa: E501 @@ -217,7 +217,7 @@ def activate_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Fie collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def enroll_mfa_factor(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], otp_device : Optional[OtpDevice] = None, **kwargs) -> EnrollMfaFactor200Response: # noqa: E501 """Enroll a Factor # noqa: E501 @@ -248,7 +248,7 @@ def enroll_mfa_factor(self, user_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the enroll_mfa_factor_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.enroll_mfa_factor_with_http_info(user_id, otp_device, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def enroll_mfa_factor_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], otp_device : Optional[OtpDevice] = None, **kwargs) -> ApiResponse: # noqa: E501 """Enroll a Factor # noqa: E501 @@ -373,7 +373,7 @@ def enroll_mfa_factor_with_http_info(self, user_id : Annotated[StrictInt, Field( collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def generate_mf_atoken(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], generate_mf_atoken_request : Optional[GenerateMFAtokenRequest] = None, **kwargs) -> GenerateMFAtoken200Response: # noqa: E501 """Generate Temp MFA Token # noqa: E501 @@ -404,7 +404,7 @@ def generate_mf_atoken(self, user_id : Annotated[StrictInt, Field(..., descripti raise ValueError("Error! Please call the generate_mf_atoken_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.generate_mf_atoken_with_http_info(user_id, generate_mf_atoken_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def generate_mf_atoken_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], generate_mf_atoken_request : Optional[GenerateMFAtokenRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate Temp MFA Token # noqa: E501 @@ -527,7 +527,7 @@ def generate_mf_atoken_with_http_info(self, user_id : Annotated[StrictInt, Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_enrolled_factors(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> GetEnrolledFactors200Response: # noqa: E501 """Get Enrolled Factors # noqa: E501 @@ -556,7 +556,7 @@ def get_enrolled_factors(self, user_id : Annotated[StrictInt, Field(..., descrip raise ValueError("Error! Please call the get_enrolled_factors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_enrolled_factors_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_enrolled_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Enrolled Factors # noqa: E501 @@ -668,7 +668,7 @@ def get_enrolled_factors_with_http_info(self, user_id : Annotated[StrictInt, Fie collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> GetMFAFactors200Response: # noqa: E501 """Get Available Factors # noqa: E501 @@ -697,7 +697,7 @@ def get_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., description= raise ValueError("Error! Please call the get_mfa_factors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_mfa_factors_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Available Factors # noqa: E501 @@ -810,7 +810,7 @@ def get_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(.. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def remove_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, **kwargs) -> None: # noqa: E501 """Remove an Enrolled Factor # noqa: E501 @@ -841,7 +841,7 @@ def remove_mfa_factors(self, user_id : Annotated[StrictInt, Field(..., descripti raise ValueError("Error! Please call the remove_mfa_factors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.remove_mfa_factors_with_http_info(user_id, device_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def remove_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Remove an Enrolled Factor # noqa: E501 @@ -955,7 +955,7 @@ def remove_mfa_factors_with_http_info(self, user_id : Annotated[StrictInt, Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def verify_mfa_factor(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, verify_mfa_factor_request : Optional[VerifyMfaFactorRequest] = None, **kwargs) -> Error: # noqa: E501 """Verify a Factor # noqa: E501 @@ -988,7 +988,7 @@ def verify_mfa_factor(self, user_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the verify_mfa_factor_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.verify_mfa_factor_with_http_info(user_id, device_id, verify_mfa_factor_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def verify_mfa_factor_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], device_id : StrictStr, verify_mfa_factor_request : Optional[VerifyMfaFactorRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Verify a Factor # noqa: E501 diff --git a/onelogin/api/o_auth2_api.py b/onelogin/api/o_auth2_api.py index 79654c7c..80024dc4 100644 --- a/onelogin/api/o_auth2_api.py +++ b/onelogin/api/o_auth2_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictStr @@ -49,7 +49,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def generate_token(self, generate_token_request : Annotated[GenerateTokenRequest, Field(..., description="Request Body to Generate OAuth Token")], content_type : Optional[StrictStr] = None, **kwargs) -> OauthToken: # noqa: E501 """Generate Token # noqa: E501 @@ -80,7 +80,7 @@ def generate_token(self, generate_token_request : Annotated[GenerateTokenRequest raise ValueError("Error! Please call the generate_token_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.generate_token_with_http_info(generate_token_request, content_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def generate_token_with_http_info(self, generate_token_request : Annotated[GenerateTokenRequest, Field(..., description="Request Body to Generate OAuth Token")], content_type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate Token # noqa: E501 @@ -206,7 +206,7 @@ def generate_token_with_http_info(self, generate_token_request : Annotated[Gener collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_rate_limit(self, **kwargs) -> GetRateLimit200Response: # noqa: E501 """Get Rate Limit # noqa: E501 @@ -233,7 +233,7 @@ def get_rate_limit(self, **kwargs) -> GetRateLimit200Response: # noqa: E501 raise ValueError("Error! Please call the get_rate_limit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_rate_limit_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_rate_limit_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Get Rate Limit # noqa: E501 @@ -340,7 +340,7 @@ def get_rate_limit_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def revoke_tokens(self, content_type : Optional[StrictStr] = None, revoke_tokens_request : Optional[RevokeTokensRequest] = None, **kwargs) -> Error: # noqa: E501 """Revoke Tokens # noqa: E501 @@ -371,7 +371,7 @@ def revoke_tokens(self, content_type : Optional[StrictStr] = None, revoke_tokens raise ValueError("Error! Please call the revoke_tokens_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.revoke_tokens_with_http_info(content_type, revoke_tokens_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def revoke_tokens_with_http_info(self, content_type : Optional[StrictStr] = None, revoke_tokens_request : Optional[RevokeTokensRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Revoke Tokens # noqa: E501 diff --git a/onelogin/api/privileges_api.py b/onelogin/api/privileges_api.py index 45c12567..11f907cc 100644 --- a/onelogin/api/privileges_api.py +++ b/onelogin/api/privileges_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr @@ -51,7 +51,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def add_privilege_to_role(self, privilege_id : StrictStr, add_privilege_to_role_request : Optional[AddPrivilegeToRoleRequest] = None, **kwargs) -> AddPrivilegeToRole201Response: # noqa: E501 """Assign a Privilege to Roles # noqa: E501 @@ -82,7 +82,7 @@ def add_privilege_to_role(self, privilege_id : StrictStr, add_privilege_to_role_ raise ValueError("Error! Please call the add_privilege_to_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.add_privilege_to_role_with_http_info(privilege_id, add_privilege_to_role_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def add_privilege_to_role_with_http_info(self, privilege_id : StrictStr, add_privilege_to_role_request : Optional[AddPrivilegeToRoleRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Assign a Privilege to Roles # noqa: E501 @@ -207,7 +207,7 @@ def add_privilege_to_role_with_http_info(self, privilege_id : StrictStr, add_pri collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def assign_users_to_privilege(self, privilege_id : StrictStr, assign_users_to_privilege_request : Optional[AssignUsersToPrivilegeRequest] = None, **kwargs) -> AddPrivilegeToRole201Response: # noqa: E501 """Assign Users to a Privilege # noqa: E501 @@ -238,7 +238,7 @@ def assign_users_to_privilege(self, privilege_id : StrictStr, assign_users_to_pr raise ValueError("Error! Please call the assign_users_to_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.assign_users_to_privilege_with_http_info(privilege_id, assign_users_to_privilege_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def assign_users_to_privilege_with_http_info(self, privilege_id : StrictStr, assign_users_to_privilege_request : Optional[AssignUsersToPrivilegeRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Assign Users to a Privilege # noqa: E501 @@ -363,7 +363,7 @@ def assign_users_to_privilege_with_http_info(self, privilege_id : StrictStr, ass collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def create_privilege(self, privilege : Optional[Privilege] = None, **kwargs) -> Privilege: # noqa: E501 """Create a Privilege # noqa: E501 @@ -392,7 +392,7 @@ def create_privilege(self, privilege : Optional[Privilege] = None, **kwargs) -> raise ValueError("Error! Please call the create_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_privilege_with_http_info(privilege, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_privilege_with_http_info(self, privilege : Optional[Privilege] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create a Privilege # noqa: E501 @@ -511,7 +511,7 @@ def create_privilege_with_http_info(self, privilege : Optional[Privilege] = None collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_privilege(self, privilege_id : StrictStr, **kwargs) -> None: # noqa: E501 """Delete a Privilege # noqa: E501 @@ -540,7 +540,7 @@ def delete_privilege(self, privilege_id : StrictStr, **kwargs) -> None: # noqa: raise ValueError("Error! Please call the delete_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_privilege_with_http_info(privilege_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_privilege_with_http_info(self, privilege_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Delete a Privilege # noqa: E501 @@ -648,7 +648,7 @@ def delete_privilege_with_http_info(self, privilege_id : StrictStr, **kwargs) -> collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_role_from_privilege(self, privilege_id : StrictStr, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> None: # noqa: E501 """Remove a Privilege from a Role # noqa: E501 @@ -679,7 +679,7 @@ def delete_role_from_privilege(self, privilege_id : StrictStr, role_id : Annotat raise ValueError("Error! Please call the delete_role_from_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_role_from_privilege_with_http_info(privilege_id, role_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_role_from_privilege_with_http_info(self, privilege_id : StrictStr, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Remove a Privilege from a Role # noqa: E501 @@ -793,7 +793,7 @@ def delete_role_from_privilege_with_http_info(self, privilege_id : StrictStr, ro collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_assigned_user(self, privilege_id : StrictStr, **kwargs) -> GetAssignedUser200Response: # noqa: E501 """Get Users assigned to a Privilege # noqa: E501 @@ -822,7 +822,7 @@ def get_assigned_user(self, privilege_id : StrictStr, **kwargs) -> GetAssignedUs raise ValueError("Error! Please call the get_assigned_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_assigned_user_with_http_info(privilege_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_assigned_user_with_http_info(self, privilege_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Get Users assigned to a Privilege # noqa: E501 @@ -934,7 +934,7 @@ def get_assigned_user_with_http_info(self, privilege_id : StrictStr, **kwargs) - collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_privilege(self, privilege_id : StrictStr, **kwargs) -> Privilege: # noqa: E501 """Get a Privilege # noqa: E501 @@ -963,7 +963,7 @@ def get_privilege(self, privilege_id : StrictStr, **kwargs) -> Privilege: # noq raise ValueError("Error! Please call the get_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_privilege_with_http_info(privilege_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_privilege_with_http_info(self, privilege_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Get a Privilege # noqa: E501 @@ -1075,7 +1075,7 @@ def get_privilege_with_http_info(self, privilege_id : StrictStr, **kwargs) -> Ap collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_privilege_roles(self, privilege_id : StrictStr, **kwargs) -> ListPrivilegeRoles200Response: # noqa: E501 """Get Roles assigned to Privilege # noqa: E501 @@ -1104,7 +1104,7 @@ def list_privilege_roles(self, privilege_id : StrictStr, **kwargs) -> ListPrivil raise ValueError("Error! Please call the list_privilege_roles_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_privilege_roles_with_http_info(privilege_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_privilege_roles_with_http_info(self, privilege_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Get Roles assigned to Privilege # noqa: E501 @@ -1216,7 +1216,7 @@ def list_privilege_roles_with_http_info(self, privilege_id : StrictStr, **kwargs collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_privileges(self, **kwargs) -> List[Privilege]: # noqa: E501 """List Privileges # noqa: E501 @@ -1243,7 +1243,7 @@ def list_privileges(self, **kwargs) -> List[Privilege]: # noqa: E501 raise ValueError("Error! Please call the list_privileges_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_privileges_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_privileges_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Privileges # noqa: E501 @@ -1348,7 +1348,7 @@ def list_privileges_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def remove_user_from_privilege(self, privilege_id : StrictStr, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> None: # noqa: E501 """Remove a Privilege from Users # noqa: E501 @@ -1379,7 +1379,7 @@ def remove_user_from_privilege(self, privilege_id : StrictStr, user_id : Annotat raise ValueError("Error! Please call the remove_user_from_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.remove_user_from_privilege_with_http_info(privilege_id, user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def remove_user_from_privilege_with_http_info(self, privilege_id : StrictStr, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Remove a Privilege from Users # noqa: E501 @@ -1493,7 +1493,7 @@ def remove_user_from_privilege_with_http_info(self, privilege_id : StrictStr, us collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_privilege(self, privilege_id : StrictStr, privilege : Optional[Privilege] = None, **kwargs) -> UpdatePrivilege200Response: # noqa: E501 """Update a Privilege # noqa: E501 @@ -1524,7 +1524,7 @@ def update_privilege(self, privilege_id : StrictStr, privilege : Optional[Privil raise ValueError("Error! Please call the update_privilege_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_privilege_with_http_info(privilege_id, privilege, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_privilege_with_http_info(self, privilege_id : StrictStr, privilege : Optional[Privilege] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update a Privilege # noqa: E501 diff --git a/onelogin/api/roles_api.py b/onelogin/api/roles_api.py index a8de750e..77f6dfe0 100644 --- a/onelogin/api/roles_api.py +++ b/onelogin/api/roles_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, conlist @@ -52,7 +52,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def add_role_admins(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> List[CreateRole201ResponseInner]: # noqa: E501 """Add Role Admins # noqa: E501 @@ -83,7 +83,7 @@ def add_role_admins(self, role_id : Annotated[StrictStr, Field(..., description= raise ValueError("Error! Please call the add_role_admins_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.add_role_admins_with_http_info(role_id, request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def add_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> ApiResponse: # noqa: E501 """Add Role Admins # noqa: E501 @@ -207,7 +207,7 @@ def add_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field(.. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def add_role_users(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> List[CreateRole201ResponseInner]: # noqa: E501 """Add Role Users # noqa: E501 @@ -238,7 +238,7 @@ def add_role_users(self, role_id : Annotated[StrictStr, Field(..., description=" raise ValueError("Error! Please call the add_role_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.add_role_users_with_http_info(role_id, request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def add_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> ApiResponse: # noqa: E501 """Add Role Users # noqa: E501 @@ -363,7 +363,7 @@ def add_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def create_role(self, role : Optional[Role] = None, **kwargs) -> List[CreateRole201ResponseInner]: # noqa: E501 """Create Role # noqa: E501 @@ -392,7 +392,7 @@ def create_role(self, role : Optional[Role] = None, **kwargs) -> List[CreateRole raise ValueError("Error! Please call the create_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_role_with_http_info(role, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_role_with_http_info(self, role : Optional[Role] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Role # noqa: E501 @@ -510,7 +510,7 @@ def create_role_with_http_info(self, role : Optional[Role] = None, **kwargs) -> collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_role(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> None: # noqa: E501 """Delete Role by ID # noqa: E501 @@ -539,7 +539,7 @@ def delete_role(self, role_id : Annotated[StrictStr, Field(..., description="Set raise ValueError("Error! Please call the delete_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_role_with_http_info(role_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_role_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Role by ID # noqa: E501 @@ -647,7 +647,7 @@ def delete_role_with_http_info(self, role_id : Annotated[StrictStr, Field(..., d collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> Role: # noqa: E501 """Get Role by ID # noqa: E501 @@ -676,7 +676,7 @@ def get_role(self, role_id : Annotated[StrictStr, Field(..., description="Set to raise ValueError("Error! Please call the get_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_with_http_info(role_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Role by ID # noqa: E501 @@ -788,7 +788,7 @@ def get_role_with_http_info(self, role_id : Annotated[StrictStr, Field(..., desc collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role_admins(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, name : Annotated[Optional[StrictStr], Field(description="Allows you to filter on first name, last name, username, and email address.")] = None, include_unassigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to false. Include users that aren’t assigned to the role.")] = None, **kwargs) -> List[User]: # noqa: E501 """Get Role Admins # noqa: E501 @@ -827,7 +827,7 @@ def get_role_admins(self, role_id : Annotated[StrictStr, Field(..., description= raise ValueError("Error! Please call the get_role_admins_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_admins_with_http_info(role_id, limit, page, cursor, name, include_unassigned, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, name : Annotated[Optional[StrictStr], Field(description="Allows you to filter on first name, last name, username, and email address.")] = None, include_unassigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to false. Include users that aren’t assigned to the role.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Role Admins # noqa: E501 @@ -969,7 +969,7 @@ def get_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field(.. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role_apps(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, assigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to true. Returns all apps not yet assigned to the role.")] = None, **kwargs) -> List[GetRoleApps200ResponseInner]: # noqa: E501 """Get all Apps assigned to Role # noqa: E501 @@ -1006,7 +1006,7 @@ def get_role_apps(self, role_id : Annotated[StrictStr, Field(..., description="S raise ValueError("Error! Please call the get_role_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_apps_with_http_info(role_id, limit, page, cursor, assigned, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_apps_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, assigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to true. Returns all apps not yet assigned to the role.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get all Apps assigned to Role # noqa: E501 @@ -1142,7 +1142,7 @@ def get_role_apps_with_http_info(self, role_id : Annotated[StrictStr, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role_by_id(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> GetRoleById200Response: # noqa: E501 """Get Role by ID # noqa: E501 @@ -1171,7 +1171,7 @@ def get_role_by_id(self, role_id : Annotated[StrictStr, Field(..., description=" raise ValueError("Error! Please call the get_role_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_by_id_with_http_info(role_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_by_id_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Role by ID # noqa: E501 @@ -1285,7 +1285,7 @@ def get_role_by_id_with_http_info(self, role_id : Annotated[StrictStr, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role_by_name(self, name : Optional[StrictStr] = None, **kwargs) -> GetRoleByName200Response: # noqa: E501 """Get Role by Name # noqa: E501 @@ -1314,7 +1314,7 @@ def get_role_by_name(self, name : Optional[StrictStr] = None, **kwargs) -> GetRo raise ValueError("Error! Please call the get_role_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_by_name_with_http_info(name, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_by_name_with_http_info(self, name : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Role by Name # noqa: E501 @@ -1426,7 +1426,7 @@ def get_role_by_name_with_http_info(self, name : Optional[StrictStr] = None, **k collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_role_users(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, name : Annotated[Optional[StrictStr], Field(description="Allows you to filter on first name, last name, username, and email address.")] = None, include_unassigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to false. Include users that aren’t assigned to the role.")] = None, **kwargs) -> List[User]: # noqa: E501 """Get Role Users # noqa: E501 @@ -1465,7 +1465,7 @@ def get_role_users(self, role_id : Annotated[StrictStr, Field(..., description=" raise ValueError("Error! Please call the get_role_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_role_users_with_http_info(role_id, limit, page, cursor, name, include_unassigned, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, name : Annotated[Optional[StrictStr], Field(description="Allows you to filter on first name, last name, username, and email address.")] = None, include_unassigned : Annotated[Optional[StrictBool], Field(description="Optional. Defaults to false. Include users that aren’t assigned to the role.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Role Users # noqa: E501 @@ -1607,7 +1607,7 @@ def get_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_roles(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, role_name : Annotated[Optional[StrictStr], Field(description="Optional. Filters by role name.")] = None, app_id : Optional[StrictInt] = None, app_name : Annotated[Optional[StrictStr], Field(description="Optional. Returns roles that contain this app name.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> List[Role]: # noqa: E501 """List Roles # noqa: E501 @@ -1648,7 +1648,7 @@ def list_roles(self, limit : Annotated[Optional[StrictInt], Field(description="H raise ValueError("Error! Please call the list_roles_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_roles_with_http_info(limit, page, cursor, role_name, app_id, app_name, fields, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_roles_with_http_info(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, role_name : Annotated[Optional[StrictStr], Field(description="Optional. Filters by role name.")] = None, app_id : Optional[StrictInt] = None, app_name : Annotated[Optional[StrictStr], Field(description="Optional. Returns roles that contain this app name.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Roles # noqa: E501 @@ -1795,7 +1795,7 @@ def list_roles_with_http_info(self, limit : Annotated[Optional[StrictInt], Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def remove_role_admins(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], remove_role_users_request : RemoveRoleUsersRequest, **kwargs) -> None: # noqa: E501 """Remove Role Admins # noqa: E501 @@ -1826,7 +1826,7 @@ def remove_role_admins(self, role_id : Annotated[StrictStr, Field(..., descripti raise ValueError("Error! Please call the remove_role_admins_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.remove_role_admins_with_http_info(role_id, remove_role_users_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def remove_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], remove_role_users_request : RemoveRoleUsersRequest, **kwargs) -> ApiResponse: # noqa: E501 """Remove Role Admins # noqa: E501 @@ -1947,7 +1947,7 @@ def remove_role_admins_with_http_info(self, role_id : Annotated[StrictStr, Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def remove_role_users(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], remove_role_users_request : RemoveRoleUsersRequest, **kwargs) -> None: # noqa: E501 """Remove Role Users # noqa: E501 @@ -1978,7 +1978,7 @@ def remove_role_users(self, role_id : Annotated[StrictStr, Field(..., descriptio raise ValueError("Error! Please call the remove_role_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.remove_role_users_with_http_info(role_id, remove_role_users_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def remove_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], remove_role_users_request : RemoveRoleUsersRequest, **kwargs) -> ApiResponse: # noqa: E501 """Remove Role Users # noqa: E501 @@ -2099,7 +2099,7 @@ def remove_role_users_with_http_info(self, role_id : Annotated[StrictStr, Field( collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def set_role_apps(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> List[CreateRole201ResponseInner]: # noqa: E501 """Set Role Apps # noqa: E501 @@ -2130,7 +2130,7 @@ def set_role_apps(self, role_id : Annotated[StrictStr, Field(..., description="S raise ValueError("Error! Please call the set_role_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.set_role_apps_with_http_info(role_id, request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def set_role_apps_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], request_body : conlist(StrictInt), **kwargs) -> ApiResponse: # noqa: E501 """Set Role Apps # noqa: E501 @@ -2255,7 +2255,7 @@ def set_role_apps_with_http_info(self, role_id : Annotated[StrictStr, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_role(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], role : Optional[Role] = None, **kwargs) -> UpdateRole200Response: # noqa: E501 """Update Role # noqa: E501 @@ -2286,7 +2286,7 @@ def update_role(self, role_id : Annotated[StrictStr, Field(..., description="Set raise ValueError("Error! Please call the update_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_role_with_http_info(role_id, role, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_role_with_http_info(self, role_id : Annotated[StrictStr, Field(..., description="Set to the id of the role you want to return.")], role : Optional[Role] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Role # noqa: E501 diff --git a/onelogin/api/saml_assertions_api.py b/onelogin/api/saml_assertions_api.py index 226d1b3b..087a8cc1 100644 --- a/onelogin/api/saml_assertions_api.py +++ b/onelogin/api/saml_assertions_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import StrictStr @@ -48,7 +48,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def generate_saml_assert(self, content_type : Optional[StrictStr] = None, saml_assert : Optional[SamlAssert] = None, **kwargs) -> GenerateSamlAssert200Response: # noqa: E501 """Generate SAML Assertion # noqa: E501 @@ -79,7 +79,7 @@ def generate_saml_assert(self, content_type : Optional[StrictStr] = None, saml_a raise ValueError("Error! Please call the generate_saml_assert_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.generate_saml_assert_with_http_info(content_type, saml_assert, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def generate_saml_assert_with_http_info(self, content_type : Optional[StrictStr] = None, saml_assert : Optional[SamlAssert] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate SAML Assertion # noqa: E501 @@ -204,7 +204,7 @@ def generate_saml_assert_with_http_info(self, content_type : Optional[StrictStr] collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def generate_saml_assert2(self, content_type : Optional[StrictStr] = None, saml_assert : Optional[SamlAssert] = None, **kwargs) -> GenerateSamlAssert200Response: # noqa: E501 """Generate SAML Assertion # noqa: E501 @@ -235,7 +235,7 @@ def generate_saml_assert2(self, content_type : Optional[StrictStr] = None, saml_ raise ValueError("Error! Please call the generate_saml_assert2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.generate_saml_assert2_with_http_info(content_type, saml_assert, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def generate_saml_assert2_with_http_info(self, content_type : Optional[StrictStr] = None, saml_assert : Optional[SamlAssert] = None, **kwargs) -> ApiResponse: # noqa: E501 """Generate SAML Assertion # noqa: E501 @@ -360,7 +360,7 @@ def generate_saml_assert2_with_http_info(self, content_type : Optional[StrictStr collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def ver_factor_saml(self, content_type : Optional[StrictStr] = None, saml_factor : Optional[SamlFactor] = None, **kwargs) -> VerFactorSaml200Response: # noqa: E501 """Verify Factor SAML # noqa: E501 @@ -391,7 +391,7 @@ def ver_factor_saml(self, content_type : Optional[StrictStr] = None, saml_factor raise ValueError("Error! Please call the ver_factor_saml_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.ver_factor_saml_with_http_info(content_type, saml_factor, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def ver_factor_saml_with_http_info(self, content_type : Optional[StrictStr] = None, saml_factor : Optional[SamlFactor] = None, **kwargs) -> ApiResponse: # noqa: E501 """Verify Factor SAML # noqa: E501 @@ -517,7 +517,7 @@ def ver_factor_saml_with_http_info(self, content_type : Optional[StrictStr] = No collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def ver_factor_saml2(self, content_type : Optional[StrictStr] = None, saml_factor : Optional[SamlFactor] = None, **kwargs) -> VerFactorSaml200Response: # noqa: E501 """Verify Factor SAML # noqa: E501 @@ -548,7 +548,7 @@ def ver_factor_saml2(self, content_type : Optional[StrictStr] = None, saml_facto raise ValueError("Error! Please call the ver_factor_saml2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.ver_factor_saml2_with_http_info(content_type, saml_factor, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def ver_factor_saml2_with_http_info(self, content_type : Optional[StrictStr] = None, saml_factor : Optional[SamlFactor] = None, **kwargs) -> ApiResponse: # noqa: E501 """Verify Factor SAML # noqa: E501 diff --git a/onelogin/api/smart_hooks_api.py b/onelogin/api/smart_hooks_api.py index 6292048f..c35f1a9c 100644 --- a/onelogin/api/smart_hooks_api.py +++ b/onelogin/api/smart_hooks_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr @@ -48,7 +48,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_environment_variable(self, hook_envvar : HookEnvvar, **kwargs) -> HookEnvvar: # noqa: E501 """Create Environment Variable # noqa: E501 @@ -77,7 +77,7 @@ def create_environment_variable(self, hook_envvar : HookEnvvar, **kwargs) -> Hoo raise ValueError("Error! Please call the create_environment_variable_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_environment_variable_with_http_info(hook_envvar, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_environment_variable_with_http_info(self, hook_envvar : HookEnvvar, **kwargs) -> ApiResponse: # noqa: E501 """Create Environment Variable # noqa: E501 @@ -196,7 +196,7 @@ def create_environment_variable_with_http_info(self, hook_envvar : HookEnvvar, * collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def create_hook(self, hook : Hook, **kwargs) -> Hook: # noqa: E501 """Create Smart Hook # noqa: E501 @@ -225,7 +225,7 @@ def create_hook(self, hook : Hook, **kwargs) -> Hook: # noqa: E501 raise ValueError("Error! Please call the create_hook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_hook_with_http_info(hook, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_hook_with_http_info(self, hook : Hook, **kwargs) -> ApiResponse: # noqa: E501 """Create Smart Hook # noqa: E501 @@ -345,7 +345,7 @@ def create_hook_with_http_info(self, hook : Hook, **kwargs) -> ApiResponse: # n collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_environment_variable(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], **kwargs) -> None: # noqa: E501 """Delete Environment Variable # noqa: E501 @@ -374,7 +374,7 @@ def delete_environment_variable(self, envvar_id : Annotated[StrictStr, Field(... raise ValueError("Error! Please call the delete_environment_variable_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_environment_variable_with_http_info(envvar_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_environment_variable_with_http_info(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Environment Variable # noqa: E501 @@ -482,7 +482,7 @@ def delete_environment_variable_with_http_info(self, envvar_id : Annotated[Stric collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], **kwargs) -> None: # noqa: E501 """Delete Smart Hook by ID # noqa: E501 @@ -511,7 +511,7 @@ def delete_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set raise ValueError("Error! Please call the delete_hook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_hook_with_http_info(hook_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_hook_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Smart Hook by ID # noqa: E501 @@ -619,7 +619,7 @@ def delete_hook_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., d collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_environment_variable(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], **kwargs) -> HookEnvvar: # noqa: E501 """Get Environment Variable # noqa: E501 @@ -648,7 +648,7 @@ def get_environment_variable(self, envvar_id : Annotated[StrictStr, Field(..., d raise ValueError("Error! Please call the get_environment_variable_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_environment_variable_with_http_info(envvar_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_environment_variable_with_http_info(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Environment Variable # noqa: E501 @@ -759,7 +759,7 @@ def get_environment_variable_with_http_info(self, envvar_id : Annotated[StrictSt collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], **kwargs) -> Hook: # noqa: E501 """Get Smart Hook by ID # noqa: E501 @@ -788,7 +788,7 @@ def get_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set to raise ValueError("Error! Please call the get_hook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_hook_with_http_info(hook_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_hook_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Smart Hook by ID # noqa: E501 @@ -900,7 +900,7 @@ def get_hook_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., desc collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_logs(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, request_id : Annotated[Optional[StrictStr], Field(description="Returns logs that contain this request_id.")] = None, correlation_id : Annotated[Optional[StrictStr], Field(description="Returns logs that contain this correlation_id.")] = None, **kwargs) -> List[HookLog]: # noqa: E501 """Get Smart Hook Logs # noqa: E501 @@ -939,7 +939,7 @@ def get_logs(self, hook_id : Annotated[StrictStr, Field(..., description="Set to raise ValueError("Error! Please call the get_logs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_logs_with_http_info(hook_id, limit, page, cursor, request_id, correlation_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_logs_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, request_id : Annotated[Optional[StrictStr], Field(description="Returns logs that contain this request_id.")] = None, correlation_id : Annotated[Optional[StrictStr], Field(description="Returns logs that contain this correlation_id.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Smart Hook Logs # noqa: E501 @@ -1081,7 +1081,7 @@ def get_logs_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., desc collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_environment_variables(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, **kwargs) -> List[HookEnvvar]: # noqa: E501 """List Environment Variables # noqa: E501 @@ -1114,7 +1114,7 @@ def list_environment_variables(self, limit : Annotated[Optional[StrictInt], Fiel raise ValueError("Error! Please call the list_environment_variables_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_environment_variables_with_http_info(limit, page, cursor, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_environment_variables_with_http_info(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Environment Variables # noqa: E501 @@ -1237,7 +1237,7 @@ def list_environment_variables_with_http_info(self, limit : Annotated[Optional[S collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_hooks(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, **kwargs) -> List[Hook]: # noqa: E501 """List all Smart Hooks # noqa: E501 @@ -1270,7 +1270,7 @@ def list_hooks(self, limit : Annotated[Optional[StrictInt], Field(description="H raise ValueError("Error! Please call the list_hooks_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_hooks_with_http_info(limit, page, cursor, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_hooks_with_http_info(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List all Smart Hooks # noqa: E501 @@ -1393,7 +1393,7 @@ def list_hooks_with_http_info(self, limit : Annotated[Optional[StrictInt], Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_environment_variable(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], update_environment_variable_request : UpdateEnvironmentVariableRequest, **kwargs) -> HookEnvvar: # noqa: E501 """Update Environment Variable # noqa: E501 @@ -1424,7 +1424,7 @@ def update_environment_variable(self, envvar_id : Annotated[StrictStr, Field(... raise ValueError("Error! Please call the update_environment_variable_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_environment_variable_with_http_info(envvar_id, update_environment_variable_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_environment_variable_with_http_info(self, envvar_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook Environment Variable that you want to fetch.")], update_environment_variable_request : UpdateEnvironmentVariableRequest, **kwargs) -> ApiResponse: # noqa: E501 """Update Environment Variable # noqa: E501 @@ -1550,7 +1550,7 @@ def update_environment_variable_with_http_info(self, envvar_id : Annotated[Stric collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], hook : Hook, **kwargs) -> Hook: # noqa: E501 """Update Smart Hook by ID # noqa: E501 @@ -1581,7 +1581,7 @@ def update_hook(self, hook_id : Annotated[StrictStr, Field(..., description="Set raise ValueError("Error! Please call the update_hook_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_hook_with_http_info(hook_id, hook, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_hook_with_http_info(self, hook_id : Annotated[StrictStr, Field(..., description="Set to the id of the Hook that you want to return.")], hook : Hook, **kwargs) -> ApiResponse: # noqa: E501 """Update Smart Hook by ID # noqa: E501 diff --git a/onelogin/api/user_mappings_api.py b/onelogin/api/user_mappings_api.py index 9053c091..503a2762 100644 --- a/onelogin/api/user_mappings_api.py +++ b/onelogin/api/user_mappings_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, conlist @@ -50,7 +50,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_mapping(self, content_type : Optional[StrictStr] = None, mapping : Optional[Mapping] = None, **kwargs) -> List[Mapping]: # noqa: E501 """Create Mapping # noqa: E501 @@ -81,7 +81,7 @@ def create_mapping(self, content_type : Optional[StrictStr] = None, mapping : Op raise ValueError("Error! Please call the create_mapping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_mapping_with_http_info(content_type, mapping, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_mapping_with_http_info(self, content_type : Optional[StrictStr] = None, mapping : Optional[Mapping] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Mapping # noqa: E501 @@ -206,7 +206,7 @@ def create_mapping_with_http_info(self, content_type : Optional[StrictStr] = Non collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_mapping(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], **kwargs) -> None: # noqa: E501 """Delete Mapping # noqa: E501 @@ -235,7 +235,7 @@ def delete_mapping(self, mapping_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the delete_mapping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_mapping_with_http_info(mapping_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_mapping_with_http_info(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete Mapping # noqa: E501 @@ -343,7 +343,7 @@ def delete_mapping_with_http_info(self, mapping_id : Annotated[StrictInt, Field( collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_mapping(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], **kwargs) -> Mapping: # noqa: E501 """Get Mapping # noqa: E501 @@ -372,7 +372,7 @@ def get_mapping(self, mapping_id : Annotated[StrictInt, Field(..., description=" raise ValueError("Error! Please call the get_mapping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_mapping_with_http_info(mapping_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_mapping_with_http_info(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Mapping # noqa: E501 @@ -484,7 +484,7 @@ def get_mapping_with_http_info(self, mapping_id : Annotated[StrictInt, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mapping_action_values(self, mapping_action_value : StrictStr, **kwargs) -> List[ListMappingActionValues200ResponseInner]: # noqa: E501 """List Actions Values # noqa: E501 @@ -513,7 +513,7 @@ def list_mapping_action_values(self, mapping_action_value : StrictStr, **kwargs) raise ValueError("Error! Please call the list_mapping_action_values_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mapping_action_values_with_http_info(mapping_action_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mapping_action_values_with_http_info(self, mapping_action_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Actions Values # noqa: E501 @@ -624,7 +624,7 @@ def list_mapping_action_values_with_http_info(self, mapping_action_value : Stric collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mapping_conditions(self, **kwargs) -> ListMappingConditions200Response: # noqa: E501 """List Conditions # noqa: E501 @@ -651,7 +651,7 @@ def list_mapping_conditions(self, **kwargs) -> ListMappingConditions200Response: raise ValueError("Error! Please call the list_mapping_conditions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mapping_conditions_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mapping_conditions_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions # noqa: E501 @@ -756,7 +756,7 @@ def list_mapping_conditions_with_http_info(self, **kwargs) -> ApiResponse: # no collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mapping_conditions_operators(self, mapping_condition_value : StrictStr, **kwargs) -> List[ListMappingConditionsOperators200ResponseInner]: # noqa: E501 """List Conditions Operators # noqa: E501 @@ -785,7 +785,7 @@ def list_mapping_conditions_operators(self, mapping_condition_value : StrictStr, raise ValueError("Error! Please call the list_mapping_conditions_operators_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mapping_conditions_operators_with_http_info(mapping_condition_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mapping_conditions_operators_with_http_info(self, mapping_condition_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions Operators # noqa: E501 @@ -896,7 +896,7 @@ def list_mapping_conditions_operators_with_http_info(self, mapping_condition_val collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mapping_contion_values(self, mapping_condition_value : StrictStr, **kwargs) -> List[ListMappingContionValues200ResponseInner]: # noqa: E501 """List Conditions Values # noqa: E501 @@ -925,7 +925,7 @@ def list_mapping_contion_values(self, mapping_condition_value : StrictStr, **kwa raise ValueError("Error! Please call the list_mapping_contion_values_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mapping_contion_values_with_http_info(mapping_condition_value, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mapping_contion_values_with_http_info(self, mapping_condition_value : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """List Conditions Values # noqa: E501 @@ -1036,7 +1036,7 @@ def list_mapping_contion_values_with_http_info(self, mapping_condition_value : S collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mappings(self, enabled : Annotated[Optional[StrictBool], Field(description="Defaults to true. When set to `false` will return all disabled mappings.")] = None, has_condition : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_condition_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_action : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Actions. Values formatted as :, where name is the Action to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_action=set_licenses:123456 Multiple filters. has_action=set_groups:123456,set_usertype:* Wildcard for actions. has_action=*:123456 Wildcard for action values. has_action=set_userprincipalname:*")] = None, has_action_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their action types. Allowed values are: builtin - actions that involve standard attributes custom - actions that involve custom attributes none - no actions are defined For example: Find Rules with no actions has_action_type=none")] = None, **kwargs) -> List[Mapping]: # noqa: E501 """List Mappings # noqa: E501 @@ -1073,7 +1073,7 @@ def list_mappings(self, enabled : Annotated[Optional[StrictBool], Field(descript raise ValueError("Error! Please call the list_mappings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mappings_with_http_info(enabled, has_condition, has_condition_type, has_action, has_action_type, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mappings_with_http_info(self, enabled : Annotated[Optional[StrictBool], Field(description="Defaults to true. When set to `false` will return all disabled mappings.")] = None, has_condition : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_condition_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Conditions. Values formatted as :, where name is the Condition to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_condition=has_role:123456 Multiple filters. has_condition=has_role:123456,status:1 Wildcard for conditions. has_condition=*:123456 Wildcard for condition values. has_condition=has_role:*")] = None, has_action : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their Actions. Values formatted as :, where name is the Action to look for, and value is the value to find. Multiple filters can be declared by using a comma delimited list. Wildcards are supported in both the name and value fields. For example: Single filter. has_action=set_licenses:123456 Multiple filters. has_action=set_groups:123456,set_usertype:* Wildcard for actions. has_action=*:123456 Wildcard for action values. has_action=set_userprincipalname:*")] = None, has_action_type : Annotated[Optional[StrictStr], Field(description="Filters Rules based on their action types. Allowed values are: builtin - actions that involve standard attributes custom - actions that involve custom attributes none - no actions are defined For example: Find Rules with no actions has_action_type=none")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Mappings # noqa: E501 @@ -1208,7 +1208,7 @@ def list_mappings_with_http_info(self, enabled : Annotated[Optional[StrictBool], collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_mappings_actions(self, **kwargs) -> List[ListMappingsActions200ResponseInner]: # noqa: E501 """List Actions # noqa: E501 @@ -1235,7 +1235,7 @@ def list_mappings_actions(self, **kwargs) -> List[ListMappingsActions200Response raise ValueError("Error! Please call the list_mappings_actions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_mappings_actions_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_mappings_actions_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Actions # noqa: E501 @@ -1340,7 +1340,7 @@ def list_mappings_actions_with_http_info(self, **kwargs) -> ApiResponse: # noqa collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def sort_mappings(self, request_body : Optional[conlist(StrictInt)] = None, **kwargs) -> List[int]: # noqa: E501 """Bulk Sort # noqa: E501 @@ -1369,7 +1369,7 @@ def sort_mappings(self, request_body : Optional[conlist(StrictInt)] = None, **kw raise ValueError("Error! Please call the sort_mappings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.sort_mappings_with_http_info(request_body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def sort_mappings_with_http_info(self, request_body : Optional[conlist(StrictInt)] = None, **kwargs) -> ApiResponse: # noqa: E501 """Bulk Sort # noqa: E501 @@ -1488,7 +1488,7 @@ def sort_mappings_with_http_info(self, request_body : Optional[conlist(StrictInt collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_mapping(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], content_type : Optional[StrictStr] = None, body : Optional[Dict[str, Any]] = None, **kwargs) -> int: # noqa: E501 """Update Mapping # noqa: E501 @@ -1521,7 +1521,7 @@ def update_mapping(self, mapping_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the update_mapping_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_mapping_with_http_info(mapping_id, content_type, body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_mapping_with_http_info(self, mapping_id : Annotated[StrictInt, Field(..., description="The id of the user mapping to locate.")], content_type : Optional[StrictStr] = None, body : Optional[Dict[str, Any]] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Mapping # noqa: E501 diff --git a/onelogin/api/users_v1_api.py b/onelogin/api/users_v1_api.py index d4e373bb..17223003 100644 --- a/onelogin/api/users_v1_api.py +++ b/onelogin/api/users_v1_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr @@ -55,7 +55,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def add_roles_to_user(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], add_roles_to_user_request : Optional[AddRolesToUserRequest] = None, **kwargs) -> Error: # noqa: E501 """Add Roles for a User # noqa: E501 @@ -86,7 +86,7 @@ def add_roles_to_user(self, user_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the add_roles_to_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.add_roles_to_user_with_http_info(user_id, add_roles_to_user_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def add_roles_to_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], add_roles_to_user_request : Optional[AddRolesToUserRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Add Roles for a User # noqa: E501 @@ -213,7 +213,7 @@ def add_roles_to_user_with_http_info(self, user_id : Annotated[StrictInt, Field( collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def create_user(self, mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 """Create a User # noqa: E501 @@ -246,7 +246,7 @@ def create_user(self, mappings : Annotated[Optional[StrictStr], Field(descriptio raise ValueError("Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_user_with_http_info(mappings, validate_policy, user, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_user_with_http_info(self, mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create a User # noqa: E501 @@ -378,7 +378,7 @@ def create_user_with_http_info(self, mappings : Annotated[Optional[StrictStr], F collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_user(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> None: # noqa: E501 """Delete a User # noqa: E501 @@ -407,7 +407,7 @@ def delete_user(self, user_id : Annotated[StrictInt, Field(..., description="Set raise ValueError("Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_user_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete a User # noqa: E501 @@ -515,7 +515,7 @@ def delete_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., d collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_custom_attributes(self, **kwargs) -> GetCustomAttributes200Response: # noqa: E501 """Get Custom Attributes # noqa: E501 @@ -542,7 +542,7 @@ def get_custom_attributes(self, **kwargs) -> GetCustomAttributes200Response: # raise ValueError("Error! Please call the get_custom_attributes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_custom_attributes_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_custom_attributes_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Get Custom Attributes # noqa: E501 @@ -648,7 +648,7 @@ def get_custom_attributes_with_http_info(self, **kwargs) -> ApiResponse: # noqa collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_apps(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], ignore_visibility : Annotated[Optional[StrictBool], Field(description="Defaults to `false`. When `true` will show all apps that are assigned to a user regardless of their portal visibility setting.")] = None, **kwargs) -> List[GetUserApps200ResponseInner]: # noqa: E501 """Get Apps for a User # noqa: E501 @@ -679,7 +679,7 @@ def get_user_apps(self, user_id : Annotated[StrictInt, Field(..., description="S raise ValueError("Error! Please call the get_user_apps_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_apps_with_http_info(user_id, ignore_visibility, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_apps_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], ignore_visibility : Annotated[Optional[StrictBool], Field(description="Defaults to `false`. When `true` will show all apps that are assigned to a user regardless of their portal visibility setting.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get Apps for a User # noqa: E501 @@ -797,7 +797,7 @@ def get_user_apps_with_http_info(self, user_id : Annotated[StrictInt, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_by_id(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> User: # noqa: E501 """Get User by ID # noqa: E501 @@ -826,7 +826,7 @@ def get_user_by_id(self, user_id : Annotated[StrictInt, Field(..., description=" raise ValueError("Error! Please call the get_user_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_by_id_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_by_id_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get User by ID # noqa: E501 @@ -938,7 +938,7 @@ def get_user_by_id_with_http_info(self, user_id : Annotated[StrictInt, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_roles(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> GetUserRoles200Response: # noqa: E501 """Get Roles for a User # noqa: E501 @@ -967,7 +967,7 @@ def get_user_roles(self, user_id : Annotated[StrictInt, Field(..., description=" raise ValueError("Error! Please call the get_user_roles_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_roles_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_roles_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get Roles for a User # noqa: E501 @@ -1081,7 +1081,7 @@ def get_user_roles_with_http_info(self, user_id : Annotated[StrictInt, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_users(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, created_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created after a given date & time.")] = None, created_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created before a given date & time.")] = None, updated_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated after a given date & time.")] = None, updated_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated before a given date & time.")] = None, last_login_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in after a given date & time.")] = None, last_login_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in before a given date & time.")] = None, firstname : Annotated[Optional[StrictStr], Field(description="The first name of the user")] = None, lastname : Annotated[Optional[StrictStr], Field(description="The last name of the user")] = None, email : Annotated[Optional[StrictStr], Field(description="The email address of the user")] = None, username : Annotated[Optional[StrictStr], Field(description="The username for the user")] = None, samaccountname : Annotated[Optional[StrictStr], Field(description="The AD login name for the user")] = None, directory_id : Optional[StrictInt] = None, external_id : Annotated[Optional[StrictStr], Field(description="An external identifier that has been set on the user")] = None, user_ids : Annotated[Optional[StrictStr], Field(description="A comma separated list of OneLogin User IDs")] = None, custom_attributes_attribute_name : Annotated[Optional[StrictStr], Field(description="The short name of a custom attribute. Note that the attribute name is prefixed with custom_attributes.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> List[User]: # noqa: E501 """List Users # noqa: E501 @@ -1146,7 +1146,7 @@ def list_users(self, limit : Annotated[Optional[StrictInt], Field(description="H raise ValueError("Error! Please call the list_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_users_with_http_info(limit, page, cursor, created_since, created_until, updated_since, updated_until, last_login_since, last_login_until, firstname, lastname, email, username, samaccountname, directory_id, external_id, user_ids, custom_attributes_attribute_name, fields, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_users_with_http_info(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, created_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created after a given date & time.")] = None, created_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created before a given date & time.")] = None, updated_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated after a given date & time.")] = None, updated_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated before a given date & time.")] = None, last_login_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in after a given date & time.")] = None, last_login_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in before a given date & time.")] = None, firstname : Annotated[Optional[StrictStr], Field(description="The first name of the user")] = None, lastname : Annotated[Optional[StrictStr], Field(description="The last name of the user")] = None, email : Annotated[Optional[StrictStr], Field(description="The email address of the user")] = None, username : Annotated[Optional[StrictStr], Field(description="The username for the user")] = None, samaccountname : Annotated[Optional[StrictStr], Field(description="The AD login name for the user")] = None, directory_id : Optional[StrictInt] = None, external_id : Annotated[Optional[StrictStr], Field(description="An external identifier that has been set on the user")] = None, user_ids : Annotated[Optional[StrictStr], Field(description="A comma separated list of OneLogin User IDs")] = None, custom_attributes_attribute_name : Annotated[Optional[StrictStr], Field(description="The short name of a custom attribute. Note that the attribute name is prefixed with custom_attributes.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Users # noqa: E501 @@ -1367,7 +1367,7 @@ def list_users_with_http_info(self, limit : Annotated[Optional[StrictInt], Field collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def lock_account_user(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], lock_account_user_request : Optional[LockAccountUserRequest] = None, **kwargs) -> Error: # noqa: E501 """Lock User Account # noqa: E501 @@ -1398,7 +1398,7 @@ def lock_account_user(self, user_id : Annotated[StrictInt, Field(..., descriptio raise ValueError("Error! Please call the lock_account_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.lock_account_user_with_http_info(user_id, lock_account_user_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def lock_account_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], lock_account_user_request : Optional[LockAccountUserRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Lock User Account # noqa: E501 @@ -1525,7 +1525,7 @@ def lock_account_user_with_http_info(self, user_id : Annotated[StrictInt, Field( collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def log_out_user(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], body : Optional[Dict[str, Any]] = None, **kwargs) -> Error: # noqa: E501 """Log User Out # noqa: E501 @@ -1556,7 +1556,7 @@ def log_out_user(self, user_id : Annotated[StrictInt, Field(..., description="Se raise ValueError("Error! Please call the log_out_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.log_out_user_with_http_info(user_id, body, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def log_out_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], body : Optional[Dict[str, Any]] = None, **kwargs) -> ApiResponse: # noqa: E501 """Log User Out # noqa: E501 @@ -1683,7 +1683,7 @@ def log_out_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def remove_user_role(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], remove_user_role_request : Optional[RemoveUserRoleRequest] = None, **kwargs) -> Error: # noqa: E501 """Remove Roles for a User # noqa: E501 @@ -1714,7 +1714,7 @@ def remove_user_role(self, user_id : Annotated[StrictInt, Field(..., description raise ValueError("Error! Please call the remove_user_role_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.remove_user_role_with_http_info(user_id, remove_user_role_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def remove_user_role_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], remove_user_role_request : Optional[RemoveUserRoleRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Remove Roles for a User # noqa: E501 @@ -1841,7 +1841,7 @@ def remove_user_role_with_http_info(self, user_id : Annotated[StrictInt, Field(. collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def set_user_state(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], set_user_state_request : Optional[SetUserStateRequest] = None, **kwargs) -> Error: # noqa: E501 """Set User State # noqa: E501 @@ -1872,7 +1872,7 @@ def set_user_state(self, user_id : Annotated[StrictInt, Field(..., description=" raise ValueError("Error! Please call the set_user_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.set_user_state_with_http_info(user_id, set_user_state_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def set_user_state_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], set_user_state_request : Optional[SetUserStateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Set User State # noqa: E501 @@ -1999,7 +1999,7 @@ def set_user_state_with_http_info(self, user_id : Annotated[StrictInt, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_password_insecure(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], update_password_insecure_request : Optional[UpdatePasswordInsecureRequest] = None, **kwargs) -> Error: # noqa: E501 """Set Password Using ID in Cleartext # noqa: E501 @@ -2030,7 +2030,7 @@ def update_password_insecure(self, user_id : Annotated[StrictInt, Field(..., des raise ValueError("Error! Please call the update_password_insecure_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_password_insecure_with_http_info(user_id, update_password_insecure_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_password_insecure_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], update_password_insecure_request : Optional[UpdatePasswordInsecureRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Set Password Using ID in Cleartext # noqa: E501 @@ -2157,7 +2157,7 @@ def update_password_insecure_with_http_info(self, user_id : Annotated[StrictInt, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_password_secure(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], update_password_secure_request : Optional[UpdatePasswordSecureRequest] = None, **kwargs) -> Error: # noqa: E501 """Set Password Using ID and SHA-256 and Salt # noqa: E501 @@ -2188,7 +2188,7 @@ def update_password_secure(self, user_id : Annotated[StrictInt, Field(..., descr raise ValueError("Error! Please call the update_password_secure_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_password_secure_with_http_info(user_id, update_password_secure_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_password_secure_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], update_password_secure_request : Optional[UpdatePasswordSecureRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Set Password Using ID and SHA-256 and Salt # noqa: E501 @@ -2315,7 +2315,7 @@ def update_password_secure_with_http_info(self, user_id : Annotated[StrictInt, F collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_user(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 """Update a User # noqa: E501 @@ -2350,7 +2350,7 @@ def update_user(self, user_id : Annotated[StrictInt, Field(..., description="Set raise ValueError("Error! Please call the update_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_user_with_http_info(user_id, mappings, validate_policy, user, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_user_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update a User # noqa: E501 diff --git a/onelogin/api/users_v2_api.py b/onelogin/api/users_v2_api.py index 6d77988f..5aea226c 100644 --- a/onelogin/api/users_v2_api.py +++ b/onelogin/api/users_v2_api.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr @@ -46,7 +46,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_user2(self, mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 """Create User # noqa: E501 @@ -79,7 +79,7 @@ def create_user2(self, mappings : Annotated[Optional[StrictStr], Field(descripti raise ValueError("Error! Please call the create_user2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_user2_with_http_info(mappings, validate_policy, user, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_user2_with_http_info(self, mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create User # noqa: E501 @@ -211,7 +211,7 @@ def create_user2_with_http_info(self, mappings : Annotated[Optional[StrictStr], collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_user2(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> None: # noqa: E501 """Delete User # noqa: E501 @@ -240,7 +240,7 @@ def delete_user2(self, user_id : Annotated[StrictInt, Field(..., description="Se raise ValueError("Error! Please call the delete_user2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_user2_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_user2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Delete User # noqa: E501 @@ -348,7 +348,7 @@ def delete_user2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user2(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> User: # noqa: E501 """Get User # noqa: E501 @@ -377,7 +377,7 @@ def get_user2(self, user_id : Annotated[StrictInt, Field(..., description="Set t raise ValueError("Error! Please call the get_user2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user2_with_http_info(user_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], **kwargs) -> ApiResponse: # noqa: E501 """Get User # noqa: E501 @@ -489,7 +489,7 @@ def get_user2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., des collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_user_apps2(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], ignore_visibility : Annotated[Optional[StrictBool], Field(description="Defaults to `false`. When `true` will show all apps that are assigned to a user regardless of their portal visibility setting.")] = None, **kwargs) -> List[GetUserApps200ResponseInner]: # noqa: E501 """Get User Apps # noqa: E501 @@ -520,7 +520,7 @@ def get_user_apps2(self, user_id : Annotated[StrictInt, Field(..., description=" raise ValueError("Error! Please call the get_user_apps2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_user_apps2_with_http_info(user_id, ignore_visibility, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_user_apps2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], ignore_visibility : Annotated[Optional[StrictBool], Field(description="Defaults to `false`. When `true` will show all apps that are assigned to a user regardless of their portal visibility setting.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get User Apps # noqa: E501 @@ -638,7 +638,7 @@ def get_user_apps2_with_http_info(self, user_id : Annotated[StrictInt, Field(... collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_users2(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, created_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created after a given date & time.")] = None, created_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created before a given date & time.")] = None, updated_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated after a given date & time.")] = None, updated_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated before a given date & time.")] = None, last_login_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in after a given date & time.")] = None, last_login_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in before a given date & time.")] = None, firstname : Annotated[Optional[StrictStr], Field(description="The first name of the user")] = None, lastname : Annotated[Optional[StrictStr], Field(description="The last name of the user")] = None, email : Annotated[Optional[StrictStr], Field(description="The email address of the user")] = None, username : Annotated[Optional[StrictStr], Field(description="The username for the user")] = None, samaccountname : Annotated[Optional[StrictStr], Field(description="The AD login name for the user")] = None, directory_id : Optional[StrictInt] = None, external_id : Annotated[Optional[StrictStr], Field(description="An external identifier that has been set on the user")] = None, user_ids : Annotated[Optional[StrictStr], Field(description="A comma separated list of OneLogin User IDs")] = None, custom_attributes_attribute_name : Annotated[Optional[StrictStr], Field(description="The short name of a custom attribute. Note that the attribute name is prefixed with custom_attributes.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> List[User]: # noqa: E501 """List Users # noqa: E501 @@ -703,7 +703,7 @@ def list_users2(self, limit : Annotated[Optional[StrictInt], Field(description=" raise ValueError("Error! Please call the list_users2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_users2_with_http_info(limit, page, cursor, created_since, created_until, updated_since, updated_until, last_login_since, last_login_until, firstname, lastname, email, username, samaccountname, directory_id, external_id, user_ids, custom_attributes_attribute_name, fields, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_users2_with_http_info(self, limit : Annotated[Optional[StrictInt], Field(description="How many items to return at one time (max 100)")] = None, page : Annotated[Optional[StrictInt], Field(description="The page number of results to return.")] = None, cursor : Annotated[Optional[StrictStr], Field(description="Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.")] = None, created_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created after a given date & time.")] = None, created_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users created before a given date & time.")] = None, updated_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated after a given date & time.")] = None, updated_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users updated before a given date & time.")] = None, last_login_since : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in after a given date & time.")] = None, last_login_until : Annotated[Optional[StrictStr], Field(description="An ISO8601 timestamp value that returns all users that logged in before a given date & time.")] = None, firstname : Annotated[Optional[StrictStr], Field(description="The first name of the user")] = None, lastname : Annotated[Optional[StrictStr], Field(description="The last name of the user")] = None, email : Annotated[Optional[StrictStr], Field(description="The email address of the user")] = None, username : Annotated[Optional[StrictStr], Field(description="The username for the user")] = None, samaccountname : Annotated[Optional[StrictStr], Field(description="The AD login name for the user")] = None, directory_id : Optional[StrictInt] = None, external_id : Annotated[Optional[StrictStr], Field(description="An external identifier that has been set on the user")] = None, user_ids : Annotated[Optional[StrictStr], Field(description="A comma separated list of OneLogin User IDs")] = None, custom_attributes_attribute_name : Annotated[Optional[StrictStr], Field(description="The short name of a custom attribute. Note that the attribute name is prefixed with custom_attributes.")] = None, fields : Annotated[Optional[StrictStr], Field(description="Optional. Comma delimited list of fields to return.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """List Users # noqa: E501 @@ -924,7 +924,7 @@ def list_users2_with_http_info(self, limit : Annotated[Optional[StrictInt], Fiel collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_user2(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 """Update User # noqa: E501 @@ -959,7 +959,7 @@ def update_user2(self, user_id : Annotated[StrictInt, Field(..., description="Se raise ValueError("Error! Please call the update_user2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_user2_with_http_info(user_id, mappings, validate_policy, user, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_user2_with_http_info(self, user_id : Annotated[StrictInt, Field(..., description="Set to the id of the user that you want to return.")], mappings : Annotated[Optional[StrictStr], Field(description="Controls how mappings will be applied to the user on creation. Defaults to async.")] = None, validate_policy : Annotated[Optional[StrictBool], Field(description="Will passwords validate against the User Policy? Defaults to true.")] = None, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update User # noqa: E501 diff --git a/onelogin/api/vigilance_ai_api.py b/onelogin/api/vigilance_ai_api.py index 3075b41d..e15490f0 100644 --- a/onelogin/api/vigilance_ai_api.py +++ b/onelogin/api/vigilance_ai_api.py @@ -17,7 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, ValidationError from typing_extensions import Annotated from pydantic import Field, StrictStr @@ -51,7 +51,7 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def create_risk_rule(self, risk_rule : Optional[RiskRule] = None, **kwargs) -> RiskRule: # noqa: E501 """Create Rule # noqa: E501 @@ -80,7 +80,7 @@ def create_risk_rule(self, risk_rule : Optional[RiskRule] = None, **kwargs) -> R raise ValueError("Error! Please call the create_risk_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.create_risk_rule_with_http_info(risk_rule, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def create_risk_rule_with_http_info(self, risk_rule : Optional[RiskRule] = None, **kwargs) -> ApiResponse: # noqa: E501 """Create Rule # noqa: E501 @@ -199,7 +199,7 @@ def create_risk_rule_with_http_info(self, risk_rule : Optional[RiskRule] = None, collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def delete_risk_rule(self, rule_id : StrictStr, **kwargs) -> None: # noqa: E501 """Delete Rule # noqa: E501 @@ -228,7 +228,7 @@ def delete_risk_rule(self, rule_id : StrictStr, **kwargs) -> None: # noqa: E501 raise ValueError("Error! Please call the delete_risk_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.delete_risk_rule_with_http_info(rule_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def delete_risk_rule_with_http_info(self, rule_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """Delete Rule # noqa: E501 @@ -336,7 +336,7 @@ def delete_risk_rule_with_http_info(self, rule_id : StrictStr, **kwargs) -> ApiR collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_risk_rule(self, rule_id : StrictStr, **kwargs) -> RiskRule: # noqa: E501 """get Risk Rule # noqa: E501 @@ -365,7 +365,7 @@ def get_risk_rule(self, rule_id : StrictStr, **kwargs) -> RiskRule: # noqa: E50 raise ValueError("Error! Please call the get_risk_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_risk_rule_with_http_info(rule_id, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_risk_rule_with_http_info(self, rule_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 """get Risk Rule # noqa: E501 @@ -476,7 +476,7 @@ def get_risk_rule_with_http_info(self, rule_id : StrictStr, **kwargs) -> ApiResp collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_risk_score(self, get_risk_score_request : GetRiskScoreRequest, before : Annotated[Optional[StrictStr], Field(description="Optional ISO8601 formatted date string. Defaults to current date. Maximum date is 90 days ago.")] = None, after : Annotated[Optional[StrictStr], Field(description="Optional ISO8601 formatted date string. Defaults to 30 days ago. Maximum date is 90 days ago.")] = None, **kwargs) -> GetRiskScore200Response: # noqa: E501 """Get a Risk Score # noqa: E501 @@ -509,7 +509,7 @@ def get_risk_score(self, get_risk_score_request : GetRiskScoreRequest, before : raise ValueError("Error! Please call the get_risk_score_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_risk_score_with_http_info(get_risk_score_request, before, after, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_risk_score_with_http_info(self, get_risk_score_request : GetRiskScoreRequest, before : Annotated[Optional[StrictStr], Field(description="Optional ISO8601 formatted date string. Defaults to current date. Maximum date is 90 days ago.")] = None, after : Annotated[Optional[StrictStr], Field(description="Optional ISO8601 formatted date string. Defaults to 30 days ago. Maximum date is 90 days ago.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """Get a Risk Score # noqa: E501 @@ -640,7 +640,7 @@ def get_risk_score_with_http_info(self, get_risk_score_request : GetRiskScoreReq collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def get_risk_scores(self, **kwargs) -> GetRiskScores200Response: # noqa: E501 """Get Score Summary # noqa: E501 @@ -667,7 +667,7 @@ def get_risk_scores(self, **kwargs) -> GetRiskScores200Response: # noqa: E501 raise ValueError("Error! Please call the get_risk_scores_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.get_risk_scores_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def get_risk_scores_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """Get Score Summary # noqa: E501 @@ -772,7 +772,7 @@ def get_risk_scores_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def list_risk_rules(self, **kwargs) -> List[RiskRule]: # noqa: E501 """List Rules # noqa: E501 @@ -799,7 +799,7 @@ def list_risk_rules(self, **kwargs) -> List[RiskRule]: # noqa: E501 raise ValueError("Error! Please call the list_risk_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.list_risk_rules_with_http_info(**kwargs) # noqa: E501 - @validate_arguments + @validate_call def list_risk_rules_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 """List Rules # noqa: E501 @@ -904,7 +904,7 @@ def list_risk_rules_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def track_risk_event(self, track_risk_event_request : TrackRiskEventRequest, **kwargs) -> None: # noqa: E501 """Track an Event # noqa: E501 @@ -933,7 +933,7 @@ def track_risk_event(self, track_risk_event_request : TrackRiskEventRequest, **k raise ValueError("Error! Please call the track_risk_event_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.track_risk_event_with_http_info(track_risk_event_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def track_risk_event_with_http_info(self, track_risk_event_request : TrackRiskEventRequest, **kwargs) -> ApiResponse: # noqa: E501 """Track an Event # noqa: E501 @@ -1048,7 +1048,7 @@ def track_risk_event_with_http_info(self, track_risk_event_request : TrackRiskEv collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments + @validate_call def update_risk_rule(self, rule_id : StrictStr, update_risk_rule_request : Optional[UpdateRiskRuleRequest] = None, **kwargs) -> RiskRule: # noqa: E501 """Update Rule # noqa: E501 @@ -1079,7 +1079,7 @@ def update_risk_rule(self, rule_id : StrictStr, update_risk_rule_request : Optio raise ValueError("Error! Please call the update_risk_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") return self.update_risk_rule_with_http_info(rule_id, update_risk_rule_request, **kwargs) # noqa: E501 - @validate_arguments + @validate_call def update_risk_rule_with_http_info(self, rule_id : StrictStr, update_risk_rule_request : Optional[UpdateRiskRuleRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 """Update Rule # noqa: E501 diff --git a/onelogin/models/action_obj.py b/onelogin/models/action_obj.py index e93b64a5..63e0fc94 100644 --- a/onelogin/models/action_obj.py +++ b/onelogin/models/action_obj.py @@ -29,10 +29,13 @@ class ActionObj(BaseModel): value: Optional[conlist(StrictStr)] = Field(None, description="Only applicable to provisioned and set_* actions. Items in the array will be a plain text string or valid value for the selected action.") __properties = ["action", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/activate_mfa_factors_request.py b/onelogin/models/activate_mfa_factors_request.py index d462389e..2fad8a2a 100644 --- a/onelogin/models/activate_mfa_factors_request.py +++ b/onelogin/models/activate_mfa_factors_request.py @@ -30,10 +30,12 @@ class ActivateMfaFactorsRequest(BaseModel): sms_message: Optional[StrictStr] = Field(None, description="Optional. Only applies to SMS factor. A message template that will be sent via SMS. Max length of the message after template items are inserted is 160 characters. The following template variables can be included in the message. - {{otp_code}} - The security code. - {{expiration}} - The number of minutes until the one time code expires.") __properties = ["state_token_expires_in", "numeric_sms_otp", "sms_message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/add_client_app201_response.py b/onelogin/models/add_client_app201_response.py index cb3e574d..8277381a 100644 --- a/onelogin/models/add_client_app201_response.py +++ b/onelogin/models/add_client_app201_response.py @@ -29,10 +29,12 @@ class AddClientApp201Response(BaseModel): api_auth_id: Optional[StrictInt] = None __properties = ["app_id", "api_auth_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/add_client_app_request.py b/onelogin/models/add_client_app_request.py index eab38dd1..6aa50fed 100644 --- a/onelogin/models/add_client_app_request.py +++ b/onelogin/models/add_client_app_request.py @@ -29,10 +29,12 @@ class AddClientAppRequest(BaseModel): scopes: Optional[conlist(StrictInt)] = Field(None, description="An array of Scope IDs that represent scopes the app can request") __properties = ["app_id", "scopes"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/add_privilege_to_role201_response.py b/onelogin/models/add_privilege_to_role201_response.py index 1cff5c10..a4b30190 100644 --- a/onelogin/models/add_privilege_to_role201_response.py +++ b/onelogin/models/add_privilege_to_role201_response.py @@ -28,10 +28,12 @@ class AddPrivilegeToRole201Response(BaseModel): success: Optional[StrictBool] = None __properties = ["success"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/add_privilege_to_role_request.py b/onelogin/models/add_privilege_to_role_request.py index f9ce54bc..03a6ee77 100644 --- a/onelogin/models/add_privilege_to_role_request.py +++ b/onelogin/models/add_privilege_to_role_request.py @@ -28,10 +28,12 @@ class AddPrivilegeToRoleRequest(BaseModel): roles: Optional[conlist(StrictInt)] = None __properties = ["roles"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/add_roles_to_user_request.py b/onelogin/models/add_roles_to_user_request.py index 12633bec..6a4a6639 100644 --- a/onelogin/models/add_roles_to_user_request.py +++ b/onelogin/models/add_roles_to_user_request.py @@ -28,10 +28,12 @@ class AddRolesToUserRequest(BaseModel): role_id_array: conlist(StrictInt) = Field(..., description="Set to an array of one or more role IDs. The IDs must be positive integers.") __properties = ["role_id_array"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/alt_err.py b/onelogin/models/alt_err.py index e55d4ae8..ffd4da27 100644 --- a/onelogin/models/alt_err.py +++ b/onelogin/models/alt_err.py @@ -30,10 +30,12 @@ class AltErr(BaseModel): message: Optional[StrictStr] = Field(None, description="Description of Error") __properties = ["statusCode", "name", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/app_parameters.py b/onelogin/models/app_parameters.py index 90a9d648..9bf5daf3 100644 --- a/onelogin/models/app_parameters.py +++ b/onelogin/models/app_parameters.py @@ -18,7 +18,7 @@ import json -from typing import Optional +from typing import Optional, Dict, Any from pydantic import BaseModel, Field, StrictBool, StrictStr class AppParameters(BaseModel): @@ -32,10 +32,12 @@ class AppParameters(BaseModel): additional_properties: Dict[str, Any] = {} __properties = ["user_attribute_mappings", "user_attribute_macros", "label", "include_in_saml_assertion"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/app_rule.py b/onelogin/models/app_rule.py index bc9e16e3..8bb46cc1 100644 --- a/onelogin/models/app_rule.py +++ b/onelogin/models/app_rule.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, field_validator from onelogin.models.action_obj import ActionObj from onelogin.models.condition import Condition @@ -36,7 +36,8 @@ class AppRule(BaseModel): actions: Optional[conlist(ActionObj)] = None __properties = ["id", "name", "match", "enabled", "position", "conditions", "actions"] - @validator('match') + @field_validator('match') + @classmethod def match_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -46,10 +47,12 @@ def match_validate_enum(cls, value): raise ValueError("must be one of enum values ('all', 'any')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/assign_users_to_privilege_request.py b/onelogin/models/assign_users_to_privilege_request.py index ef6401fb..4838162f 100644 --- a/onelogin/models/assign_users_to_privilege_request.py +++ b/onelogin/models/assign_users_to_privilege_request.py @@ -28,10 +28,12 @@ class AssignUsersToPrivilegeRequest(BaseModel): users: Optional[conlist(StrictInt)] = None __properties = ["users"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/auth_claim.py b/onelogin/models/auth_claim.py index 2e796ae5..06e8a2f9 100644 --- a/onelogin/models/auth_claim.py +++ b/onelogin/models/auth_claim.py @@ -30,10 +30,12 @@ class AuthClaim(BaseModel): user_attribute_macros: Optional[StrictStr] = Field(None, description="When `user_attribute_mappings` is set to `_macro_` this macro will be used to assign the parameter value.") __properties = ["name", "user_attribute_mappings", "user_attribute_macros"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/auth_id.py b/onelogin/models/auth_id.py index 3aea54dd..0ee85629 100644 --- a/onelogin/models/auth_id.py +++ b/onelogin/models/auth_id.py @@ -28,10 +28,12 @@ class AuthId(BaseModel): id: Optional[StrictInt] = Field(None, description="Unique ID for the Scope") __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/auth_scope.py b/onelogin/models/auth_scope.py index 6fa44cda..cd6388f0 100644 --- a/onelogin/models/auth_scope.py +++ b/onelogin/models/auth_scope.py @@ -30,10 +30,12 @@ class AuthScope(BaseModel): description: Optional[StrictStr] = Field(None, description="A description of what access the scope enables") __properties = ["id", "value", "description"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/auth_server.py b/onelogin/models/auth_server.py index 8fd8e02b..98bf9bc7 100644 --- a/onelogin/models/auth_server.py +++ b/onelogin/models/auth_server.py @@ -32,10 +32,12 @@ class AuthServer(BaseModel): configuration: AuthServerConfiguration = ... __properties = ["id", "name", "description", "configuration"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/auth_server_configuration.py b/onelogin/models/auth_server_configuration.py index 0385df05..ab1ecb9c 100644 --- a/onelogin/models/auth_server_configuration.py +++ b/onelogin/models/auth_server_configuration.py @@ -31,10 +31,12 @@ class AuthServerConfiguration(BaseModel): access_token_expiration_minutes: Optional[StrictInt] = Field(None, description="The number of minutes until access token expires. There is no maximum expiry limit.") __properties = ["audiences", "refresh_token_expiration_minutes", "resource_identifier", "access_token_expiration_minutes"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand.py b/onelogin/models/brand.py index 4a751614..8f1a03ba 100644 --- a/onelogin/models/brand.py +++ b/onelogin/models/brand.py @@ -44,10 +44,12 @@ class Brand(BaseModel): logo: BrandLogo = ... __properties = ["id", "enabled", "custom_support_enabled", "custom_color", "custom_accent_color", "custom_masking_color", "custom_masking_opacity", "mfa_enrollment_message", "enable_custom_label_for_login_screen", "custom_label_text_for_login_screen", "login_instruction", "login_instruction_title", "hide_onelogin_footer", "background", "logo"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_app.py b/onelogin/models/brand_app.py index 5b111f14..cfe0aa23 100644 --- a/onelogin/models/brand_app.py +++ b/onelogin/models/brand_app.py @@ -36,10 +36,12 @@ class BrandApp(BaseModel): visible: StrictBool = ... __properties = ["id", "updated_at", "name", "connector_id", "auth_method_description", "description", "auth_method", "created_at", "visible"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_background.py b/onelogin/models/brand_background.py index ea91e294..8e4fb373 100644 --- a/onelogin/models/brand_background.py +++ b/onelogin/models/brand_background.py @@ -32,10 +32,12 @@ class BrandBackground(BaseModel): content_type: StrictStr = ... __properties = ["urls", "file_size", "updated_at", "content_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_background_urls.py b/onelogin/models/brand_background_urls.py index b3bedd92..74ef79c3 100644 --- a/onelogin/models/brand_background_urls.py +++ b/onelogin/models/brand_background_urls.py @@ -30,10 +30,12 @@ class BrandBackgroundUrls(BaseModel): branding: StrictStr = ... __properties = ["original", "login", "branding"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_logo.py b/onelogin/models/brand_logo.py index 5f178dc6..56c446d9 100644 --- a/onelogin/models/brand_logo.py +++ b/onelogin/models/brand_logo.py @@ -32,10 +32,12 @@ class BrandLogo(BaseModel): content_type: StrictStr = ... __properties = ["urls", "file_size", "updated_at", "content_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_logo_urls.py b/onelogin/models/brand_logo_urls.py index 2f1271a7..9c877aae 100644 --- a/onelogin/models/brand_logo_urls.py +++ b/onelogin/models/brand_logo_urls.py @@ -30,10 +30,12 @@ class BrandLogoUrls(BaseModel): navigation: StrictStr = ... __properties = ["original", "login", "navigation"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/brand_req.py b/onelogin/models/brand_req.py index 03e0a235..0ae055c7 100644 --- a/onelogin/models/brand_req.py +++ b/onelogin/models/brand_req.py @@ -30,10 +30,12 @@ class BrandReq(BaseModel): name: Optional[StrictStr] = Field(None, description="Brand name for humans. This isn’t related to subdomains.") __properties = ["id", "enabled", "name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/client_app_full.py b/onelogin/models/client_app_full.py index 3edc5760..8243d8d5 100644 --- a/onelogin/models/client_app_full.py +++ b/onelogin/models/client_app_full.py @@ -32,10 +32,12 @@ class ClientAppFull(BaseModel): api_auth_id: Optional[StrictInt] = None __properties = ["scopes", "app_id", "name", "api_auth_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/clock_counter.py b/onelogin/models/clock_counter.py index 34b24b5a..6c09d935 100644 --- a/onelogin/models/clock_counter.py +++ b/onelogin/models/clock_counter.py @@ -29,10 +29,12 @@ class ClockCounter(BaseModel): unit: Optional[StrictInt] = None __properties = ["value", "unit"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/condition.py b/onelogin/models/condition.py index 51147e02..b192b9ce 100644 --- a/onelogin/models/condition.py +++ b/onelogin/models/condition.py @@ -30,10 +30,12 @@ class Condition(BaseModel): value: Optional[StrictStr] = Field(None, description="A plain text string or valid value for the selected condition source") __properties = ["source", "operator", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/configuration_oidc.py b/onelogin/models/configuration_oidc.py index 7bc32608..f65f103b 100644 --- a/onelogin/models/configuration_oidc.py +++ b/onelogin/models/configuration_oidc.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator class ConfigurationOidc(BaseModel): """ @@ -33,24 +33,28 @@ class ConfigurationOidc(BaseModel): oidc_application_type: StrictInt = Field(..., description="- 0 : Web - 1 : Native / Mobile") __properties = ["login_url", "redirect_uri", "access_token_expiration_minutes", "refresh_token_expiration_minutes", "token_endpoint_auth_method", "oidc_application_type"] - @validator('token_endpoint_auth_method') + @field_validator('token_endpoint_auth_method') + @classmethod def token_endpoint_auth_method_validate_enum(cls, value): """Validates the enum""" if value not in (0, 1, 2): raise ValueError("must be one of enum values (0, 1, 2)") return value - @validator('oidc_application_type') + @field_validator('oidc_application_type') + @classmethod def oidc_application_type_validate_enum(cls, value): """Validates the enum""" if value not in (0, 1): raise ValueError("must be one of enum values (0, 1)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/configuration_saml.py b/onelogin/models/configuration_saml.py index 4d1a921a..a6707163 100644 --- a/onelogin/models/configuration_saml.py +++ b/onelogin/models/configuration_saml.py @@ -29,10 +29,12 @@ class ConfigurationSaml(BaseModel): certificate_id: Optional[StrictInt] = Field(None, description="When creating apps the default certificate will be used unless the `certificate_id` attribute is applied in the `configuration` object.") __properties = ["signature_algorithm", "certificate_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/connector.py b/onelogin/models/connector.py index 4343fc2e..099504ac 100644 --- a/onelogin/models/connector.py +++ b/onelogin/models/connector.py @@ -33,10 +33,12 @@ class Connector(BaseModel): allows_new_parameters: Optional[StrictBool] = Field(None, description="Indicates if apps created using this connector will be allowed to create custom parameters.") __properties = ["id", "name", "icon_url", "auth_method", "allows_new_parameters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_app200_response.py b/onelogin/models/create_app200_response.py index 3b90209d..8f98dd96 100644 --- a/onelogin/models/create_app200_response.py +++ b/onelogin/models/create_app200_response.py @@ -19,11 +19,11 @@ import re # noqa: F401 from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from onelogin.models.generic_app import GenericApp from onelogin.models.oidc_app import OidcApp from onelogin.models.saml_app import SamlApp -from typing import Any, List +from typing import Any, List, Literal, ClassVar from pydantic import StrictStr, Field CREATEAPP200RESPONSE_ONE_OF_SCHEMAS = ["GenericApp", "OidcApp", "SamlApp"] @@ -39,12 +39,14 @@ class CreateApp200Response(BaseModel): # data type: GenericApp oneof_schema_3_validator: Optional[GenericApp] = None actual_instance: Any - one_of_schemas: List[str] = Field(CREATEAPP200RESPONSE_ONE_OF_SCHEMAS, const=True) + one_of_schemas: List[str] = Literal[CREATEAPP200RESPONSE_ONE_OF_SCHEMAS] - class Config: - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_assignment": True + } - discriminator_value_class_map = { + discriminator_value_class_map: ClassVar[dict] = { } def __init__(self, *args, **kwargs): @@ -57,7 +59,8 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') + @classmethod def actual_instance_must_validate_oneof(cls, v): instance = CreateApp200Response.construct() error_messages = [] diff --git a/onelogin/models/create_app_request.py b/onelogin/models/create_app_request.py index 1a23dcdf..93c81ff7 100644 --- a/onelogin/models/create_app_request.py +++ b/onelogin/models/create_app_request.py @@ -19,11 +19,11 @@ import re # noqa: F401 from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from onelogin.models.generic_app import GenericApp from onelogin.models.oidc_app import OidcApp from onelogin.models.saml_app import SamlApp -from typing import Any, List +from typing import Any, List, Literal from pydantic import StrictStr, Field CREATEAPPREQUEST_ONE_OF_SCHEMAS = ["GenericApp", "OidcApp", "SamlApp"] @@ -39,10 +39,12 @@ class CreateAppRequest(BaseModel): # data type: GenericApp oneof_schema_3_validator: Optional[GenericApp] = None actual_instance: Any - one_of_schemas: List[str] = Field(CREATEAPPREQUEST_ONE_OF_SCHEMAS, const=True) + one_of_schemas: List[str] = Literal[CREATEAPPREQUEST_ONE_OF_SCHEMAS] - class Config: - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: @@ -54,7 +56,8 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') + @classmethod def actual_instance_must_validate_oneof(cls, v): instance = CreateAppRequest.construct() error_messages = [] diff --git a/onelogin/models/create_device_verification201_response.py b/onelogin/models/create_device_verification201_response.py index 5a67885d..b375c705 100644 --- a/onelogin/models/create_device_verification201_response.py +++ b/onelogin/models/create_device_verification201_response.py @@ -35,10 +35,12 @@ class CreateDeviceVerification201Response(BaseModel): auth_factor_name: Optional[StrictStr] = Field(None, description="Authentication factor name, as it appears to administrators in OneLogin.") __properties = ["device_id", "display_name", "expires_at", "redirect_to", "user_display_name", "id", "type_display_name", "auth_factor_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_device_verification_request.py b/onelogin/models/create_device_verification_request.py index cc6a0546..db3ec2eb 100644 --- a/onelogin/models/create_device_verification_request.py +++ b/onelogin/models/create_device_verification_request.py @@ -32,10 +32,12 @@ class CreateDeviceVerificationRequest(BaseModel): custom_message: Optional[StrictStr] = Field(None, description="Only applies to SMS factor. A message template that will be sent via SMS. Max length of the message after template items are inserted is 160 characters including the OTP code. SMS must already be configured by the user. The following template variables can be included in the message. - {{otp_code}} - The security code. - {{otp_expiry}} - The number of minutes until the one time code expires.") __properties = ["device_id", "display_name", "expires_in", "redirect_to", "custom_message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_factor_registration201_response.py b/onelogin/models/create_factor_registration201_response.py index 502a8de3..7fea5b58 100644 --- a/onelogin/models/create_factor_registration201_response.py +++ b/onelogin/models/create_factor_registration201_response.py @@ -33,10 +33,12 @@ class CreateFactorRegistration201Response(BaseModel): user_id: Optional[StrictStr] = Field(None, description="User identifier") __properties = ["device_id", "user_display_name", "type_display_name", "auth_factor_name", "id", "user_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_factor_registration_request.py b/onelogin/models/create_factor_registration_request.py index b604fd89..b9f7ba38 100644 --- a/onelogin/models/create_factor_registration_request.py +++ b/onelogin/models/create_factor_registration_request.py @@ -33,10 +33,12 @@ class CreateFactorRegistrationRequest(BaseModel): custom_message: Optional[StrictStr] = Field(None, description="Only applies to SMS factor. A message template that will be sent via SMS. Max length of the message after template items are inserted is 160 characters including the OTP code. SMS must already be configured by the user. The following template variables can be included in the message. - {{otp_code}} - The security code. - {{otp_expiry}} - The number of minutes until the one time code expires.") __properties = ["factor_id", "display_name", "expires_in", "verified", "redirect_to", "custom_message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_privilege200_response.py b/onelogin/models/create_privilege200_response.py index 478c76c0..3abec5d0 100644 --- a/onelogin/models/create_privilege200_response.py +++ b/onelogin/models/create_privilege200_response.py @@ -29,9 +29,12 @@ class CreatePrivilege200Response(BaseModel): id: Optional[StrictStr] = Field(None, description="Privilege Id") __properties = ["id"] - class Config: - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/create_role201_response_inner.py b/onelogin/models/create_role201_response_inner.py index 9a562e40..44c29696 100644 --- a/onelogin/models/create_role201_response_inner.py +++ b/onelogin/models/create_role201_response_inner.py @@ -28,10 +28,12 @@ class CreateRole201ResponseInner(BaseModel): id: Optional[StrictInt] = None __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/device.py b/onelogin/models/device.py index 3f5f6a0f..4179f47a 100644 --- a/onelogin/models/device.py +++ b/onelogin/models/device.py @@ -29,10 +29,12 @@ class Device(BaseModel): device_type: Optional[StrictStr] = Field(None, description="Lists an available MFA device type, such as OneLogin OTP SMS or Google Authenticator.") __properties = ["device_id", "device_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/email_config.py b/onelogin/models/email_config.py index a0228834..83f08a39 100644 --- a/onelogin/models/email_config.py +++ b/onelogin/models/email_config.py @@ -34,10 +34,12 @@ class EmailConfig(BaseModel): port: Optional[StrictInt] = Field(25, description="Defaults to 25.") __properties = ["address", "use_tls", "from", "domain", "user_name", "password", "port"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/enforcement_point.py b/onelogin/models/enforcement_point.py index 950ba22f..3d1a1001 100644 --- a/onelogin/models/enforcement_point.py +++ b/onelogin/models/enforcement_point.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, field_validator from onelogin.models.clock_counter import ClockCounter from onelogin.models.enforcement_point_resources_inner import EnforcementPointResourcesInner @@ -42,7 +42,8 @@ class EnforcementPoint(BaseModel): case_sensitive: Optional[StrictBool] = Field(None, description="The URL path evaluation is case insensitive by default. Resources hosted on web servers such as Apache, NGINX and Java EE are case sensitive paths. Web servers such as Microsoft IIS are not case-sensitive.") __properties = ["require_sitewide_authentication", "conditions", "session_expiry_fixed", "session_expiry_inactivity", "permissions", "token", "target", "resources", "context_root", "use_target_host_header", "vhost", "landing_page", "case_sensitive"] - @validator('permissions') + @field_validator('permissions') + @classmethod def permissions_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -52,10 +53,12 @@ def permissions_validate_enum(cls, value): raise ValueError("must be one of enum values ('allow', 'deny', 'conditional')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/enforcement_point_resources_inner.py b/onelogin/models/enforcement_point_resources_inner.py index 7f3cc853..efd7d74e 100644 --- a/onelogin/models/enforcement_point_resources_inner.py +++ b/onelogin/models/enforcement_point_resources_inner.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator class EnforcementPointResourcesInner(BaseModel): """ @@ -32,7 +32,8 @@ class EnforcementPointResourcesInner(BaseModel): conditions: Optional[StrictStr] = Field(None, description="required if permission == \"conditions\"") __properties = ["path", "is_path_regex", "require_auth", "permission", "conditions"] - @validator('permission') + @field_validator('permission') + @classmethod def permission_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -42,10 +43,12 @@ def permission_validate_enum(cls, value): raise ValueError("must be one of enum values ('allow', 'deny', 'conditions')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/enroll_mfa_factor200_response.py b/onelogin/models/enroll_mfa_factor200_response.py index 9e916d02..c9124eaf 100644 --- a/onelogin/models/enroll_mfa_factor200_response.py +++ b/onelogin/models/enroll_mfa_factor200_response.py @@ -33,10 +33,12 @@ class EnrollMfaFactor200Response(BaseModel): data: Optional[conlist(GetEnrolledFactors200ResponseDataOtpDevicesInner)] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/error.py b/onelogin/models/error.py index 447f2605..8ca1f164 100644 --- a/onelogin/models/error.py +++ b/onelogin/models/error.py @@ -33,10 +33,12 @@ class Error(BaseModel): message: StrictStr = ... __properties = ["error", "code", "type", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/event.py b/onelogin/models/event.py index 530b7146..da7512b0 100644 --- a/onelogin/models/event.py +++ b/onelogin/models/event.py @@ -21,7 +21,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator class Event(BaseModel): """ @@ -74,7 +74,8 @@ class Event(BaseModel): user_name: Optional[StrictStr] = Field(None, description="Name of the user that was acted upon to trigger the event.") __properties = ["account_id", "actor_system", "actor_user_id", "actor_user_name", "adc_id", "app-name", "app_id", "assumed_by_superadmin_or_reseller", "assuming_acting_user_id", "certificate_id", "client_id", "created_at", "custom_message", "directory_sync_run_id", "error_description", "event_type_id", "group-name", "group_id", "id", "ipaddr", "mapping_id", "notes", "object_id", "otp_device_id", "otp_device_name", "param", "policy_id", "policy_name", "policy_type", "privilege_id", "proxy_ip", "radius_config_id", "resolved_at", "resource_type_id", "risk_cookie_id", "risk_reasons", "risk_score", "role_id", "role_name", "service_directory_id", "solved", "trusted_idp_id", "user_field_id", "user_id", "user_name"] - @validator('event_type_id') + @field_validator('event_type_id') + @classmethod def event_type_id_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -84,10 +85,12 @@ def event_type_id_validate_enum(cls, value): raise ValueError("must be one of enum values (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 95, 96, 100, 101, 102, 103, 104, 105, 106, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 291, 300, 301, 303, 304, 305, 306, 307, 330, 331, 332, 333, 334, 400, 401, 402, 410, 411, 412, 501, 502, 503, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 545, 546, 550, 551, 552, 553, 554, 555, 600, 601, 602, 700, 701, 702, 703, 704, 705, 706, 800, 801, 802, 803, 804, 805, 900, 901, 902, 903, 904, 905, 906, 907, 911, 912, 931, 932, 950, 1001, 1002, 1010, 1100, 1101, 1200, 1201, 1244, 1245, 1300, 1301, 1302, 1303, 1304, 1305, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1700, 1701, 1702, 1801, 1802, 1900, 1901, 1902, 1903, 1904, 1905, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2201, 2202, 2203, 2204, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 9000, 9001, 9002, 9003, 9004, 9005, 9006, 9007, 9008, 9009, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9020, 9021, 9022, 9023, 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 9033, 9034, 9035, 9036, 9037, 9038, 9039, 9040, 9041, 9042, 9043, 9044, 9045, 9046, 9047, 9048, 9049, 9050, 9051, 9052, 9053, 9054, 9055, 9056, 9057, 9058, 9059)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_mf_atoken200_response.py b/onelogin/models/generate_mf_atoken200_response.py index eee9c217..7a1761f6 100644 --- a/onelogin/models/generate_mf_atoken200_response.py +++ b/onelogin/models/generate_mf_atoken200_response.py @@ -32,10 +32,12 @@ class GenerateMFAtoken200Response(BaseModel): expires_at: Optional[StrictStr] = Field(None, description="Defines the expiration time and date for the token. Format is UTC time.") __properties = ["mfa_token", "resuable", "expires_at"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_mf_atoken_request.py b/onelogin/models/generate_mf_atoken_request.py index 014a1856..4b541486 100644 --- a/onelogin/models/generate_mf_atoken_request.py +++ b/onelogin/models/generate_mf_atoken_request.py @@ -31,10 +31,12 @@ class GenerateMFAtokenRequest(BaseModel): reusable: Optional[StrictBool] = Field(False, description="Defines if the token is reusable multiple times within the expiry window. Value defaults to false. If set to true, token can be used multiple times, until it expires.") __properties = ["expires_in", "reusable"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_otp201_response.py b/onelogin/models/generate_otp201_response.py index dfbd2dfa..fd862d21 100644 --- a/onelogin/models/generate_otp201_response.py +++ b/onelogin/models/generate_otp201_response.py @@ -31,10 +31,12 @@ class GenerateOTP201Response(BaseModel): device_id: Optional[StrictStr] = Field(None, description="A unique identifier for the temp otp device that has been created for this token.") __properties = ["mfa_token", "reusable", "expires_at", "device_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_otp_request.py b/onelogin/models/generate_otp_request.py index 3a11a8fe..701cc903 100644 --- a/onelogin/models/generate_otp_request.py +++ b/onelogin/models/generate_otp_request.py @@ -30,10 +30,12 @@ class GenerateOTPRequest(BaseModel): reusable: Optional[StrictBool] = Field(False, description="Defines if the token is reusable multiple times within the expiry window. Value defaults to false. If set to true, token can be used multiple times, until it expires.") __properties = ["expires_in", "reusable"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_saml_assert200_response.py b/onelogin/models/generate_saml_assert200_response.py index 6f14bd74..477703dc 100644 --- a/onelogin/models/generate_saml_assert200_response.py +++ b/onelogin/models/generate_saml_assert200_response.py @@ -30,10 +30,12 @@ class GenerateSamlAssert200Response(BaseModel): data: Optional[conlist(Dict[str, Any])] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generate_token_request.py b/onelogin/models/generate_token_request.py index 037723e5..df9dc309 100644 --- a/onelogin/models/generate_token_request.py +++ b/onelogin/models/generate_token_request.py @@ -28,10 +28,12 @@ class GenerateTokenRequest(BaseModel): grant_type: StrictStr = Field(..., description="Set to client_credentials.") __properties = ["grant_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generic_app.py b/onelogin/models/generic_app.py index f300b42e..63ed6dd7 100644 --- a/onelogin/models/generic_app.py +++ b/onelogin/models/generic_app.py @@ -18,7 +18,7 @@ import json -from typing import List, Optional +from typing import List, Dict, Optional, Any from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist from onelogin.models.app_parameters import AppParameters from onelogin.models.auth_method import AuthMethod @@ -49,10 +49,12 @@ class GenericApp(BaseModel): additional_properties: Dict[str, Any] = {} __properties = ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/generic_app_provisioning.py b/onelogin/models/generic_app_provisioning.py index 8d800564..e94ad6bf 100644 --- a/onelogin/models/generic_app_provisioning.py +++ b/onelogin/models/generic_app_provisioning.py @@ -28,10 +28,12 @@ class GenericAppProvisioning(BaseModel): enabled: Optional[StrictBool] = None __properties = ["enabled"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_assigned_user200_response.py b/onelogin/models/get_assigned_user200_response.py index 654932d9..aeb31ab8 100644 --- a/onelogin/models/get_assigned_user200_response.py +++ b/onelogin/models/get_assigned_user200_response.py @@ -33,10 +33,12 @@ class GetAssignedUser200Response(BaseModel): next_link: Optional[StrictStr] = Field(None, alias="nextLink") __properties = ["total", "users", "beforeCursor", "previousLink", "afterCursor", "nextLink"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_auth_factors200_response.py b/onelogin/models/get_auth_factors200_response.py index 7e5f2348..e8dccbb1 100644 --- a/onelogin/models/get_auth_factors200_response.py +++ b/onelogin/models/get_auth_factors200_response.py @@ -30,10 +30,12 @@ class GetAuthFactors200Response(BaseModel): auth_factor_name: Optional[StrictStr] = Field(None, description="Internal use only") __properties = ["factor_id", "name", "auth_factor_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_authentication_devices200_response_inner.py b/onelogin/models/get_authentication_devices200_response_inner.py index 66f5114d..c2c78f7e 100644 --- a/onelogin/models/get_authentication_devices200_response_inner.py +++ b/onelogin/models/get_authentication_devices200_response_inner.py @@ -32,10 +32,12 @@ class GetAuthenticationDevices200ResponseInner(BaseModel): default: Optional[StrictBool] = Field(False, description="true = is user’s default MFA device for OneLogin.") __properties = ["device_id", "user_display_name", "type_display_name", "auth_factor_name", "default"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_custom_attributes200_response.py b/onelogin/models/get_custom_attributes200_response.py index b0dc18ee..6d139de3 100644 --- a/onelogin/models/get_custom_attributes200_response.py +++ b/onelogin/models/get_custom_attributes200_response.py @@ -30,10 +30,12 @@ class GetCustomAttributes200Response(BaseModel): data: Optional[conlist(conlist(StrictStr))] = Field(None, description="Provides a list of custom attribute fields (also known as custom user fields) that are available for your account. The values returned correspond to the values you provided in the Shortname field when you defined the custom user field. For details about defining custom user fields, see Custom User Fields.") __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_email_settings200_response.py b/onelogin/models/get_email_settings200_response.py index 11b45c6f..2a932e0d 100644 --- a/onelogin/models/get_email_settings200_response.py +++ b/onelogin/models/get_email_settings200_response.py @@ -19,10 +19,10 @@ import re # noqa: F401 from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from onelogin.models.email_config import EmailConfig from onelogin.models.get_email_settings200_response_one_of import GetEmailSettings200ResponseOneOf -from typing import Any, List +from typing import Any, List, Literal from pydantic import StrictStr, Field GETEMAILSETTINGS200RESPONSE_ONE_OF_SCHEMAS = ["EmailConfig", "GetEmailSettings200ResponseOneOf"] @@ -36,10 +36,12 @@ class GetEmailSettings200Response(BaseModel): # data type: EmailConfig oneof_schema_2_validator: Optional[EmailConfig] = None actual_instance: Any - one_of_schemas: List[str] = Field(GETEMAILSETTINGS200RESPONSE_ONE_OF_SCHEMAS, const=True) + one_of_schemas: List[str] = Literal[GETEMAILSETTINGS200RESPONSE_ONE_OF_SCHEMAS] - class Config: - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: @@ -51,7 +53,8 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') + @classmethod def actual_instance_must_validate_oneof(cls, v): instance = GetEmailSettings200Response.construct() error_messages = [] diff --git a/onelogin/models/get_email_settings200_response_one_of.py b/onelogin/models/get_email_settings200_response_one_of.py index 5490c28f..515ff11c 100644 --- a/onelogin/models/get_email_settings200_response_one_of.py +++ b/onelogin/models/get_email_settings200_response_one_of.py @@ -28,10 +28,12 @@ class GetEmailSettings200ResponseOneOf(BaseModel): mode: Optional[StrictStr] = None __properties = ["mode"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_enrolled_factors200_response.py b/onelogin/models/get_enrolled_factors200_response.py index a0664891..8801bebd 100644 --- a/onelogin/models/get_enrolled_factors200_response.py +++ b/onelogin/models/get_enrolled_factors200_response.py @@ -31,10 +31,12 @@ class GetEnrolledFactors200Response(BaseModel): data: Optional[GetEnrolledFactors200ResponseData] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_enrolled_factors200_response_data.py b/onelogin/models/get_enrolled_factors200_response_data.py index d87b40b8..74925d90 100644 --- a/onelogin/models/get_enrolled_factors200_response_data.py +++ b/onelogin/models/get_enrolled_factors200_response_data.py @@ -29,10 +29,12 @@ class GetEnrolledFactors200ResponseData(BaseModel): otp_devices: Optional[conlist(GetEnrolledFactors200ResponseDataOtpDevicesInner)] = None __properties = ["otp_devices"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_enrolled_factors200_response_data_otp_devices_inner.py b/onelogin/models/get_enrolled_factors200_response_data_otp_devices_inner.py index a9bed4cb..690462c1 100644 --- a/onelogin/models/get_enrolled_factors200_response_data_otp_devices_inner.py +++ b/onelogin/models/get_enrolled_factors200_response_data_otp_devices_inner.py @@ -36,10 +36,12 @@ class GetEnrolledFactors200ResponseDataOtpDevicesInner(BaseModel): id: Optional[StrictInt] = Field(None, description="MFA device identifier.") __properties = ["active", "default", "state_token", "auth_factor_name", "phone_number", "type_display_name", "needs_trigger", "user_display_name", "id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_event_by_id200_response.py b/onelogin/models/get_event_by_id200_response.py index 6eff7332..2a3bebf8 100644 --- a/onelogin/models/get_event_by_id200_response.py +++ b/onelogin/models/get_event_by_id200_response.py @@ -31,10 +31,12 @@ class GetEventById200Response(BaseModel): data: Optional[Event] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_event_types200_response.py b/onelogin/models/get_event_types200_response.py index 5c6ed794..5e4495a8 100644 --- a/onelogin/models/get_event_types200_response.py +++ b/onelogin/models/get_event_types200_response.py @@ -31,10 +31,12 @@ class GetEventTypes200Response(BaseModel): data: Optional[conlist(GetEventTypes200ResponseDataInner)] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_event_types200_response_data_inner.py b/onelogin/models/get_event_types200_response_data_inner.py index 009685d5..ee7702d1 100644 --- a/onelogin/models/get_event_types200_response_data_inner.py +++ b/onelogin/models/get_event_types200_response_data_inner.py @@ -30,10 +30,12 @@ class GetEventTypes200ResponseDataInner(BaseModel): id: Optional[StrictInt] = None __properties = ["name", "description", "id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_events200_response.py b/onelogin/models/get_events200_response.py index 2f0c3ed3..7f91f2d2 100644 --- a/onelogin/models/get_events200_response.py +++ b/onelogin/models/get_events200_response.py @@ -33,10 +33,12 @@ class GetEvents200Response(BaseModel): data: Optional[conlist(Event)] = None __properties = ["status", "pagination", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_events200_response_pagination.py b/onelogin/models/get_events200_response_pagination.py index 1b353757..8b5cbb24 100644 --- a/onelogin/models/get_events200_response_pagination.py +++ b/onelogin/models/get_events200_response_pagination.py @@ -31,10 +31,12 @@ class GetEvents200ResponsePagination(BaseModel): next_link: Optional[StrictStr] = None __properties = ["before_cursor", "after_cursor", "previous_link", "next_link"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_groups200_response.py b/onelogin/models/get_groups200_response.py index 435eb91e..ab56f820 100644 --- a/onelogin/models/get_groups200_response.py +++ b/onelogin/models/get_groups200_response.py @@ -31,10 +31,12 @@ class GetGroups200Response(BaseModel): data: Optional[conlist(Group)] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_invite_link200_response.py b/onelogin/models/get_invite_link200_response.py index 6f3677bd..12a8e778 100644 --- a/onelogin/models/get_invite_link200_response.py +++ b/onelogin/models/get_invite_link200_response.py @@ -30,10 +30,12 @@ class GetInviteLink200Response(BaseModel): data: Optional[conlist(StrictStr)] = Field(None, description="Provides reset password link") __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_invite_link_request.py b/onelogin/models/get_invite_link_request.py index e269c6b4..007d68b1 100644 --- a/onelogin/models/get_invite_link_request.py +++ b/onelogin/models/get_invite_link_request.py @@ -28,10 +28,12 @@ class GetInviteLinkRequest(BaseModel): email: Optional[StrictStr] = Field(None, description="Set to the user email address to generate an invite link. The value is case sensitive.") __properties = ["email"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_mfa_factors200_response.py b/onelogin/models/get_mfa_factors200_response.py index 59b047c1..b517cdb3 100644 --- a/onelogin/models/get_mfa_factors200_response.py +++ b/onelogin/models/get_mfa_factors200_response.py @@ -31,10 +31,12 @@ class GetMFAFactors200Response(BaseModel): data: Optional[GetMFAFactors200ResponseData] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_mfa_factors200_response_data.py b/onelogin/models/get_mfa_factors200_response_data.py index 1734e444..e1d3ea08 100644 --- a/onelogin/models/get_mfa_factors200_response_data.py +++ b/onelogin/models/get_mfa_factors200_response_data.py @@ -29,10 +29,12 @@ class GetMFAFactors200ResponseData(BaseModel): auth_factors: Optional[conlist(GetMFAFactors200ResponseDataAuthFactorsInner)] = None __properties = ["auth_factors"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_mfa_factors200_response_data_auth_factors_inner.py b/onelogin/models/get_mfa_factors200_response_data_auth_factors_inner.py index 472fb41c..80e4b1f4 100644 --- a/onelogin/models/get_mfa_factors200_response_data_auth_factors_inner.py +++ b/onelogin/models/get_mfa_factors200_response_data_auth_factors_inner.py @@ -29,10 +29,12 @@ class GetMFAFactors200ResponseDataAuthFactorsInner(BaseModel): factor_id: Optional[StrictInt] = Field(None, description="Identifier for the factor which will be used for user enrollment") __properties = ["name", "factor_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_rate_limit200_response.py b/onelogin/models/get_rate_limit200_response.py index 0cc403f7..df33b740 100644 --- a/onelogin/models/get_rate_limit200_response.py +++ b/onelogin/models/get_rate_limit200_response.py @@ -32,10 +32,12 @@ class GetRateLimit200Response(BaseModel): data: Optional[RateLimit] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_risk_score200_response.py b/onelogin/models/get_risk_score200_response.py index c2256497..aeca2946 100644 --- a/onelogin/models/get_risk_score200_response.py +++ b/onelogin/models/get_risk_score200_response.py @@ -30,10 +30,12 @@ class GetRiskScore200Response(BaseModel): triggers: Optional[conlist(StrictStr)] = Field(None, description="Triggers are indicators of some of the key items that influenced the risk score.") __properties = ["score", "triggers"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_risk_score_request.py b/onelogin/models/get_risk_score_request.py index 91c77b66..2436564b 100644 --- a/onelogin/models/get_risk_score_request.py +++ b/onelogin/models/get_risk_score_request.py @@ -38,10 +38,12 @@ class GetRiskScoreRequest(BaseModel): fp: Optional[StrictStr] = Field(None, description="Set to the value of the __tdli_fp cookie.") __properties = ["ip", "user_agent", "user", "source", "session", "device", "fp"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_risk_scores200_response.py b/onelogin/models/get_risk_scores200_response.py index 7a37f0cd..0168afa4 100644 --- a/onelogin/models/get_risk_scores200_response.py +++ b/onelogin/models/get_risk_scores200_response.py @@ -30,10 +30,12 @@ class GetRiskScores200Response(BaseModel): total: Optional[StrictInt] = None __properties = ["scores", "total"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_risk_scores200_response_scores.py b/onelogin/models/get_risk_scores200_response_scores.py index 7f9a3498..504d9b6d 100644 --- a/onelogin/models/get_risk_scores200_response_scores.py +++ b/onelogin/models/get_risk_scores200_response_scores.py @@ -33,10 +33,12 @@ class GetRiskScores200ResponseScores(BaseModel): very_high: Optional[StrictInt] = None __properties = ["minimal", "low", "medium", "high", "very_high"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_apps200_response_inner.py b/onelogin/models/get_role_apps200_response_inner.py index e9b49aba..7cc984eb 100644 --- a/onelogin/models/get_role_apps200_response_inner.py +++ b/onelogin/models/get_role_apps200_response_inner.py @@ -30,10 +30,12 @@ class GetRoleApps200ResponseInner(BaseModel): icon_url: Optional[StrictStr] = Field(None, description="url of Icon") __properties = ["id", "name", "icon_url"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_by_id200_response.py b/onelogin/models/get_role_by_id200_response.py index 2e8ca183..d3aa7824 100644 --- a/onelogin/models/get_role_by_id200_response.py +++ b/onelogin/models/get_role_by_id200_response.py @@ -31,10 +31,12 @@ class GetRoleById200Response(BaseModel): data: Optional[conlist(GetRoleById200ResponseDataInner)] = None __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_by_id200_response_data_inner.py b/onelogin/models/get_role_by_id200_response_data_inner.py index 062ea640..c8cc04c9 100644 --- a/onelogin/models/get_role_by_id200_response_data_inner.py +++ b/onelogin/models/get_role_by_id200_response_data_inner.py @@ -29,10 +29,12 @@ class GetRoleById200ResponseDataInner(BaseModel): name: Optional[StrictStr] = Field(None, description="Role name") __properties = ["id", "name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_by_name200_response.py b/onelogin/models/get_role_by_name200_response.py index 55921ee2..2f18dfd4 100644 --- a/onelogin/models/get_role_by_name200_response.py +++ b/onelogin/models/get_role_by_name200_response.py @@ -33,10 +33,12 @@ class GetRoleByName200Response(BaseModel): data: Optional[conlist(GetRoleByName200ResponseDataInner)] = None __properties = ["status", "pagination", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_by_name200_response_data_inner.py b/onelogin/models/get_role_by_name200_response_data_inner.py index 416a0531..6c156bf5 100644 --- a/onelogin/models/get_role_by_name200_response_data_inner.py +++ b/onelogin/models/get_role_by_name200_response_data_inner.py @@ -29,10 +29,12 @@ class GetRoleByName200ResponseDataInner(BaseModel): name: Optional[StrictStr] = Field(None, description="Role Name") __properties = ["id", "name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_role_by_name200_response_pagination.py b/onelogin/models/get_role_by_name200_response_pagination.py index 575e7a1d..4c357d41 100644 --- a/onelogin/models/get_role_by_name200_response_pagination.py +++ b/onelogin/models/get_role_by_name200_response_pagination.py @@ -31,10 +31,12 @@ class GetRoleByName200ResponsePagination(BaseModel): previous_link: Optional[StrictStr] = None __properties = ["after_cursor", "before_cursor", "next_link", "previous_link"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_user_apps200_response_inner.py b/onelogin/models/get_user_apps200_response_inner.py index cd5ed222..491919a4 100644 --- a/onelogin/models/get_user_apps200_response_inner.py +++ b/onelogin/models/get_user_apps200_response_inner.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator class GetUserApps200ResponseInner(BaseModel): """ @@ -35,7 +35,8 @@ class GetUserApps200ResponseInner(BaseModel): provisioning_enabled: Optional[StrictBool] = Field(None, description="Indicates if provisioning is enabled for this app.") __properties = ["id", "icon_url", "extension", "login_id", "name", "provisioning_status", "provisioning_state", "provisioning_enabled"] - @validator('provisioning_status') + @field_validator('provisioning_status') + @classmethod def provisioning_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -45,7 +46,8 @@ def provisioning_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('enabling', 'disabling', 'enabling_pending_approval', 'disabling_pendding_approval', 'enabled', 'disabled', 'disabling_failed', 'enabling_failed')") return value - @validator('provisioning_state') + @field_validator('provisioning_state') + @classmethod def provisioning_state_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -55,10 +57,12 @@ def provisioning_state_validate_enum(cls, value): raise ValueError("must be one of enum values ('unknown', 'provisioning', 'modifying', 'deleting', 'provisioning_pending_approval', 'deleting_pending_approval', 'modifying_pending_approval', 'linking', 'provisioned', 'deleted', 'modifying_failed', 'provisioning_failed', 'deleting_failed', 'linking_failed', 'disabled', 'nonexistent', 'modifying_pending_approval_then_disabled')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_user_roles200_response.py b/onelogin/models/get_user_roles200_response.py index 1df4371a..6d395fc2 100644 --- a/onelogin/models/get_user_roles200_response.py +++ b/onelogin/models/get_user_roles200_response.py @@ -30,10 +30,12 @@ class GetUserRoles200Response(BaseModel): data: Optional[conlist(StrictInt)] = Field(None, description="List of Role IDs that are assigned to the User") __properties = ["status", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/get_user_verification200_response.py b/onelogin/models/get_user_verification200_response.py index 43a8a029..c2d1edc0 100644 --- a/onelogin/models/get_user_verification200_response.py +++ b/onelogin/models/get_user_verification200_response.py @@ -30,10 +30,12 @@ class GetUserVerification200Response(BaseModel): device_id: Optional[StrictStr] = Field(None, description="Device Id to be used with verify factor") __properties = ["id", "status", "device_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/group.py b/onelogin/models/group.py index 2480c10a..d71c7d54 100644 --- a/onelogin/models/group.py +++ b/onelogin/models/group.py @@ -30,10 +30,12 @@ class Group(BaseModel): reference: Optional[StrictStr] = Field(None, description="Deprecated. Will always show the attribute nil=\"true\".") __properties = ["id", "name", "reference"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/hook.py b/onelogin/models/hook.py index 1b03fc4b..e96b0f17 100644 --- a/onelogin/models/hook.py +++ b/onelogin/models/hook.py @@ -19,7 +19,7 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist, field_validator from onelogin.models.condition import Condition from onelogin.models.hook_options import HookOptions @@ -44,7 +44,8 @@ class Hook(BaseModel): updated_at: Optional[StrictStr] = Field(None, description="ISO8601 format date that they hook function was last updated.") __properties = ["id", "type", "disabled", "timeout", "env_vars", "runtime", "retries", "packages", "function", "context_version", "status", "options", "conditions", "created_at", "updated_at"] - @validator('status') + @field_validator('status') + @classmethod def status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -54,10 +55,12 @@ def status_validate_enum(cls, value): raise ValueError("must be one of enum values ('ready', 'create-queued', 'create-running', 'create-failed', 'update-queued', 'update-running', 'update-failed')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/hook_envvar.py b/onelogin/models/hook_envvar.py index b3e4bd97..da467ec5 100644 --- a/onelogin/models/hook_envvar.py +++ b/onelogin/models/hook_envvar.py @@ -32,10 +32,12 @@ class HookEnvvar(BaseModel): value: StrictStr = Field(..., description="The secret value that will be encrypted at rest and injected in applicable hook functions at run time.") __properties = ["id", "name", "created_at", "updated_at", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/hook_log.py b/onelogin/models/hook_log.py index e8a5a793..7b182ccb 100644 --- a/onelogin/models/hook_log.py +++ b/onelogin/models/hook_log.py @@ -31,10 +31,12 @@ class HookLog(BaseModel): events: Optional[conlist(StrictStr)] = None __properties = ["request_id", "correlation_id", "created_at", "events"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/hook_options.py b/onelogin/models/hook_options.py index 575c4593..b020bf16 100644 --- a/onelogin/models/hook_options.py +++ b/onelogin/models/hook_options.py @@ -30,10 +30,12 @@ class HookOptions(BaseModel): mfa_device_info_enabled: Optional[StrictBool] = None __properties = ["risk_enabled", "location_enabled", "mfa_device_info_enabled"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/hook_status.py b/onelogin/models/hook_status.py index beb4140a..4c4b1e8d 100644 --- a/onelogin/models/hook_status.py +++ b/onelogin/models/hook_status.py @@ -29,10 +29,12 @@ class HookStatus(BaseModel): message: Optional[StrictStr] = Field(None, description="your operation was successful") __properties = ["name", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_conditions200_response_inner.py b/onelogin/models/list_conditions200_response_inner.py index fbf807df..cfa0a824 100644 --- a/onelogin/models/list_conditions200_response_inner.py +++ b/onelogin/models/list_conditions200_response_inner.py @@ -29,10 +29,12 @@ class ListConditions200ResponseInner(BaseModel): value: Optional[StrictStr] = Field(None, description="The unique identifier of the condition. This should be used when defining conditions for a rule.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_mapping_action_values200_response_inner.py b/onelogin/models/list_mapping_action_values200_response_inner.py index 8fb653a8..baec6ec8 100644 --- a/onelogin/models/list_mapping_action_values200_response_inner.py +++ b/onelogin/models/list_mapping_action_values200_response_inner.py @@ -29,10 +29,12 @@ class ListMappingActionValues200ResponseInner(BaseModel): value: Optional[StrictInt] = Field(None, description="The action operator value to use when creating or updating User Mappings.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_mapping_conditions200_response.py b/onelogin/models/list_mapping_conditions200_response.py index 8c9b50ad..5d9f87f3 100644 --- a/onelogin/models/list_mapping_conditions200_response.py +++ b/onelogin/models/list_mapping_conditions200_response.py @@ -29,10 +29,12 @@ class ListMappingConditions200Response(BaseModel): value: Optional[StrictStr] = Field(None, description="The unique identifier of the condition. This should be used when defining conditions for a User Mapping") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_mapping_conditions_operators200_response_inner.py b/onelogin/models/list_mapping_conditions_operators200_response_inner.py index a3ec6146..cfafdb9a 100644 --- a/onelogin/models/list_mapping_conditions_operators200_response_inner.py +++ b/onelogin/models/list_mapping_conditions_operators200_response_inner.py @@ -29,10 +29,12 @@ class ListMappingConditionsOperators200ResponseInner(BaseModel): value: Optional[StrictStr] = Field(None, description="The condition operator value to use when creating or updating User Mappings.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_mapping_contion_values200_response_inner.py b/onelogin/models/list_mapping_contion_values200_response_inner.py index 69b28b95..f250b746 100644 --- a/onelogin/models/list_mapping_contion_values200_response_inner.py +++ b/onelogin/models/list_mapping_contion_values200_response_inner.py @@ -29,10 +29,12 @@ class ListMappingContionValues200ResponseInner(BaseModel): value: Optional[StrictInt] = Field(None, description="The condition operator value to use when creating or updating User Mappings.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_mappings_actions200_response_inner.py b/onelogin/models/list_mappings_actions200_response_inner.py index e05243e9..b9fd9491 100644 --- a/onelogin/models/list_mappings_actions200_response_inner.py +++ b/onelogin/models/list_mappings_actions200_response_inner.py @@ -29,10 +29,12 @@ class ListMappingsActions200ResponseInner(BaseModel): value: Optional[StrictStr] = Field(None, description="The unique identifier of the action. This should be used when defining actions for a User Mapping.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_message_templates200_response_inner.py b/onelogin/models/list_message_templates200_response_inner.py index d327c167..b69c7323 100644 --- a/onelogin/models/list_message_templates200_response_inner.py +++ b/onelogin/models/list_message_templates200_response_inner.py @@ -30,10 +30,12 @@ class ListMessageTemplates200ResponseInner(BaseModel): name: Optional[StrictStr] = Field(None, description="name of message template") __properties = ["id", "enabled", "name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_privelege_roles200_response.py b/onelogin/models/list_privelege_roles200_response.py index 68d7a545..4072f2ae 100644 --- a/onelogin/models/list_privelege_roles200_response.py +++ b/onelogin/models/list_privelege_roles200_response.py @@ -34,9 +34,12 @@ class ListPrivelegeRoles200Response(BaseModel): next_link: Optional[StrictStr] = Field(None, alias="nextLink") __properties = ["total", "roles", "beforeCursor", "previousLink", "afterCursor", "nextLink"] - class Config: - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/list_privilege_roles200_response.py b/onelogin/models/list_privilege_roles200_response.py index c034a8af..8f0bbf3a 100644 --- a/onelogin/models/list_privilege_roles200_response.py +++ b/onelogin/models/list_privilege_roles200_response.py @@ -33,10 +33,12 @@ class ListPrivilegeRoles200Response(BaseModel): next_link: Optional[StrictStr] = Field(None, alias="nextLink") __properties = ["total", "roles", "beforeCursor", "previousLink", "afterCursor", "nextLink"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/locale.py b/onelogin/models/locale.py index fb5ca4c6..26ebd276 100644 --- a/onelogin/models/locale.py +++ b/onelogin/models/locale.py @@ -29,10 +29,12 @@ class Locale(BaseModel): is_default: Optional[StrictBool] = Field(None, description="indicator if language is default") __properties = ["language", "is_default"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/lock_account_user_request.py b/onelogin/models/lock_account_user_request.py index c7ade211..60cb147d 100644 --- a/onelogin/models/lock_account_user_request.py +++ b/onelogin/models/lock_account_user_request.py @@ -28,10 +28,12 @@ class LockAccountUserRequest(BaseModel): locked_until: StrictInt = Field(..., description="Set to the number of minutes for which you want to lock the user account. Set to 0 if you want to lock the user account based on the Lock effective period set in the policy assigned to the user. If no policy is assigned to the user, setting this value to 0 will lock the user’s account until you unlock it Note that this value can not be less time that the Lock Effective Period specified on a user policy.") __properties = ["locked_until"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/mapping.py b/onelogin/models/mapping.py index 15b596ce..10cecf65 100644 --- a/onelogin/models/mapping.py +++ b/onelogin/models/mapping.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, field_validator from onelogin.models.action_obj import ActionObj from onelogin.models.condition import Condition @@ -36,17 +36,20 @@ class Mapping(BaseModel): actions: conlist(ActionObj) = Field(..., description="An array of actions that will be applied to the users that are matched by the conditions.") __properties = ["id", "name", "enabled", "match", "position", "conditions", "actions"] - @validator('match') + @field_validator('match') + @classmethod def match_validate_enum(cls, value): """Validates the enum""" if value not in ('all', 'any'): raise ValueError("must be one of enum values ('all', 'any')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/message_template.py b/onelogin/models/message_template.py index af49fd67..b4f480aa 100644 --- a/onelogin/models/message_template.py +++ b/onelogin/models/message_template.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr, validator +from pydantic import BaseModel, Field, StrictInt, StrictStr, constr, field_validator from onelogin.models.message_template_template import MessageTemplateTemplate class MessageTemplate(BaseModel): @@ -36,24 +36,28 @@ class MessageTemplate(BaseModel): brand_id: Optional[StrictInt] = Field(None, description="brand id number") __properties = ["id", "account_id", "type", "locale", "template", "template_class", "updated_at", "brand_id"] - @validator('type') + @field_validator('type') + @classmethod def type_validate_enum(cls, value): """Validates the enum""" if value not in ('email_forgot_password', 'email_code_registration', 'email_code_login_verification', 'email_code_app_verification', 'email_code_pw_reset_verification', 'email_magiclink_registration', 'email_magiclink_login_verification', 'email_magiclink_app_verification', 'email_magiclink_pw_reset_verification', 'sms_registration', 'sms_login_verification', 'sms_app_verification', 'sms_pw_reset_verification'): raise ValueError("must be one of enum values ('email_forgot_password', 'email_code_registration', 'email_code_login_verification', 'email_code_app_verification', 'email_code_pw_reset_verification', 'email_magiclink_registration', 'email_magiclink_login_verification', 'email_magiclink_app_verification', 'email_magiclink_pw_reset_verification', 'sms_registration', 'sms_login_verification', 'sms_app_verification', 'sms_pw_reset_verification')") return value - @validator('locale') + @field_validator('locale') + @classmethod def locale_validate_regular_expression(cls, value): """Validates the regular expression""" if not re.match(r"^[a-z]{2}$", value): raise ValueError(r"must validate the regular expression /^[a-z]{2}$/") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/message_template_template.py b/onelogin/models/message_template_template.py index 6809e677..56728a3c 100644 --- a/onelogin/models/message_template_template.py +++ b/onelogin/models/message_template_template.py @@ -19,11 +19,11 @@ import re # noqa: F401 from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from onelogin.models.message_template_template_one_of import MessageTemplateTemplateOneOf from onelogin.models.message_template_template_one_of1 import MessageTemplateTemplateOneOf1 -from typing import Any, List -from pydantic import StrictStr, Field +from typing import Any, List, Literal +from pydantic import StrictStr MESSAGETEMPLATETEMPLATE_ONE_OF_SCHEMAS = ["MessageTemplateTemplateOneOf", "MessageTemplateTemplateOneOf1"] @@ -36,10 +36,12 @@ class MessageTemplateTemplate(BaseModel): # data type: MessageTemplateTemplateOneOf1 oneof_schema_2_validator: Optional[MessageTemplateTemplateOneOf1] = None actual_instance: Any - one_of_schemas: List[str] = Field(MESSAGETEMPLATETEMPLATE_ONE_OF_SCHEMAS, const=True) + one_of_schemas: List[str] = Literal[MESSAGETEMPLATETEMPLATE_ONE_OF_SCHEMAS] - class Config: - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: @@ -51,7 +53,8 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') + @classmethod def actual_instance_must_validate_oneof(cls, v): instance = MessageTemplateTemplate.construct() error_messages = [] diff --git a/onelogin/models/message_template_template_one_of.py b/onelogin/models/message_template_template_one_of.py index f17590ef..bc634629 100644 --- a/onelogin/models/message_template_template_one_of.py +++ b/onelogin/models/message_template_template_one_of.py @@ -30,10 +30,12 @@ class MessageTemplateTemplateOneOf(BaseModel): plain: StrictStr = Field(..., description="The Plain text body of the email") __properties = ["subject", "html", "plain"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/message_template_template_one_of1.py b/onelogin/models/message_template_template_one_of1.py index 0b3b318e..7a014cba 100644 --- a/onelogin/models/message_template_template_one_of1.py +++ b/onelogin/models/message_template_template_one_of1.py @@ -28,10 +28,12 @@ class MessageTemplateTemplateOneOf1(BaseModel): message: constr(strict=True, max_length=160) = Field(..., description="The body of the SMS message. Max length 160 characters.") __properties = ["message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/oauth_token.py b/onelogin/models/oauth_token.py index eba48de4..9a17076a 100644 --- a/onelogin/models/oauth_token.py +++ b/onelogin/models/oauth_token.py @@ -34,10 +34,12 @@ class OauthToken(BaseModel): account_id: Optional[StrictInt] = Field(None, description="Account ID associated with the API credentials used to generate the token.") __properties = ["access_token", "created_at", "expires_in", "refresh_token", "token_type", "account_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/oidc_app.py b/onelogin/models/oidc_app.py index da1415ed..cc1ba1d2 100644 --- a/onelogin/models/oidc_app.py +++ b/onelogin/models/oidc_app.py @@ -52,10 +52,12 @@ class OidcApp(BaseModel): sso: Optional[SsoOidc] = None __properties = ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point", "configuration", "sso"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/oidc_app_all_of.py b/onelogin/models/oidc_app_all_of.py index 8e1dfa7e..a5440710 100644 --- a/onelogin/models/oidc_app_all_of.py +++ b/onelogin/models/oidc_app_all_of.py @@ -31,10 +31,12 @@ class OidcAppAllOf(BaseModel): sso: Optional[SsoOidc] = None __properties = ["configuration", "sso"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/otp_device.py b/onelogin/models/otp_device.py index 2ef06107..864ebd09 100644 --- a/onelogin/models/otp_device.py +++ b/onelogin/models/otp_device.py @@ -31,10 +31,12 @@ class OtpDevice(BaseModel): verified: Optional[StrictBool] = Field(None, description="Defaults to false. Some factors like SMS or Voice require that a user recieve a token and then that token is supplied to the Verify endpoint before the device is considered active. You can set verfied to `true` which indicates the the users phone number is pre verified and the device can be immediately activated. ") __properties = ["factor_id", "display_name", "number", "verified"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/privilege.py b/onelogin/models/privilege.py index df55c7cd..bd29f6b3 100644 --- a/onelogin/models/privilege.py +++ b/onelogin/models/privilege.py @@ -32,10 +32,12 @@ class Privilege(BaseModel): privilege: PrivilegePrivilege = ... __properties = ["id", "name", "description", "privilege"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/privilege_privilege.py b/onelogin/models/privilege_privilege.py index 444a7ad4..fed7076a 100644 --- a/onelogin/models/privilege_privilege.py +++ b/onelogin/models/privilege_privilege.py @@ -30,10 +30,12 @@ class PrivilegePrivilege(BaseModel): statement: Optional[conlist(PrivilegePrivilegeStatementInner)] = Field(None, alias="Statement") __properties = ["Version", "Statement"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/privilege_privilege_statement_inner.py b/onelogin/models/privilege_privilege_statement_inner.py index 2edf784f..3bef4844 100644 --- a/onelogin/models/privilege_privilege_statement_inner.py +++ b/onelogin/models/privilege_privilege_statement_inner.py @@ -20,7 +20,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictStr, conlist, field_validator class PrivilegePrivilegeStatementInner(BaseModel): """ @@ -31,7 +31,8 @@ class PrivilegePrivilegeStatementInner(BaseModel): scope: conlist(StrictStr) = Field(..., alias="Scope", description="Target the privileged action against specific resources with the scope. The scope pattern is the class of object used by the Action, followed by an ID that represents a resource in OneLogin. e.g. apps/1234, where apps is the class and 1234 is the ID of an app. The wildcard * is supported and indicates that all resources of the class type declared, in the Action, are in scope. The Action and Scope classes must match. However, there is an exception, a scope of roles/{role_id} can be combined with Actions on the user or app class. The exception allows you to target groups of users or apps with specific actions.") __properties = ["Effect", "Action", "Scope"] - @validator('action') + @field_validator('action') + @classmethod def action_validate_enum(cls, value): """Validates the enum""" for i in value: @@ -39,10 +40,12 @@ def action_validate_enum(cls, value): raise ValueError("each list item must be one of ('Apps:Create', 'Apps:Delete', 'Apps:List', 'Apps:Get', 'Apps:Update', 'Apps:ManageConnectors', 'Apps:ManageRoles', 'Apps:ManageTabs', 'Apps:ManageUsers', 'Apps:ReapplyMappings', 'Users:Create', 'Users:Delete', 'Users:List', 'Users:Get', 'Users:Update', 'Users:AssumeUser', 'Users:ManageApps', 'Users:Unlock', 'Users:GenerateTempMfaToken', 'Users:ResetPassword', 'Users:ReapplyMappings', 'Users:ManageLicense', 'Users:Invite', 'Users:ManageRoles', 'Roles:Create', 'Roles:Get', 'Roles:List', 'Roles:Update', 'Roles:Delete', 'Roles:ManageUsers', 'Roles:ManageApps', 'Reports:Create', 'Reports:Get', 'Reports:List', 'Reports:Update', 'Reports:Delete', 'Reports:Clone', 'Events:Get', 'Events:List', 'Groups:Create', 'Groups:Get', 'Groups:List', 'Groups:Update', 'Groups:Delete', 'Policies:Create', 'Policies:Get', 'Policies:List', 'Policies:Update', 'Policies:Delete', 'Policies:SetDefault')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/rate_limit.py b/onelogin/models/rate_limit.py index 79e2a97d..d38803e7 100644 --- a/onelogin/models/rate_limit.py +++ b/onelogin/models/rate_limit.py @@ -30,10 +30,12 @@ class RateLimit(BaseModel): x_rate_limit_reset: Optional[StrictInt] = Field(None, alias="X-RateLimit-Reset", description="Rate Limit Reset") __properties = ["X-RateLimit-Limit", "X-RateLimit-Remaining", "X-RateLimit-Reset"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/remove_role_users_request.py b/onelogin/models/remove_role_users_request.py index cd27e260..caba5770 100644 --- a/onelogin/models/remove_role_users_request.py +++ b/onelogin/models/remove_role_users_request.py @@ -28,10 +28,12 @@ class RemoveRoleUsersRequest(BaseModel): user_id: Optional[conlist(StrictInt)] = None __properties = ["user_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/remove_user_role_request.py b/onelogin/models/remove_user_role_request.py index 2e2f25c1..4c831c57 100644 --- a/onelogin/models/remove_user_role_request.py +++ b/onelogin/models/remove_user_role_request.py @@ -29,10 +29,12 @@ class RemoveUserRoleRequest(BaseModel): role_id_array: conlist(RemoveUserRoleRequestRoleIdArrayInner) = ... __properties = ["role_id_array"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/remove_user_role_request_role_id_array_inner.py b/onelogin/models/remove_user_role_request_role_id_array_inner.py index 16827486..f99462cb 100644 --- a/onelogin/models/remove_user_role_request_role_id_array_inner.py +++ b/onelogin/models/remove_user_role_request_role_id_array_inner.py @@ -28,10 +28,12 @@ class RemoveUserRoleRequestRoleIdArrayInner(BaseModel): role_id: Optional[StrictInt] = None __properties = ["role_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/request_brand.py b/onelogin/models/request_brand.py index c487342f..9e3a3c06 100644 --- a/onelogin/models/request_brand.py +++ b/onelogin/models/request_brand.py @@ -42,10 +42,12 @@ class RequestBrand(BaseModel): logo: Optional[StrictStr] = Field(None, description="Base64 encoded image data (PNG, <1MB)") __properties = ["enabled", "name", "custom_support_enabled", "custom_color", "custom_accent_color", "custom_masking_color", "custom_masking_opacity", "enable_custom_label_for_login_screen", "custom_label_text_for_login_screen", "login_instruction_title", "login_instruction", "hide_onelogin_footer", "mfa_enrollment_message", "background", "logo"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/revoke_tokens_request.py b/onelogin/models/revoke_tokens_request.py index ab0d27d5..c23f9d08 100644 --- a/onelogin/models/revoke_tokens_request.py +++ b/onelogin/models/revoke_tokens_request.py @@ -29,10 +29,12 @@ class RevokeTokensRequest(BaseModel): access_token: StrictStr = Field(..., description="Set to the access token you want to revoke. This access token must have been generated using the client_id and client_secret provided in the Authorization header.") __properties = ["access_token"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/risk_device.py b/onelogin/models/risk_device.py index 5b7e54a6..b3b0dcef 100644 --- a/onelogin/models/risk_device.py +++ b/onelogin/models/risk_device.py @@ -28,10 +28,12 @@ class RiskDevice(BaseModel): id: Optional[StrictStr] = Field(None, description="This device's unique identifier") __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/risk_rule.py b/onelogin/models/risk_rule.py index 7ca1057b..1f6c8534 100644 --- a/onelogin/models/risk_rule.py +++ b/onelogin/models/risk_rule.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictStr, conlist, field_validator from onelogin.models.source import Source class RiskRule(BaseModel): @@ -35,7 +35,8 @@ class RiskRule(BaseModel): source: Optional[Source] = None __properties = ["id", "name", "description", "type", "target", "filters", "source"] - @validator('type') + @field_validator('type') + @classmethod def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -45,7 +46,8 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('blacklist', 'whitelist')") return value - @validator('target') + @field_validator('target') + @classmethod def target_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -55,10 +57,12 @@ def target_validate_enum(cls, value): raise ValueError("must be one of enum values ('location.ip', 'location.address.country_iso_code')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/risk_user.py b/onelogin/models/risk_user.py index db6b125d..e3b25383 100644 --- a/onelogin/models/risk_user.py +++ b/onelogin/models/risk_user.py @@ -31,10 +31,12 @@ class RiskUser(BaseModel): authenticated: Optional[StrictBool] = Field(False, description="Indicates if the metadata supplied in this event should be considered as trusted for the user.") __properties = ["id", "name", "authenticated"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/role.py b/onelogin/models/role.py index f558c102..4021aa47 100644 --- a/onelogin/models/role.py +++ b/onelogin/models/role.py @@ -32,10 +32,12 @@ class Role(BaseModel): admins: Optional[conlist(StrictInt)] = Field(None, description="A list of user IDs to assign as role administrators.") __properties = ["id", "name", "apps", "users", "admins"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/rule_action.py b/onelogin/models/rule_action.py index 628fb6d8..00f768eb 100644 --- a/onelogin/models/rule_action.py +++ b/onelogin/models/rule_action.py @@ -29,10 +29,12 @@ class RuleAction(BaseModel): value: Optional[StrictStr] = Field(None, description="The unique identifier of the action. This should be used when defining actions for a User Mapping.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/rule_condition.py b/onelogin/models/rule_condition.py index c7ce6087..669b61a1 100644 --- a/onelogin/models/rule_condition.py +++ b/onelogin/models/rule_condition.py @@ -29,10 +29,12 @@ class RuleCondition(BaseModel): value: Optional[StrictStr] = Field(None, description="The condition operator value to use when creating or updating rules.") __properties = ["name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_app.py b/onelogin/models/saml_app.py index a2f94f83..e2a942f9 100644 --- a/onelogin/models/saml_app.py +++ b/onelogin/models/saml_app.py @@ -52,10 +52,12 @@ class SamlApp(BaseModel): sso: Optional[SsoSaml] = None __properties = ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point", "configuration", "sso"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_app_all_of.py b/onelogin/models/saml_app_all_of.py index b1b68278..a85374e9 100644 --- a/onelogin/models/saml_app_all_of.py +++ b/onelogin/models/saml_app_all_of.py @@ -33,10 +33,12 @@ class SamlAppAllOf(BaseModel): parameters: Optional[SamlAppAllOfParameters] = None __properties = ["configuration", "sso", "parameters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_app_all_of_parameters.py b/onelogin/models/saml_app_all_of_parameters.py index 1ec2d54b..fd898cdf 100644 --- a/onelogin/models/saml_app_all_of_parameters.py +++ b/onelogin/models/saml_app_all_of_parameters.py @@ -29,10 +29,12 @@ class SamlAppAllOfParameters(BaseModel): saml_username: SamlAppAllOfParametersSamlUsername = ... __properties = ["saml_username"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_app_all_of_parameters_saml_username.py b/onelogin/models/saml_app_all_of_parameters_saml_username.py index 43613d3f..976461b4 100644 --- a/onelogin/models/saml_app_all_of_parameters_saml_username.py +++ b/onelogin/models/saml_app_all_of_parameters_saml_username.py @@ -28,10 +28,12 @@ class SamlAppAllOfParametersSamlUsername(BaseModel): user_attribute_mappings: StrictStr = ... __properties = ["user_attribute_mappings"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_assert.py b/onelogin/models/saml_assert.py index c5a3f368..dc5778c9 100644 --- a/onelogin/models/saml_assert.py +++ b/onelogin/models/saml_assert.py @@ -32,10 +32,12 @@ class SamlAssert(BaseModel): ip_address: Optional[StrictStr] = Field(None, description="If you are using this API in a scenario in which MFA is required and you’ll need to be able to honor IP address whitelisting defined in MFA policies, provide this parameter and set its value to the whitelisted IP address that needs to be bypassed.") __properties = ["username_or_email", "password", "app_id", "subdomain", "ip_address"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/saml_factor.py b/onelogin/models/saml_factor.py index 14bcce1f..c2e2cbf8 100644 --- a/onelogin/models/saml_factor.py +++ b/onelogin/models/saml_factor.py @@ -32,10 +32,12 @@ class SamlFactor(BaseModel): do_not_notify: Optional[StrictBool] = Field(None, description="When verifying MFA via Protect Push, set this to true to stop additional push notifications being sent to the OneLogin Protect device.") __properties = ["app_id", "device_id", "state_token", "otp_token", "do_not_notify"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/scope.py b/onelogin/models/scope.py index 8e797cde..e509f3af 100644 --- a/onelogin/models/scope.py +++ b/onelogin/models/scope.py @@ -31,10 +31,12 @@ class Scope(BaseModel): description: Optional[StrictStr] = Field(None, description="Description of the scope") __properties = ["id", "value", "description"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/send_invite_link200_response.py b/onelogin/models/send_invite_link200_response.py index 1675f983..ac12e24c 100644 --- a/onelogin/models/send_invite_link200_response.py +++ b/onelogin/models/send_invite_link200_response.py @@ -29,10 +29,12 @@ class SendInviteLink200Response(BaseModel): status: Optional[Error] = None __properties = ["status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/send_invite_link_request.py b/onelogin/models/send_invite_link_request.py index 737b50b7..91ac4c49 100644 --- a/onelogin/models/send_invite_link_request.py +++ b/onelogin/models/send_invite_link_request.py @@ -29,10 +29,12 @@ class SendInviteLinkRequest(BaseModel): personal_email: Optional[StrictStr] = Field(None, description="To send an invite email to a different address than the one provided in email, provide it here. The invite link is sent to this address instead.") __properties = ["email", "personal_email"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/session.py b/onelogin/models/session.py index 77a0a1c0..00f6fdf7 100644 --- a/onelogin/models/session.py +++ b/onelogin/models/session.py @@ -28,10 +28,12 @@ class Session(BaseModel): id: Optional[StrictStr] = Field(None, description="If you use a database to track sessions, you can send us the session ID.") __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/set_user_state_request.py b/onelogin/models/set_user_state_request.py index 3c654088..467497bd 100644 --- a/onelogin/models/set_user_state_request.py +++ b/onelogin/models/set_user_state_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, validator +from pydantic import BaseModel, Field, StrictInt, field_validator class SetUserStateRequest(BaseModel): """ @@ -28,17 +28,20 @@ class SetUserStateRequest(BaseModel): state: StrictInt = Field(..., description="Set to the state value. Valid values include: - 0 : Unapproved - 1 : Approved - 2 : Rejected - 3 : Unlicensed") __properties = ["state"] - @validator('state') + @field_validator('state') + @classmethod def state_validate_enum(cls, value): """Validates the enum""" if value not in (0, 1, 2, 3): raise ValueError("must be one of enum values (0, 1, 2, 3)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/source.py b/onelogin/models/source.py index f90a72cc..b22cbb20 100644 --- a/onelogin/models/source.py +++ b/onelogin/models/source.py @@ -29,10 +29,12 @@ class Source(BaseModel): name: Optional[StrictStr] = Field(None, description="The name of the source") __properties = ["id", "name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/sso_oidc.py b/onelogin/models/sso_oidc.py index 0d7d6dad..846e7943 100644 --- a/onelogin/models/sso_oidc.py +++ b/onelogin/models/sso_oidc.py @@ -28,10 +28,12 @@ class SsoOidc(BaseModel): client_id: Optional[StrictStr] = Field(None, description="OIDC: The OpenId Connect Client Id. Note that client_secret is only returned after Creating an App") __properties = ["client_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/sso_saml.py b/onelogin/models/sso_saml.py index 3a950d59..cfcc0d85 100644 --- a/onelogin/models/sso_saml.py +++ b/onelogin/models/sso_saml.py @@ -33,10 +33,12 @@ class SsoSaml(BaseModel): certificate: Optional[SsoSamlCertificate] = None __properties = ["metadata_url", "acs_url", "sls_url", "issuer", "certificate"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/sso_saml_certificate.py b/onelogin/models/sso_saml_certificate.py index 7b6d7b4d..d5b439fc 100644 --- a/onelogin/models/sso_saml_certificate.py +++ b/onelogin/models/sso_saml_certificate.py @@ -30,10 +30,12 @@ class SsoSamlCertificate(BaseModel): value: Optional[StrictStr] = Field(None, description="SAML Certificate Value") __properties = ["id", "name", "value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/token_claim.py b/onelogin/models/token_claim.py index ad994e76..4283a281 100644 --- a/onelogin/models/token_claim.py +++ b/onelogin/models/token_claim.py @@ -36,10 +36,12 @@ class TokenClaim(BaseModel): provisioned_entitlements: Optional[StrictBool] = Field(None, description="Relates to Rules/Entitlements. Not supported yet.") __properties = ["id", "label", "user_attribute_mappings", "user_attribute_macros", "attribute_transformations", "skip_if_blank", "values", "default_values", "provisioned_entitlements"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/track_risk_event_request.py b/onelogin/models/track_risk_event_request.py index 86eea548..328a02ca 100644 --- a/onelogin/models/track_risk_event_request.py +++ b/onelogin/models/track_risk_event_request.py @@ -40,10 +40,12 @@ class TrackRiskEventRequest(BaseModel): published: Optional[StrictStr] = Field(None, description="Date and time of the event in IS08601 format. Useful for preloading old events. Defaults to date time this API request is received.") __properties = ["verb", "ip", "user_agent", "user", "source", "session", "device", "fp", "published"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_client_app_request.py b/onelogin/models/update_client_app_request.py index 3404d892..e9bd2317 100644 --- a/onelogin/models/update_client_app_request.py +++ b/onelogin/models/update_client_app_request.py @@ -28,10 +28,12 @@ class UpdateClientAppRequest(BaseModel): scopes: Optional[conlist(StrictInt)] = Field(None, description="An array of Scope IDs the scopes the app can request") __properties = ["scopes"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_environment_variable_request.py b/onelogin/models/update_environment_variable_request.py index bdaa5a20..2b3de39f 100644 --- a/onelogin/models/update_environment_variable_request.py +++ b/onelogin/models/update_environment_variable_request.py @@ -28,10 +28,12 @@ class UpdateEnvironmentVariableRequest(BaseModel): value: StrictStr = Field(..., description="The secret value that will be encrypted at rest and injected in applicable hook functions at run time.") __properties = ["value"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_password_insecure_request.py b/onelogin/models/update_password_insecure_request.py index 41a35e0e..238cdbe6 100644 --- a/onelogin/models/update_password_insecure_request.py +++ b/onelogin/models/update_password_insecure_request.py @@ -30,10 +30,12 @@ class UpdatePasswordInsecureRequest(BaseModel): validate_policy: Optional[StrictBool] = Field(False, description="Will passwords validate against the User Policy. Defaults to false.") __properties = ["password", "password_confirmation", "validate_policy"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_password_secure_request.py b/onelogin/models/update_password_secure_request.py index bb057af1..fc7e1944 100644 --- a/onelogin/models/update_password_secure_request.py +++ b/onelogin/models/update_password_secure_request.py @@ -31,10 +31,12 @@ class UpdatePasswordSecureRequest(BaseModel): password_salt: Optional[StrictStr] = Field(None, description="Optional. If your password hash has been salted then you can provide the salt used in this param. This assumes that the salt was prepended to the password before doing the SHA256 hash. The API supports a salt value that is up to 40 characters long.") __properties = ["password", "password_confirmation", "password_algorithm", "password_salt"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_privilege200_response.py b/onelogin/models/update_privilege200_response.py index 1381af44..1170305d 100644 --- a/onelogin/models/update_privilege200_response.py +++ b/onelogin/models/update_privilege200_response.py @@ -29,10 +29,12 @@ class UpdatePrivilege200Response(BaseModel): id: Optional[StrictStr] = Field(None, description="Privilege ID") __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_risk_rule_request.py b/onelogin/models/update_risk_rule_request.py index 6df39e57..1488943b 100644 --- a/onelogin/models/update_risk_rule_request.py +++ b/onelogin/models/update_risk_rule_request.py @@ -28,10 +28,12 @@ class UpdateRiskRuleRequest(BaseModel): id: Optional[StrictStr] = Field(None, description="The ID of the Rule to Update") __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/update_role200_response.py b/onelogin/models/update_role200_response.py index cb07560a..511bd233 100644 --- a/onelogin/models/update_role200_response.py +++ b/onelogin/models/update_role200_response.py @@ -28,10 +28,12 @@ class UpdateRole200Response(BaseModel): id: Optional[StrictInt] = None __properties = ["id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/user.py b/onelogin/models/user.py index de7962d4..eb1cb1c5 100644 --- a/onelogin/models/user.py +++ b/onelogin/models/user.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, field_validator class User(BaseModel): """ @@ -63,7 +63,8 @@ class User(BaseModel): salt: Optional[StrictStr] = Field(None, description="The salt value used with the password_algorithm.") __properties = ["id", "username", "email", "firstname", "lastname", "title", "department", "company", "comment", "group_id", "role_ids", "phone", "state", "status", "directory_id", "trusted_idp_id", "manager_ad_id", "manager_user_id", "samaccountname", "member_of", "userprincipalname", "distinguished_name", "external_id", "activated_at", "last_login", "invitation_sent_at", "updated_at", "preferred_locale_code", "created_at", "invalid_login_attempts", "locked_until", "password_changed_at", "password", "password_confirmation", "password_algorithm", "salt"] - @validator('state') + @field_validator('state') + @classmethod def state_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -73,7 +74,8 @@ def state_validate_enum(cls, value): raise ValueError("must be one of enum values (0, 1, 2, 3)") return value - @validator('status') + @field_validator('status') + @classmethod def status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -83,10 +85,12 @@ def status_validate_enum(cls, value): raise ValueError("must be one of enum values (0, 1, 2, 3, 4, 5, 7, 8)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/ver_factor_saml200_response.py b/onelogin/models/ver_factor_saml200_response.py index c90c0c54..2c486659 100644 --- a/onelogin/models/ver_factor_saml200_response.py +++ b/onelogin/models/ver_factor_saml200_response.py @@ -31,10 +31,12 @@ class VerFactorSaml200Response(BaseModel): message: Optional[StrictStr] = Field(None, description="Plain text description describing the outcome of the response.") __properties = ["data", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/verify_mfa_factor_request.py b/onelogin/models/verify_mfa_factor_request.py index 1bb39af7..992805c1 100644 --- a/onelogin/models/verify_mfa_factor_request.py +++ b/onelogin/models/verify_mfa_factor_request.py @@ -29,10 +29,12 @@ class VerifyMfaFactorRequest(BaseModel): otp_token: Optional[StrictStr] = Field(None, description="OTP code provided by the device or SMS message sent to user. When a device like OneLogin Protect that supports Push has been used you do not need to provide the otp_token and can keep polling this endpoint until the state_token expires.") __properties = ["state_token", "otp_token"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/verify_user_registration200_response.py b/onelogin/models/verify_user_registration200_response.py index 06b141d0..6803eef9 100644 --- a/onelogin/models/verify_user_registration200_response.py +++ b/onelogin/models/verify_user_registration200_response.py @@ -30,10 +30,12 @@ class VerifyUserRegistration200Response(BaseModel): device_id: Optional[StrictStr] = Field(None, description="Device id to be used with Verify the Factor.") __properties = ["id", "status", "device_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/verify_user_registration_request.py b/onelogin/models/verify_user_registration_request.py index 62163ac0..444e8654 100644 --- a/onelogin/models/verify_user_registration_request.py +++ b/onelogin/models/verify_user_registration_request.py @@ -28,10 +28,12 @@ class VerifyUserRegistrationRequest(BaseModel): otp: Optional[StrictInt] = Field(None, description="One-Time-Password (OTP) that was sent to the user based on the chosen factor. OneLogin SMS and OneLogin Email support this OTP code.") __properties = ["otp"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/onelogin/models/verify_user_verification_request.py b/onelogin/models/verify_user_verification_request.py index 75e5d01d..4286c635 100644 --- a/onelogin/models/verify_user_verification_request.py +++ b/onelogin/models/verify_user_verification_request.py @@ -29,10 +29,12 @@ class VerifyUserVerificationRequest(BaseModel): device_id: Optional[StrictInt] = Field(None, description="ID of the specified device which has been registerd for the given user. Available on Get Devices API call.") __properties = ["otp", "device_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """Pydantic configuration""" + model_config = { + "validate_by_name": True, + "validate_by_alias": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/sample_script.py b/sample_script.py index ce67fdb4..e7bf388c 100644 --- a/sample_script.py +++ b/sample_script.py @@ -5,13 +5,14 @@ # Change host to your domain or it will default to https://your-api-subdomain.onelogin.com configuration = onelogin.Configuration( - host = "https://your-api-subdomain.onelogin.com" + host = "https://sumit-shadow.onelogin-shadow01.com", + username = "6c5576b0622759fcbbefe177e61be499879b4d0f5fb33a512c551f7e238c3da6", + password = "e4c318ac6c5c2691f544c104dd534356428e8d9c0a36ed7a14da782436b486f9" ) -configuration = onelogin.Configuration( - username = os.environ["USERNAME"], - password = os.environ["PASSWORD"] -) +# configuration = onelogin.Configuration( + +# ) # Enter a context with an instance of the API client with onelogin.ApiClient(configuration) as api_client: From 7b6e63efc468b98519b5250710ab1c506717fccf Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Wed, 30 Apr 2025 12:37:07 +0530 Subject: [PATCH 2/7] fix: updated the sample_script --- onelogin/models/privilege_privilege_statement_inner.py | 4 ++-- sample_script.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onelogin/models/privilege_privilege_statement_inner.py b/onelogin/models/privilege_privilege_statement_inner.py index 3bef4844..c3a50483 100644 --- a/onelogin/models/privilege_privilege_statement_inner.py +++ b/onelogin/models/privilege_privilege_statement_inner.py @@ -36,8 +36,8 @@ class PrivilegePrivilegeStatementInner(BaseModel): def action_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in ('Apps:Create', 'Apps:Delete', 'Apps:List', 'Apps:Get', 'Apps:Update', 'Apps:ManageConnectors', 'Apps:ManageRoles', 'Apps:ManageTabs', 'Apps:ManageUsers', 'Apps:ReapplyMappings', 'Users:Create', 'Users:Delete', 'Users:List', 'Users:Get', 'Users:Update', 'Users:AssumeUser', 'Users:ManageApps', 'Users:Unlock', 'Users:GenerateTempMfaToken', 'Users:ResetPassword', 'Users:ReapplyMappings', 'Users:ManageLicense', 'Users:Invite', 'Users:ManageRoles', 'Roles:Create', 'Roles:Get', 'Roles:List', 'Roles:Update', 'Roles:Delete', 'Roles:ManageUsers', 'Roles:ManageApps', 'Reports:Create', 'Reports:Get', 'Reports:List', 'Reports:Update', 'Reports:Delete', 'Reports:Clone', 'Events:Get', 'Events:List', 'Groups:Create', 'Groups:Get', 'Groups:List', 'Groups:Update', 'Groups:Delete', 'Policies:Create', 'Policies:Get', 'Policies:List', 'Policies:Update', 'Policies:Delete', 'Policies:SetDefault'): - raise ValueError("each list item must be one of ('Apps:Create', 'Apps:Delete', 'Apps:List', 'Apps:Get', 'Apps:Update', 'Apps:ManageConnectors', 'Apps:ManageRoles', 'Apps:ManageTabs', 'Apps:ManageUsers', 'Apps:ReapplyMappings', 'Users:Create', 'Users:Delete', 'Users:List', 'Users:Get', 'Users:Update', 'Users:AssumeUser', 'Users:ManageApps', 'Users:Unlock', 'Users:GenerateTempMfaToken', 'Users:ResetPassword', 'Users:ReapplyMappings', 'Users:ManageLicense', 'Users:Invite', 'Users:ManageRoles', 'Roles:Create', 'Roles:Get', 'Roles:List', 'Roles:Update', 'Roles:Delete', 'Roles:ManageUsers', 'Roles:ManageApps', 'Reports:Create', 'Reports:Get', 'Reports:List', 'Reports:Update', 'Reports:Delete', 'Reports:Clone', 'Events:Get', 'Events:List', 'Groups:Create', 'Groups:Get', 'Groups:List', 'Groups:Update', 'Groups:Delete', 'Policies:Create', 'Policies:Get', 'Policies:List', 'Policies:Update', 'Policies:Delete', 'Policies:SetDefault')") + if i not in ('apps:Create', 'apps:Delete', 'apps:List', 'apps:Get', 'apps:Update', 'apps:ManageConnectors', 'apps:ManageRoles', 'apps:ManageTabs', 'apps:ManageUsers', 'apps:ReapplyMappings', 'users:Create', 'users:Delete', 'users:List', 'users:Get', 'users:Update', 'users:AssumeUser', 'users:ManageApps', 'users:Unlock', 'users:GenerateTempMfaToken', 'users:ResetPassword', 'users:ReapplyMappings', 'users:ManageLicense', 'users:Invite', 'users:ManageRoles', 'roles:Create', 'roles:Get', 'roles:List', 'roles:Update', 'roles:Delete', 'roles:ManageUsers', 'roles:ManageApps', 'reports:Create', 'reports:Get', 'reports:List', 'reports:Update', 'reports:Delete', 'reports:Clone', 'events:Get', 'events:List', 'groups:Create', 'groups:Get', 'groups:List', 'groups:Update', 'groups:Delete', 'policies:Create', 'policies:Get', 'policies:List', 'policies:Update', 'policies:Delete', 'policies:SetDefault'): + raise ValueError("each list item must be one of ('apps:Create', 'apps:Delete', 'apps:List', 'apps:Get', 'apps:Update', 'apps:ManageConnectors', 'apps:ManageRoles', 'apps:ManageTabs', 'apps:ManageUsers', 'apps:ReapplyMappings', 'users:Create', 'users:Delete', 'users:List', 'users:Get', 'users:Update', 'users:AssumeUser', 'users:ManageApps', 'users:Unlock', 'users:GenerateTempMfaToken', 'users:ResetPassword', 'users:ReapplyMappings', 'users:ManageLicense', 'users:Invite', 'users:ManageRoles', 'roles:Create', 'roles:Get', 'roles:List', 'roles:Update', 'roles:Delete', 'roles:ManageUsers', 'roles:ManageApps', 'reports:Create', 'reports:Get', 'reports:List', 'reports:Update', 'reports:Delete', 'reports:Clone', 'events:Get', 'events:List', 'groups:Create', 'groups:Get', 'groups:List', 'groups:Update', 'groups:Delete', 'policies:Create', 'policies:Get', 'policies:List', 'policies:Update', 'policies:Delete', 'policies:SetDefault')") return value """Pydantic configuration""" diff --git a/sample_script.py b/sample_script.py index e7bf388c..bff0c539 100644 --- a/sample_script.py +++ b/sample_script.py @@ -38,7 +38,7 @@ print("Exception when calling UsersV2Api->list_users: %s\n" % e) priv_instance = onelogin.PrivilegesApi(api_client) - privilege = {"name":"User Helpdesk","description":"Can administer helpdesk users","privilege":{"Version":"2018-05-18","Statement":[{"Effect":"Allow","Action":["Users:List","Users:Get","Users:Unlock","Users:ResetPassword","Users:GenerateTempMfaToken"],"Scope":["*"]}]}} # Privilege | (optional) + privilege = {"name":"User Helpdesk","description":"Can administer helpdesk users","privilege":{"Version":"2018-05-18","Statement":[{"Effect":"Allow","Action":["users:List","users:Get","users:Unlock","users:ResetPassword","users:GenerateTempMfaToken"],"Scope":["*"]}]}} # Privilege | (optional) try: # Create a Privilege From a9ef19086aa779a615cd1fb0b78e819e5bb4b42a Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Wed, 7 May 2025 11:49:00 +0530 Subject: [PATCH 3/7] fix: app scripts --- app_script.py | 70 ++++++++++++++++ onelogin/models/app_parameters.py | 9 +- onelogin/models/clock_counter.py | 6 +- onelogin/models/enforcement_point.py | 6 +- .../enforcement_point_resources_inner.py | 6 +- onelogin/models/generic_app.py | 10 ++- onelogin/models/generic_app_provisioning.py | 6 +- user_script.py | 82 +++++++++++++++++++ 8 files changed, 181 insertions(+), 14 deletions(-) create mode 100644 app_script.py create mode 100644 user_script.py diff --git a/app_script.py b/app_script.py new file mode 100644 index 00000000..59ae4c06 --- /dev/null +++ b/app_script.py @@ -0,0 +1,70 @@ +import os +import onelogin +from onelogin.rest import ApiException +from onelogin.models.generic_app import GenericApp +from pprint import pprint + +# Change host to your domain or it will default to https://your-api-subdomain.onelogin.com +configuration = onelogin.Configuration( + host = "https://your-api-subdomain.onelogin.com", + username = "", + password = "" +) + +# Enter a context with an instance of the API client +with onelogin.ApiClient(configuration) as api_client: + # Create an instance of the API class + token_instance = onelogin.OAuth2Api(api_client) + generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token + content_type="application/json" + + try: + # Generate and Save Access Token + api_response = token_instance.generate_token(generate_token_request, content_type=content_type) + configuration.access_token = api_response.access_token + pprint(configuration.access_token) + except Exception as e: + print("Exception when generating access token: %s\n" % e) + + app_id = "" # Replace with your app ID + app_instance = onelogin.AppsApi(api_client) + + try: + # List Apps + api_response = app_instance.list_apps() + print("The response of AppsApi->get_app:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AppsApi->get_app: %s\n" % e) + + try: + # Get App by ID + api_response = app_instance.get_app(app_id=app_id) + print("The response of AppsApi->get_app:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AppsApi->get_app: %s\n" % e) + + try: + # Update App + api_response = app_instance.update_app(app_id=app_id, request_body={"visible": False}) + print("The response of AppsApi->update_app:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AppsApi->update_app: %s\n" % e) + + # try: + # # Delete App + # api_response = app_instance.delete_app(app_id=app_id) + # print("The response of AppsApi->delete_app:\n") + # pprint(api_response) + # except Exception as e: + # print("Exception when calling AppsApi->delete_app: %s\n" % e) + + try: + # Get App Users + api_response = app_instance.get_app_users(app_id=app_id) + print("The response of AppsApi->get_app_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AppsApi->get_app_users: %s\n" % e) \ No newline at end of file diff --git a/onelogin/models/app_parameters.py b/onelogin/models/app_parameters.py index 9bf5daf3..334b2a79 100644 --- a/onelogin/models/app_parameters.py +++ b/onelogin/models/app_parameters.py @@ -18,7 +18,7 @@ import json -from typing import Optional, Dict, Any +from typing import Optional, Dict, Any, ClassVar, List from pydantic import BaseModel, Field, StrictBool, StrictStr class AppParameters(BaseModel): @@ -30,7 +30,9 @@ class AppParameters(BaseModel): label: Optional[StrictStr] = Field(None, description="The can only be set when creating a new parameter. It can not be updated.") include_in_saml_assertion: Optional[StrictBool] = Field(None, description="When true, this parameter will be included in a SAML assertion payload.") additional_properties: Dict[str, Any] = {} - __properties = ["user_attribute_mappings", "user_attribute_macros", "label", "include_in_saml_assertion"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["user_attribute_mappings", "user_attribute_macros", "label", "include_in_saml_assertion"] """Pydantic configuration""" model_config = { @@ -82,8 +84,9 @@ def from_dict(cls, obj: dict) -> AppParameters: "include_in_saml_assertion": obj.get("include_in_saml_assertion") }) # store additional fields in additional_properties + standard_props = getattr(cls, "_properties", ["user_attribute_mappings", "user_attribute_macros", "label", "include_in_saml_assertion"]) for _key in obj.keys(): - if _key not in cls.__properties: + if _key not in standard_props: _obj.additional_properties[_key] = obj.get(_key) return _obj diff --git a/onelogin/models/clock_counter.py b/onelogin/models/clock_counter.py index 6c09d935..ca757d41 100644 --- a/onelogin/models/clock_counter.py +++ b/onelogin/models/clock_counter.py @@ -18,7 +18,7 @@ import json -from typing import Optional +from typing import Optional, ClassVar, List from pydantic import BaseModel, StrictInt class ClockCounter(BaseModel): @@ -27,7 +27,9 @@ class ClockCounter(BaseModel): """ value: Optional[StrictInt] = None unit: Optional[StrictInt] = None - __properties = ["value", "unit"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["value", "unit"] """Pydantic configuration""" model_config = { diff --git a/onelogin/models/enforcement_point.py b/onelogin/models/enforcement_point.py index 3d1a1001..bf03c9b2 100644 --- a/onelogin/models/enforcement_point.py +++ b/onelogin/models/enforcement_point.py @@ -18,7 +18,7 @@ import json -from typing import List, Optional +from typing import List, Optional, ClassVar from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, field_validator from onelogin.models.clock_counter import ClockCounter from onelogin.models.enforcement_point_resources_inner import EnforcementPointResourcesInner @@ -40,7 +40,9 @@ class EnforcementPoint(BaseModel): vhost: Optional[StrictStr] = Field(None, description="A comma-delimited list of one or more virtual hosts that map to applications assigned to the enforcement point. A VHOST may be a host name or an IP address. VHOST distinguish between applications that are at the same context root.") landing_page: Optional[StrictStr] = Field(None, description="The location within the context root to which the browser will be redirected for IdP-initiated single sign-on. For example, the landing page might be an index page in the context root such as index.html or default.aspx. The landing page cannot begin with a slash and must use valid URL characters.") case_sensitive: Optional[StrictBool] = Field(None, description="The URL path evaluation is case insensitive by default. Resources hosted on web servers such as Apache, NGINX and Java EE are case sensitive paths. Web servers such as Microsoft IIS are not case-sensitive.") - __properties = ["require_sitewide_authentication", "conditions", "session_expiry_fixed", "session_expiry_inactivity", "permissions", "token", "target", "resources", "context_root", "use_target_host_header", "vhost", "landing_page", "case_sensitive"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["require_sitewide_authentication", "conditions", "session_expiry_fixed", "session_expiry_inactivity", "permissions", "token", "target", "resources", "context_root", "use_target_host_header", "vhost", "landing_page", "case_sensitive"] @field_validator('permissions') @classmethod diff --git a/onelogin/models/enforcement_point_resources_inner.py b/onelogin/models/enforcement_point_resources_inner.py index efd7d74e..c9f9c7eb 100644 --- a/onelogin/models/enforcement_point_resources_inner.py +++ b/onelogin/models/enforcement_point_resources_inner.py @@ -18,7 +18,7 @@ import json -from typing import Optional +from typing import Optional, ClassVar, List from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator class EnforcementPointResourcesInner(BaseModel): @@ -30,7 +30,9 @@ class EnforcementPointResourcesInner(BaseModel): require_auth: Optional[StrictBool] = None permission: Optional[StrictStr] = None conditions: Optional[StrictStr] = Field(None, description="required if permission == \"conditions\"") - __properties = ["path", "is_path_regex", "require_auth", "permission", "conditions"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["path", "is_path_regex", "require_auth", "permission", "conditions"] @field_validator('permission') @classmethod diff --git a/onelogin/models/generic_app.py b/onelogin/models/generic_app.py index 63ed6dd7..f9d34640 100644 --- a/onelogin/models/generic_app.py +++ b/onelogin/models/generic_app.py @@ -18,7 +18,7 @@ import json -from typing import List, Dict, Optional, Any +from typing import List, Dict, Optional, Any, ClassVar from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist from onelogin.models.app_parameters import AppParameters from onelogin.models.auth_method import AuthMethod @@ -47,7 +47,9 @@ class GenericApp(BaseModel): parameters: Optional[AppParameters] = None enforcement_point: Optional[EnforcementPoint] = None additional_properties: Dict[str, Any] = {} - __properties = ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point"] """Pydantic configuration""" model_config = { @@ -122,8 +124,10 @@ def from_dict(cls, obj: dict) -> GenericApp: "enforcement_point": EnforcementPoint.from_dict(obj.get("enforcement_point")) if obj.get("enforcement_point") is not None else None }) # store additional fields in additional_properties + # Get standard properties with fallback + standard_props = getattr(cls, "_properties", ["id", "name", "visible", "description", "notes", "icon_url", "auth_method", "policy_id", "allow_assumed_signin", "tab_id", "connector_id", "created_at", "updated_at", "role_ids", "provisioning", "parameters", "enforcement_point"]) for _key in obj.keys(): - if _key not in cls.__properties: + if _key not in standard_props: _obj.additional_properties[_key] = obj.get(_key) return _obj diff --git a/onelogin/models/generic_app_provisioning.py b/onelogin/models/generic_app_provisioning.py index e94ad6bf..9a26f9be 100644 --- a/onelogin/models/generic_app_provisioning.py +++ b/onelogin/models/generic_app_provisioning.py @@ -18,7 +18,7 @@ import json -from typing import Optional +from typing import Optional, ClassVar, List from pydantic import BaseModel, StrictBool class GenericAppProvisioning(BaseModel): @@ -26,7 +26,9 @@ class GenericAppProvisioning(BaseModel): Indicates if provisioning is enabled for this app. """ enabled: Optional[StrictBool] = None - __properties = ["enabled"] + + # Define properties as a class variable + _properties: ClassVar[List[str]] = ["enabled"] """Pydantic configuration""" model_config = { diff --git a/user_script.py b/user_script.py new file mode 100644 index 00000000..45cca521 --- /dev/null +++ b/user_script.py @@ -0,0 +1,82 @@ +import os +import onelogin +from onelogin.rest import ApiException +from pprint import pprint + +# Change host to your domain or it will default to https://your-api-subdomain.onelogin.com +configuration = onelogin.Configuration( + host = "https://your-api-subdomain.onelogin.com", + username = "", + password = "" +) + +# Enter a context with an instance of the API client +with onelogin.ApiClient(configuration) as api_client: + # Create an instance of the API class + token_instance = onelogin.OAuth2Api(api_client) + generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token + content_type="application/json" + + try: + # Generate and Save Access Token + api_response = token_instance.generate_token(generate_token_request, content_type=content_type) + configuration.access_token = api_response.access_token + pprint(configuration.access_token) + except Exception as e: + print("Exception when generating access token: %s\n" % e) + + users = None + user_instance = onelogin.UsersV2Api(api_client) + + try: + # List All Users + api_response = user_instance.list_users2() + print("The response of UsersV2Api->list_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->list_users: %s\n" % e) + + try: + # Create User + dummy_user = { + "email": "dummy@quest.com", + } + api_response = user_instance.create_user2(user=dummy_user, _headers={"Authorization": "Bearer " + configuration.access_token}) + users = api_response + print("The response of UsersV2Api->create_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->create_user: %s\n" % e) + + try: + # Get User by ID + api_response = user_instance.get_user2(user_id=users.id) + pprint("The response of UsersV2Api->get_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->get_user: %s\n" % e) + + try: + # List User Apps + api_response = user_instance.get_user_apps2(user_id=users.id) + print("The response of UsersV2Api->list_user_apps:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->list_user_apps: %s\n" % e) + + try: + # Update User + user_details = {"firstname": 'dummy', "lastname": 'user'} + api_response = user_instance.update_user2(user_id=users.id, user=user_details, _headers={"Authorization": "Bearer " + configuration.access_token}) + print("The response of UsersV2Api->update_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->update_user: %s\n" % e) + + try: + # Delete User + api_response = user_instance.delete_user2(user_id=users.id) + print("The response of UsersV2Api->delete_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersV2Api->delete_user: %s\n" % e) \ No newline at end of file From 7e168081362b6058f1cfdfe55800d7da0e8e434a Mon Sep 17 00:00:00 2001 From: Will Munslow Date: Thu, 8 May 2025 11:04:15 -0700 Subject: [PATCH 4/7] fix: update pydantic dependency --- pyproject.toml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b75a362b..fefec1f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ python = "^3.7" urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" +pydantic = ">=2.11.0" aenum = ">=3.1.11" [tool.poetry.dev-dependencies] diff --git a/requirements.txt b/requirements.txt index f6e341f2..a6479dd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 67.7.1 urllib3 >= 2.0.2 -pydantic >= 1.10.5, < 2 +pydantic >= 2.11.0 aenum >= 3.1.11 From a5a6180cccda2ea3eb26fb83b48dff96b920f57a Mon Sep 17 00:00:00 2001 From: Will Munslow Date: Thu, 8 May 2025 11:16:20 -0700 Subject: [PATCH 5/7] fix: add example for create_auth_claim & delete_auth_claim --- sample_script.py | 74 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/sample_script.py b/sample_script.py index bff0c539..542c915b 100644 --- a/sample_script.py +++ b/sample_script.py @@ -56,4 +56,76 @@ print("The response of PrivilegesApi->list_privileges:\n") pprint(api_response) except Exception as e: - print("Exception when calling PrivilegesApi->list_privileges: %s\n" % e) \ No newline at end of file + print("Exception when calling PrivilegesApi->list_privileges: %s\n" % e) + + # Create an instance of the APIAuthClaimsApi + auth_claims_api = onelogin.APIAuthClaimsApi(api_client) + content_type = "application/json" + + # First, list available auth servers to get an ID + auth_server_api = onelogin.APIAuthorizationServerApi(api_client) + try: + # Get list of auth servers + auth_servers = auth_server_api.get_auth_servers(content_type=content_type) + print("Available Auth Servers:\n") + pprint(auth_servers) + + # For testing, use the first auth server ID if available + if auth_servers and len(auth_servers) > 0: + auth_server_id = str(auth_servers[0].id) + + # Create an auth claim + auth_claim = onelogin.AuthClaim( + name="test_claim", + user_attribute_mappings="email" + ) + + try: + # Create Auth Claim + create_response = auth_claims_api.create_auth_claim( + api_auth_id=auth_server_id, + content_type=content_type, + auth_claim=auth_claim + ) + print("Created Auth Claim with ID:\n") + pprint(create_response) + + # Get the created claim ID + claim_id = create_response + + # List all claims to verify creation + try: + all_claims = auth_claims_api.get_authclaims( + api_auth_id=auth_server_id, + content_type=content_type + ) + print("All Auth Claims:\n") + pprint(all_claims) + except Exception as e: + print(f"Exception when listing auth claims: {e}") + + # Delete the auth claim + try: + auth_claims_api.delete_auth_claim( + api_auth_id=auth_server_id, + claim_id=claim_id, + content_type=content_type + ) + print(f"Successfully deleted auth claim with ID: {claim_id}") + + # Verify deletion by listing claims again + all_claims_after = auth_claims_api.get_authclaims( + api_auth_id=auth_server_id, + content_type=content_type + ) + print("Auth Claims after deletion:\n") + pprint(all_claims_after) + except Exception as e: + print(f"Exception when deleting auth claim: {e}") + + except Exception as e: + print(f"Exception when creating auth claim: {e}") + else: + print("No authorization servers found to test with.") + except Exception as e: + print(f"Exception when getting auth servers: {e}") \ No newline at end of file From 74722922a186a7138081d8f9e965cee10df1ebfd Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Fri, 9 May 2025 22:31:25 +0530 Subject: [PATCH 6/7] fix: updated CRUD ops for auth_claims and auth_server apis --- app_script.py | 70 --------------------- sample_script.py | 160 +++++++++++++++++++++++++++-------------------- user_script.py | 82 ------------------------ 3 files changed, 93 insertions(+), 219 deletions(-) delete mode 100644 app_script.py delete mode 100644 user_script.py diff --git a/app_script.py b/app_script.py deleted file mode 100644 index 59ae4c06..00000000 --- a/app_script.py +++ /dev/null @@ -1,70 +0,0 @@ -import os -import onelogin -from onelogin.rest import ApiException -from onelogin.models.generic_app import GenericApp -from pprint import pprint - -# Change host to your domain or it will default to https://your-api-subdomain.onelogin.com -configuration = onelogin.Configuration( - host = "https://your-api-subdomain.onelogin.com", - username = "", - password = "" -) - -# Enter a context with an instance of the API client -with onelogin.ApiClient(configuration) as api_client: - # Create an instance of the API class - token_instance = onelogin.OAuth2Api(api_client) - generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token - content_type="application/json" - - try: - # Generate and Save Access Token - api_response = token_instance.generate_token(generate_token_request, content_type=content_type) - configuration.access_token = api_response.access_token - pprint(configuration.access_token) - except Exception as e: - print("Exception when generating access token: %s\n" % e) - - app_id = "" # Replace with your app ID - app_instance = onelogin.AppsApi(api_client) - - try: - # List Apps - api_response = app_instance.list_apps() - print("The response of AppsApi->get_app:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AppsApi->get_app: %s\n" % e) - - try: - # Get App by ID - api_response = app_instance.get_app(app_id=app_id) - print("The response of AppsApi->get_app:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AppsApi->get_app: %s\n" % e) - - try: - # Update App - api_response = app_instance.update_app(app_id=app_id, request_body={"visible": False}) - print("The response of AppsApi->update_app:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AppsApi->update_app: %s\n" % e) - - # try: - # # Delete App - # api_response = app_instance.delete_app(app_id=app_id) - # print("The response of AppsApi->delete_app:\n") - # pprint(api_response) - # except Exception as e: - # print("Exception when calling AppsApi->delete_app: %s\n" % e) - - try: - # Get App Users - api_response = app_instance.get_app_users(app_id=app_id) - print("The response of AppsApi->get_app_users:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AppsApi->get_app_users: %s\n" % e) \ No newline at end of file diff --git a/sample_script.py b/sample_script.py index 542c915b..978eb074 100644 --- a/sample_script.py +++ b/sample_script.py @@ -20,6 +20,7 @@ token_instance = onelogin.OAuth2Api(api_client) generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token content_type="application/json" + try: # Generate and Save Access Token api_response = token_instance.generate_token(generate_token_request, content_type=content_type) @@ -58,74 +59,99 @@ except Exception as e: print("Exception when calling PrivilegesApi->list_privileges: %s\n" % e) - # Create an instance of the APIAuthClaimsApi - auth_claims_api = onelogin.APIAuthClaimsApi(api_client) - content_type = "application/json" - - # First, list available auth servers to get an ID + + auth_servers = None auth_server_api = onelogin.APIAuthorizationServerApi(api_client) + try: - # Get list of auth servers - auth_servers = auth_server_api.get_auth_servers(content_type=content_type) - print("Available Auth Servers:\n") - pprint(auth_servers) - - # For testing, use the first auth server ID if available - if auth_servers and len(auth_servers) > 0: - auth_server_id = str(auth_servers[0].id) - - # Create an auth claim - auth_claim = onelogin.AuthClaim( - name="test_claim", - user_attribute_mappings="email" + # Create a dummy auth server for testing + auth_server = onelogin.AuthServer( + name="Test Auth Server", + description="This is a dummy auth server", + configuration= { + "resource_identifier": "http://myapi.com/contacts2", + "audiences": ["http://myapi.com/contacts2"] + } ) - - try: - # Create Auth Claim - create_response = auth_claims_api.create_auth_claim( - api_auth_id=auth_server_id, - content_type=content_type, - auth_claim=auth_claim - ) - print("Created Auth Claim with ID:\n") - pprint(create_response) - - # Get the created claim ID - claim_id = create_response - - # List all claims to verify creation - try: - all_claims = auth_claims_api.get_authclaims( - api_auth_id=auth_server_id, - content_type=content_type - ) - print("All Auth Claims:\n") - pprint(all_claims) - except Exception as e: - print(f"Exception when listing auth claims: {e}") - - # Delete the auth claim - try: - auth_claims_api.delete_auth_claim( - api_auth_id=auth_server_id, - claim_id=claim_id, - content_type=content_type - ) - print(f"Successfully deleted auth claim with ID: {claim_id}") - - # Verify deletion by listing claims again - all_claims_after = auth_claims_api.get_authclaims( - api_auth_id=auth_server_id, - content_type=content_type - ) - print("Auth Claims after deletion:\n") - pprint(all_claims_after) - except Exception as e: - print(f"Exception when deleting auth claim: {e}") - - except Exception as e: - print(f"Exception when creating auth claim: {e}") - else: - print("No authorization servers found to test with.") + # auth_server = onelogin.AuthServer( + auth_server_response = auth_server_api.create_auth_server( + auth_server=auth_server + ) + + pprint("The response of APIAuthorizationServerApi->create_auth_server:\n") + pprint(auth_server_response) + except Exception as e: + print("Exception when calling APIAuthorizationServerApi->create_auth_server: %s\n" % e) + + try: + # List auth servers + auth_servers_response = auth_server_api.list_auth_servers() + auth_servers = auth_servers_response + print("The response of APIAuthorizationServerApi->list_auth_servers:\n") + pprint(auth_servers_response) + except Exception as e: + print("Exception when calling APIAuthorizationServerApi->list_auth_servers: %s\n" % e) + + try: + # Update Auth Server + auth_server = onelogin.AuthServer( + id=auth_servers[0].id, + name="Test Auth Server v3", + description="This is a dummy auth server v3", + ) + + auth_server_response = auth_server_api.update_auth_server(api_auth_id=str(auth_servers[0].id), auth_server=auth_server) + print("The response of APIAuthorizationServerApi->update_auth_server:\n") + pprint(auth_server_response) + except Exception as e: + print("Exception when calling APIAuthorizationServerApi->update_auth_server: %s\n" % e) + + try: + # Delete Auth Server + auth_server_response = auth_server_api.delete_auth_server(api_auth_id=str(auth_servers[-1].id)) + print("The response of APIAuthorizationServerApi->delete_auth_server:\n") + pprint(auth_server_response) + except Exception as e: + print("Exception when calling APIAuthorizationServerApi->delete_auth_server: %s\n" % e) + + + auth_claims = None + auth_claims_api = onelogin.APIAuthClaimsApi(api_client) + + try: + # Create a new claim + claim = onelogin.AuthClaim( + name="Dummy Claim v2", + user_attribute_mappings="firstname" + ) + + claim_response = auth_claims_api.create_auth_claim(api_auth_id=str(auth_servers[0].id), auth_claim=claim) + print("The response of APIAuthClaimsApi->create_auth_claim:\n") + pprint(claim_response) + except Exception as e: + print("Exception when calling APIAuthClaimsApi->create_auth_claim: %s\n" % e) + + try: + #List Auth Claim by ID + auth_claims_response = auth_claims_api.get_authclaims(api_auth_id=str(auth_servers[0].id)) + auth_claims = auth_claims_response + print("The response of APIAuthClaimsApi->get_authclaims:\n") + pprint(auth_claims_response) + except Exception as e: + print("Exception when calling APIAuthClaimsApi->get_authclaims: %s\n" % e) + + try: + # Update claim + auth_claims_response = auth_claims_api.update_claim(api_auth_id=str(auth_servers[0].id), claim_id=auth_claims[1].id, auth_claim=onelogin.AuthClaim(name="Test Claim v1")) + print("The response of APIAuthClaimsApi->update_claim:\n") + pprint(auth_claims_response) + except Exception as e: + print("Exception when calling APIAuthClaimsApi->update_claim: %s\n" % e) + + try: + # Delete Claim + auth_claims_response = auth_claims_api.delete_auth_claim(api_auth_id=str(auth_servers[0].id), claim_id=auth_claims[1].id) + print("The response of APIAuthClaimsApi->delete_claim:\n") + pprint(auth_claims_response) except Exception as e: - print(f"Exception when getting auth servers: {e}") \ No newline at end of file + print("Exception when calling APIAuthClaimsApi->delete_claim: %s\n" % e) \ No newline at end of file diff --git a/user_script.py b/user_script.py deleted file mode 100644 index 45cca521..00000000 --- a/user_script.py +++ /dev/null @@ -1,82 +0,0 @@ -import os -import onelogin -from onelogin.rest import ApiException -from pprint import pprint - -# Change host to your domain or it will default to https://your-api-subdomain.onelogin.com -configuration = onelogin.Configuration( - host = "https://your-api-subdomain.onelogin.com", - username = "", - password = "" -) - -# Enter a context with an instance of the API client -with onelogin.ApiClient(configuration) as api_client: - # Create an instance of the API class - token_instance = onelogin.OAuth2Api(api_client) - generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token - content_type="application/json" - - try: - # Generate and Save Access Token - api_response = token_instance.generate_token(generate_token_request, content_type=content_type) - configuration.access_token = api_response.access_token - pprint(configuration.access_token) - except Exception as e: - print("Exception when generating access token: %s\n" % e) - - users = None - user_instance = onelogin.UsersV2Api(api_client) - - try: - # List All Users - api_response = user_instance.list_users2() - print("The response of UsersV2Api->list_users:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->list_users: %s\n" % e) - - try: - # Create User - dummy_user = { - "email": "dummy@quest.com", - } - api_response = user_instance.create_user2(user=dummy_user, _headers={"Authorization": "Bearer " + configuration.access_token}) - users = api_response - print("The response of UsersV2Api->create_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->create_user: %s\n" % e) - - try: - # Get User by ID - api_response = user_instance.get_user2(user_id=users.id) - pprint("The response of UsersV2Api->get_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->get_user: %s\n" % e) - - try: - # List User Apps - api_response = user_instance.get_user_apps2(user_id=users.id) - print("The response of UsersV2Api->list_user_apps:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->list_user_apps: %s\n" % e) - - try: - # Update User - user_details = {"firstname": 'dummy', "lastname": 'user'} - api_response = user_instance.update_user2(user_id=users.id, user=user_details, _headers={"Authorization": "Bearer " + configuration.access_token}) - print("The response of UsersV2Api->update_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->update_user: %s\n" % e) - - try: - # Delete User - api_response = user_instance.delete_user2(user_id=users.id) - print("The response of UsersV2Api->delete_user:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling UsersV2Api->delete_user: %s\n" % e) \ No newline at end of file From 04957350027ae09d52d7aa83b353b9beddb99a7a Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Fri, 9 May 2025 22:39:50 +0530 Subject: [PATCH 7/7] chore: reverted creds to default --- sample_script.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sample_script.py b/sample_script.py index 978eb074..393f69e4 100644 --- a/sample_script.py +++ b/sample_script.py @@ -5,15 +5,11 @@ # Change host to your domain or it will default to https://your-api-subdomain.onelogin.com configuration = onelogin.Configuration( - host = "https://sumit-shadow.onelogin-shadow01.com", - username = "6c5576b0622759fcbbefe177e61be499879b4d0f5fb33a512c551f7e238c3da6", - password = "e4c318ac6c5c2691f544c104dd534356428e8d9c0a36ed7a14da782436b486f9" + host = "https://your-api-subdomain.onelogin.com", + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) -# configuration = onelogin.Configuration( - -# ) - # Enter a context with an instance of the API client with onelogin.ApiClient(configuration) as api_client: # Create an instance of the API class