ory-client 1.9.0__py3-none-any.whl → 1.11.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ory_client/__init__.py +279 -10
- ory_client/api/__init__.py +16 -3
- ory_client/api/courier_api.py +576 -287
- ory_client/api/events_api.py +1147 -576
- ory_client/api/frontend_api.py +8736 -4145
- ory_client/api/identity_api.py +5219 -2605
- ory_client/api/jwk_api.py +1881 -939
- ory_client/api/metadata_api.py +245 -376
- ory_client/api/o_auth2_api.py +7763 -3858
- ory_client/api/oidc_api.py +2071 -1034
- ory_client/api/permission_api.py +1675 -776
- ory_client/api/project_api.py +5314 -2638
- ory_client/api/relationship_api.py +1844 -860
- ory_client/api/wellknown_api.py +250 -131
- ory_client/api_client.py +520 -658
- ory_client/api_response.py +21 -0
- ory_client/configuration.py +65 -75
- ory_client/exceptions.py +73 -32
- ory_client/models/__init__.py +266 -291
- ory_client/models/accept_o_auth2_consent_request.py +118 -0
- ory_client/models/accept_o_auth2_consent_request_session.py +113 -0
- ory_client/models/accept_o_auth2_login_request.py +117 -0
- ory_client/models/active_project_in_console.py +101 -0
- ory_client/models/attribute.py +103 -0
- ory_client/models/attribute_filter.py +115 -0
- ory_client/models/attributes_count_datapoint.py +103 -0
- ory_client/models/authenticator_assurance_level.py +40 -0
- ory_client/models/batch_patch_identities_response.py +109 -0
- ory_client/models/check_opl_syntax_result.py +109 -0
- ory_client/models/check_permission_result.py +101 -0
- ory_client/models/cloud_account.py +105 -0
- ory_client/models/consistency_request_parameters.py +111 -0
- ory_client/models/continue_with.py +214 -0
- ory_client/models/continue_with_recovery_ui.py +114 -0
- ory_client/models/continue_with_recovery_ui_flow.py +103 -0
- ory_client/models/continue_with_set_ory_session_token.py +110 -0
- ory_client/models/continue_with_settings_ui.py +114 -0
- ory_client/models/continue_with_settings_ui_flow.py +101 -0
- ory_client/models/continue_with_verification_ui.py +114 -0
- ory_client/models/continue_with_verification_ui_flow.py +105 -0
- ory_client/models/courier_message_status.py +40 -0
- ory_client/models/courier_message_type.py +38 -0
- ory_client/models/create_custom_domain_body.py +109 -0
- ory_client/models/create_event_stream_body.py +112 -0
- ory_client/models/create_identity_body.py +155 -0
- ory_client/models/create_invite_response.py +114 -0
- ory_client/models/create_json_web_key_set.py +105 -0
- ory_client/models/create_project_api_key_request.py +101 -0
- ory_client/models/create_project_body.py +112 -0
- ory_client/models/create_project_branding.py +115 -0
- ory_client/models/create_project_member_invite_body.py +101 -0
- ory_client/models/create_project_normalized_payload.py +685 -0
- ory_client/models/create_recovery_code_for_identity_body.py +114 -0
- ory_client/models/create_recovery_link_for_identity_body.py +114 -0
- ory_client/models/create_relationship_body.py +113 -0
- ory_client/models/create_subscription_body.py +126 -0
- ory_client/models/create_subscription_common.py +124 -0
- ory_client/models/create_verifiable_credential_request_body.py +109 -0
- ory_client/models/create_workspace_member_invite_body.py +101 -0
- ory_client/models/create_workspace_payload.py +101 -0
- ory_client/models/create_workspace_subscription_body.py +124 -0
- ory_client/models/credential_supported_draft00.py +107 -0
- ory_client/models/custom_domain.py +132 -0
- ory_client/models/delete_my_sessions_count.py +101 -0
- ory_client/models/email_template_data.py +107 -0
- ory_client/models/email_template_data_body.py +103 -0
- ory_client/models/error_authenticator_assurance_level_not_satisfied.py +107 -0
- ory_client/models/error_browser_location_change_required.py +107 -0
- ory_client/models/error_flow_replaced.py +107 -0
- ory_client/models/error_generic.py +105 -0
- ory_client/models/error_o_auth2.py +109 -0
- ory_client/models/event_stream.py +112 -0
- ory_client/models/expanded_permission_tree.py +125 -0
- ory_client/models/flow_error.py +108 -0
- ory_client/models/generic_error.py +126 -0
- ory_client/models/generic_error_content.py +109 -0
- ory_client/models/generic_usage.py +103 -0
- ory_client/models/get_attributes_count_response.py +111 -0
- ory_client/models/get_managed_identity_schema_location.py +101 -0
- ory_client/models/get_metrics_event_attributes_response.py +103 -0
- ory_client/models/get_metrics_event_types_response.py +103 -0
- ory_client/models/get_organization_response.py +105 -0
- ory_client/models/get_project_events_body.py +120 -0
- ory_client/models/get_project_events_response.py +115 -0
- ory_client/models/get_project_metrics_response.py +111 -0
- ory_client/models/get_session_activity_response.py +111 -0
- ory_client/models/get_version200_response.py +101 -0
- ory_client/models/health_not_ready_status.py +101 -0
- ory_client/models/health_status.py +101 -0
- ory_client/models/identity.py +187 -0
- ory_client/models/identity_credentials.py +122 -0
- ory_client/models/identity_credentials_code.py +109 -0
- ory_client/models/identity_credentials_oidc.py +109 -0
- ory_client/models/identity_credentials_oidc_provider.py +111 -0
- ory_client/models/identity_credentials_password.py +101 -0
- ory_client/models/identity_patch.py +107 -0
- ory_client/models/identity_patch_response.py +115 -0
- ory_client/models/identity_schema_container.py +103 -0
- ory_client/models/identity_schema_preset.py +103 -0
- ory_client/models/identity_with_credentials.py +111 -0
- ory_client/models/identity_with_credentials_oidc.py +105 -0
- ory_client/models/identity_with_credentials_oidc_config.py +115 -0
- ory_client/models/identity_with_credentials_oidc_config_provider.py +103 -0
- ory_client/models/identity_with_credentials_password.py +105 -0
- ory_client/models/identity_with_credentials_password_config.py +103 -0
- ory_client/models/internal_get_project_branding_body.py +101 -0
- ory_client/models/internal_is_ax_welcome_screen_enabled_for_project_body.py +103 -0
- ory_client/models/internal_is_owner_for_project_by_slug_body.py +114 -0
- ory_client/models/internal_is_owner_for_project_by_slug_response.py +101 -0
- ory_client/models/introspected_o_auth2_token.py +127 -0
- ory_client/models/is_owner_for_project_by_slug.py +103 -0
- ory_client/models/json_patch.py +119 -0
- ory_client/models/json_web_key.py +133 -0
- ory_client/models/json_web_key_set.py +109 -0
- ory_client/models/keto_namespace.py +103 -0
- ory_client/models/list_event_streams.py +109 -0
- ory_client/models/list_my_workspaces_response.py +113 -0
- ory_client/models/list_organizations_response.py +109 -0
- ory_client/models/list_workspace_projects_response.py +113 -0
- ory_client/models/login_flow.py +165 -0
- ory_client/models/login_flow_state.py +39 -0
- ory_client/models/logout_flow.py +103 -0
- ory_client/models/managed_identity_schema.py +120 -0
- ory_client/models/managed_identity_schema_validation_result.py +103 -0
- ory_client/models/member_invite.py +148 -0
- ory_client/models/message.py +141 -0
- ory_client/models/message_dispatch.py +119 -0
- ory_client/models/metrics_datapoint.py +104 -0
- ory_client/models/migration_options.py +117 -0
- ory_client/models/namespace.py +101 -0
- ory_client/models/needs_privileged_session_error.py +107 -0
- ory_client/models/normalized_project.py +171 -0
- ory_client/models/normalized_project_revision.py +674 -0
- ory_client/models/normalized_project_revision_courier_channel.py +145 -0
- ory_client/models/normalized_project_revision_hook.py +140 -0
- ory_client/models/normalized_project_revision_identity_schema.py +133 -0
- ory_client/models/normalized_project_revision_third_party_provider.py +187 -0
- ory_client/models/normalized_project_revision_tokenizer_template.py +133 -0
- ory_client/models/o_auth2_client.py +352 -0
- ory_client/models/o_auth2_client_token_lifespans.py +270 -0
- ory_client/models/o_auth2_consent_request.py +133 -0
- ory_client/models/o_auth2_consent_request_open_id_connect_context.py +109 -0
- ory_client/models/o_auth2_consent_session.py +130 -0
- ory_client/models/o_auth2_consent_session_expires_at.py +110 -0
- ory_client/models/o_auth2_login_request.py +125 -0
- ory_client/models/o_auth2_logout_request.py +115 -0
- ory_client/models/o_auth2_redirect_to.py +101 -0
- ory_client/models/o_auth2_token_exchange.py +111 -0
- ory_client/models/oidc_configuration.py +169 -0
- ory_client/models/oidc_user_info.py +137 -0
- ory_client/models/organization.py +116 -0
- ory_client/models/organization_body.py +103 -0
- ory_client/models/pagination.py +104 -0
- ory_client/models/pagination_headers.py +103 -0
- ory_client/models/parse_error.py +112 -0
- ory_client/models/patch_identities_body.py +109 -0
- ory_client/models/perform_native_logout_body.py +101 -0
- ory_client/models/permissions_on_workpace_response.py +101 -0
- ory_client/models/plan.py +103 -0
- ory_client/models/plan_details.py +128 -0
- ory_client/models/post_check_permission_body.py +113 -0
- ory_client/models/post_check_permission_or_error_body.py +113 -0
- ory_client/models/project.py +148 -0
- ory_client/models/project_api_key.py +126 -0
- ory_client/models/project_branding.py +129 -0
- ory_client/models/project_branding_colors.py +157 -0
- ory_client/models/project_branding_theme.py +182 -0
- ory_client/models/project_cors.py +103 -0
- ory_client/models/project_events_datapoint.py +114 -0
- ory_client/models/project_host.py +107 -0
- ory_client/models/project_member.py +107 -0
- ory_client/models/project_metadata.py +161 -0
- ory_client/models/project_service_identity.py +101 -0
- ory_client/models/project_service_o_auth2.py +101 -0
- ory_client/models/project_service_permission.py +101 -0
- ory_client/models/project_services.py +117 -0
- ory_client/models/quota_usage.py +118 -0
- ory_client/models/recovery_code_for_identity.py +106 -0
- ory_client/models/recovery_flow.py +139 -0
- ory_client/models/recovery_flow_state.py +39 -0
- ory_client/models/recovery_identity_address.py +110 -0
- ory_client/models/recovery_link_for_identity.py +104 -0
- ory_client/models/registration_flow.py +156 -0
- ory_client/models/registration_flow_state.py +39 -0
- ory_client/models/reject_o_auth2_request.py +109 -0
- ory_client/models/relation_query.py +113 -0
- ory_client/models/relationship.py +113 -0
- ory_client/models/relationship_namespaces.py +109 -0
- ory_client/models/relationship_patch.py +117 -0
- ory_client/models/relationships.py +111 -0
- ory_client/models/rfc6749_error_json.py +109 -0
- ory_client/models/schema_patch.py +103 -0
- ory_client/models/self_service_flow_expired_error.py +112 -0
- ory_client/models/session.py +141 -0
- ory_client/models/session_activity_datapoint.py +105 -0
- ory_client/models/session_authentication_method.py +121 -0
- ory_client/models/session_device.py +107 -0
- ory_client/models/set_active_project_in_console_body.py +101 -0
- ory_client/models/set_custom_domain_body.py +109 -0
- ory_client/models/set_event_stream_body.py +112 -0
- ory_client/models/set_project.py +118 -0
- ory_client/models/set_project_branding_theme_body.py +115 -0
- ory_client/models/settings_flow.py +145 -0
- ory_client/models/settings_flow_state.py +38 -0
- ory_client/models/source_position.py +103 -0
- ory_client/models/subject_set.py +105 -0
- ory_client/models/subscription.py +179 -0
- ory_client/models/successful_code_exchange_response.py +107 -0
- ory_client/models/successful_native_login.py +117 -0
- ory_client/models/successful_native_registration.py +123 -0
- ory_client/models/successful_project_update.py +115 -0
- ory_client/models/token_pagination.py +104 -0
- ory_client/models/token_pagination_headers.py +103 -0
- ory_client/models/token_pagination_request_parameters.py +104 -0
- ory_client/models/token_pagination_response_headers.py +103 -0
- ory_client/models/trust_o_auth2_jwt_grant_issuer.py +116 -0
- ory_client/models/trusted_o_auth2_jwt_grant_issuer.py +120 -0
- ory_client/models/trusted_o_auth2_jwt_grant_json_web_key.py +103 -0
- ory_client/models/ui_container.py +123 -0
- ory_client/models/ui_node.py +139 -0
- ory_client/models/ui_node_anchor_attributes.py +118 -0
- ory_client/models/ui_node_attributes.py +238 -0
- ory_client/models/ui_node_image_attributes.py +116 -0
- ory_client/models/ui_node_input_attributes.py +154 -0
- ory_client/models/ui_node_meta.py +105 -0
- ory_client/models/ui_node_script_attributes.py +124 -0
- ory_client/models/ui_node_text_attributes.py +116 -0
- ory_client/models/ui_text.py +114 -0
- ory_client/models/update_identity_body.py +132 -0
- ory_client/models/update_login_flow_body.py +286 -0
- ory_client/models/update_login_flow_with_code_method.py +111 -0
- ory_client/models/update_login_flow_with_lookup_secret_method.py +105 -0
- ory_client/models/update_login_flow_with_oidc_method.py +115 -0
- ory_client/models/update_login_flow_with_passkey_method.py +105 -0
- ory_client/models/update_login_flow_with_password_method.py +111 -0
- ory_client/models/update_login_flow_with_totp_method.py +107 -0
- ory_client/models/update_login_flow_with_web_authn_method.py +109 -0
- ory_client/models/update_recovery_flow_body.py +166 -0
- ory_client/models/update_recovery_flow_with_code_method.py +116 -0
- ory_client/models/update_recovery_flow_with_link_method.py +114 -0
- ory_client/models/update_registration_flow_body.py +238 -0
- ory_client/models/update_registration_flow_with_code_method.py +111 -0
- ory_client/models/update_registration_flow_with_oidc_method.py +115 -0
- ory_client/models/update_registration_flow_with_passkey_method.py +109 -0
- ory_client/models/update_registration_flow_with_password_method.py +109 -0
- ory_client/models/update_registration_flow_with_profile_method.py +109 -0
- ory_client/models/update_registration_flow_with_web_authn_method.py +111 -0
- ory_client/models/update_settings_flow_body.py +286 -0
- ory_client/models/update_settings_flow_with_lookup_method.py +113 -0
- ory_client/models/update_settings_flow_with_oidc_method.py +113 -0
- ory_client/models/update_settings_flow_with_passkey_method.py +107 -0
- ory_client/models/update_settings_flow_with_password_method.py +107 -0
- ory_client/models/update_settings_flow_with_profile_method.py +107 -0
- ory_client/models/update_settings_flow_with_totp_method.py +109 -0
- ory_client/models/update_settings_flow_with_web_authn_method.py +111 -0
- ory_client/models/update_subscription_body.py +112 -0
- ory_client/models/update_verification_flow_body.py +166 -0
- ory_client/models/update_verification_flow_with_code_method.py +116 -0
- ory_client/models/update_verification_flow_with_link_method.py +114 -0
- ory_client/models/update_workspace_payload.py +101 -0
- ory_client/models/usage.py +105 -0
- ory_client/models/verifiable_credential_priming_response.py +115 -0
- ory_client/models/verifiable_credential_proof.py +103 -0
- ory_client/models/verifiable_credential_response.py +103 -0
- ory_client/models/verifiable_identity_address.py +123 -0
- ory_client/models/verification_flow.py +129 -0
- ory_client/models/verification_flow_state.py +39 -0
- ory_client/models/version.py +101 -0
- ory_client/models/warning.py +103 -0
- ory_client/models/workspace.py +115 -0
- ory_client/models/workspace_meta.py +122 -0
- ory_client/py.typed +0 -0
- ory_client/rest.py +139 -236
- {ory_client-1.9.0.dist-info → ory_client-1.11.7.dist-info}/METADATA +6 -4
- ory_client-1.11.7.dist-info/RECORD +278 -0
- ory_client/apis/__init__.py +0 -28
- ory_client/model/__init__.py +0 -5
- ory_client/model/accept_o_auth2_consent_request.py +0 -296
- ory_client/model/accept_o_auth2_consent_request_session.py +0 -268
- ory_client/model/accept_o_auth2_login_request.py +0 -308
- ory_client/model/active_project_in_console.py +0 -264
- ory_client/model/attribute.py +0 -268
- ory_client/model/attribute_filter.py +0 -282
- ory_client/model/attributes_count_datapoint.py +0 -276
- ory_client/model/authenticator_assurance_level.py +0 -293
- ory_client/model/batch_patch_identities_response.py +0 -270
- ory_client/model/check_opl_syntax_result.py +0 -270
- ory_client/model/check_permission_result.py +0 -270
- ory_client/model/cloud_account.py +0 -282
- ory_client/model/consistency_request_parameters.py +0 -269
- ory_client/model/continue_with.py +0 -356
- ory_client/model/continue_with_recovery_ui.py +0 -287
- ory_client/model/continue_with_recovery_ui_flow.py +0 -274
- ory_client/model/continue_with_set_ory_session_token.py +0 -281
- ory_client/model/continue_with_settings_ui.py +0 -287
- ory_client/model/continue_with_settings_ui_flow.py +0 -270
- ory_client/model/continue_with_verification_ui.py +0 -287
- ory_client/model/continue_with_verification_ui_flow.py +0 -280
- ory_client/model/courier_message_status.py +0 -293
- ory_client/model/courier_message_type.py +0 -291
- ory_client/model/create_custom_domain_body.py +0 -280
- ory_client/model/create_event_stream_body.py +0 -287
- ory_client/model/create_identity_body.py +0 -314
- ory_client/model/create_invite_response.py +0 -282
- ory_client/model/create_json_web_key_set.py +0 -282
- ory_client/model/create_member_invite_response.py +0 -287
- ory_client/model/create_project_api_key_request.py +0 -270
- ory_client/model/create_project_body.py +0 -284
- ory_client/model/create_project_branding.py +0 -290
- ory_client/model/create_project_member_invite_body.py +0 -264
- ory_client/model/create_project_normalized_payload.py +0 -1119
- ory_client/model/create_recovery_code_for_identity_body.py +0 -279
- ory_client/model/create_recovery_link_for_identity_body.py +0 -279
- ory_client/model/create_relationship_body.py +0 -286
- ory_client/model/create_subscription_body.py +0 -298
- ory_client/model/create_subscription_common.py +0 -292
- ory_client/model/create_verifiable_credential_request_body.py +0 -278
- ory_client/model/create_workspace_member_invite_body.py +0 -264
- ory_client/model/create_workspace_payload.py +0 -270
- ory_client/model/create_workspace_subscription_body.py +0 -292
- ory_client/model/credential_supported_draft00.py +0 -276
- ory_client/model/custom_domain.py +0 -334
- ory_client/model/delete_my_sessions_count.py +0 -264
- ory_client/model/email_template_data.py +0 -282
- ory_client/model/email_template_data_body.py +0 -276
- ory_client/model/error_authenticator_assurance_level_not_satisfied.py +0 -274
- ory_client/model/error_browser_location_change_required.py +0 -274
- ory_client/model/error_flow_replaced.py +0 -274
- ory_client/model/error_generic.py +0 -276
- ory_client/model/error_o_auth2.py +0 -280
- ory_client/model/event_stream.py +0 -284
- ory_client/model/expanded_permission_tree.py +0 -294
- ory_client/model/flow_error.py +0 -282
- ory_client/model/generic_error.py +0 -308
- ory_client/model/generic_error_content.py +0 -280
- ory_client/model/generic_usage.py +0 -276
- ory_client/model/get_attributes_count_response.py +0 -273
- ory_client/model/get_managed_identity_schema_location.py +0 -264
- ory_client/model/get_metrics_event_attributes_response.py +0 -267
- ory_client/model/get_metrics_event_types_response.py +0 -267
- ory_client/model/get_organization_response.py +0 -276
- ory_client/model/get_project_events_body.py +0 -298
- ory_client/model/get_project_events_response.py +0 -278
- ory_client/model/get_project_metrics_response.py +0 -273
- ory_client/model/get_session_activity_response.py +0 -273
- ory_client/model/get_version200_response.py +0 -270
- ory_client/model/health_not_ready_status.py +0 -264
- ory_client/model/health_status.py +0 -264
- ory_client/model/identity.py +0 -342
- ory_client/model/identity_credentials.py +0 -294
- ory_client/model/identity_credentials_code.py +0 -268
- ory_client/model/identity_credentials_oidc.py +0 -270
- ory_client/model/identity_credentials_oidc_provider.py +0 -284
- ory_client/model/identity_credentials_password.py +0 -264
- ory_client/model/identity_patch.py +0 -274
- ory_client/model/identity_patch_response.py +0 -275
- ory_client/model/identity_schema_container.py +0 -268
- ory_client/model/identity_schema_preset.py +0 -276
- ory_client/model/identity_schema_presets.py +0 -292
- ory_client/model/identity_schemas.py +0 -292
- ory_client/model/identity_with_credentials.py +0 -276
- ory_client/model/identity_with_credentials_oidc.py +0 -270
- ory_client/model/identity_with_credentials_oidc_config.py +0 -276
- ory_client/model/identity_with_credentials_oidc_config_provider.py +0 -276
- ory_client/model/identity_with_credentials_password.py +0 -270
- ory_client/model/identity_with_credentials_password_config.py +0 -268
- ory_client/model/internal_get_project_branding_body.py +0 -264
- ory_client/model/internal_is_ax_welcome_screen_enabled_for_project_body.py +0 -276
- ory_client/model/internal_is_owner_for_project_by_slug_body.py +0 -290
- ory_client/model/internal_is_owner_for_project_by_slug_response.py +0 -270
- ory_client/model/introspected_o_auth2_token.py +0 -322
- ory_client/model/is_owner_for_project_by_slug.py +0 -276
- ory_client/model/is_ready200_response.py +0 -270
- ory_client/model/is_ready503_response.py +0 -270
- ory_client/model/json_patch.py +0 -292
- ory_client/model/json_patch_document.py +0 -292
- ory_client/model/json_web_key.py +0 -340
- ory_client/model/json_web_key_set.py +0 -270
- ory_client/model/keto_namespace.py +0 -268
- ory_client/model/keto_namespaces.py +0 -292
- ory_client/model/list_custom_domains.py +0 -292
- ory_client/model/list_event_streams.py +0 -270
- ory_client/model/list_my_workspaces_response.py +0 -288
- ory_client/model/list_organizations_response.py +0 -276
- ory_client/model/list_workspace_projects_response.py +0 -288
- ory_client/model/login_flow.py +0 -370
- ory_client/model/login_flow_state.py +0 -292
- ory_client/model/logout_flow.py +0 -276
- ory_client/model/managed_identity_schema.py +0 -300
- ory_client/model/managed_identity_schema_validation_result.py +0 -268
- ory_client/model/managed_identity_schemas.py +0 -292
- ory_client/model/member_invite.py +0 -321
- ory_client/model/member_invites.py +0 -292
- ory_client/model/message.py +0 -355
- ory_client/model/message_dispatch.py +0 -302
- ory_client/model/metrics_datapoint.py +0 -276
- ory_client/model/migration_options.py +0 -284
- ory_client/model/namespace.py +0 -264
- ory_client/model/needs_privileged_session_error.py +0 -280
- ory_client/model/normalized_project.py +0 -337
- ory_client/model/normalized_project_revision.py +0 -1105
- ory_client/model/normalized_project_revision_courier_channel.py +0 -328
- ory_client/model/normalized_project_revision_hook.py +0 -342
- ory_client/model/normalized_project_revision_identity_schema.py +0 -308
- ory_client/model/normalized_project_revision_identity_schemas.py +0 -292
- ory_client/model/normalized_project_revision_third_party_provider.py +0 -368
- ory_client/model/normalized_project_revision_tokenizer_template.py +0 -300
- ory_client/model/normalized_project_revision_tokenizer_templates.py +0 -292
- ory_client/model/normalized_projects.py +0 -292
- ory_client/model/null_duration.py +0 -292
- ory_client/model/o_auth2_client.py +0 -460
- ory_client/model/o_auth2_client_token_lifespans.py +0 -306
- ory_client/model/o_auth2_consent_request.py +0 -328
- ory_client/model/o_auth2_consent_request_open_id_connect_context.py +0 -280
- ory_client/model/o_auth2_consent_session.py +0 -308
- ory_client/model/o_auth2_consent_session_expires_at.py +0 -280
- ory_client/model/o_auth2_consent_sessions.py +0 -292
- ory_client/model/o_auth2_login_request.py +0 -320
- ory_client/model/o_auth2_logout_request.py +0 -290
- ory_client/model/o_auth2_redirect_to.py +0 -270
- ory_client/model/o_auth2_token_exchange.py +0 -284
- ory_client/model/oidc_configuration.py +0 -412
- ory_client/model/oidc_user_info.py +0 -336
- ory_client/model/organization.py +0 -302
- ory_client/model/organization_body.py +0 -268
- ory_client/model/pagination.py +0 -274
- ory_client/model/pagination_headers.py +0 -268
- ory_client/model/parse_error.py +0 -278
- ory_client/model/patch_identities_body.py +0 -270
- ory_client/model/perform_native_logout_body.py +0 -270
- ory_client/model/permissions_on_project.py +0 -260
- ory_client/model/permissions_on_workpace_response.py +0 -264
- ory_client/model/plan.py +0 -276
- ory_client/model/plan_details.py +0 -316
- ory_client/model/plan_features.py +0 -266
- ory_client/model/plans.py +0 -287
- ory_client/model/post_check_permission_body.py +0 -286
- ory_client/model/post_check_permission_or_error_body.py +0 -286
- ory_client/model/pricing.py +0 -292
- ory_client/model/project.py +0 -319
- ory_client/model/project_api_key.py +0 -298
- ory_client/model/project_api_keys.py +0 -292
- ory_client/model/project_branding.py +0 -303
- ory_client/model/project_branding_colors.py +0 -376
- ory_client/model/project_branding_theme.py +0 -421
- ory_client/model/project_branding_themes.py +0 -292
- ory_client/model/project_cors.py +0 -268
- ory_client/model/project_events_datapoint.py +0 -288
- ory_client/model/project_host.py +0 -281
- ory_client/model/project_member.py +0 -288
- ory_client/model/project_members.py +0 -292
- ory_client/model/project_metadata.py +0 -337
- ory_client/model/project_metadata_list.py +0 -292
- ory_client/model/project_revision_hooks.py +0 -292
- ory_client/model/project_revision_identity_schemas.py +0 -292
- ory_client/model/project_revision_third_party_login_providers.py +0 -292
- ory_client/model/project_revisions.py +0 -292
- ory_client/model/project_service_identity.py +0 -270
- ory_client/model/project_service_o_auth2.py +0 -270
- ory_client/model/project_service_permission.py +0 -270
- ory_client/model/project_services.py +0 -282
- ory_client/model/projects.py +0 -292
- ory_client/model/quota_usage.py +0 -328
- ory_client/model/recovery_code_for_identity.py +0 -280
- ory_client/model/recovery_flow.py +0 -330
- ory_client/model/recovery_flow_state.py +0 -292
- ory_client/model/recovery_identity_address.py +0 -290
- ory_client/model/recovery_link_for_identity.py +0 -274
- ory_client/model/registration_flow.py +0 -352
- ory_client/model/registration_flow_state.py +0 -292
- ory_client/model/reject_o_auth2_request.py +0 -280
- ory_client/model/relation_query.py +0 -286
- ory_client/model/relationship.py +0 -296
- ory_client/model/relationship_namespaces.py +0 -270
- ory_client/model/relationship_patch.py +0 -278
- ory_client/model/relationships.py +0 -274
- ory_client/model/revision_courier_channels.py +0 -292
- ory_client/model/rfc6749_error_json.py +0 -280
- ory_client/model/schema_patch.py +0 -276
- ory_client/model/self_service_flow_expired_error.py +0 -282
- ory_client/model/session.py +0 -318
- ory_client/model/session_activity_datapoint.py +0 -282
- ory_client/model/session_authentication_method.py +0 -297
- ory_client/model/session_authentication_methods.py +0 -292
- ory_client/model/session_device.py +0 -282
- ory_client/model/set_active_project_in_console_body.py +0 -270
- ory_client/model/set_custom_domain_body.py +0 -280
- ory_client/model/set_event_stream_body.py +0 -287
- ory_client/model/set_project.py +0 -296
- ory_client/model/set_project_branding_theme_body.py +0 -290
- ory_client/model/settings_flow.py +0 -338
- ory_client/model/settings_flow_state.py +0 -291
- ory_client/model/source_position.py +0 -268
- ory_client/model/string_slice_json_format.py +0 -287
- ory_client/model/subject_set.py +0 -282
- ory_client/model/subscription.py +0 -350
- ory_client/model/successful_code_exchange_response.py +0 -280
- ory_client/model/successful_native_login.py +0 -280
- ory_client/model/successful_native_registration.py +0 -292
- ory_client/model/successful_project_update.py +0 -284
- ory_client/model/token_pagination.py +0 -274
- ory_client/model/token_pagination_headers.py +0 -268
- ory_client/model/token_pagination_request_parameters.py +0 -274
- ory_client/model/token_pagination_response_headers.py +0 -268
- ory_client/model/trust_o_auth2_jwt_grant_issuer.py +0 -302
- ory_client/model/trusted_o_auth2_jwt_grant_issuer.py +0 -298
- ory_client/model/trusted_o_auth2_jwt_grant_issuers.py +0 -292
- ory_client/model/trusted_o_auth2_jwt_grant_json_web_key.py +0 -268
- ory_client/model/ui_container.py +0 -294
- ory_client/model/ui_node.py +0 -322
- ory_client/model/ui_node_anchor_attributes.py +0 -294
- ory_client/model/ui_node_attributes.py +0 -440
- ory_client/model/ui_node_image_attributes.py +0 -294
- ory_client/model/ui_node_input_attributes.py +0 -340
- ory_client/model/ui_node_meta.py +0 -270
- ory_client/model/ui_node_script_attributes.py +0 -318
- ory_client/model/ui_node_text_attributes.py +0 -288
- ory_client/model/ui_nodes.py +0 -292
- ory_client/model/ui_text.py +0 -291
- ory_client/model/ui_texts.py +0 -292
- ory_client/model/update_identity_body.py +0 -304
- ory_client/model/update_login_flow_body.py +0 -411
- ory_client/model/update_login_flow_with_code_method.py +0 -292
- ory_client/model/update_login_flow_with_lookup_secret_method.py +0 -280
- ory_client/model/update_login_flow_with_oidc_method.py +0 -300
- ory_client/model/update_login_flow_with_password_method.py +0 -294
- ory_client/model/update_login_flow_with_totp_method.py +0 -284
- ory_client/model/update_login_flow_with_web_authn_method.py +0 -288
- ory_client/model/update_recovery_flow_body.py +0 -351
- ory_client/model/update_recovery_flow_with_code_method.py +0 -290
- ory_client/model/update_recovery_flow_with_link_method.py +0 -288
- ory_client/model/update_registration_flow_body.py +0 -389
- ory_client/model/update_registration_flow_with_code_method.py +0 -292
- ory_client/model/update_registration_flow_with_oidc_method.py +0 -300
- ory_client/model/update_registration_flow_with_password_method.py +0 -290
- ory_client/model/update_registration_flow_with_web_authn_method.py +0 -292
- ory_client/model/update_settings_flow_body.py +0 -419
- ory_client/model/update_settings_flow_with_lookup_method.py +0 -294
- ory_client/model/update_settings_flow_with_oidc_method.py +0 -294
- ory_client/model/update_settings_flow_with_password_method.py +0 -284
- ory_client/model/update_settings_flow_with_profile_method.py +0 -284
- ory_client/model/update_settings_flow_with_totp_method.py +0 -286
- ory_client/model/update_settings_flow_with_web_authn_method.py +0 -290
- ory_client/model/update_subscription_body.py +0 -284
- ory_client/model/update_verification_flow_body.py +0 -351
- ory_client/model/update_verification_flow_with_code_method.py +0 -290
- ory_client/model/update_verification_flow_with_link_method.py +0 -288
- ory_client/model/update_workspace_payload.py +0 -270
- ory_client/model/usage.py +0 -270
- ory_client/model/verifiable_credential_priming_response.py +0 -292
- ory_client/model/verifiable_credential_proof.py +0 -268
- ory_client/model/verifiable_credential_response.py +0 -268
- ory_client/model/verifiable_identity_address.py +0 -308
- ory_client/model/verification_flow.py +0 -318
- ory_client/model/verification_flow_state.py +0 -292
- ory_client/model/version.py +0 -264
- ory_client/model/warning.py +0 -268
- ory_client/model/workspace.py +0 -292
- ory_client/model/workspace_meta.py +0 -296
- ory_client/model/workspaces.py +0 -292
- ory_client/model_utils.py +0 -2059
- ory_client-1.9.0.dist-info/RECORD +0 -310
- {ory_client-1.9.0.dist-info → ory_client-1.11.7.dist-info}/LICENSE +0 -0
- {ory_client-1.9.0.dist-info → ory_client-1.11.7.dist-info}/WHEEL +0 -0
- {ory_client-1.9.0.dist-info → ory_client-1.11.7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
"""API response object."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from typing import Optional, Generic, Mapping, TypeVar
|
5
|
+
from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
6
|
+
|
7
|
+
T = TypeVar("T")
|
8
|
+
|
9
|
+
class ApiResponse(BaseModel, Generic[T]):
|
10
|
+
"""
|
11
|
+
API response object
|
12
|
+
"""
|
13
|
+
|
14
|
+
status_code: StrictInt = Field(description="HTTP status code")
|
15
|
+
headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
|
16
|
+
data: T = Field(description="Deserialized data given the data type")
|
17
|
+
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
18
|
+
|
19
|
+
model_config = {
|
20
|
+
"arbitrary_types_allowed": True
|
21
|
+
}
|
ory_client/configuration.py
CHANGED
@@ -1,23 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
"""
|
2
4
|
Ory APIs
|
3
5
|
|
4
|
-
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
6
|
+
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
7
|
|
6
|
-
The version of the OpenAPI document: v1.
|
8
|
+
The version of the OpenAPI document: v1.11.7
|
7
9
|
Contact: support@ory.sh
|
8
|
-
Generated by
|
9
|
-
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
10
14
|
|
11
15
|
|
12
16
|
import copy
|
13
17
|
import logging
|
18
|
+
from logging import FileHandler
|
14
19
|
import multiprocessing
|
15
20
|
import sys
|
21
|
+
from typing import Optional
|
16
22
|
import urllib3
|
17
23
|
|
18
|
-
|
19
|
-
from ory_client.exceptions import ApiValueError
|
20
|
-
|
24
|
+
import http.client as httplib
|
21
25
|
|
22
26
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
23
27
|
'multipleOf', 'maximum', 'exclusiveMaximum',
|
@@ -25,46 +29,20 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
25
29
|
'minLength', 'pattern', 'maxItems', 'minItems'
|
26
30
|
}
|
27
31
|
|
28
|
-
class Configuration
|
29
|
-
"""
|
30
|
-
|
31
|
-
Ref: https://openapi-generator.tech
|
32
|
-
Do not edit the class manually.
|
32
|
+
class Configuration:
|
33
|
+
"""This class contains various settings of the API client.
|
33
34
|
|
34
|
-
:param host: Base url
|
35
|
+
:param host: Base url.
|
35
36
|
:param api_key: Dict to store API key(s).
|
36
37
|
Each entry in the dict specifies an API key.
|
37
38
|
The dict key is the name of the security scheme in the OAS specification.
|
38
39
|
The dict value is the API key secret.
|
39
|
-
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
|
40
|
+
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
40
41
|
The dict key is the name of the security scheme in the OAS specification.
|
41
42
|
The dict value is an API key prefix when generating the auth data.
|
42
|
-
:param username: Username for HTTP basic authentication
|
43
|
-
:param password: Password for HTTP basic authentication
|
44
|
-
:param
|
45
|
-
unknown properties. A server may send a response that includes additional
|
46
|
-
properties that are not known by the client in the following scenarios:
|
47
|
-
1. The OpenAPI document is incomplete, i.e. it does not match the server
|
48
|
-
implementation.
|
49
|
-
2. The client was generated using an older version of the OpenAPI document
|
50
|
-
and the server has been upgraded since then.
|
51
|
-
If a schema in the OpenAPI document defines the additionalProperties attribute,
|
52
|
-
then all undeclared properties received by the server are injected into the
|
53
|
-
additional properties map. In that case, there are undeclared properties, and
|
54
|
-
nothing to discard.
|
55
|
-
:param disabled_client_side_validations (string): Comma-separated list of
|
56
|
-
JSON schema validation keywords to disable JSON schema structural validation
|
57
|
-
rules. The following keywords may be specified: multipleOf, maximum,
|
58
|
-
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
|
59
|
-
maxItems, minItems.
|
60
|
-
By default, the validation is performed for data generated locally by the client
|
61
|
-
and data received from the server, independent of any validation performed by
|
62
|
-
the server side. If the input data does not satisfy the JSON schema validation
|
63
|
-
rules specified in the OpenAPI document, an exception is raised.
|
64
|
-
If disabled_client_side_validations is set, structural validation is
|
65
|
-
disabled. This can be useful to troubleshoot data validation problem, such as
|
66
|
-
when the OpenAPI document validation rules do not match the actual API data
|
67
|
-
received by the server.
|
43
|
+
:param username: Username for HTTP basic authentication.
|
44
|
+
:param password: Password for HTTP basic authentication.
|
45
|
+
:param access_token: Access token.
|
68
46
|
:param server_index: Index to servers configuration.
|
69
47
|
:param server_variables: Mapping with string values to replace variables in
|
70
48
|
templated server configuration. The validation of enums is performed for
|
@@ -73,9 +51,10 @@ class Configuration(object):
|
|
73
51
|
configuration.
|
74
52
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
75
53
|
string values to replace variables in templated server configuration.
|
76
|
-
The validation of enums is performed for variables with defined enum
|
54
|
+
The validation of enums is performed for variables with defined enum
|
55
|
+
values before.
|
77
56
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
78
|
-
in PEM format
|
57
|
+
in PEM format.
|
79
58
|
|
80
59
|
:Example:
|
81
60
|
|
@@ -100,14 +79,12 @@ conf = ory_client.Configuration(
|
|
100
79
|
|
101
80
|
def __init__(self, host=None,
|
102
81
|
api_key=None, api_key_prefix=None,
|
103
|
-
access_token=None,
|
104
82
|
username=None, password=None,
|
105
|
-
|
106
|
-
disabled_client_side_validations="",
|
83
|
+
access_token=None,
|
107
84
|
server_index=None, server_variables=None,
|
108
85
|
server_operation_index=None, server_operation_variables=None,
|
109
86
|
ssl_ca_cert=None,
|
110
|
-
):
|
87
|
+
) -> None:
|
111
88
|
"""Constructor
|
112
89
|
"""
|
113
90
|
self._base_path = "https://playground.projects.oryapis.com" if host is None else host
|
@@ -125,7 +102,6 @@ conf = ory_client.Configuration(
|
|
125
102
|
"""Temp file folder for downloading files
|
126
103
|
"""
|
127
104
|
# Authentication Settings
|
128
|
-
self.access_token = access_token
|
129
105
|
self.api_key = {}
|
130
106
|
if api_key:
|
131
107
|
self.api_key = api_key
|
@@ -145,8 +121,9 @@ conf = ory_client.Configuration(
|
|
145
121
|
self.password = password
|
146
122
|
"""Password for HTTP basic authentication
|
147
123
|
"""
|
148
|
-
self.
|
149
|
-
|
124
|
+
self.access_token = access_token
|
125
|
+
"""Access token
|
126
|
+
"""
|
150
127
|
self.logger = {}
|
151
128
|
"""Logging Settings
|
152
129
|
"""
|
@@ -158,7 +135,7 @@ conf = ory_client.Configuration(
|
|
158
135
|
self.logger_stream_handler = None
|
159
136
|
"""Log stream handler
|
160
137
|
"""
|
161
|
-
self.logger_file_handler = None
|
138
|
+
self.logger_file_handler: Optional[FileHandler] = None
|
162
139
|
"""Log file handler
|
163
140
|
"""
|
164
141
|
self.logger_file = None
|
@@ -185,6 +162,10 @@ conf = ory_client.Configuration(
|
|
185
162
|
self.assert_hostname = None
|
186
163
|
"""Set this to True/False to enable/disable SSL hostname verification.
|
187
164
|
"""
|
165
|
+
self.tls_server_name = None
|
166
|
+
"""SSL/TLS Server Name Indication (SNI)
|
167
|
+
Set this to the SNI value expected by the server.
|
168
|
+
"""
|
188
169
|
|
189
170
|
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
190
171
|
"""urllib3 connection pool's maximum number of connections saved
|
@@ -194,12 +175,9 @@ conf = ory_client.Configuration(
|
|
194
175
|
cpu_count * 5 is used as default value to increase performance.
|
195
176
|
"""
|
196
177
|
|
197
|
-
self.proxy = None
|
178
|
+
self.proxy: Optional[str] = None
|
198
179
|
"""Proxy URL
|
199
180
|
"""
|
200
|
-
self.no_proxy = None
|
201
|
-
"""bypass proxy for host in the no_proxy list.
|
202
|
-
"""
|
203
181
|
self.proxy_headers = None
|
204
182
|
"""Proxy headers
|
205
183
|
"""
|
@@ -212,8 +190,17 @@ conf = ory_client.Configuration(
|
|
212
190
|
# Enable client side validation
|
213
191
|
self.client_side_validation = True
|
214
192
|
|
215
|
-
# Options to pass down to the underlying urllib3 socket
|
216
193
|
self.socket_options = None
|
194
|
+
"""Options to pass down to the underlying urllib3 socket
|
195
|
+
"""
|
196
|
+
|
197
|
+
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
|
198
|
+
"""datetime format
|
199
|
+
"""
|
200
|
+
|
201
|
+
self.date_format = "%Y-%m-%d"
|
202
|
+
"""date format
|
203
|
+
"""
|
217
204
|
|
218
205
|
def __deepcopy__(self, memo):
|
219
206
|
cls = self.__class__
|
@@ -231,13 +218,6 @@ conf = ory_client.Configuration(
|
|
231
218
|
|
232
219
|
def __setattr__(self, name, value):
|
233
220
|
object.__setattr__(self, name, value)
|
234
|
-
if name == 'disabled_client_side_validations':
|
235
|
-
s = set(filter(None, value.split(',')))
|
236
|
-
for v in s:
|
237
|
-
if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
|
238
|
-
raise ApiValueError(
|
239
|
-
"Invalid keyword: '{0}''".format(v))
|
240
|
-
self._disabled_client_side_validations = s
|
241
221
|
|
242
222
|
@classmethod
|
243
223
|
def set_default(cls, default):
|
@@ -248,21 +228,31 @@ conf = ory_client.Configuration(
|
|
248
228
|
|
249
229
|
:param default: object of Configuration
|
250
230
|
"""
|
251
|
-
cls._default =
|
231
|
+
cls._default = default
|
252
232
|
|
253
233
|
@classmethod
|
254
234
|
def get_default_copy(cls):
|
255
|
-
"""
|
235
|
+
"""Deprecated. Please use `get_default` instead.
|
236
|
+
|
237
|
+
Deprecated. Please use `get_default` instead.
|
238
|
+
|
239
|
+
:return: The configuration object.
|
240
|
+
"""
|
241
|
+
return cls.get_default()
|
242
|
+
|
243
|
+
@classmethod
|
244
|
+
def get_default(cls):
|
245
|
+
"""Return the default configuration.
|
256
246
|
|
257
247
|
This method returns newly created, based on default constructor,
|
258
248
|
object of Configuration class or returns a copy of default
|
259
|
-
configuration
|
249
|
+
configuration.
|
260
250
|
|
261
251
|
:return: The configuration object.
|
262
252
|
"""
|
263
|
-
if cls._default is
|
264
|
-
|
265
|
-
return
|
253
|
+
if cls._default is None:
|
254
|
+
cls._default = Configuration()
|
255
|
+
return cls._default
|
266
256
|
|
267
257
|
@property
|
268
258
|
def logger_file(self):
|
@@ -316,15 +306,15 @@ conf = ory_client.Configuration(
|
|
316
306
|
# if debug status is True, turn on debug logging
|
317
307
|
for _, logger in self.logger.items():
|
318
308
|
logger.setLevel(logging.DEBUG)
|
319
|
-
# turn on
|
320
|
-
|
309
|
+
# turn on httplib debug
|
310
|
+
httplib.HTTPConnection.debuglevel = 1
|
321
311
|
else:
|
322
312
|
# if debug status is False, turn off debug logging,
|
323
313
|
# setting log level to default `logging.WARNING`
|
324
314
|
for _, logger in self.logger.items():
|
325
315
|
logger.setLevel(logging.WARNING)
|
326
|
-
# turn off
|
327
|
-
|
316
|
+
# turn off httplib debug
|
317
|
+
httplib.HTTPConnection.debuglevel = 0
|
328
318
|
|
329
319
|
@property
|
330
320
|
def logger_format(self):
|
@@ -425,8 +415,8 @@ conf = ory_client.Configuration(
|
|
425
415
|
return "Python SDK Debug Report:\n"\
|
426
416
|
"OS: {env}\n"\
|
427
417
|
"Python Version: {pyversion}\n"\
|
428
|
-
"Version of the API: v1.
|
429
|
-
"SDK Package Version: v1.
|
418
|
+
"Version of the API: v1.11.7\n"\
|
419
|
+
"SDK Package Version: v1.11.7".\
|
430
420
|
format(env=sys.platform, pyversion=sys.version)
|
431
421
|
|
432
422
|
def get_host_settings(self):
|
@@ -442,8 +432,8 @@ conf = ory_client.Configuration(
|
|
442
432
|
'project': {
|
443
433
|
'description': "Project slug as provided by the Ory Console.",
|
444
434
|
'default_value': "playground",
|
435
|
+
}
|
445
436
|
}
|
446
|
-
}
|
447
437
|
}
|
448
438
|
]
|
449
439
|
|
ory_client/exceptions.py
CHANGED
@@ -1,13 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
"""
|
2
4
|
Ory APIs
|
3
5
|
|
4
|
-
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
6
|
+
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
7
|
|
6
|
-
The version of the OpenAPI document: v1.
|
8
|
+
The version of the OpenAPI document: v1.11.7
|
7
9
|
Contact: support@ory.sh
|
8
|
-
Generated by
|
9
|
-
"""
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
11
|
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
from typing import Any, Optional
|
16
|
+
from typing_extensions import Self
|
11
17
|
|
12
18
|
class OpenApiException(Exception):
|
13
19
|
"""The base exception class for all OpenAPIExceptions"""
|
@@ -15,7 +21,7 @@ class OpenApiException(Exception):
|
|
15
21
|
|
16
22
|
class ApiTypeError(OpenApiException, TypeError):
|
17
23
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
18
|
-
key_type=None):
|
24
|
+
key_type=None) -> None:
|
19
25
|
""" Raises an exception for TypeErrors
|
20
26
|
|
21
27
|
Args:
|
@@ -43,7 +49,7 @@ class ApiTypeError(OpenApiException, TypeError):
|
|
43
49
|
|
44
50
|
|
45
51
|
class ApiValueError(OpenApiException, ValueError):
|
46
|
-
def __init__(self, msg, path_to_item=None):
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
47
53
|
"""
|
48
54
|
Args:
|
49
55
|
msg (str): the exception message
|
@@ -61,7 +67,7 @@ class ApiValueError(OpenApiException, ValueError):
|
|
61
67
|
|
62
68
|
|
63
69
|
class ApiAttributeError(OpenApiException, AttributeError):
|
64
|
-
def __init__(self, msg, path_to_item=None):
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
65
71
|
"""
|
66
72
|
Raised when an attribute reference or assignment fails.
|
67
73
|
|
@@ -80,7 +86,7 @@ class ApiAttributeError(OpenApiException, AttributeError):
|
|
80
86
|
|
81
87
|
|
82
88
|
class ApiKeyError(OpenApiException, KeyError):
|
83
|
-
def __init__(self, msg, path_to_item=None):
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
84
90
|
"""
|
85
91
|
Args:
|
86
92
|
msg (str): the exception message
|
@@ -98,54 +104,89 @@ class ApiKeyError(OpenApiException, KeyError):
|
|
98
104
|
|
99
105
|
class ApiException(OpenApiException):
|
100
106
|
|
101
|
-
def __init__(
|
107
|
+
def __init__(
|
108
|
+
self,
|
109
|
+
status=None,
|
110
|
+
reason=None,
|
111
|
+
http_resp=None,
|
112
|
+
*,
|
113
|
+
body: Optional[str] = None,
|
114
|
+
data: Optional[Any] = None,
|
115
|
+
) -> None:
|
116
|
+
self.status = status
|
117
|
+
self.reason = reason
|
118
|
+
self.body = body
|
119
|
+
self.data = data
|
120
|
+
self.headers = None
|
121
|
+
|
102
122
|
if http_resp:
|
103
|
-
self.status
|
104
|
-
|
105
|
-
self.
|
123
|
+
if self.status is None:
|
124
|
+
self.status = http_resp.status
|
125
|
+
if self.reason is None:
|
126
|
+
self.reason = http_resp.reason
|
127
|
+
if self.body is None:
|
128
|
+
try:
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
130
|
+
except Exception:
|
131
|
+
pass
|
106
132
|
self.headers = http_resp.getheaders()
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
133
|
+
|
134
|
+
@classmethod
|
135
|
+
def from_response(
|
136
|
+
cls,
|
137
|
+
*,
|
138
|
+
http_resp,
|
139
|
+
body: Optional[str],
|
140
|
+
data: Optional[Any],
|
141
|
+
) -> Self:
|
142
|
+
if http_resp.status == 400:
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
144
|
+
|
145
|
+
if http_resp.status == 401:
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
147
|
+
|
148
|
+
if http_resp.status == 403:
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
150
|
+
|
151
|
+
if http_resp.status == 404:
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
153
|
+
|
154
|
+
if 500 <= http_resp.status <= 599:
|
155
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
156
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
112
157
|
|
113
158
|
def __str__(self):
|
114
159
|
"""Custom error messages for exception"""
|
115
|
-
error_message = "
|
160
|
+
error_message = "({0})\n"\
|
116
161
|
"Reason: {1}\n".format(self.status, self.reason)
|
117
162
|
if self.headers:
|
118
163
|
error_message += "HTTP response headers: {0}\n".format(
|
119
164
|
self.headers)
|
120
165
|
|
121
|
-
if self.body:
|
122
|
-
error_message += "HTTP response body: {0}\n".format(self.body)
|
166
|
+
if self.data or self.body:
|
167
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
123
168
|
|
124
169
|
return error_message
|
125
170
|
|
126
171
|
|
127
|
-
class
|
172
|
+
class BadRequestException(ApiException):
|
173
|
+
pass
|
174
|
+
|
128
175
|
|
129
|
-
|
130
|
-
|
176
|
+
class NotFoundException(ApiException):
|
177
|
+
pass
|
131
178
|
|
132
179
|
|
133
180
|
class UnauthorizedException(ApiException):
|
134
|
-
|
135
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
136
|
-
super(UnauthorizedException, self).__init__(status, reason, http_resp)
|
181
|
+
pass
|
137
182
|
|
138
183
|
|
139
184
|
class ForbiddenException(ApiException):
|
140
|
-
|
141
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
142
|
-
super(ForbiddenException, self).__init__(status, reason, http_resp)
|
185
|
+
pass
|
143
186
|
|
144
187
|
|
145
188
|
class ServiceException(ApiException):
|
146
|
-
|
147
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
148
|
-
super(ServiceException, self).__init__(status, reason, http_resp)
|
189
|
+
pass
|
149
190
|
|
150
191
|
|
151
192
|
def render_path(path_to_item):
|