diff --git a/docs/generated/AppInfo.md b/docs/generated/AppInfo.md index 2dbe5a8..014127e 100644 --- a/docs/generated/AppInfo.md +++ b/docs/generated/AppInfo.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **additional_auth_origins** | **List[str]** | | @@ -13,6 +14,7 @@ Name | Type | Description | Notes **auth_fallback_method_ttl** | **int** | Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. | **auth_methods** | [**AuthMethods**](AuthMethods.md) | | **auth_origin** | **str** | | +**auto_theme_enabled** | **bool** | Deprecated Property. Please use `hosted_theme` to set hosted page theming instead. | **created_at** | **datetime** | | **default_language** | **str** | | **id** | **str** | | @@ -21,8 +23,9 @@ Name | Type | Description | Notes **light_logo_url** | **str** | | [optional] **dark_logo_url** | **str** | | [optional] **name** | **str** | | -**hosted** | **bool** | whether or not the app's login page hosted by passage | +**hosted** | **bool** | whether or not the app's login page is hosted by Passage | **hosted_subdomain** | **str** | the subdomain of the app's hosted login page | +**hosted_theme** | [**ThemeType**](ThemeType.md) | | **id_token_lifetime** | **int** | | [optional] **passage_branding** | **bool** | | **profile_management** | **bool** | | @@ -54,12 +57,12 @@ json = "{}" # create an instance of AppInfo from a JSON string app_info_instance = AppInfo.from_json(json) # print the JSON string representation of the object -print AppInfo.to_json() +print(AppInfo.to_json()) # convert the object into a dict app_info_dict = app_info_instance.to_dict() # create an instance of AppInfo from a dict -app_info_form_dict = app_info.from_dict(app_info_dict) +app_info_from_dict = AppInfo.from_dict(app_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/AppResponse.md b/docs/generated/AppResponse.md index cc3e711..2f1688a 100644 --- a/docs/generated/AppResponse.md +++ b/docs/generated/AppResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **app** | [**AppInfo**](AppInfo.md) | | @@ -16,12 +17,12 @@ json = "{}" # create an instance of AppResponse from a JSON string app_response_instance = AppResponse.from_json(json) # print the JSON string representation of the object -print AppResponse.to_json() +print(AppResponse.to_json()) # convert the object into a dict app_response_dict = app_response_instance.to_dict() # create an instance of AppResponse from a dict -app_response_form_dict = app_response.from_dict(app_response_dict) +app_response_from_dict = AppResponse.from_dict(app_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/AppleUserSocialConnection.md b/docs/generated/AppleUserSocialConnection.md index 60a2ef0..cba6f7c 100644 --- a/docs/generated/AppleUserSocialConnection.md +++ b/docs/generated/AppleUserSocialConnection.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **provider_id** | **str** | The external ID of the Social Connection. | @@ -19,12 +20,12 @@ json = "{}" # create an instance of AppleUserSocialConnection from a JSON string apple_user_social_connection_instance = AppleUserSocialConnection.from_json(json) # print the JSON string representation of the object -print AppleUserSocialConnection.to_json() +print(AppleUserSocialConnection.to_json()) # convert the object into a dict apple_user_social_connection_dict = apple_user_social_connection_instance.to_dict() # create an instance of AppleUserSocialConnection from a dict -apple_user_social_connection_form_dict = apple_user_social_connection.from_dict(apple_user_social_connection_dict) +apple_user_social_connection_from_dict = AppleUserSocialConnection.from_dict(apple_user_social_connection_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/AppsApi.md b/docs/generated/AppsApi.md index e2ea6b4..53e7b6c 100644 --- a/docs/generated/AppsApi.md +++ b/docs/generated/AppsApi.md @@ -17,9 +17,8 @@ Get app information. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.app_response import AppResponse from passageidentity.openapi_client.rest import ApiException @@ -60,6 +59,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -78,6 +78,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/generated/AuthMethods.md b/docs/generated/AuthMethods.md index 8b84a37..5ebe523 100644 --- a/docs/generated/AuthMethods.md +++ b/docs/generated/AuthMethods.md @@ -3,6 +3,7 @@ Denotes what methods this app is allowed to use for authentication with configurations ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **passkeys** | [**PasskeysAuthMethod**](PasskeysAuthMethod.md) | | @@ -19,12 +20,12 @@ json = "{}" # create an instance of AuthMethods from a JSON string auth_methods_instance = AuthMethods.from_json(json) # print the JSON string representation of the object -print AuthMethods.to_json() +print(AuthMethods.to_json()) # convert the object into a dict auth_methods_dict = auth_methods_instance.to_dict() # create an instance of AuthMethods from a dict -auth_methods_form_dict = auth_methods.from_dict(auth_methods_dict) +auth_methods_from_dict = AuthMethods.from_dict(auth_methods_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/CreateMagicLinkRequest.md b/docs/generated/CreateMagicLinkRequest.md index ea1a1bb..50e4af1 100644 --- a/docs/generated/CreateMagicLinkRequest.md +++ b/docs/generated/CreateMagicLinkRequest.md @@ -2,18 +2,19 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**channel** | [**MagicLinkChannel**](MagicLinkChannel.md) | | -**email** | **str** | | +**channel** | [**MagicLinkChannel**](MagicLinkChannel.md) | | [optional] +**email** | **str** | | [optional] **language** | **str** | language of the email to send (optional) | [optional] -**magic_link_path** | **str** | | -**phone** | **str** | | -**redirect_url** | **str** | | -**send** | **bool** | | -**ttl** | **int** | | +**magic_link_path** | **str** | must be a relative url | [optional] +**phone** | **str** | | [optional] +**redirect_url** | **str** | | [optional] +**send** | **bool** | | [optional] +**ttl** | **int** | | [optional] **type** | [**MagicLinkType**](MagicLinkType.md) | | [optional] -**user_id** | **str** | | +**user_id** | **str** | | [optional] ## Example @@ -25,12 +26,12 @@ json = "{}" # create an instance of CreateMagicLinkRequest from a JSON string create_magic_link_request_instance = CreateMagicLinkRequest.from_json(json) # print the JSON string representation of the object -print CreateMagicLinkRequest.to_json() +print(CreateMagicLinkRequest.to_json()) # convert the object into a dict create_magic_link_request_dict = create_magic_link_request_instance.to_dict() # create an instance of CreateMagicLinkRequest from a dict -create_magic_link_request_form_dict = create_magic_link_request.from_dict(create_magic_link_request_dict) +create_magic_link_request_from_dict = CreateMagicLinkRequest.from_dict(create_magic_link_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/CreateUserRequest.md b/docs/generated/CreateUserRequest.md index 55f56f0..f50e53d 100644 --- a/docs/generated/CreateUserRequest.md +++ b/docs/generated/CreateUserRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | Email of the new user. Either this or `phone` is required; both may be provided. | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of CreateUserRequest from a JSON string create_user_request_instance = CreateUserRequest.from_json(json) # print the JSON string representation of the object -print CreateUserRequest.to_json() +print(CreateUserRequest.to_json()) # convert the object into a dict create_user_request_dict = create_user_request_instance.to_dict() # create an instance of CreateUserRequest from a dict -create_user_request_form_dict = create_user_request.from_dict(create_user_request_dict) +create_user_request_from_dict = CreateUserRequest.from_dict(create_user_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/ElementCustomization.md b/docs/generated/ElementCustomization.md index ba18d36..a06f832 100644 --- a/docs/generated/ElementCustomization.md +++ b/docs/generated/ElementCustomization.md @@ -2,14 +2,15 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **passage_container_background_color** | **str** | Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. | [optional] **passage_container_max_width** | **int** | Maximum width of container (px) | [optional] [default to 300] **passage_input_box_background_color** | **str** | Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. | [optional] **passage_input_box_border_radius** | **int** | Input box border radius (px) | [optional] [default to 5] -**passage_header_font_family** | [**FontFamily**](FontFamily.md) | | [optional] -**passage_body_font_family** | [**FontFamily**](FontFamily.md) | | [optional] +**passage_header_font_family** | [**FontFamily**](FontFamily.md) | | [optional] [default to FontFamily.HELVETICA] +**passage_body_font_family** | [**FontFamily**](FontFamily.md) | | [optional] [default to FontFamily.HELVETICA] **passage_header_text_color** | **str** | Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] **passage_body_text_color** | **str** | Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] **passage_primary_button_background_color** | **str** | Primary button background colour (hex) | [optional] [default to '#121212'] @@ -35,12 +36,12 @@ json = "{}" # create an instance of ElementCustomization from a JSON string element_customization_instance = ElementCustomization.from_json(json) # print the JSON string representation of the object -print ElementCustomization.to_json() +print(ElementCustomization.to_json()) # convert the object into a dict element_customization_dict = element_customization_instance.to_dict() # create an instance of ElementCustomization from a dict -element_customization_form_dict = element_customization.from_dict(element_customization_dict) +element_customization_from_dict = ElementCustomization.from_dict(element_customization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/FontFamily.md b/docs/generated/FontFamily.md index d67e448..787c435 100644 --- a/docs/generated/FontFamily.md +++ b/docs/generated/FontFamily.md @@ -2,9 +2,47 @@ Body font family -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `HELVETICA` (value: `'Helvetica'`) + +* `ARIAL` (value: `'Arial'`) + +* `ARIAL_BLACK` (value: `'Arial Black'`) + +* `VERDANA` (value: `'Verdana'`) + +* `TAHOMA` (value: `'Tahoma'`) + +* `TREBUCHET_MS` (value: `'Trebuchet MS'`) + +* `IMPACT` (value: `'Impact'`) + +* `GILL_SANS` (value: `'Gill Sans'`) + +* `TIMES_NEW_ROMAN` (value: `'Times New Roman'`) + +* `GEORGIA` (value: `'Georgia'`) + +* `PALATINO` (value: `'Palatino'`) + +* `BASKERVILLE` (value: `'Baskerville'`) + +* `ANDALÉ_MONO` (value: `'Andalé Mono'`) + +* `COURIER` (value: `'Courier'`) + +* `LUCIDA` (value: `'Lucida'`) + +* `MONACO` (value: `'Monaco'`) + +* `BRADLEY_HAND` (value: `'Bradley Hand'`) + +* `BRUSH_SCRIPT_MT` (value: `'Brush Script MT'`) + +* `LUMINARI` (value: `'Luminari'`) + +* `COMIC_SANS_MS` (value: `'Comic Sans MS'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/GithubUserSocialConnection.md b/docs/generated/GithubUserSocialConnection.md index 4a4e1ed..17402f6 100644 --- a/docs/generated/GithubUserSocialConnection.md +++ b/docs/generated/GithubUserSocialConnection.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **provider_id** | **str** | The external ID of the Social Connection. | @@ -19,12 +20,12 @@ json = "{}" # create an instance of GithubUserSocialConnection from a JSON string github_user_social_connection_instance = GithubUserSocialConnection.from_json(json) # print the JSON string representation of the object -print GithubUserSocialConnection.to_json() +print(GithubUserSocialConnection.to_json()) # convert the object into a dict github_user_social_connection_dict = github_user_social_connection_instance.to_dict() # create an instance of GithubUserSocialConnection from a dict -github_user_social_connection_form_dict = github_user_social_connection.from_dict(github_user_social_connection_dict) +github_user_social_connection_from_dict = GithubUserSocialConnection.from_dict(github_user_social_connection_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/GoogleUserSocialConnection.md b/docs/generated/GoogleUserSocialConnection.md index b70d8e8..5d92f2f 100644 --- a/docs/generated/GoogleUserSocialConnection.md +++ b/docs/generated/GoogleUserSocialConnection.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **provider_id** | **str** | The external ID of the Social Connection. | @@ -19,12 +20,12 @@ json = "{}" # create an instance of GoogleUserSocialConnection from a JSON string google_user_social_connection_instance = GoogleUserSocialConnection.from_json(json) # print the JSON string representation of the object -print GoogleUserSocialConnection.to_json() +print(GoogleUserSocialConnection.to_json()) # convert the object into a dict google_user_social_connection_dict = google_user_social_connection_instance.to_dict() # create an instance of GoogleUserSocialConnection from a dict -google_user_social_connection_form_dict = google_user_social_connection.from_dict(google_user_social_connection_dict) +google_user_social_connection_from_dict = GoogleUserSocialConnection.from_dict(google_user_social_connection_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/LayoutConfig.md b/docs/generated/LayoutConfig.md index 3fb1ee4..9a66845 100644 --- a/docs/generated/LayoutConfig.md +++ b/docs/generated/LayoutConfig.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **h** | **int** | | @@ -20,12 +21,12 @@ json = "{}" # create an instance of LayoutConfig from a JSON string layout_config_instance = LayoutConfig.from_json(json) # print the JSON string representation of the object -print LayoutConfig.to_json() +print(LayoutConfig.to_json()) # convert the object into a dict layout_config_dict = layout_config_instance.to_dict() # create an instance of LayoutConfig from a dict -layout_config_form_dict = layout_config.from_dict(layout_config_dict) +layout_config_from_dict = LayoutConfig.from_dict(layout_config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Layouts.md b/docs/generated/Layouts.md index d2673dd..2b8b854 100644 --- a/docs/generated/Layouts.md +++ b/docs/generated/Layouts.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **profile** | [**List[LayoutConfig]**](LayoutConfig.md) | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Layouts from a JSON string layouts_instance = Layouts.from_json(json) # print the JSON string representation of the object -print Layouts.to_json() +print(Layouts.to_json()) # convert the object into a dict layouts_dict = layouts_instance.to_dict() # create an instance of Layouts from a dict -layouts_form_dict = layouts.from_dict(layouts_dict) +layouts_from_dict = Layouts.from_dict(layouts_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Link.md b/docs/generated/Link.md index a5e2777..d95c3f8 100644 --- a/docs/generated/Link.md +++ b/docs/generated/Link.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **href** | **str** | | @@ -16,12 +17,12 @@ json = "{}" # create an instance of Link from a JSON string link_instance = Link.from_json(json) # print the JSON string representation of the object -print Link.to_json() +print(Link.to_json()) # convert the object into a dict link_dict = link_instance.to_dict() # create an instance of Link from a dict -link_form_dict = link.from_dict(link_dict) +link_from_dict = Link.from_dict(link_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/ListDevicesResponse.md b/docs/generated/ListDevicesResponse.md index d28cebe..58a7250 100644 --- a/docs/generated/ListDevicesResponse.md +++ b/docs/generated/ListDevicesResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **devices** | [**List[WebAuthnDevices]**](WebAuthnDevices.md) | | @@ -16,12 +17,12 @@ json = "{}" # create an instance of ListDevicesResponse from a JSON string list_devices_response_instance = ListDevicesResponse.from_json(json) # print the JSON string representation of the object -print ListDevicesResponse.to_json() +print(ListDevicesResponse.to_json()) # convert the object into a dict list_devices_response_dict = list_devices_response_instance.to_dict() # create an instance of ListDevicesResponse from a dict -list_devices_response_form_dict = list_devices_response.from_dict(list_devices_response_dict) +list_devices_response_from_dict = ListDevicesResponse.from_dict(list_devices_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/ListPaginatedUsersItem.md b/docs/generated/ListPaginatedUsersItem.md index 5fe993f..046f67c 100644 --- a/docs/generated/ListPaginatedUsersItem.md +++ b/docs/generated/ListPaginatedUsersItem.md @@ -2,11 +2,13 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | | **email** | **str** | | **email_verified** | **bool** | | +**external_id** | **str** | The external ID of the user. Only set if the user was created in a Flex app. | **id** | **str** | | **last_login_at** | **datetime** | | **login_count** | **int** | | @@ -26,12 +28,12 @@ json = "{}" # create an instance of ListPaginatedUsersItem from a JSON string list_paginated_users_item_instance = ListPaginatedUsersItem.from_json(json) # print the JSON string representation of the object -print ListPaginatedUsersItem.to_json() +print(ListPaginatedUsersItem.to_json()) # convert the object into a dict list_paginated_users_item_dict = list_paginated_users_item_instance.to_dict() # create an instance of ListPaginatedUsersItem from a dict -list_paginated_users_item_form_dict = list_paginated_users_item.from_dict(list_paginated_users_item_dict) +list_paginated_users_item_from_dict = ListPaginatedUsersItem.from_dict(list_paginated_users_item_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/ListPaginatedUsersResponse.md b/docs/generated/ListPaginatedUsersResponse.md index 58cb5e4..1a250ed 100644 --- a/docs/generated/ListPaginatedUsersResponse.md +++ b/docs/generated/ListPaginatedUsersResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **links** | [**PaginatedLinks**](PaginatedLinks.md) | | @@ -21,12 +22,12 @@ json = "{}" # create an instance of ListPaginatedUsersResponse from a JSON string list_paginated_users_response_instance = ListPaginatedUsersResponse.from_json(json) # print the JSON string representation of the object -print ListPaginatedUsersResponse.to_json() +print(ListPaginatedUsersResponse.to_json()) # convert the object into a dict list_paginated_users_response_dict = list_paginated_users_response_instance.to_dict() # create an instance of ListPaginatedUsersResponse from a dict -list_paginated_users_response_form_dict = list_paginated_users_response.from_dict(list_paginated_users_response_dict) +list_paginated_users_response_from_dict = ListPaginatedUsersResponse.from_dict(list_paginated_users_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLink.md b/docs/generated/MagicLink.md index 6d3255b..5335dcd 100644 --- a/docs/generated/MagicLink.md +++ b/docs/generated/MagicLink.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **activated** | **bool** | | @@ -25,12 +26,12 @@ json = "{}" # create an instance of MagicLink from a JSON string magic_link_instance = MagicLink.from_json(json) # print the JSON string representation of the object -print MagicLink.to_json() +print(MagicLink.to_json()) # convert the object into a dict magic_link_dict = magic_link_instance.to_dict() # create an instance of MagicLink from a dict -magic_link_form_dict = magic_link.from_dict(magic_link_dict) +magic_link_from_dict = MagicLink.from_dict(magic_link_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLinkAuthMethod.md b/docs/generated/MagicLinkAuthMethod.md index 76dcbc9..6870946 100644 --- a/docs/generated/MagicLinkAuthMethod.md +++ b/docs/generated/MagicLinkAuthMethod.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | | @@ -18,12 +19,12 @@ json = "{}" # create an instance of MagicLinkAuthMethod from a JSON string magic_link_auth_method_instance = MagicLinkAuthMethod.from_json(json) # print the JSON string representation of the object -print MagicLinkAuthMethod.to_json() +print(MagicLinkAuthMethod.to_json()) # convert the object into a dict magic_link_auth_method_dict = magic_link_auth_method_instance.to_dict() # create an instance of MagicLinkAuthMethod from a dict -magic_link_auth_method_form_dict = magic_link_auth_method.from_dict(magic_link_auth_method_dict) +magic_link_auth_method_from_dict = MagicLinkAuthMethod.from_dict(magic_link_auth_method_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLinkChannel.md b/docs/generated/MagicLinkChannel.md index 2243f37..765e5c5 100644 --- a/docs/generated/MagicLinkChannel.md +++ b/docs/generated/MagicLinkChannel.md @@ -1,9 +1,11 @@ # MagicLinkChannel -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `EMAIL` (value: `'email'`) + +* `PHONE` (value: `'phone'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLinkResponse.md b/docs/generated/MagicLinkResponse.md index add9565..5da51f9 100644 --- a/docs/generated/MagicLinkResponse.md +++ b/docs/generated/MagicLinkResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **magic_link** | [**MagicLink**](MagicLink.md) | | @@ -16,12 +17,12 @@ json = "{}" # create an instance of MagicLinkResponse from a JSON string magic_link_response_instance = MagicLinkResponse.from_json(json) # print the JSON string representation of the object -print MagicLinkResponse.to_json() +print(MagicLinkResponse.to_json()) # convert the object into a dict magic_link_response_dict = magic_link_response_instance.to_dict() # create an instance of MagicLinkResponse from a dict -magic_link_response_form_dict = magic_link_response.from_dict(magic_link_response_dict) +magic_link_response_from_dict = MagicLinkResponse.from_dict(magic_link_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLinkType.md b/docs/generated/MagicLinkType.md index fa657d2..f6c578a 100644 --- a/docs/generated/MagicLinkType.md +++ b/docs/generated/MagicLinkType.md @@ -1,9 +1,11 @@ # MagicLinkType -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `LOGIN` (value: `'login'`) + +* `VERIFY_IDENTIFIER` (value: `'verify_identifier'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/MagicLinksApi.md b/docs/generated/MagicLinksApi.md index 9123fc2..fb4bf70 100644 --- a/docs/generated/MagicLinksApi.md +++ b/docs/generated/MagicLinksApi.md @@ -17,9 +17,8 @@ Create magic link for a user. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.create_magic_link_request import CreateMagicLinkRequest from passageidentity.openapi_client.models.magic_link_response import MagicLinkResponse @@ -47,7 +46,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = passageidentity.openapi_client.MagicLinksApi(api_client) app_id = 'app_id_example' # str | App ID - create_magic_link_request = passageidentity.openapi_client.CreateMagicLinkRequest() # CreateMagicLinkRequest | magic link request + create_magic_link_request = passageidentity.openapi_client.CreateMagicLinkRequest() # CreateMagicLinkRequest | Request to create a magic link try: # Create Embeddable Magic Link @@ -62,10 +61,11 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | - **create_magic_link_request** | [**CreateMagicLinkRequest**](CreateMagicLinkRequest.md)| magic link request | + **create_magic_link_request** | [**CreateMagicLinkRequest**](CreateMagicLinkRequest.md)| Request to create a magic link | ### Return type @@ -81,6 +81,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Created | - | diff --git a/docs/generated/Model400Error.md b/docs/generated/Model400Error.md index 6603e65..27ab9f8 100644 --- a/docs/generated/Model400Error.md +++ b/docs/generated/Model400Error.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Model400Error from a JSON string model400_error_instance = Model400Error.from_json(json) # print the JSON string representation of the object -print Model400Error.to_json() +print(Model400Error.to_json()) # convert the object into a dict model400_error_dict = model400_error_instance.to_dict() # create an instance of Model400Error from a dict -model400_error_form_dict = model400_error.from_dict(model400_error_dict) +model400_error_from_dict = Model400Error.from_dict(model400_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Model401Error.md b/docs/generated/Model401Error.md index 9bef156..213502c 100644 --- a/docs/generated/Model401Error.md +++ b/docs/generated/Model401Error.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Model401Error from a JSON string model401_error_instance = Model401Error.from_json(json) # print the JSON string representation of the object -print Model401Error.to_json() +print(Model401Error.to_json()) # convert the object into a dict model401_error_dict = model401_error_instance.to_dict() # create an instance of Model401Error from a dict -model401_error_form_dict = model401_error.from_dict(model401_error_dict) +model401_error_from_dict = Model401Error.from_dict(model401_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Model403Error.md b/docs/generated/Model403Error.md index 2fb7a3e..0ace9b5 100644 --- a/docs/generated/Model403Error.md +++ b/docs/generated/Model403Error.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Model403Error from a JSON string model403_error_instance = Model403Error.from_json(json) # print the JSON string representation of the object -print Model403Error.to_json() +print(Model403Error.to_json()) # convert the object into a dict model403_error_dict = model403_error_instance.to_dict() # create an instance of Model403Error from a dict -model403_error_form_dict = model403_error.from_dict(model403_error_dict) +model403_error_from_dict = Model403Error.from_dict(model403_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Model404Error.md b/docs/generated/Model404Error.md index aa636bd..82e22c3 100644 --- a/docs/generated/Model404Error.md +++ b/docs/generated/Model404Error.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Model404Error from a JSON string model404_error_instance = Model404Error.from_json(json) # print the JSON string representation of the object -print Model404Error.to_json() +print(Model404Error.to_json()) # convert the object into a dict model404_error_dict = model404_error_instance.to_dict() # create an instance of Model404Error from a dict -model404_error_form_dict = model404_error.from_dict(model404_error_dict) +model404_error_from_dict = Model404Error.from_dict(model404_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Model500Error.md b/docs/generated/Model500Error.md index 45e0cc5..a4aa340 100644 --- a/docs/generated/Model500Error.md +++ b/docs/generated/Model500Error.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Model500Error from a JSON string model500_error_instance = Model500Error.from_json(json) # print the JSON string representation of the object -print Model500Error.to_json() +print(Model500Error.to_json()) # convert the object into a dict model500_error_dict = model500_error_instance.to_dict() # create an instance of Model500Error from a dict -model500_error_form_dict = model500_error.from_dict(model500_error_dict) +model500_error_from_dict = Model500Error.from_dict(model500_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/Nonce.md b/docs/generated/Nonce.md index f9f8359..fdb7d77 100644 --- a/docs/generated/Nonce.md +++ b/docs/generated/Nonce.md @@ -3,6 +3,7 @@ the nonce to exchange for an authentication token ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nonce** | **str** | | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Nonce from a JSON string nonce_instance = Nonce.from_json(json) # print the JSON string representation of the object -print Nonce.to_json() +print(Nonce.to_json()) # convert the object into a dict nonce_dict = nonce_instance.to_dict() # create an instance of Nonce from a dict -nonce_form_dict = nonce.from_dict(nonce_dict) +nonce_from_dict = Nonce.from_dict(nonce_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/OtpAuthMethod.md b/docs/generated/OtpAuthMethod.md index 56d7632..9e50a74 100644 --- a/docs/generated/OtpAuthMethod.md +++ b/docs/generated/OtpAuthMethod.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | | @@ -18,12 +19,12 @@ json = "{}" # create an instance of OtpAuthMethod from a JSON string otp_auth_method_instance = OtpAuthMethod.from_json(json) # print the JSON string representation of the object -print OtpAuthMethod.to_json() +print(OtpAuthMethod.to_json()) # convert the object into a dict otp_auth_method_dict = otp_auth_method_instance.to_dict() # create an instance of OtpAuthMethod from a dict -otp_auth_method_form_dict = otp_auth_method.from_dict(otp_auth_method_dict) +otp_auth_method_from_dict = OtpAuthMethod.from_dict(otp_auth_method_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/PaginatedLinks.md b/docs/generated/PaginatedLinks.md index 52522d6..7af1e96 100644 --- a/docs/generated/PaginatedLinks.md +++ b/docs/generated/PaginatedLinks.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **first** | [**Link**](Link.md) | | @@ -20,12 +21,12 @@ json = "{}" # create an instance of PaginatedLinks from a JSON string paginated_links_instance = PaginatedLinks.from_json(json) # print the JSON string representation of the object -print PaginatedLinks.to_json() +print(PaginatedLinks.to_json()) # convert the object into a dict paginated_links_dict = paginated_links_instance.to_dict() # create an instance of PaginatedLinks from a dict -paginated_links_form_dict = paginated_links.from_dict(paginated_links_dict) +paginated_links_from_dict = PaginatedLinks.from_dict(paginated_links_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/PasskeysAuthMethod.md b/docs/generated/PasskeysAuthMethod.md index b572522..809d67e 100644 --- a/docs/generated/PasskeysAuthMethod.md +++ b/docs/generated/PasskeysAuthMethod.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | | [default to True] @@ -16,12 +17,12 @@ json = "{}" # create an instance of PasskeysAuthMethod from a JSON string passkeys_auth_method_instance = PasskeysAuthMethod.from_json(json) # print the JSON string representation of the object -print PasskeysAuthMethod.to_json() +print(PasskeysAuthMethod.to_json()) # convert the object into a dict passkeys_auth_method_dict = passkeys_auth_method_instance.to_dict() # create an instance of PasskeysAuthMethod from a dict -passkeys_auth_method_form_dict = passkeys_auth_method.from_dict(passkeys_auth_method_dict) +passkeys_auth_method_from_dict = PasskeysAuthMethod.from_dict(passkeys_auth_method_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/README.md b/docs/generated/README.md index c4fa8c8..e447f92 100644 --- a/docs/generated/README.md +++ b/docs/generated/README.md @@ -5,12 +5,13 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1 - Package version: 1.0.0 +- Generator version: 7.11.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://passage.id/support](https://passage.id/support) ## Requirements. -Python 3.7+ +Python 3.8+ ## Installation & Usage ### pip install @@ -51,7 +52,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import passageidentity.openapi_client from passageidentity.openapi_client.rest import ApiException from pprint import pprint @@ -141,9 +141,12 @@ Class | Method | HTTP request | Description - [OtpAuthMethod](docs/OtpAuthMethod.md) - [PaginatedLinks](docs/PaginatedLinks.md) - [PasskeysAuthMethod](docs/PasskeysAuthMethod.md) + - [SocialConnectionType](docs/SocialConnectionType.md) - [Technologies](docs/Technologies.md) + - [ThemeType](docs/ThemeType.md) - [TtlDisplayUnit](docs/TtlDisplayUnit.md) - [UpdateUserRequest](docs/UpdateUserRequest.md) + - [UserEventAction](docs/UserEventAction.md) - [UserEventStatus](docs/UserEventStatus.md) - [UserInfo](docs/UserInfo.md) - [UserMetadataField](docs/UserMetadataField.md) diff --git a/docs/generated/SocialConnectionType.md b/docs/generated/SocialConnectionType.md new file mode 100644 index 0000000..437bb29 --- /dev/null +++ b/docs/generated/SocialConnectionType.md @@ -0,0 +1,14 @@ +# SocialConnectionType + + +## Enum + +* `APPLE` (value: `'apple'`) + +* `GITHUB` (value: `'github'`) + +* `GOOGLE` (value: `'google'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/generated/Technologies.md b/docs/generated/Technologies.md index 71a55e2..800dfb4 100644 --- a/docs/generated/Technologies.md +++ b/docs/generated/Technologies.md @@ -1,9 +1,23 @@ # Technologies -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `REACT` (value: `'react'`) + +* `GO` (value: `'go'`) + +* `VUE` (value: `'vue'`) + +* `ANGULAR` (value: `'angular'`) + +* `PYTHON` (value: `'python'`) + +* `JAVASCRIPT` (value: `'javascript'`) + +* `IOS` (value: `'ios'`) + +* `ANDROID` (value: `'android'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/ThemeType.md b/docs/generated/ThemeType.md new file mode 100644 index 0000000..f3a2dba --- /dev/null +++ b/docs/generated/ThemeType.md @@ -0,0 +1,14 @@ +# ThemeType + + +## Enum + +* `AUTO` (value: `'auto'`) + +* `LIGHT` (value: `'light'`) + +* `DARK` (value: `'dark'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/generated/TokensApi.md b/docs/generated/TokensApi.md index 2588232..f66669c 100644 --- a/docs/generated/TokensApi.md +++ b/docs/generated/TokensApi.md @@ -17,9 +17,8 @@ Revokes all refresh tokens for a user ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.rest import ApiException from pprint import pprint @@ -58,6 +57,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -77,6 +77,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/generated/TtlDisplayUnit.md b/docs/generated/TtlDisplayUnit.md index 5d4d6ed..44e9bb0 100644 --- a/docs/generated/TtlDisplayUnit.md +++ b/docs/generated/TtlDisplayUnit.md @@ -2,9 +2,15 @@ Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `S` (value: `'s'`) + +* `M` (value: `'m'`) + +* `H` (value: `'h'`) + +* `D` (value: `'d'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UpdateUserRequest.md b/docs/generated/UpdateUserRequest.md index ce979dc..c5b234e 100644 --- a/docs/generated/UpdateUserRequest.md +++ b/docs/generated/UpdateUserRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of UpdateUserRequest from a JSON string update_user_request_instance = UpdateUserRequest.from_json(json) # print the JSON string representation of the object -print UpdateUserRequest.to_json() +print(UpdateUserRequest.to_json()) # convert the object into a dict update_user_request_dict = update_user_request_instance.to_dict() # create an instance of UpdateUserRequest from a dict -update_user_request_form_dict = update_user_request.from_dict(update_user_request_dict) +update_user_request_from_dict = UpdateUserRequest.from_dict(update_user_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserDevicesApi.md b/docs/generated/UserDevicesApi.md index bf56a05..a47b4bc 100644 --- a/docs/generated/UserDevicesApi.md +++ b/docs/generated/UserDevicesApi.md @@ -18,9 +18,8 @@ Delete a device for a user. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.rest import ApiException from pprint import pprint @@ -60,6 +59,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -80,6 +80,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -99,9 +100,8 @@ List user devices. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.list_devices_response import ListDevicesResponse from passageidentity.openapi_client.rest import ApiException @@ -143,6 +143,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -162,6 +163,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/generated/UserEventAction.md b/docs/generated/UserEventAction.md new file mode 100644 index 0000000..87a6ee2 --- /dev/null +++ b/docs/generated/UserEventAction.md @@ -0,0 +1,14 @@ +# UserEventAction + + +## Enum + +* `REGISTER` (value: `'register'`) + +* `LOGIN` (value: `'login'`) + +* `OTHER` (value: `'other'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/generated/UserEventStatus.md b/docs/generated/UserEventStatus.md index f8b037b..0315f2b 100644 --- a/docs/generated/UserEventStatus.md +++ b/docs/generated/UserEventStatus.md @@ -1,9 +1,11 @@ # UserEventStatus -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `COMPLETE` (value: `'complete'`) + +* `INCOMPLETE` (value: `'incomplete'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserInfo.md b/docs/generated/UserInfo.md index 8337004..800466c 100644 --- a/docs/generated/UserInfo.md +++ b/docs/generated/UserInfo.md @@ -2,11 +2,13 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | | **email** | **str** | | **email_verified** | **bool** | | +**external_id** | **str** | The external ID of the user. Only set if the user was created in a Flex app. | **id** | **str** | | **last_login_at** | **datetime** | | **login_count** | **int** | | @@ -31,12 +33,12 @@ json = "{}" # create an instance of UserInfo from a JSON string user_info_instance = UserInfo.from_json(json) # print the JSON string representation of the object -print UserInfo.to_json() +print(UserInfo.to_json()) # convert the object into a dict user_info_dict = user_info_instance.to_dict() # create an instance of UserInfo from a dict -user_info_form_dict = user_info.from_dict(user_info_dict) +user_info_from_dict = UserInfo.from_dict(user_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserMetadataField.md b/docs/generated/UserMetadataField.md index 17ea00a..83ce32d 100644 --- a/docs/generated/UserMetadataField.md +++ b/docs/generated/UserMetadataField.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field_name** | **str** | | @@ -21,12 +22,12 @@ json = "{}" # create an instance of UserMetadataField from a JSON string user_metadata_field_instance = UserMetadataField.from_json(json) # print the JSON string representation of the object -print UserMetadataField.to_json() +print(UserMetadataField.to_json()) # convert the object into a dict user_metadata_field_dict = user_metadata_field_instance.to_dict() # create an instance of UserMetadataField from a dict -user_metadata_field_form_dict = user_metadata_field.from_dict(user_metadata_field_dict) +user_metadata_field_from_dict = UserMetadataField.from_dict(user_metadata_field_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserMetadataFieldType.md b/docs/generated/UserMetadataFieldType.md index 0667d73..942954c 100644 --- a/docs/generated/UserMetadataFieldType.md +++ b/docs/generated/UserMetadataFieldType.md @@ -1,9 +1,19 @@ # UserMetadataFieldType -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `STRING` (value: `'string'`) + +* `BOOLEAN` (value: `'boolean'`) + +* `INTEGER` (value: `'integer'`) + +* `DATE` (value: `'date'`) + +* `PHONE` (value: `'phone'`) + +* `EMAIL` (value: `'email'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserRecentEvent.md b/docs/generated/UserRecentEvent.md index d449394..afb7367 100644 --- a/docs/generated/UserRecentEvent.md +++ b/docs/generated/UserRecentEvent.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | | @@ -10,7 +11,10 @@ Name | Type | Description | Notes **ip_addr** | **str** | | **status** | [**UserEventStatus**](UserEventStatus.md) | | **type** | **str** | | -**user_agent** | **str** | | +**user_agent** | **str** | The raw user agent value from the originating device | +**user_agent_display** | **str** | A display-friendly version of the user agent | +**action** | [**UserEventAction**](UserEventAction.md) | | +**social_login_type** | [**SocialConnectionType**](SocialConnectionType.md) | | ## Example @@ -22,12 +26,12 @@ json = "{}" # create an instance of UserRecentEvent from a JSON string user_recent_event_instance = UserRecentEvent.from_json(json) # print the JSON string representation of the object -print UserRecentEvent.to_json() +print(UserRecentEvent.to_json()) # convert the object into a dict user_recent_event_dict = user_recent_event_instance.to_dict() # create an instance of UserRecentEvent from a dict -user_recent_event_form_dict = user_recent_event.from_dict(user_recent_event_dict) +user_recent_event_from_dict = UserRecentEvent.from_dict(user_recent_event_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserResponse.md b/docs/generated/UserResponse.md index 584f95a..901c4db 100644 --- a/docs/generated/UserResponse.md +++ b/docs/generated/UserResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | [**UserInfo**](UserInfo.md) | | @@ -16,12 +17,12 @@ json = "{}" # create an instance of UserResponse from a JSON string user_response_instance = UserResponse.from_json(json) # print the JSON string representation of the object -print UserResponse.to_json() +print(UserResponse.to_json()) # convert the object into a dict user_response_dict = user_response_instance.to_dict() # create an instance of UserResponse from a dict -user_response_form_dict = user_response.from_dict(user_response_dict) +user_response_from_dict = UserResponse.from_dict(user_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserSocialConnections.md b/docs/generated/UserSocialConnections.md index 8f477f8..52a2e32 100644 --- a/docs/generated/UserSocialConnections.md +++ b/docs/generated/UserSocialConnections.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **apple** | [**AppleUserSocialConnection**](AppleUserSocialConnection.md) | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of UserSocialConnections from a JSON string user_social_connections_instance = UserSocialConnections.from_json(json) # print the JSON string representation of the object -print UserSocialConnections.to_json() +print(UserSocialConnections.to_json()) # convert the object into a dict user_social_connections_dict = user_social_connections_instance.to_dict() # create an instance of UserSocialConnections from a dict -user_social_connections_form_dict = user_social_connections.from_dict(user_social_connections_dict) +user_social_connections_from_dict = UserSocialConnections.from_dict(user_social_connections_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UserStatus.md b/docs/generated/UserStatus.md index 14e0f00..cb9de17 100644 --- a/docs/generated/UserStatus.md +++ b/docs/generated/UserStatus.md @@ -1,9 +1,13 @@ # UserStatus -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ACTIVE` (value: `'active'`) + +* `INACTIVE` (value: `'inactive'`) + +* `PENDING` (value: `'pending'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/UsersApi.md b/docs/generated/UsersApi.md index 54d9362..d9a5412 100644 --- a/docs/generated/UsersApi.md +++ b/docs/generated/UsersApi.md @@ -23,9 +23,8 @@ Activate a user. They will now be able to login. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.user_response import UserResponse from passageidentity.openapi_client.rest import ApiException @@ -67,6 +66,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -86,6 +86,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -105,9 +106,8 @@ Create user for an application. Must provide an email of phone number identifier ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.create_user_request import CreateUserRequest from passageidentity.openapi_client.models.user_response import UserResponse @@ -150,6 +150,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -169,6 +170,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Created | - | @@ -189,9 +191,8 @@ Deactivate a user. Their account will still exist, but they will not be able to ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.user_response import UserResponse from passageidentity.openapi_client.rest import ApiException @@ -233,6 +234,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -252,6 +254,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -271,9 +274,8 @@ Delete a user. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.rest import ApiException from pprint import pprint @@ -312,6 +314,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -331,6 +334,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -350,9 +354,8 @@ Get information about a user. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.user_response import UserResponse from passageidentity.openapi_client.rest import ApiException @@ -394,6 +397,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -413,6 +417,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -432,9 +437,8 @@ List users for an app. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.list_paginated_users_response import ListPaginatedUsersResponse from passageidentity.openapi_client.rest import ApiException @@ -486,6 +490,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -515,6 +520,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -535,9 +541,8 @@ Update a user's information. ### Example * Bearer (JWT) Authentication (bearerAuth): + ```python -import time -import os import passageidentity.openapi_client from passageidentity.openapi_client.models.update_user_request import UpdateUserRequest from passageidentity.openapi_client.models.user_response import UserResponse @@ -581,6 +586,7 @@ with passageidentity.openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| App ID | @@ -601,6 +607,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/generated/WebAuthnDevices.md b/docs/generated/WebAuthnDevices.md index fc3a58d..f5144cb 100644 --- a/docs/generated/WebAuthnDevices.md +++ b/docs/generated/WebAuthnDevices.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | The first time this webAuthn device was used to authenticate the user | @@ -24,12 +25,12 @@ json = "{}" # create an instance of WebAuthnDevices from a JSON string web_authn_devices_instance = WebAuthnDevices.from_json(json) # print the JSON string representation of the object -print WebAuthnDevices.to_json() +print(WebAuthnDevices.to_json()) # convert the object into a dict web_authn_devices_dict = web_authn_devices_instance.to_dict() # create an instance of WebAuthnDevices from a dict -web_authn_devices_form_dict = web_authn_devices.from_dict(web_authn_devices_dict) +web_authn_devices_from_dict = WebAuthnDevices.from_dict(web_authn_devices_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/WebAuthnIcons.md b/docs/generated/WebAuthnIcons.md index 35c43bf..4e104b7 100644 --- a/docs/generated/WebAuthnIcons.md +++ b/docs/generated/WebAuthnIcons.md @@ -3,6 +3,7 @@ Contains the light and dark SVG icons that represent the brand of those devices Values can be null or base64 encoded SVG. Example of SVG output: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4= ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **light** | **str** | | @@ -18,12 +19,12 @@ json = "{}" # create an instance of WebAuthnIcons from a JSON string web_authn_icons_instance = WebAuthnIcons.from_json(json) # print the JSON string representation of the object -print WebAuthnIcons.to_json() +print(WebAuthnIcons.to_json()) # convert the object into a dict web_authn_icons_dict = web_authn_icons_instance.to_dict() # create an instance of WebAuthnIcons from a dict -web_authn_icons_form_dict = web_authn_icons.from_dict(web_authn_icons_dict) +web_authn_icons_from_dict = WebAuthnIcons.from_dict(web_authn_icons_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/generated/WebAuthnType.md b/docs/generated/WebAuthnType.md index 8e78e19..1d59706 100644 --- a/docs/generated/WebAuthnType.md +++ b/docs/generated/WebAuthnType.md @@ -2,9 +2,13 @@ The type of this credential -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `PASSKEY` (value: `'passkey'`) + +* `SECURITY_KEY` (value: `'security_key'`) + +* `PLATFORM` (value: `'platform'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/passageidentity/openapi_client/__init__.py b/passageidentity/openapi_client/__init__.py index 65aa73a..98ed398 100644 --- a/passageidentity/openapi_client/__init__.py +++ b/passageidentity/openapi_client/__init__.py @@ -66,9 +66,12 @@ from passageidentity.openapi_client.models.otp_auth_method import OtpAuthMethod from passageidentity.openapi_client.models.paginated_links import PaginatedLinks from passageidentity.openapi_client.models.passkeys_auth_method import PasskeysAuthMethod +from passageidentity.openapi_client.models.social_connection_type import SocialConnectionType from passageidentity.openapi_client.models.technologies import Technologies +from passageidentity.openapi_client.models.theme_type import ThemeType from passageidentity.openapi_client.models.ttl_display_unit import TtlDisplayUnit from passageidentity.openapi_client.models.update_user_request import UpdateUserRequest +from passageidentity.openapi_client.models.user_event_action import UserEventAction from passageidentity.openapi_client.models.user_event_status import UserEventStatus from passageidentity.openapi_client.models.user_info import UserInfo from passageidentity.openapi_client.models.user_metadata_field import UserMetadataField diff --git a/passageidentity/openapi_client/api/apps_api.py b/passageidentity/openapi_client/api/apps_api.py index 0a2a64f..346d8bd 100644 --- a/passageidentity/openapi_client/api/apps_api.py +++ b/passageidentity/openapi_client/api/apps_api.py @@ -12,25 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr +from pydantic import Field, StrictStr +from typing_extensions import Annotated from passageidentity.openapi_client.models.app_response import AppResponse -from passageidentity.openapi_client.api_client import ApiClient +from passageidentity.openapi_client.api_client import ApiClient, RequestSerialized from passageidentity.openapi_client.api_response import ApiResponse from passageidentity.openapi_client.rest import RESTResponseType @@ -105,8 +96,7 @@ def get_app( '200': "AppResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -176,8 +166,7 @@ def get_app_with_http_info( '200': "AppResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -247,8 +236,7 @@ def get_app_without_preload_content( '200': "AppResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -264,19 +252,20 @@ def _get_app_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -289,11 +278,12 @@ def _get_app_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/passageidentity/openapi_client/api/magic_links_api.py b/passageidentity/openapi_client/api/magic_links_api.py index 6b897f7..6e90ef2 100644 --- a/passageidentity/openapi_client/api/magic_links_api.py +++ b/passageidentity/openapi_client/api/magic_links_api.py @@ -12,26 +12,17 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr +from pydantic import Field, StrictStr +from typing_extensions import Annotated from passageidentity.openapi_client.models.create_magic_link_request import CreateMagicLinkRequest from passageidentity.openapi_client.models.magic_link_response import MagicLinkResponse -from passageidentity.openapi_client.api_client import ApiClient +from passageidentity.openapi_client.api_client import ApiClient, RequestSerialized from passageidentity.openapi_client.api_response import ApiResponse from passageidentity.openapi_client.rest import RESTResponseType @@ -53,7 +44,7 @@ def __init__(self, api_client=None) -> None: def create_magic_link( self, app_id: Annotated[StrictStr, Field(description="App ID")], - create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="magic link request")], + create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="Request to create a magic link")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -73,7 +64,7 @@ def create_magic_link( :param app_id: App ID (required) :type app_id: str - :param create_magic_link_request: magic link request (required) + :param create_magic_link_request: Request to create a magic link (required) :type create_magic_link_request: CreateMagicLinkRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -112,8 +103,7 @@ def create_magic_link( '401': "Model401Error", '403': "Model403Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -130,7 +120,7 @@ def create_magic_link( def create_magic_link_with_http_info( self, app_id: Annotated[StrictStr, Field(description="App ID")], - create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="magic link request")], + create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="Request to create a magic link")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -150,7 +140,7 @@ def create_magic_link_with_http_info( :param app_id: App ID (required) :type app_id: str - :param create_magic_link_request: magic link request (required) + :param create_magic_link_request: Request to create a magic link (required) :type create_magic_link_request: CreateMagicLinkRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -189,8 +179,7 @@ def create_magic_link_with_http_info( '401': "Model401Error", '403': "Model403Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -207,7 +196,7 @@ def create_magic_link_with_http_info( def create_magic_link_without_preload_content( self, app_id: Annotated[StrictStr, Field(description="App ID")], - create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="magic link request")], + create_magic_link_request: Annotated[CreateMagicLinkRequest, Field(description="Request to create a magic link")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -227,7 +216,7 @@ def create_magic_link_without_preload_content( :param app_id: App ID (required) :type app_id: str - :param create_magic_link_request: magic link request (required) + :param create_magic_link_request: Request to create a magic link (required) :type create_magic_link_request: CreateMagicLinkRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -266,8 +255,7 @@ def create_magic_link_without_preload_content( '401': "Model401Error", '403': "Model403Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -284,19 +272,20 @@ def _create_magic_link_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -311,11 +300,12 @@ def _create_magic_link_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/passageidentity/openapi_client/api/tokens_api.py b/passageidentity/openapi_client/api/tokens_api.py index 63822da..b3e45c8 100644 --- a/passageidentity/openapi_client/api/tokens_api.py +++ b/passageidentity/openapi_client/api/tokens_api.py @@ -12,24 +12,15 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr +from pydantic import Field, StrictStr +from typing_extensions import Annotated -from passageidentity.openapi_client.api_client import ApiClient +from passageidentity.openapi_client.api_client import ApiClient, RequestSerialized from passageidentity.openapi_client.api_response import ApiResponse from passageidentity.openapi_client.rest import RESTResponseType @@ -105,7 +96,11 @@ def revoke_user_refresh_tokens( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '403': "Model403Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -176,7 +171,11 @@ def revoke_user_refresh_tokens_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '403': "Model403Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -247,7 +246,11 @@ def revoke_user_refresh_tokens_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '403': "Model403Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -264,19 +267,20 @@ def _revoke_user_refresh_tokens_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -291,11 +295,12 @@ def _revoke_user_refresh_tokens_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/passageidentity/openapi_client/api/user_devices_api.py b/passageidentity/openapi_client/api/user_devices_api.py index 2535c5b..3f7456c 100644 --- a/passageidentity/openapi_client/api/user_devices_api.py +++ b/passageidentity/openapi_client/api/user_devices_api.py @@ -12,25 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr +from pydantic import Field, StrictStr +from typing_extensions import Annotated from passageidentity.openapi_client.models.list_devices_response import ListDevicesResponse -from passageidentity.openapi_client.api_client import ApiClient +from passageidentity.openapi_client.api_client import ApiClient, RequestSerialized from passageidentity.openapi_client.api_response import ApiResponse from passageidentity.openapi_client.rest import RESTResponseType @@ -110,7 +101,10 @@ def delete_user_devices( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -185,7 +179,10 @@ def delete_user_devices_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -260,7 +257,10 @@ def delete_user_devices_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -278,19 +278,20 @@ def _delete_user_devices_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -307,11 +308,12 @@ def _delete_user_devices_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -398,8 +400,7 @@ def list_user_devices( '200': "ListDevicesResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -473,8 +474,7 @@ def list_user_devices_with_http_info( '200': "ListDevicesResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -548,8 +548,7 @@ def list_user_devices_without_preload_content( '200': "ListDevicesResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -566,19 +565,20 @@ def _list_user_devices_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -593,11 +593,12 @@ def _list_user_devices_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/passageidentity/openapi_client/api/users_api.py b/passageidentity/openapi_client/api/users_api.py index b67f688..77c60b6 100644 --- a/passageidentity/openapi_client/api/users_api.py +++ b/passageidentity/openapi_client/api/users_api.py @@ -12,30 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt, StrictStr +from pydantic import Field, StrictInt, StrictStr from typing import Optional - +from typing_extensions import Annotated from passageidentity.openapi_client.models.create_user_request import CreateUserRequest from passageidentity.openapi_client.models.list_paginated_users_response import ListPaginatedUsersResponse from passageidentity.openapi_client.models.update_user_request import UpdateUserRequest from passageidentity.openapi_client.models.user_response import UserResponse -from passageidentity.openapi_client.api_client import ApiClient +from passageidentity.openapi_client.api_client import ApiClient, RequestSerialized from passageidentity.openapi_client.api_response import ApiResponse from passageidentity.openapi_client.rest import RESTResponseType @@ -114,8 +104,7 @@ def activate_user( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -189,8 +178,7 @@ def activate_user_with_http_info( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -264,8 +252,7 @@ def activate_user_without_preload_content( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -282,19 +269,20 @@ def _activate_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -309,11 +297,12 @@ def _activate_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -401,8 +390,7 @@ def create_user( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -477,8 +465,7 @@ def create_user_with_http_info( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -553,8 +540,7 @@ def create_user_without_preload_content( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -571,19 +557,20 @@ def _create_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -598,11 +585,12 @@ def _create_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -702,8 +690,7 @@ def deactivate_user( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -777,8 +764,7 @@ def deactivate_user_with_http_info( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -852,8 +838,7 @@ def deactivate_user_without_preload_content( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -870,19 +855,20 @@ def _deactivate_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -897,11 +883,12 @@ def _deactivate_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -985,7 +972,10 @@ def delete_user( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1056,7 +1046,10 @@ def delete_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1127,7 +1120,10 @@ def delete_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - + '200': None, + '401': "Model401Error", + '404': "Model404Error", + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1144,19 +1140,20 @@ def _delete_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1171,11 +1168,12 @@ def _delete_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1262,8 +1260,7 @@ def get_user( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1337,8 +1334,7 @@ def get_user_with_http_info( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1412,8 +1408,7 @@ def get_user_without_preload_content( '200': "UserResponse", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1430,19 +1425,20 @@ def _get_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1457,11 +1453,12 @@ def _get_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1589,8 +1586,7 @@ def list_paginated_users( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1705,8 +1701,7 @@ def list_paginated_users_with_http_info( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1821,8 +1816,7 @@ def list_paginated_users_without_preload_content( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -1849,19 +1843,20 @@ def _list_paginated_users_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1918,11 +1913,12 @@ def _list_paginated_users_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2014,8 +2010,7 @@ def update_user( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -2094,8 +2089,7 @@ def update_user_with_http_info( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -2174,8 +2168,7 @@ def update_user_without_preload_content( '400': "Model400Error", '401': "Model401Error", '404': "Model404Error", - '500': "Model500Error" - + '500': "Model500Error", } response_data = self.api_client.call_api( *_param, @@ -2193,19 +2186,20 @@ def _update_user_serialize( _content_type, _headers, _host_index, - ) -> Tuple: + ) -> RequestSerialized: _host = None _collection_formats: Dict[str, str] = { - } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2222,11 +2216,12 @@ def _update_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/passageidentity/openapi_client/api_client.py b/passageidentity/openapi_client/api_client.py index 8fc85e3..78da05d 100644 --- a/passageidentity/openapi_client/api_client.py +++ b/passageidentity/openapi_client/api_client.py @@ -13,9 +13,10 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes import os @@ -23,10 +24,11 @@ import tempfile from urllib.parse import quote -from typing import Tuple, Optional, List +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from passageidentity.openapi_client.configuration import Configuration -from passageidentity.openapi_client.api_response import ApiResponse +from passageidentity.openapi_client.api_response import ApiResponse, T as ApiResponseT import passageidentity.openapi_client.models from passageidentity.openapi_client import rest from passageidentity.openapi_client.exceptions import ( @@ -39,6 +41,7 @@ ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: """Generic API client for OpenAPI client library builds. @@ -65,6 +68,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -148,7 +152,7 @@ def param_serialize( collection_formats=None, _host=None, _request_auth=None - ) -> Tuple: + ) -> RequestSerialized: """Builds the HTTP request params needed by the request. :param method: Method to call. @@ -207,7 +211,8 @@ def param_serialize( post_params, collection_formats ) - post_params.extend(self.files_parameters(files)) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( @@ -225,7 +230,7 @@ def param_serialize( body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -274,62 +279,52 @@ def call_api( ) except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e return response_data def response_deserialize( self, - response_data=None, - response_types_map=None - ) -> ApiResponse: + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. :param response_types_map: dict of response types. :return: ApiResponse """ + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: # if not found, look for '1XX', '2XX', etc. response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - if not 200 <= response_data.status <= 299: - if response_data.status == 400: - raise BadRequestException(http_resp=response_data) - - if response_data.status == 401: - raise UnauthorizedException(http_resp=response_data) - - if response_data.status == 403: - raise ForbiddenException(http_resp=response_data) - - if response_data.status == 404: - raise NotFoundException(http_resp=response_data) - - if 500 <= response_data.status <= 599: - raise ServiceException(http_resp=response_data) - raise ApiException(http_resp=response_data) - # deserialize response data - - if response_type == "bytearray": - return_data = response_data.data - elif response_type is None: - return_data = None - elif response_type == "file": - return_data = self.__deserialize_file(response_data) - else: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_text = response_data.data.decode(encoding) - return_data = self.deserialize(response_text, response_type) + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) return ApiResponse( status_code = response_data.status, @@ -342,9 +337,11 @@ def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -354,6 +351,10 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): @@ -366,6 +367,8 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -375,28 +378,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ return { key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -413,12 +433,16 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -436,6 +460,10 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) @@ -446,7 +474,7 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: @@ -476,7 +504,7 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: @@ -490,7 +518,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -506,33 +534,41 @@ def parameters_to_url_query(self, params, collection_formats): else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -661,10 +697,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search( + m = re.search( r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition - ).group(1) + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -731,6 +769,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/passageidentity/openapi_client/api_response.py b/passageidentity/openapi_client/api_response.py index 2ac1ada..9bc7c11 100644 --- a/passageidentity/openapi_client/api_response.py +++ b/passageidentity/openapi_client/api_response.py @@ -1,8 +1,8 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar -from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel T = TypeVar("T") @@ -12,7 +12,7 @@ class ApiResponse(BaseModel, Generic[T]): """ status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") diff --git a/passageidentity/openapi_client/configuration.py b/passageidentity/openapi_client/configuration.py index cee2844..6cb15b1 100644 --- a/passageidentity/openapi_client/configuration.py +++ b/passageidentity/openapi_client/configuration.py @@ -14,11 +14,16 @@ import copy +import http.client as httplib import logging +from logging import FileHandler +import multiprocessing import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -26,10 +31,114 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "bearerAuth": BearerFormatAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -52,20 +161,31 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "https://api.passage.id/v1" if host is None else host @@ -79,6 +199,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -116,13 +239,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -148,8 +274,15 @@ def __init__(self, host=None, Set this to the SNI value expected by the server. """ + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -158,7 +291,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation @@ -176,7 +309,7 @@ def __init__(self, host=None, """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -190,11 +323,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -205,7 +338,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -215,7 +348,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -225,11 +358,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -241,7 +374,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -260,7 +393,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -269,7 +402,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -291,7 +424,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -302,7 +435,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -313,7 +446,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -330,7 +463,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -345,12 +480,12 @@ def get_basic_auth_token(self): basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth['bearerAuth'] = { 'type': 'bearer', @@ -361,7 +496,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -373,7 +508,7 @@ def to_debug_report(self): "SDK Package Version: 1.0.0".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -385,7 +520,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -425,12 +565,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/passageidentity/openapi_client/exceptions.py b/passageidentity/openapi_client/exceptions.py index aa4b312..c303cf9 100644 --- a/passageidentity/openapi_client/exceptions.py +++ b/passageidentity/openapi_client/exceptions.py @@ -12,6 +12,8 @@ Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -102,17 +104,56 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data.decode('utf-8') + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -122,38 +163,30 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message + class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/passageidentity/openapi_client/models/__init__.py b/passageidentity/openapi_client/models/__init__.py index 7561daa..f6f8ba3 100644 --- a/passageidentity/openapi_client/models/__init__.py +++ b/passageidentity/openapi_client/models/__init__.py @@ -45,9 +45,12 @@ from passageidentity.openapi_client.models.otp_auth_method import OtpAuthMethod from passageidentity.openapi_client.models.paginated_links import PaginatedLinks from passageidentity.openapi_client.models.passkeys_auth_method import PasskeysAuthMethod +from passageidentity.openapi_client.models.social_connection_type import SocialConnectionType from passageidentity.openapi_client.models.technologies import Technologies +from passageidentity.openapi_client.models.theme_type import ThemeType from passageidentity.openapi_client.models.ttl_display_unit import TtlDisplayUnit from passageidentity.openapi_client.models.update_user_request import UpdateUserRequest +from passageidentity.openapi_client.models.user_event_action import UserEventAction from passageidentity.openapi_client.models.user_event_status import UserEventStatus from passageidentity.openapi_client.models.user_info import UserInfo from passageidentity.openapi_client.models.user_metadata_field import UserMetadataField diff --git a/passageidentity/openapi_client/models/app_info.py b/passageidentity/openapi_client/models/app_info.py index 385838d..c5ef4d2 100644 --- a/passageidentity/openapi_client/models/app_info.py +++ b/passageidentity/openapi_client/models/app_info.py @@ -19,18 +19,15 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, field_validator -from pydantic import Field from passageidentity.openapi_client.models.auth_methods import AuthMethods from passageidentity.openapi_client.models.element_customization import ElementCustomization from passageidentity.openapi_client.models.layouts import Layouts from passageidentity.openapi_client.models.technologies import Technologies from passageidentity.openapi_client.models.user_metadata_field import UserMetadataField -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class AppInfo(BaseModel): """ @@ -45,6 +42,7 @@ class AppInfo(BaseModel): auth_fallback_method_ttl: StrictInt = Field(description="Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods.") auth_methods: AuthMethods auth_origin: StrictStr + auto_theme_enabled: StrictBool = Field(description="Deprecated Property. Please use `hosted_theme` to set hosted page theming instead.") created_at: datetime default_language: StrictStr id: StrictStr @@ -53,8 +51,9 @@ class AppInfo(BaseModel): light_logo_url: Optional[StrictStr] = None dark_logo_url: Optional[StrictStr] = None name: StrictStr - hosted: StrictBool = Field(description="whether or not the app's login page hosted by passage") + hosted: StrictBool = Field(description="whether or not the app's login page is hosted by Passage") hosted_subdomain: StrictStr = Field(description="the subdomain of the app's hosted login page") + hosted_theme: StrictStr id_token_lifetime: Optional[StrictInt] = None passage_branding: StrictBool profile_management: StrictBool @@ -75,19 +74,20 @@ class AppInfo(BaseModel): technologies: List[Technologies] element_customization: ElementCustomization element_customization_dark: ElementCustomization - __properties: ClassVar[List[str]] = ["additional_auth_origins", "allowed_callback_urls", "allowed_identifier", "allowed_logout_urls", "application_login_uri", "auth_fallback_method", "auth_fallback_method_ttl", "auth_methods", "auth_origin", "created_at", "default_language", "id", "layouts", "login_url", "light_logo_url", "dark_logo_url", "name", "hosted", "hosted_subdomain", "id_token_lifetime", "passage_branding", "profile_management", "public_signup", "redirect_url", "refresh_absolute_lifetime", "refresh_enabled", "refresh_inactivity_lifetime", "require_email_verification", "require_identifier_verification", "required_identifier", "role", "rsa_public_key", "secret", "session_timeout_length", "type", "user_metadata_schema", "technologies", "element_customization", "element_customization_dark"] + __properties: ClassVar[List[str]] = ["additional_auth_origins", "allowed_callback_urls", "allowed_identifier", "allowed_logout_urls", "application_login_uri", "auth_fallback_method", "auth_fallback_method_ttl", "auth_methods", "auth_origin", "auto_theme_enabled", "created_at", "default_language", "id", "layouts", "login_url", "light_logo_url", "dark_logo_url", "name", "hosted", "hosted_subdomain", "hosted_theme", "id_token_lifetime", "passage_branding", "profile_management", "public_signup", "redirect_url", "refresh_absolute_lifetime", "refresh_enabled", "refresh_inactivity_lifetime", "require_email_verification", "require_identifier_verification", "required_identifier", "role", "rsa_public_key", "secret", "session_timeout_length", "type", "user_metadata_schema", "technologies", "element_customization", "element_customization_dark"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('complete', 'flex'): + if value not in set(['complete', 'flex']): raise ValueError("must be one of enum values ('complete', 'flex')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -100,7 +100,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AppInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -114,10 +114,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of auth_methods @@ -129,9 +131,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in user_metadata_schema (list) _items = [] if self.user_metadata_schema: - for _item in self.user_metadata_schema: - if _item: - _items.append(_item.to_dict()) + for _item_user_metadata_schema in self.user_metadata_schema: + if _item_user_metadata_schema: + _items.append(_item_user_metadata_schema.to_dict()) _dict['user_metadata_schema'] = _items # override the default output from pydantic by calling `to_dict()` of element_customization if self.element_customization: @@ -142,7 +144,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AppInfo from a dict""" if obj is None: return None @@ -158,18 +160,20 @@ def from_dict(cls, obj: Dict) -> Self: "application_login_uri": obj.get("application_login_uri"), "auth_fallback_method": obj.get("auth_fallback_method"), "auth_fallback_method_ttl": obj.get("auth_fallback_method_ttl"), - "auth_methods": AuthMethods.from_dict(obj.get("auth_methods")) if obj.get("auth_methods") is not None else None, + "auth_methods": AuthMethods.from_dict(obj["auth_methods"]) if obj.get("auth_methods") is not None else None, "auth_origin": obj.get("auth_origin"), + "auto_theme_enabled": obj.get("auto_theme_enabled"), "created_at": obj.get("created_at"), "default_language": obj.get("default_language"), "id": obj.get("id"), - "layouts": Layouts.from_dict(obj.get("layouts")) if obj.get("layouts") is not None else None, + "layouts": Layouts.from_dict(obj["layouts"]) if obj.get("layouts") is not None else None, "login_url": obj.get("login_url"), "light_logo_url": obj.get("light_logo_url"), "dark_logo_url": obj.get("dark_logo_url"), "name": obj.get("name"), "hosted": obj.get("hosted"), "hosted_subdomain": obj.get("hosted_subdomain"), + "hosted_theme": obj.get("hosted_theme"), "id_token_lifetime": obj.get("id_token_lifetime"), "passage_branding": obj.get("passage_branding"), "profile_management": obj.get("profile_management"), @@ -186,10 +190,10 @@ def from_dict(cls, obj: Dict) -> Self: "secret": obj.get("secret"), "session_timeout_length": obj.get("session_timeout_length"), "type": obj.get("type"), - "user_metadata_schema": [UserMetadataField.from_dict(_item) for _item in obj.get("user_metadata_schema")] if obj.get("user_metadata_schema") is not None else None, + "user_metadata_schema": [UserMetadataField.from_dict(_item) for _item in obj["user_metadata_schema"]] if obj.get("user_metadata_schema") is not None else None, "technologies": obj.get("technologies"), - "element_customization": ElementCustomization.from_dict(obj.get("element_customization")) if obj.get("element_customization") is not None else None, - "element_customization_dark": ElementCustomization.from_dict(obj.get("element_customization_dark")) if obj.get("element_customization_dark") is not None else None + "element_customization": ElementCustomization.from_dict(obj["element_customization"]) if obj.get("element_customization") is not None else None, + "element_customization_dark": ElementCustomization.from_dict(obj["element_customization_dark"]) if obj.get("element_customization_dark") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/app_response.py b/passageidentity/openapi_client/models/app_response.py index 68e64ff..f93c094 100644 --- a/passageidentity/openapi_client/models/app_response.py +++ b/passageidentity/openapi_client/models/app_response.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.app_info import AppInfo -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class AppResponse(BaseModel): """ @@ -34,10 +31,11 @@ class AppResponse(BaseModel): app: AppInfo __properties: ClassVar[List[str]] = ["app"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,7 +48,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AppResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,10 +62,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of app @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AppResponse from a dict""" if obj is None: return None @@ -85,7 +85,7 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "app": AppInfo.from_dict(obj.get("app")) if obj.get("app") is not None else None + "app": AppInfo.from_dict(obj["app"]) if obj.get("app") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/apple_user_social_connection.py b/passageidentity/openapi_client/models/apple_user_social_connection.py index f183202..9d7e6b6 100644 --- a/passageidentity/openapi_client/models/apple_user_social_connection.py +++ b/passageidentity/openapi_client/models/apple_user_social_connection.py @@ -19,13 +19,10 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class AppleUserSocialConnection(BaseModel): """ @@ -37,10 +34,11 @@ class AppleUserSocialConnection(BaseModel): provider_identifier: StrictStr = Field(description="The email of connected social user.") __properties: ClassVar[List[str]] = ["provider_id", "created_at", "last_login_at", "provider_identifier"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AppleUserSocialConnection from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AppleUserSocialConnection from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/auth_methods.py b/passageidentity/openapi_client/models/auth_methods.py index 1163f98..770afde 100644 --- a/passageidentity/openapi_client/models/auth_methods.py +++ b/passageidentity/openapi_client/models/auth_methods.py @@ -18,16 +18,13 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.magic_link_auth_method import MagicLinkAuthMethod from passageidentity.openapi_client.models.otp_auth_method import OtpAuthMethod from passageidentity.openapi_client.models.passkeys_auth_method import PasskeysAuthMethod -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class AuthMethods(BaseModel): """ @@ -38,10 +35,11 @@ class AuthMethods(BaseModel): magic_link: MagicLinkAuthMethod __properties: ClassVar[List[str]] = ["passkeys", "otp", "magic_link"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AuthMethods from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,10 +66,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of passkeys @@ -86,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AuthMethods from a dict""" if obj is None: return None @@ -95,9 +95,9 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "passkeys": PasskeysAuthMethod.from_dict(obj.get("passkeys")) if obj.get("passkeys") is not None else None, - "otp": OtpAuthMethod.from_dict(obj.get("otp")) if obj.get("otp") is not None else None, - "magic_link": MagicLinkAuthMethod.from_dict(obj.get("magic_link")) if obj.get("magic_link") is not None else None + "passkeys": PasskeysAuthMethod.from_dict(obj["passkeys"]) if obj.get("passkeys") is not None else None, + "otp": OtpAuthMethod.from_dict(obj["otp"]) if obj.get("otp") is not None else None, + "magic_link": MagicLinkAuthMethod.from_dict(obj["magic_link"]) if obj.get("magic_link") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/create_magic_link_request.py b/passageidentity/openapi_client/models/create_magic_link_request.py index 5cfeedb..f13a1e5 100644 --- a/passageidentity/openapi_client/models/create_magic_link_request.py +++ b/passageidentity/openapi_client/models/create_magic_link_request.py @@ -18,37 +18,34 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr -from pydantic import Field from passageidentity.openapi_client.models.magic_link_channel import MagicLinkChannel from passageidentity.openapi_client.models.magic_link_type import MagicLinkType -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class CreateMagicLinkRequest(BaseModel): """ CreateMagicLinkRequest """ # noqa: E501 - channel: MagicLinkChannel - email: StrictStr + channel: Optional[MagicLinkChannel] = None + email: Optional[StrictStr] = None language: Optional[StrictStr] = Field(default=None, description="language of the email to send (optional)") - magic_link_path: StrictStr - phone: StrictStr - redirect_url: StrictStr - send: StrictBool - ttl: StrictInt + magic_link_path: Optional[StrictStr] = Field(default=None, description="must be a relative url") + phone: Optional[StrictStr] = None + redirect_url: Optional[StrictStr] = None + send: Optional[StrictBool] = None + ttl: Optional[StrictInt] = None type: Optional[MagicLinkType] = None - user_id: StrictStr + user_id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["channel", "email", "language", "magic_link_path", "phone", "redirect_url", "send", "ttl", "type", "user_id"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -61,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CreateMagicLinkRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -75,16 +72,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CreateMagicLinkRequest from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/create_user_request.py b/passageidentity/openapi_client/models/create_user_request.py index aa7cc17..c425151 100644 --- a/passageidentity/openapi_client/models/create_user_request.py +++ b/passageidentity/openapi_client/models/create_user_request.py @@ -18,14 +18,10 @@ import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class CreateUserRequest(BaseModel): """ @@ -33,13 +29,14 @@ class CreateUserRequest(BaseModel): """ # noqa: E501 email: Optional[StrictStr] = Field(default=None, description="Email of the new user. Either this or `phone` is required; both may be provided.") phone: Optional[StrictStr] = Field(default=None, description="Phone number of the new user. Either this or `email` is required; both may be provided.") - user_metadata: Optional[Union[str, Any]] = None + user_metadata: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["email", "phone", "user_metadata"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -52,7 +49,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CreateUserRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,16 +63,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CreateUserRequest from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/element_customization.py b/passageidentity/openapi_client/models/element_customization.py index 5c107f9..3de3555 100644 --- a/passageidentity/openapi_client/models/element_customization.py +++ b/passageidentity/openapi_client/models/element_customization.py @@ -18,15 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field from passageidentity.openapi_client.models.font_family import FontFamily -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class ElementCustomization(BaseModel): """ @@ -36,8 +32,8 @@ class ElementCustomization(BaseModel): passage_container_max_width: Optional[StrictInt] = Field(default=300, description="Maximum width of container (px)") passage_input_box_background_color: Optional[StrictStr] = Field(default=None, description="Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. ") passage_input_box_border_radius: Optional[StrictInt] = Field(default=5, description="Input box border radius (px)") - passage_header_font_family: Optional[FontFamily] = None - passage_body_font_family: Optional[FontFamily] = None + passage_header_font_family: Optional[FontFamily] = FontFamily.HELVETICA + passage_body_font_family: Optional[FontFamily] = FontFamily.HELVETICA passage_header_text_color: Optional[StrictStr] = Field(default=None, description="Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. ") passage_body_text_color: Optional[StrictStr] = Field(default=None, description="Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. ") passage_primary_button_background_color: Optional[StrictStr] = Field(default='#121212', description="Primary button background colour (hex)") @@ -54,10 +50,11 @@ class ElementCustomization(BaseModel): passage_secondary_button_border_width: Optional[StrictInt] = Field(default=1, description="Secondary button border width (px)") __properties: ClassVar[List[str]] = ["passage_container_background_color", "passage_container_max_width", "passage_input_box_background_color", "passage_input_box_border_radius", "passage_header_font_family", "passage_body_font_family", "passage_header_text_color", "passage_body_text_color", "passage_primary_button_background_color", "passage_primary_button_text_color", "passage_primary_button_hover_color", "passage_primary_button_border_radius", "passage_primary_button_border_color", "passage_primary_button_border_width", "passage_secondary_button_background_color", "passage_secondary_button_text_color", "passage_secondary_button_hover_color", "passage_secondary_button_border_radius", "passage_secondary_button_border_color", "passage_secondary_button_border_width"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -70,7 +67,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ElementCustomization from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -84,16 +81,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ElementCustomization from a dict""" if obj is None: return None @@ -106,8 +105,8 @@ def from_dict(cls, obj: Dict) -> Self: "passage_container_max_width": obj.get("passage_container_max_width") if obj.get("passage_container_max_width") is not None else 300, "passage_input_box_background_color": obj.get("passage_input_box_background_color"), "passage_input_box_border_radius": obj.get("passage_input_box_border_radius") if obj.get("passage_input_box_border_radius") is not None else 5, - "passage_header_font_family": obj.get("passage_header_font_family"), - "passage_body_font_family": obj.get("passage_body_font_family"), + "passage_header_font_family": obj.get("passage_header_font_family") if obj.get("passage_header_font_family") is not None else FontFamily.HELVETICA, + "passage_body_font_family": obj.get("passage_body_font_family") if obj.get("passage_body_font_family") is not None else FontFamily.HELVETICA, "passage_header_text_color": obj.get("passage_header_text_color"), "passage_body_text_color": obj.get("passage_body_text_color"), "passage_primary_button_background_color": obj.get("passage_primary_button_background_color") if obj.get("passage_primary_button_background_color") is not None else '#121212', diff --git a/passageidentity/openapi_client/models/font_family.py b/passageidentity/openapi_client/models/font_family.py index 15a1e06..1962536 100644 --- a/passageidentity/openapi_client/models/font_family.py +++ b/passageidentity/openapi_client/models/font_family.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class FontFamily(str, Enum): diff --git a/passageidentity/openapi_client/models/github_user_social_connection.py b/passageidentity/openapi_client/models/github_user_social_connection.py index f20de8b..e8477a5 100644 --- a/passageidentity/openapi_client/models/github_user_social_connection.py +++ b/passageidentity/openapi_client/models/github_user_social_connection.py @@ -19,13 +19,10 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class GithubUserSocialConnection(BaseModel): """ @@ -37,10 +34,11 @@ class GithubUserSocialConnection(BaseModel): provider_identifier: StrictStr = Field(description="The email of connected social user.") __properties: ClassVar[List[str]] = ["provider_id", "created_at", "last_login_at", "provider_identifier"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GithubUserSocialConnection from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GithubUserSocialConnection from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/google_user_social_connection.py b/passageidentity/openapi_client/models/google_user_social_connection.py index 214b1c7..26046c7 100644 --- a/passageidentity/openapi_client/models/google_user_social_connection.py +++ b/passageidentity/openapi_client/models/google_user_social_connection.py @@ -19,13 +19,10 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class GoogleUserSocialConnection(BaseModel): """ @@ -37,10 +34,11 @@ class GoogleUserSocialConnection(BaseModel): provider_identifier: StrictStr = Field(description="The email of connected social user.") __properties: ClassVar[List[str]] = ["provider_id", "created_at", "last_login_at", "provider_identifier"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GoogleUserSocialConnection from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GoogleUserSocialConnection from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/layout_config.py b/passageidentity/openapi_client/models/layout_config.py index 261ad81..d01d0af 100644 --- a/passageidentity/openapi_client/models/layout_config.py +++ b/passageidentity/openapi_client/models/layout_config.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictInt, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class LayoutConfig(BaseModel): """ @@ -37,10 +34,11 @@ class LayoutConfig(BaseModel): y: StrictInt __properties: ClassVar[List[str]] = ["h", "id", "w", "x", "y"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayoutConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayoutConfig from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/layouts.py b/passageidentity/openapi_client/models/layouts.py index 2caf330..77535fd 100644 --- a/passageidentity/openapi_client/models/layouts.py +++ b/passageidentity/openapi_client/models/layouts.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.layout_config import LayoutConfig -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Layouts(BaseModel): """ @@ -35,10 +32,11 @@ class Layouts(BaseModel): registration: List[LayoutConfig] __properties: ClassVar[List[str]] = ["profile", "registration"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -51,7 +49,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Layouts from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -65,30 +63,32 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in profile (list) _items = [] if self.profile: - for _item in self.profile: - if _item: - _items.append(_item.to_dict()) + for _item_profile in self.profile: + if _item_profile: + _items.append(_item_profile.to_dict()) _dict['profile'] = _items # override the default output from pydantic by calling `to_dict()` of each item in registration (list) _items = [] if self.registration: - for _item in self.registration: - if _item: - _items.append(_item.to_dict()) + for _item_registration in self.registration: + if _item_registration: + _items.append(_item_registration.to_dict()) _dict['registration'] = _items return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Layouts from a dict""" if obj is None: return None @@ -97,8 +97,8 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "profile": [LayoutConfig.from_dict(_item) for _item in obj.get("profile")] if obj.get("profile") is not None else None, - "registration": [LayoutConfig.from_dict(_item) for _item in obj.get("registration")] if obj.get("registration") is not None else None + "profile": [LayoutConfig.from_dict(_item) for _item in obj["profile"]] if obj.get("profile") is not None else None, + "registration": [LayoutConfig.from_dict(_item) for _item in obj["registration"]] if obj.get("registration") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/link.py b/passageidentity/openapi_client/models/link.py index 358d1d3..f17b1ac 100644 --- a/passageidentity/openapi_client/models/link.py +++ b/passageidentity/openapi_client/models/link.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Link(BaseModel): """ @@ -33,10 +30,11 @@ class Link(BaseModel): href: StrictStr __properties: ClassVar[List[str]] = ["href"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -49,7 +47,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Link from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,16 +61,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Link from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/list_devices_response.py b/passageidentity/openapi_client/models/list_devices_response.py index 2addcb6..5d505e4 100644 --- a/passageidentity/openapi_client/models/list_devices_response.py +++ b/passageidentity/openapi_client/models/list_devices_response.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.web_authn_devices import WebAuthnDevices -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class ListDevicesResponse(BaseModel): """ @@ -34,10 +31,11 @@ class ListDevicesResponse(BaseModel): devices: List[WebAuthnDevices] __properties: ClassVar[List[str]] = ["devices"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,7 +48,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ListDevicesResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,23 +62,25 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in devices (list) _items = [] if self.devices: - for _item in self.devices: - if _item: - _items.append(_item.to_dict()) + for _item_devices in self.devices: + if _item_devices: + _items.append(_item_devices.to_dict()) _dict['devices'] = _items return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ListDevicesResponse from a dict""" if obj is None: return None @@ -89,7 +89,7 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "devices": [WebAuthnDevices.from_dict(_item) for _item in obj.get("devices")] if obj.get("devices") is not None else None + "devices": [WebAuthnDevices.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/list_paginated_users_item.py b/passageidentity/openapi_client/models/list_paginated_users_item.py index 613699d..cc7f7c0 100644 --- a/passageidentity/openapi_client/models/list_paginated_users_item.py +++ b/passageidentity/openapi_client/models/list_paginated_users_item.py @@ -19,13 +19,11 @@ import json from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from passageidentity.openapi_client.models.user_status import UserStatus -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class ListPaginatedUsersItem(BaseModel): """ @@ -34,6 +32,7 @@ class ListPaginatedUsersItem(BaseModel): created_at: datetime email: StrictStr email_verified: StrictBool + external_id: StrictStr = Field(description="The external ID of the user. Only set if the user was created in a Flex app.") id: StrictStr last_login_at: datetime login_count: StrictInt @@ -41,13 +40,14 @@ class ListPaginatedUsersItem(BaseModel): phone_verified: StrictBool status: UserStatus updated_at: datetime - user_metadata: Optional[Union[str, Any]] - __properties: ClassVar[List[str]] = ["created_at", "email", "email_verified", "id", "last_login_at", "login_count", "phone", "phone_verified", "status", "updated_at", "user_metadata"] + user_metadata: Optional[Dict[str, Any]] + __properties: ClassVar[List[str]] = ["created_at", "email", "email_verified", "external_id", "id", "last_login_at", "login_count", "phone", "phone_verified", "status", "updated_at", "user_metadata"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ListPaginatedUsersItem from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -74,10 +74,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # set to None if user_metadata (nullable) is None @@ -88,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ListPaginatedUsersItem from a dict""" if obj is None: return None @@ -100,6 +102,7 @@ def from_dict(cls, obj: Dict) -> Self: "created_at": obj.get("created_at"), "email": obj.get("email"), "email_verified": obj.get("email_verified"), + "external_id": obj.get("external_id"), "id": obj.get("id"), "last_login_at": obj.get("last_login_at"), "login_count": obj.get("login_count"), diff --git a/passageidentity/openapi_client/models/list_paginated_users_response.py b/passageidentity/openapi_client/models/list_paginated_users_response.py index 8bd1958..1a7aeeb 100644 --- a/passageidentity/openapi_client/models/list_paginated_users_response.py +++ b/passageidentity/openapi_client/models/list_paginated_users_response.py @@ -18,16 +18,12 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictInt -from pydantic import Field from passageidentity.openapi_client.models.list_paginated_users_item import ListPaginatedUsersItem from passageidentity.openapi_client.models.paginated_links import PaginatedLinks -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class ListPaginatedUsersResponse(BaseModel): """ @@ -41,10 +37,11 @@ class ListPaginatedUsersResponse(BaseModel): users: List[ListPaginatedUsersItem] __properties: ClassVar[List[str]] = ["_links", "created_before", "limit", "page", "total_users", "users"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ListPaginatedUsersResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,10 +68,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of links @@ -83,14 +82,14 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in users (list) _items = [] if self.users: - for _item in self.users: - if _item: - _items.append(_item.to_dict()) + for _item_users in self.users: + if _item_users: + _items.append(_item_users.to_dict()) _dict['users'] = _items return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ListPaginatedUsersResponse from a dict""" if obj is None: return None @@ -99,12 +98,12 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "_links": PaginatedLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None, + "_links": PaginatedLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "created_before": obj.get("created_before"), "limit": obj.get("limit"), "page": obj.get("page"), "total_users": obj.get("total_users"), - "users": [ListPaginatedUsersItem.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None + "users": [ListPaginatedUsersItem.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/magic_link.py b/passageidentity/openapi_client/models/magic_link.py index f493eea..65e7bfc 100644 --- a/passageidentity/openapi_client/models/magic_link.py +++ b/passageidentity/openapi_client/models/magic_link.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr from passageidentity.openapi_client.models.magic_link_type import MagicLinkType -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class MagicLink(BaseModel): """ @@ -43,10 +40,11 @@ class MagicLink(BaseModel): user_id: StrictStr __properties: ClassVar[List[str]] = ["activated", "app_id", "id", "identifier", "redirect_url", "secret", "ttl", "type", "url", "user_id"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -59,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MagicLink from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -73,16 +71,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MagicLink from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/magic_link_auth_method.py b/passageidentity/openapi_client/models/magic_link_auth_method.py index 951e64e..afdba75 100644 --- a/passageidentity/openapi_client/models/magic_link_auth_method.py +++ b/passageidentity/openapi_client/models/magic_link_auth_method.py @@ -18,16 +18,12 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictBool -from pydantic import Field from typing_extensions import Annotated from passageidentity.openapi_client.models.ttl_display_unit import TtlDisplayUnit -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class MagicLinkAuthMethod(BaseModel): """ @@ -38,10 +34,11 @@ class MagicLinkAuthMethod(BaseModel): ttl_display_unit: TtlDisplayUnit __properties: ClassVar[List[str]] = ["enabled", "ttl", "ttl_display_unit"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MagicLinkAuthMethod from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MagicLinkAuthMethod from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/magic_link_channel.py b/passageidentity/openapi_client/models/magic_link_channel.py index e7741e9..3e7ad9c 100644 --- a/passageidentity/openapi_client/models/magic_link_channel.py +++ b/passageidentity/openapi_client/models/magic_link_channel.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class MagicLinkChannel(str, Enum): diff --git a/passageidentity/openapi_client/models/magic_link_response.py b/passageidentity/openapi_client/models/magic_link_response.py index 22ed16d..3ddd763 100644 --- a/passageidentity/openapi_client/models/magic_link_response.py +++ b/passageidentity/openapi_client/models/magic_link_response.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.magic_link import MagicLink -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class MagicLinkResponse(BaseModel): """ @@ -34,10 +31,11 @@ class MagicLinkResponse(BaseModel): magic_link: MagicLink __properties: ClassVar[List[str]] = ["magic_link"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,7 +48,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MagicLinkResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,10 +62,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of magic_link @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MagicLinkResponse from a dict""" if obj is None: return None @@ -85,7 +85,7 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "magic_link": MagicLink.from_dict(obj.get("magic_link")) if obj.get("magic_link") is not None else None + "magic_link": MagicLink.from_dict(obj["magic_link"]) if obj.get("magic_link") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/magic_link_type.py b/passageidentity/openapi_client/models/magic_link_type.py index 3e44caf..2834107 100644 --- a/passageidentity/openapi_client/models/magic_link_type.py +++ b/passageidentity/openapi_client/models/magic_link_type.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class MagicLinkType(str, Enum): diff --git a/passageidentity/openapi_client/models/model400_error.py b/passageidentity/openapi_client/models/model400_error.py index b6d1539..de98bc3 100644 --- a/passageidentity/openapi_client/models/model400_error.py +++ b/passageidentity/openapi_client/models/model400_error.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Model400Error(BaseModel): """ @@ -37,14 +34,15 @@ class Model400Error(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in ('invalid_request', 'custom_provider_required'): + if value not in set(['invalid_request', 'custom_provider_required']): raise ValueError("must be one of enum values ('invalid_request', 'custom_provider_required')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Model400Error from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Model400Error from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/model401_error.py b/passageidentity/openapi_client/models/model401_error.py index 8a47922..fa50979 100644 --- a/passageidentity/openapi_client/models/model401_error.py +++ b/passageidentity/openapi_client/models/model401_error.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Model401Error(BaseModel): """ @@ -37,14 +34,15 @@ class Model401Error(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in ('invalid_access_token', 'invalid_nonce'): + if value not in set(['invalid_access_token', 'invalid_nonce']): raise ValueError("must be one of enum values ('invalid_access_token', 'invalid_nonce')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Model401Error from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Model401Error from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/model403_error.py b/passageidentity/openapi_client/models/model403_error.py index 21700b7..640b20f 100644 --- a/passageidentity/openapi_client/models/model403_error.py +++ b/passageidentity/openapi_client/models/model403_error.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Model403Error(BaseModel): """ @@ -37,14 +34,15 @@ class Model403Error(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in ('cannot_create_organization_billing_portal_session', 'cannot_create_transaction', 'cannot_delete_admin', 'cannot_delete_organization_member', 'cannot_self_update_organization_member', 'operation_not_allowed'): + if value not in set(['cannot_create_organization_billing_portal_session', 'cannot_create_transaction', 'cannot_delete_admin', 'cannot_delete_organization_member', 'cannot_self_update_organization_member', 'operation_not_allowed']): raise ValueError("must be one of enum values ('cannot_create_organization_billing_portal_session', 'cannot_create_transaction', 'cannot_delete_admin', 'cannot_delete_organization_member', 'cannot_self_update_organization_member', 'operation_not_allowed')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Model403Error from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Model403Error from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/model404_error.py b/passageidentity/openapi_client/models/model404_error.py index 0ec0fc0..087aaf6 100644 --- a/passageidentity/openapi_client/models/model404_error.py +++ b/passageidentity/openapi_client/models/model404_error.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Model404Error(BaseModel): """ @@ -37,14 +34,15 @@ class Model404Error(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in ('admin_not_found', 'api_key_not_found', 'app_not_found', 'device_not_found', 'domain_not_found', 'email_provider_not_found', 'email_template_not_found', 'event_not_found', 'function_not_found', 'function_secret_key_not_found', 'function_version_not_found', 'metadata_field_not_found', 'oauth2_app_not_found', 'organization_member_not_found', 'sms_provider_not_found', 'sms_template_not_found', 'social_connection_not_found', 'user_not_found'): - raise ValueError("must be one of enum values ('admin_not_found', 'api_key_not_found', 'app_not_found', 'device_not_found', 'domain_not_found', 'email_provider_not_found', 'email_template_not_found', 'event_not_found', 'function_not_found', 'function_secret_key_not_found', 'function_version_not_found', 'metadata_field_not_found', 'oauth2_app_not_found', 'organization_member_not_found', 'sms_provider_not_found', 'sms_template_not_found', 'social_connection_not_found', 'user_not_found')") + if value not in set(['admin_not_found', 'api_key_not_found', 'app_not_found', 'device_not_found', 'domain_not_found', 'email_provider_not_found', 'email_template_not_found', 'event_not_found', 'function_not_found', 'function_secret_key_not_found', 'function_version_not_found', 'metadata_field_not_found', 'oauth2_app_not_found', 'organization_member_not_found', 'sms_provider_not_found', 'sms_template_not_found', 'social_connection_not_found', 'user_not_found', 'native_client_not_found']): + raise ValueError("must be one of enum values ('admin_not_found', 'api_key_not_found', 'app_not_found', 'device_not_found', 'domain_not_found', 'email_provider_not_found', 'email_template_not_found', 'event_not_found', 'function_not_found', 'function_secret_key_not_found', 'function_version_not_found', 'metadata_field_not_found', 'oauth2_app_not_found', 'organization_member_not_found', 'sms_provider_not_found', 'sms_template_not_found', 'social_connection_not_found', 'user_not_found', 'native_client_not_found')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Model404Error from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Model404Error from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/model500_error.py b/passageidentity/openapi_client/models/model500_error.py index a01b46c..9e0b417 100644 --- a/passageidentity/openapi_client/models/model500_error.py +++ b/passageidentity/openapi_client/models/model500_error.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Model500Error(BaseModel): """ @@ -37,14 +34,15 @@ class Model500Error(BaseModel): @field_validator('code') def code_validate_enum(cls, value): """Validates the enum""" - if value not in ('internal_server_error'): + if value not in set(['internal_server_error']): raise ValueError("must be one of enum values ('internal_server_error')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Model500Error from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Model500Error from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/nonce.py b/passageidentity/openapi_client/models/nonce.py index 16852b5..70e65e5 100644 --- a/passageidentity/openapi_client/models/nonce.py +++ b/passageidentity/openapi_client/models/nonce.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class Nonce(BaseModel): """ @@ -33,10 +30,11 @@ class Nonce(BaseModel): nonce: StrictStr __properties: ClassVar[List[str]] = ["nonce"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -49,7 +47,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Nonce from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,16 +61,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Nonce from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/otp_auth_method.py b/passageidentity/openapi_client/models/otp_auth_method.py index 13ba27a..aa835de 100644 --- a/passageidentity/openapi_client/models/otp_auth_method.py +++ b/passageidentity/openapi_client/models/otp_auth_method.py @@ -18,16 +18,12 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictBool -from pydantic import Field from typing_extensions import Annotated from passageidentity.openapi_client.models.ttl_display_unit import TtlDisplayUnit -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class OtpAuthMethod(BaseModel): """ @@ -38,10 +34,11 @@ class OtpAuthMethod(BaseModel): ttl_display_unit: TtlDisplayUnit __properties: ClassVar[List[str]] = ["enabled", "ttl", "ttl_display_unit"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,7 +51,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OtpAuthMethod from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,16 +65,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OtpAuthMethod from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/paginated_links.py b/passageidentity/openapi_client/models/paginated_links.py index ef10956..b72bae0 100644 --- a/passageidentity/openapi_client/models/paginated_links.py +++ b/passageidentity/openapi_client/models/paginated_links.py @@ -18,15 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel -from pydantic import Field from passageidentity.openapi_client.models.link import Link -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class PaginatedLinks(BaseModel): """ @@ -39,10 +35,11 @@ class PaginatedLinks(BaseModel): var_self: Link = Field(alias="self") __properties: ClassVar[List[str]] = ["first", "last", "next", "previous", "self"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -55,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedLinks from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,10 +66,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of first @@ -93,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedLinks from a dict""" if obj is None: return None @@ -102,11 +101,11 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "first": Link.from_dict(obj.get("first")) if obj.get("first") is not None else None, - "last": Link.from_dict(obj.get("last")) if obj.get("last") is not None else None, - "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None, - "previous": Link.from_dict(obj.get("previous")) if obj.get("previous") is not None else None, - "self": Link.from_dict(obj.get("self")) if obj.get("self") is not None else None + "first": Link.from_dict(obj["first"]) if obj.get("first") is not None else None, + "last": Link.from_dict(obj["last"]) if obj.get("last") is not None else None, + "next": Link.from_dict(obj["next"]) if obj.get("next") is not None else None, + "previous": Link.from_dict(obj["previous"]) if obj.get("previous") is not None else None, + "self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/passkeys_auth_method.py b/passageidentity/openapi_client/models/passkeys_auth_method.py index 302864e..ed826d5 100644 --- a/passageidentity/openapi_client/models/passkeys_auth_method.py +++ b/passageidentity/openapi_client/models/passkeys_auth_method.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictBool -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class PasskeysAuthMethod(BaseModel): """ @@ -33,10 +30,11 @@ class PasskeysAuthMethod(BaseModel): enabled: StrictBool __properties: ClassVar[List[str]] = ["enabled"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -49,7 +47,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PasskeysAuthMethod from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,16 +61,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PasskeysAuthMethod from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/social_connection_type.py b/passageidentity/openapi_client/models/social_connection_type.py new file mode 100644 index 0000000..c29ad18 --- /dev/null +++ b/passageidentity/openapi_client/models/social_connection_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Passage Management API + + Passage's management API to manage your Passage apps and users. + + The version of the OpenAPI document: 1 + Contact: support@passage.id + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SocialConnectionType(str, Enum): + """ + SocialConnectionType + """ + + """ + allowed enum values + """ + APPLE = 'apple' + GITHUB = 'github' + GOOGLE = 'google' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SocialConnectionType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/passageidentity/openapi_client/models/technologies.py b/passageidentity/openapi_client/models/technologies.py index 46d4ee5..1e17ace 100644 --- a/passageidentity/openapi_client/models/technologies.py +++ b/passageidentity/openapi_client/models/technologies.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class Technologies(str, Enum): diff --git a/passageidentity/openapi_client/models/theme_type.py b/passageidentity/openapi_client/models/theme_type.py new file mode 100644 index 0000000..23fc9a6 --- /dev/null +++ b/passageidentity/openapi_client/models/theme_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Passage Management API + + Passage's management API to manage your Passage apps and users. + + The version of the OpenAPI document: 1 + Contact: support@passage.id + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ThemeType(str, Enum): + """ + ThemeType + """ + + """ + allowed enum values + """ + AUTO = 'auto' + LIGHT = 'light' + DARK = 'dark' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ThemeType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/passageidentity/openapi_client/models/ttl_display_unit.py b/passageidentity/openapi_client/models/ttl_display_unit.py index fdb8e0f..c455474 100644 --- a/passageidentity/openapi_client/models/ttl_display_unit.py +++ b/passageidentity/openapi_client/models/ttl_display_unit.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class TtlDisplayUnit(str, Enum): diff --git a/passageidentity/openapi_client/models/update_user_request.py b/passageidentity/openapi_client/models/update_user_request.py index 9e1a0f0..3f365c0 100644 --- a/passageidentity/openapi_client/models/update_user_request.py +++ b/passageidentity/openapi_client/models/update_user_request.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class UpdateUserRequest(BaseModel): """ @@ -32,13 +29,14 @@ class UpdateUserRequest(BaseModel): """ # noqa: E501 email: Optional[StrictStr] = None phone: Optional[StrictStr] = None - user_metadata: Optional[Union[str, Any]] = None + user_metadata: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["email", "phone", "user_metadata"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -51,7 +49,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UpdateUserRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -65,16 +63,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateUserRequest from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/user_event_action.py b/passageidentity/openapi_client/models/user_event_action.py new file mode 100644 index 0000000..5ec83dd --- /dev/null +++ b/passageidentity/openapi_client/models/user_event_action.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Passage Management API + + Passage's management API to manage your Passage apps and users. + + The version of the OpenAPI document: 1 + Contact: support@passage.id + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class UserEventAction(str, Enum): + """ + UserEventAction + """ + + """ + allowed enum values + """ + REGISTER = 'register' + LOGIN = 'login' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserEventAction from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/passageidentity/openapi_client/models/user_event_status.py b/passageidentity/openapi_client/models/user_event_status.py index 8f930f2..cd93a72 100644 --- a/passageidentity/openapi_client/models/user_event_status.py +++ b/passageidentity/openapi_client/models/user_event_status.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class UserEventStatus(str, Enum): diff --git a/passageidentity/openapi_client/models/user_info.py b/passageidentity/openapi_client/models/user_info.py index 554d75a..18574ed 100644 --- a/passageidentity/openapi_client/models/user_info.py +++ b/passageidentity/openapi_client/models/user_info.py @@ -19,18 +19,15 @@ import json from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr -from pydantic import Field +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from passageidentity.openapi_client.models.user_recent_event import UserRecentEvent from passageidentity.openapi_client.models.user_social_connections import UserSocialConnections from passageidentity.openapi_client.models.user_status import UserStatus from passageidentity.openapi_client.models.web_authn_devices import WebAuthnDevices from passageidentity.openapi_client.models.web_authn_type import WebAuthnType -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class UserInfo(BaseModel): """ @@ -39,6 +36,7 @@ class UserInfo(BaseModel): created_at: datetime email: StrictStr email_verified: StrictBool + external_id: StrictStr = Field(description="The external ID of the user. Only set if the user was created in a Flex app.") id: StrictStr last_login_at: datetime login_count: StrictInt @@ -48,16 +46,17 @@ class UserInfo(BaseModel): social_connections: UserSocialConnections status: UserStatus updated_at: datetime - user_metadata: Optional[Union[str, Any]] + user_metadata: Optional[Dict[str, Any]] webauthn: StrictBool webauthn_devices: List[WebAuthnDevices] webauthn_types: List[WebAuthnType] = Field(description="List of credential types that have been used for authentication") - __properties: ClassVar[List[str]] = ["created_at", "email", "email_verified", "id", "last_login_at", "login_count", "phone", "phone_verified", "recent_events", "social_connections", "status", "updated_at", "user_metadata", "webauthn", "webauthn_devices", "webauthn_types"] + __properties: ClassVar[List[str]] = ["created_at", "email", "email_verified", "external_id", "id", "last_login_at", "login_count", "phone", "phone_verified", "recent_events", "social_connections", "status", "updated_at", "user_metadata", "webauthn", "webauthn_devices", "webauthn_types"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -70,7 +69,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -84,18 +83,20 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in recent_events (list) _items = [] if self.recent_events: - for _item in self.recent_events: - if _item: - _items.append(_item.to_dict()) + for _item_recent_events in self.recent_events: + if _item_recent_events: + _items.append(_item_recent_events.to_dict()) _dict['recent_events'] = _items # override the default output from pydantic by calling `to_dict()` of social_connections if self.social_connections: @@ -103,9 +104,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in webauthn_devices (list) _items = [] if self.webauthn_devices: - for _item in self.webauthn_devices: - if _item: - _items.append(_item.to_dict()) + for _item_webauthn_devices in self.webauthn_devices: + if _item_webauthn_devices: + _items.append(_item_webauthn_devices.to_dict()) _dict['webauthn_devices'] = _items # set to None if user_metadata (nullable) is None # and model_fields_set contains the field @@ -115,7 +116,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserInfo from a dict""" if obj is None: return None @@ -127,18 +128,19 @@ def from_dict(cls, obj: Dict) -> Self: "created_at": obj.get("created_at"), "email": obj.get("email"), "email_verified": obj.get("email_verified"), + "external_id": obj.get("external_id"), "id": obj.get("id"), "last_login_at": obj.get("last_login_at"), "login_count": obj.get("login_count"), "phone": obj.get("phone"), "phone_verified": obj.get("phone_verified"), - "recent_events": [UserRecentEvent.from_dict(_item) for _item in obj.get("recent_events")] if obj.get("recent_events") is not None else None, - "social_connections": UserSocialConnections.from_dict(obj.get("social_connections")) if obj.get("social_connections") is not None else None, + "recent_events": [UserRecentEvent.from_dict(_item) for _item in obj["recent_events"]] if obj.get("recent_events") is not None else None, + "social_connections": UserSocialConnections.from_dict(obj["social_connections"]) if obj.get("social_connections") is not None else None, "status": obj.get("status"), "updated_at": obj.get("updated_at"), "user_metadata": obj.get("user_metadata"), "webauthn": obj.get("webauthn"), - "webauthn_devices": [WebAuthnDevices.from_dict(_item) for _item in obj.get("webauthn_devices")] if obj.get("webauthn_devices") is not None else None, + "webauthn_devices": [WebAuthnDevices.from_dict(_item) for _item in obj["webauthn_devices"]] if obj.get("webauthn_devices") is not None else None, "webauthn_types": obj.get("webauthn_types") }) return _obj diff --git a/passageidentity/openapi_client/models/user_metadata_field.py b/passageidentity/openapi_client/models/user_metadata_field.py index f34dbca..4efaefe 100644 --- a/passageidentity/openapi_client/models/user_metadata_field.py +++ b/passageidentity/openapi_client/models/user_metadata_field.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictBool, StrictStr from passageidentity.openapi_client.models.user_metadata_field_type import UserMetadataFieldType -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class UserMetadataField(BaseModel): """ @@ -39,10 +36,11 @@ class UserMetadataField(BaseModel): type: UserMetadataFieldType __properties: ClassVar[List[str]] = ["field_name", "friendly_name", "id", "profile", "registration", "type"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -55,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserMetadataField from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,16 +67,18 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserMetadataField from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/user_metadata_field_type.py b/passageidentity/openapi_client/models/user_metadata_field_type.py index 44349ba..6dff08b 100644 --- a/passageidentity/openapi_client/models/user_metadata_field_type.py +++ b/passageidentity/openapi_client/models/user_metadata_field_type.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class UserMetadataFieldType(str, Enum): diff --git a/passageidentity/openapi_client/models/user_recent_event.py b/passageidentity/openapi_client/models/user_recent_event.py index bba50d3..962268f 100644 --- a/passageidentity/openapi_client/models/user_recent_event.py +++ b/passageidentity/openapi_client/models/user_recent_event.py @@ -19,13 +19,13 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr +from passageidentity.openapi_client.models.social_connection_type import SocialConnectionType +from passageidentity.openapi_client.models.user_event_action import UserEventAction from passageidentity.openapi_client.models.user_event_status import UserEventStatus -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class UserRecentEvent(BaseModel): """ @@ -37,13 +37,17 @@ class UserRecentEvent(BaseModel): ip_addr: StrictStr status: UserEventStatus type: StrictStr - user_agent: StrictStr - __properties: ClassVar[List[str]] = ["created_at", "completed_at", "id", "ip_addr", "status", "type", "user_agent"] + user_agent: StrictStr = Field(description="The raw user agent value from the originating device") + user_agent_display: StrictStr = Field(description="A display-friendly version of the user agent") + action: UserEventAction + social_login_type: Optional[SocialConnectionType] + __properties: ClassVar[List[str]] = ["created_at", "completed_at", "id", "ip_addr", "status", "type", "user_agent", "user_agent_display", "action", "social_login_type"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -56,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserRecentEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,10 +74,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # set to None if completed_at (nullable) is None @@ -81,10 +87,15 @@ def to_dict(self) -> Dict[str, Any]: if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None + # set to None if social_login_type (nullable) is None + # and model_fields_set contains the field + if self.social_login_type is None and "social_login_type" in self.model_fields_set: + _dict['social_login_type'] = None + return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserRecentEvent from a dict""" if obj is None: return None @@ -99,7 +110,10 @@ def from_dict(cls, obj: Dict) -> Self: "ip_addr": obj.get("ip_addr"), "status": obj.get("status"), "type": obj.get("type"), - "user_agent": obj.get("user_agent") + "user_agent": obj.get("user_agent"), + "user_agent_display": obj.get("user_agent_display"), + "action": obj.get("action"), + "social_login_type": obj.get("social_login_type") }) return _obj diff --git a/passageidentity/openapi_client/models/user_response.py b/passageidentity/openapi_client/models/user_response.py index f1e5a98..607cc72 100644 --- a/passageidentity/openapi_client/models/user_response.py +++ b/passageidentity/openapi_client/models/user_response.py @@ -18,14 +18,11 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel from passageidentity.openapi_client.models.user_info import UserInfo -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class UserResponse(BaseModel): """ @@ -34,10 +31,11 @@ class UserResponse(BaseModel): user: UserInfo __properties: ClassVar[List[str]] = ["user"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,7 +48,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,10 +62,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of user @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserResponse from a dict""" if obj is None: return None @@ -85,7 +85,7 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "user": UserInfo.from_dict(obj.get("user")) if obj.get("user") is not None else None + "user": UserInfo.from_dict(obj["user"]) if obj.get("user") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/user_social_connections.py b/passageidentity/openapi_client/models/user_social_connections.py index 0f71c5f..cb69725 100644 --- a/passageidentity/openapi_client/models/user_social_connections.py +++ b/passageidentity/openapi_client/models/user_social_connections.py @@ -18,16 +18,13 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel from passageidentity.openapi_client.models.apple_user_social_connection import AppleUserSocialConnection from passageidentity.openapi_client.models.github_user_social_connection import GithubUserSocialConnection from passageidentity.openapi_client.models.google_user_social_connection import GoogleUserSocialConnection -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class UserSocialConnections(BaseModel): """ @@ -38,10 +35,11 @@ class UserSocialConnections(BaseModel): google: Optional[GoogleUserSocialConnection] = None __properties: ClassVar[List[str]] = ["apple", "github", "google"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserSocialConnections from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,10 +66,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of apple @@ -86,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserSocialConnections from a dict""" if obj is None: return None @@ -95,9 +95,9 @@ def from_dict(cls, obj: Dict) -> Self: return cls.model_validate(obj) _obj = cls.model_validate({ - "apple": AppleUserSocialConnection.from_dict(obj.get("apple")) if obj.get("apple") is not None else None, - "github": GithubUserSocialConnection.from_dict(obj.get("github")) if obj.get("github") is not None else None, - "google": GoogleUserSocialConnection.from_dict(obj.get("google")) if obj.get("google") is not None else None + "apple": AppleUserSocialConnection.from_dict(obj["apple"]) if obj.get("apple") is not None else None, + "github": GithubUserSocialConnection.from_dict(obj["github"]) if obj.get("github") is not None else None, + "google": GoogleUserSocialConnection.from_dict(obj["google"]) if obj.get("google") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/user_status.py b/passageidentity/openapi_client/models/user_status.py index 3b939b0..b8e46f8 100644 --- a/passageidentity/openapi_client/models/user_status.py +++ b/passageidentity/openapi_client/models/user_status.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class UserStatus(str, Enum): diff --git a/passageidentity/openapi_client/models/web_authn_devices.py b/passageidentity/openapi_client/models/web_authn_devices.py index 6285181..5850afa 100644 --- a/passageidentity/openapi_client/models/web_authn_devices.py +++ b/passageidentity/openapi_client/models/web_authn_devices.py @@ -19,15 +19,12 @@ import json from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field from passageidentity.openapi_client.models.web_authn_icons import WebAuthnIcons from passageidentity.openapi_client.models.web_authn_type import WebAuthnType -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class WebAuthnDevices(BaseModel): """ @@ -44,10 +41,11 @@ class WebAuthnDevices(BaseModel): icons: WebAuthnIcons __properties: ClassVar[List[str]] = ["created_at", "cred_id", "friendly_name", "id", "last_login_at", "type", "updated_at", "usage_count", "icons"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WebAuthnDevices from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -74,10 +72,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of icons @@ -86,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WebAuthnDevices from a dict""" if obj is None: return None @@ -103,7 +103,7 @@ def from_dict(cls, obj: Dict) -> Self: "type": obj.get("type"), "updated_at": obj.get("updated_at"), "usage_count": obj.get("usage_count"), - "icons": WebAuthnIcons.from_dict(obj.get("icons")) if obj.get("icons") is not None else None + "icons": WebAuthnIcons.from_dict(obj["icons"]) if obj.get("icons") is not None else None }) return _obj diff --git a/passageidentity/openapi_client/models/web_authn_icons.py b/passageidentity/openapi_client/models/web_authn_icons.py index 4d8d1c6..74770d4 100644 --- a/passageidentity/openapi_client/models/web_authn_icons.py +++ b/passageidentity/openapi_client/models/web_authn_icons.py @@ -18,13 +18,10 @@ import re # noqa: F401 import json - +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Optional, Set +from typing_extensions import Self class WebAuthnIcons(BaseModel): """ @@ -34,10 +31,11 @@ class WebAuthnIcons(BaseModel): dark: Optional[StrictStr] __properties: ClassVar[List[str]] = ["light", "dark"] - model_config = { - "populate_by_name": True, - "validate_assignment": True - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,7 +48,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WebAuthnIcons from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,10 +62,12 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( by_alias=True, - exclude={ - }, + exclude=excluded_fields, exclude_none=True, ) # set to None if light (nullable) is None @@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict) -> Self: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WebAuthnIcons from a dict""" if obj is None: return None diff --git a/passageidentity/openapi_client/models/web_authn_type.py b/passageidentity/openapi_client/models/web_authn_type.py index 0a3c2bc..e66b6ba 100644 --- a/passageidentity/openapi_client/models/web_authn_type.py +++ b/passageidentity/openapi_client/models/web_authn_type.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class WebAuthnType(str, Enum): diff --git a/passageidentity/openapi_client/rest.py b/passageidentity/openapi_client/rest.py index a39ae29..ce85aa5 100644 --- a/passageidentity/openapi_client/rest.py +++ b/passageidentity/openapi_client/rest.py @@ -22,8 +22,20 @@ from passageidentity.openapi_client.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} RESTResponseType = urllib3.HTTPResponse + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + class RESTResponse(io.IOBase): def __init__(self, resp) -> None: @@ -60,41 +72,45 @@ def __init__(self, configuration) -> None: else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = ( + pool_args['assert_hostname'] = ( configuration.assert_hostname ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) + self.pool_manager = urllib3.PoolManager(**pool_args) def request( self, @@ -187,6 +203,8 @@ def request( # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( method, url, @@ -197,18 +215,26 @@ def request( preload_content=False ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( method, url, - body=request_body, + body=body, timeout=timeout, headers=headers, preload_content=False ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided