onfido-python 2.10.0__py3-none-any.whl → 3.1.0__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.
- onfido/__init__.py +311 -2
- onfido/api/__init__.py +5 -0
- onfido/api/default_api.py +17207 -0
- onfido/api_client.py +770 -0
- onfido/api_response.py +21 -0
- onfido/configuration.py +460 -0
- onfido/exceptions.py +184 -77
- onfido/models/__init__.py +291 -0
- onfido/models/address.py +169 -0
- onfido/models/address_builder.py +169 -0
- onfido/models/address_shared.py +169 -0
- onfido/models/addresses_list.py +108 -0
- onfido/models/applicant.py +162 -0
- onfido/models/applicant_builder.py +152 -0
- onfido/models/applicant_create.py +117 -0
- onfido/models/applicant_request.py +116 -0
- onfido/models/applicant_response.py +146 -0
- onfido/models/applicant_shared.py +115 -0
- onfido/models/applicant_update.py +123 -0
- onfido/models/applicant_updater.py +158 -0
- onfido/models/applicants_list.py +108 -0
- onfido/models/check.py +147 -0
- onfido/models/check_builder.py +127 -0
- onfido/models/check_request.py +119 -0
- onfido/models/check_response.py +137 -0
- onfido/models/check_shared.py +108 -0
- onfido/models/checks_list.py +108 -0
- onfido/models/complete_task_builder.py +104 -0
- onfido/models/complete_task_data_builder.py +143 -0
- onfido/models/consent_item.py +109 -0
- onfido/models/consents_builder.py +98 -0
- onfido/models/country_codes.py +285 -0
- onfido/models/device_intelligence_breakdown.py +110 -0
- onfido/models/device_intelligence_breakdown_breakdown.py +104 -0
- onfido/models/device_intelligence_breakdown_breakdown_device.py +104 -0
- onfido/models/device_intelligence_breakdown_breakdown_device_breakdown.py +114 -0
- onfido/models/device_intelligence_breakdown_properties.py +116 -0
- onfido/models/device_intelligence_breakdown_properties_device.py +189 -0
- onfido/models/device_intelligence_breakdown_properties_geolocation.py +105 -0
- onfido/models/device_intelligence_breakdown_properties_ip.py +106 -0
- onfido/models/device_intelligence_report.py +135 -0
- onfido/models/document.py +142 -0
- onfido/models/document_breakdown.py +152 -0
- onfido/models/document_breakdown_age_validation.py +106 -0
- onfido/models/document_breakdown_age_validation_breakdown.py +104 -0
- onfido/models/document_breakdown_compromised_document.py +106 -0
- onfido/models/document_breakdown_compromised_document_breakdown.py +109 -0
- onfido/models/document_breakdown_data_comparison.py +106 -0
- onfido/models/document_breakdown_data_comparison_breakdown.py +139 -0
- onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.py +102 -0
- onfido/models/document_breakdown_data_consistency.py +106 -0
- onfido/models/document_breakdown_data_consistency_breakdown.py +149 -0
- onfido/models/document_breakdown_data_validation.py +106 -0
- onfido/models/document_breakdown_data_validation_breakdown.py +136 -0
- onfido/models/document_breakdown_data_validation_breakdown_document_expiration.py +102 -0
- onfido/models/document_breakdown_data_validation_breakdown_expiry_date.py +102 -0
- onfido/models/document_breakdown_image_integrity.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown.py +122 -0
- onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.py +102 -0
- onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown_image_quality.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown_supported_document.py +102 -0
- onfido/models/document_breakdown_issuing_authority.py +106 -0
- onfido/models/document_breakdown_issuing_authority_breakdown.py +110 -0
- onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.py +102 -0
- onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.py +102 -0
- onfido/models/document_breakdown_police_record.py +100 -0
- onfido/models/document_breakdown_visual_authenticity.py +106 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown.py +146 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.py +106 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_other.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_template.py +102 -0
- onfido/models/document_cdq_reasons.py +114 -0
- onfido/models/document_iq_reasons.py +118 -0
- onfido/models/document_odp_reasons.py +106 -0
- onfido/models/document_properties.py +191 -0
- onfido/models/document_properties_address_lines.py +110 -0
- onfido/models/document_properties_barcode_inner.py +135 -0
- onfido/models/document_properties_document_classification.py +104 -0
- onfido/models/document_properties_document_numbers_inner.py +102 -0
- onfido/models/document_properties_driving_licence_information.py +107 -0
- onfido/models/document_properties_extracted_data.py +141 -0
- onfido/models/document_properties_nfc.py +125 -0
- onfido/models/document_report.py +141 -0
- onfido/models/document_response.py +111 -0
- onfido/models/document_shared.py +129 -0
- onfido/models/document_types.py +60 -0
- onfido/models/document_video_report.py +141 -0
- onfido/models/document_video_with_address_information_report.py +141 -0
- onfido/models/document_with_address_information_report.py +141 -0
- onfido/models/document_with_driver_verification_report.py +141 -0
- onfido/models/document_with_driver_verification_report_all_of_properties.py +215 -0
- onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.py +105 -0
- onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.py +107 -0
- onfido/models/document_with_driving_licence_information_report.py +141 -0
- onfido/models/documents_list.py +108 -0
- onfido/models/error.py +104 -0
- onfido/models/error1.py +106 -0
- onfido/models/error_properties.py +104 -0
- onfido/models/error_properties1.py +102 -0
- onfido/models/extract_request.py +100 -0
- onfido/models/extraction.py +112 -0
- onfido/models/extraction_document_classification.py +120 -0
- onfido/models/extraction_extracted_data.py +176 -0
- onfido/models/facial_similarity_motion_breakdown.py +116 -0
- onfido/models/facial_similarity_motion_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.py +110 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_motion_properties.py +100 -0
- onfido/models/facial_similarity_motion_report.py +141 -0
- onfido/models/facial_similarity_photo_breakdown.py +116 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.py +104 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.py +102 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.py +104 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.py +100 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown.py +116 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_photo_fully_auto_properties.py +100 -0
- onfido/models/facial_similarity_photo_fully_auto_report.py +141 -0
- onfido/models/facial_similarity_photo_properties.py +100 -0
- onfido/models/facial_similarity_photo_report.py +141 -0
- onfido/models/facial_similarity_video_breakdown.py +116 -0
- onfido/models/facial_similarity_video_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.py +110 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.py +102 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_video_properties.py +100 -0
- onfido/models/facial_similarity_video_report.py +141 -0
- onfido/models/id_number.py +114 -0
- onfido/models/id_photo.py +113 -0
- onfido/models/id_photo_response.py +113 -0
- onfido/models/id_photos_list.py +108 -0
- onfido/models/identity_enhanced_breakdown.py +122 -0
- onfido/models/identity_enhanced_breakdown_address.py +106 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown.py +116 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.py +106 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.py +100 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.py +102 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.py +102 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth.py +106 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.py +110 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.py +102 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.py +102 -0
- onfido/models/identity_enhanced_breakdown_mortality.py +100 -0
- onfido/models/identity_enhanced_breakdown_sources.py +106 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown.py +104 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.py +106 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.py +100 -0
- onfido/models/identity_enhanced_properties.py +110 -0
- onfido/models/identity_enhanced_properties_matched_addresses_inner.py +102 -0
- onfido/models/identity_enhanced_report.py +141 -0
- onfido/models/india_pan_report.py +141 -0
- onfido/models/india_pan_report_all_of_breakdown.py +104 -0
- onfido/models/india_pan_report_all_of_breakdown_device.py +104 -0
- onfido/models/india_pan_report_all_of_breakdown_device_breakdown.py +109 -0
- onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.py +100 -0
- onfido/models/india_pan_report_all_of_properties.py +104 -0
- onfido/models/india_pan_report_all_of_properties_device.py +102 -0
- onfido/models/known_faces_breakdown.py +110 -0
- onfido/models/known_faces_breakdown_image_integrity.py +100 -0
- onfido/models/known_faces_breakdown_previously_seen_faces.py +100 -0
- onfido/models/known_faces_properties.py +108 -0
- onfido/models/known_faces_properties_matches_inner.py +108 -0
- onfido/models/known_faces_report.py +141 -0
- onfido/models/live_photo.py +113 -0
- onfido/models/live_photo_response.py +113 -0
- onfido/models/live_photos_list.py +108 -0
- onfido/models/live_video.py +115 -0
- onfido/models/live_videos_list.py +108 -0
- onfido/models/location.py +103 -0
- onfido/models/location_builder.py +103 -0
- onfido/models/location_shared.py +103 -0
- onfido/models/motion_capture.py +113 -0
- onfido/models/motion_captures_list.py +108 -0
- onfido/models/photo_auto_reasons.py +108 -0
- onfido/models/photo_reasons.py +108 -0
- onfido/models/proof_of_address_breakdown.py +116 -0
- onfido/models/proof_of_address_breakdown_data_comparison.py +106 -0
- onfido/models/proof_of_address_breakdown_data_comparison_breakdown.py +114 -0
- onfido/models/proof_of_address_breakdown_document_classification.py +106 -0
- onfido/models/proof_of_address_breakdown_document_classification_breakdown.py +104 -0
- onfido/models/proof_of_address_breakdown_image_integrity.py +106 -0
- onfido/models/proof_of_address_breakdown_image_integrity_breakdown.py +104 -0
- onfido/models/proof_of_address_properties.py +125 -0
- onfido/models/proof_of_address_report.py +141 -0
- onfido/models/repeat_attempts_list.py +117 -0
- onfido/models/repeat_attempts_list_repeat_attempts_inner.py +143 -0
- onfido/models/report.py +621 -0
- onfido/models/report_document.py +100 -0
- onfido/models/report_name.py +56 -0
- onfido/models/report_result.py +38 -0
- onfido/models/report_shared.py +129 -0
- onfido/models/report_status.py +40 -0
- onfido/models/report_sub_result.py +39 -0
- onfido/models/reports_list.py +108 -0
- onfido/models/results_feedback.py +116 -0
- onfido/models/sdk_token.py +100 -0
- onfido/models/sdk_token_builder.py +106 -0
- onfido/models/sdk_token_request.py +106 -0
- onfido/models/sdk_token_response.py +100 -0
- onfido/models/task.py +146 -0
- onfido/models/task_item.py +128 -0
- onfido/models/timeline_file_reference.py +102 -0
- onfido/models/us_driving_licence_breakdown.py +116 -0
- onfido/models/us_driving_licence_breakdown_address.py +106 -0
- onfido/models/us_driving_licence_breakdown_address_breakdown.py +129 -0
- onfido/models/us_driving_licence_breakdown_document.py +106 -0
- onfido/models/us_driving_licence_breakdown_document_breakdown.py +119 -0
- onfido/models/us_driving_licence_breakdown_personal.py +106 -0
- onfido/models/us_driving_licence_breakdown_personal_breakdown.py +164 -0
- onfido/models/us_driving_licence_builder.py +185 -0
- onfido/models/us_driving_licence_report.py +141 -0
- onfido/models/us_driving_licence_shared.py +185 -0
- onfido/models/video_reasons.py +106 -0
- onfido/models/watchlist_aml_breakdown.py +122 -0
- onfido/models/watchlist_aml_breakdown_adverse_media.py +100 -0
- onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.py +100 -0
- onfido/models/watchlist_aml_breakdown_politically_exposed_person.py +100 -0
- onfido/models/watchlist_aml_breakdown_sanction.py +100 -0
- onfido/models/watchlist_aml_properties.py +100 -0
- onfido/models/watchlist_aml_report.py +141 -0
- onfido/models/watchlist_enhanced_breakdown.py +122 -0
- onfido/models/watchlist_enhanced_properties.py +100 -0
- onfido/models/watchlist_enhanced_report.py +141 -0
- onfido/models/watchlist_monitor.py +120 -0
- onfido/models/watchlist_monitor_builder.py +111 -0
- onfido/models/watchlist_monitor_match.py +102 -0
- onfido/models/watchlist_monitor_matches_list.py +108 -0
- onfido/models/watchlist_monitor_matches_updater.py +102 -0
- onfido/models/watchlist_monitor_response.py +107 -0
- onfido/models/watchlist_monitor_shared.py +111 -0
- onfido/models/watchlist_monitors_list.py +108 -0
- onfido/models/watchlist_peps_only_report.py +141 -0
- onfido/models/watchlist_sanctions_only_report.py +141 -0
- onfido/models/watchlist_standard_breakdown.py +116 -0
- onfido/models/watchlist_standard_properties.py +100 -0
- onfido/models/watchlist_standard_report.py +141 -0
- onfido/models/webhook.py +115 -0
- onfido/models/webhook_builder.py +109 -0
- onfido/models/webhook_create.py +100 -0
- onfido/models/webhook_event.py +104 -0
- onfido/models/webhook_event_payload.py +111 -0
- onfido/models/webhook_event_payload_object.py +107 -0
- onfido/models/webhook_event_type.py +52 -0
- onfido/models/webhook_resend.py +108 -0
- onfido/models/webhook_response.py +106 -0
- onfido/models/webhook_shared.py +107 -0
- onfido/models/webhook_update.py +100 -0
- onfido/models/webhook_updater.py +109 -0
- onfido/models/webhooks_list.py +108 -0
- onfido/models/webhooks_resend_item.py +103 -0
- onfido/models/workflow_run.py +149 -0
- onfido/models/workflow_run_builder.py +123 -0
- onfido/models/workflow_run_request.py +100 -0
- onfido/models/workflow_run_response.py +126 -0
- onfido/models/workflow_run_response_error.py +102 -0
- onfido/models/workflow_run_shared.py +121 -0
- onfido/models/workflow_run_shared_link.py +119 -0
- onfido/py.typed +0 -0
- onfido/rest.py +258 -0
- onfido/webhook_event_verifier.py +7 -3
- {onfido_python-2.10.0.dist-info → onfido_python-3.1.0.dist-info}/LICENSE +1 -1
- onfido_python-3.1.0.dist-info/METADATA +18 -0
- onfido_python-3.1.0.dist-info/RECORD +291 -0
- {onfido_python-2.10.0.dist-info → onfido_python-3.1.0.dist-info}/WHEEL +2 -1
- onfido_python-3.1.0.dist-info/top_level.txt +1 -0
- onfido/aio_resource.py +0 -132
- onfido/mimetype.py +0 -5
- onfido/onfido.py +0 -71
- onfido/onfido_download.py +0 -11
- onfido/regions.py +0 -11
- onfido/resource.py +0 -88
- onfido/resources/address_picker.py +0 -6
- onfido/resources/applicants.py +0 -23
- onfido/resources/checks.py +0 -19
- onfido/resources/documents.py +0 -16
- onfido/resources/extraction.py +0 -6
- onfido/resources/live_photos.py +0 -17
- onfido/resources/live_videos.py +0 -16
- onfido/resources/motion_captures.py +0 -16
- onfido/resources/reports.py +0 -16
- onfido/resources/sdk_tokens.py +0 -5
- onfido/resources/watchlist_monitors.py +0 -16
- onfido/resources/webhooks.py +0 -18
- onfido/resources/workflow_runs.py +0 -17
- onfido/resources_aio/address_picker.py +0 -6
- onfido/resources_aio/applicants.py +0 -23
- onfido/resources_aio/checks.py +0 -19
- onfido/resources_aio/documents.py +0 -16
- onfido/resources_aio/extraction.py +0 -6
- onfido/resources_aio/live_photos.py +0 -17
- onfido/resources_aio/live_videos.py +0 -16
- onfido/resources_aio/motion_captures.py +0 -16
- onfido/resources_aio/reports.py +0 -16
- onfido/resources_aio/sdk_tokens.py +0 -6
- onfido/resources_aio/watchlist_monitors.py +0 -16
- onfido/resources_aio/webhooks.py +0 -18
- onfido/resources_aio/workflow_runs.py +0 -17
- onfido/utils.py +0 -22
- onfido_python-2.10.0.dist-info/METADATA +0 -181
- onfido_python-2.10.0.dist-info/RECORD +0 -40
onfido/aio_resource.py
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
from aiohttp import AsyncIterablePayload, ClientSession, MultipartWriter, StringPayload
|
|
2
|
-
from .exceptions import OnfidoRequestError
|
|
3
|
-
from aiohttp.client_reqrep import ClientResponse
|
|
4
|
-
from .onfido_download import OnfidoAioDownload
|
|
5
|
-
from .exceptions import async_error_decorator, OnfidoUnknownError
|
|
6
|
-
from .mimetype import mimetype_from_name
|
|
7
|
-
from .utils import form_data_converter
|
|
8
|
-
from typing import BinaryIO
|
|
9
|
-
|
|
10
|
-
try:
|
|
11
|
-
import importlib.metadata as importlib_metadata
|
|
12
|
-
except ImportError:
|
|
13
|
-
import importlib_metadata
|
|
14
|
-
|
|
15
|
-
CURRENT_VERSION = importlib_metadata.version("onfido-python")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Resource:
|
|
19
|
-
def __init__(self, api_token, region, aio_session: ClientSession, timeout):
|
|
20
|
-
self._api_token = api_token
|
|
21
|
-
self._region = region
|
|
22
|
-
self._timeout = timeout
|
|
23
|
-
self._aio_session = aio_session
|
|
24
|
-
|
|
25
|
-
@property
|
|
26
|
-
def _url(self):
|
|
27
|
-
return getattr(self._region, "region_url", self._region)
|
|
28
|
-
|
|
29
|
-
def _build_url(self, path):
|
|
30
|
-
return self._url + path
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def _headers(self):
|
|
34
|
-
return {
|
|
35
|
-
"User-Agent": f"onfido-python/{CURRENT_VERSION}",
|
|
36
|
-
"Authorization": f"Token token={self._api_token}",
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async def _handle_response(self, response: ClientResponse):
|
|
40
|
-
if response.status == 422:
|
|
41
|
-
error = None
|
|
42
|
-
if response.code == 422:
|
|
43
|
-
content_type = response.headers.get("Content-Type", "")
|
|
44
|
-
if "application/json" in content_type:
|
|
45
|
-
resp_json = await response.json()
|
|
46
|
-
error = resp_json.get("error")
|
|
47
|
-
raise OnfidoRequestError(error)
|
|
48
|
-
|
|
49
|
-
response.raise_for_status()
|
|
50
|
-
if response.status == 204:
|
|
51
|
-
return None
|
|
52
|
-
|
|
53
|
-
try:
|
|
54
|
-
return await response.json()
|
|
55
|
-
except ValueError as e:
|
|
56
|
-
raise OnfidoUnknownError("Onfido returned invalid JSON") from e
|
|
57
|
-
|
|
58
|
-
@async_error_decorator
|
|
59
|
-
async def _upload_request(self, path, file: BinaryIO, **request_body):
|
|
60
|
-
import uuid
|
|
61
|
-
|
|
62
|
-
boundary = uuid.uuid4().hex
|
|
63
|
-
with MultipartWriter("form-data", boundary=boundary) as mpwriter:
|
|
64
|
-
for k, v in form_data_converter(request_body).items():
|
|
65
|
-
part = mpwriter.append(
|
|
66
|
-
StringPayload(
|
|
67
|
-
v, headers={"Content-Disposition": f'form-data; name="{k}"'}
|
|
68
|
-
)
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
file_part = mpwriter.append_payload(
|
|
72
|
-
AsyncIterablePayload(
|
|
73
|
-
file,
|
|
74
|
-
content_type=mimetype_from_name(file.name),
|
|
75
|
-
headers={
|
|
76
|
-
"Content-Disposition": f'form-data; name="file"; filename="{file.name}"'
|
|
77
|
-
},
|
|
78
|
-
)
|
|
79
|
-
)
|
|
80
|
-
additional_headers = {
|
|
81
|
-
"Content-Type": f"multipart/form-data;boundary={boundary}"
|
|
82
|
-
}
|
|
83
|
-
async with self._aio_session.post(
|
|
84
|
-
self._build_url(path),
|
|
85
|
-
data=mpwriter,
|
|
86
|
-
headers=dict(self._headers, **additional_headers),
|
|
87
|
-
timeout=self._timeout,
|
|
88
|
-
) as response:
|
|
89
|
-
return await self._handle_response(response)
|
|
90
|
-
|
|
91
|
-
@async_error_decorator
|
|
92
|
-
async def _post(self, path, **request_body):
|
|
93
|
-
async with self._aio_session.post(
|
|
94
|
-
self._build_url(path),
|
|
95
|
-
json=request_body,
|
|
96
|
-
headers=self._headers,
|
|
97
|
-
timeout=self._timeout,
|
|
98
|
-
) as response:
|
|
99
|
-
return await self._handle_response(response)
|
|
100
|
-
|
|
101
|
-
@async_error_decorator
|
|
102
|
-
async def _put(self, path, data=None):
|
|
103
|
-
async with self._aio_session.put(
|
|
104
|
-
self._build_url(path),
|
|
105
|
-
json=data,
|
|
106
|
-
headers=self._headers,
|
|
107
|
-
timeout=self._timeout,
|
|
108
|
-
) as response:
|
|
109
|
-
return await self._handle_response(response)
|
|
110
|
-
|
|
111
|
-
@async_error_decorator
|
|
112
|
-
async def _get(self, path, payload=None):
|
|
113
|
-
async with self._aio_session.get(
|
|
114
|
-
self._build_url(path), headers=self._headers, timeout=self._timeout
|
|
115
|
-
) as response:
|
|
116
|
-
return await self._handle_response(response)
|
|
117
|
-
|
|
118
|
-
@async_error_decorator
|
|
119
|
-
async def _download_request(self, path):
|
|
120
|
-
async with self._aio_session.get(
|
|
121
|
-
self._build_url(path), headers=self._headers, timeout=self._timeout
|
|
122
|
-
) as response:
|
|
123
|
-
response.raise_for_status()
|
|
124
|
-
|
|
125
|
-
return OnfidoAioDownload(response)
|
|
126
|
-
|
|
127
|
-
@async_error_decorator
|
|
128
|
-
async def _delete_request(self, path):
|
|
129
|
-
async with self._aio_session.delete(
|
|
130
|
-
self._build_url(path), headers=self._headers, timeout=self._timeout
|
|
131
|
-
) as response:
|
|
132
|
-
return await self._handle_response(response)
|
onfido/mimetype.py
DELETED
onfido/onfido.py
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
from .resources.applicants import Applicants
|
|
2
|
-
from .resources.documents import Documents
|
|
3
|
-
from .resources.address_picker import Addresses
|
|
4
|
-
from .resources.checks import Checks
|
|
5
|
-
from .resources.workflow_runs import WorkflowRuns
|
|
6
|
-
from .resources.reports import Reports
|
|
7
|
-
from .resources.live_photos import LivePhotos
|
|
8
|
-
from .resources.live_videos import LiveVideos
|
|
9
|
-
from .resources.motion_captures import MotionCaptures
|
|
10
|
-
from .resources.webhooks import Webhooks
|
|
11
|
-
from .resources.sdk_tokens import SdkToken
|
|
12
|
-
from .resources.extraction import Extraction
|
|
13
|
-
from .resources.watchlist_monitors import WatchlistMonitors
|
|
14
|
-
from .regions import Region
|
|
15
|
-
from .exceptions import OnfidoRegionError
|
|
16
|
-
|
|
17
|
-
from .resources_aio.applicants import Applicants as AsyncApplicants
|
|
18
|
-
from .resources_aio.documents import Documents as AsyncDocuments
|
|
19
|
-
from .resources_aio.address_picker import Addresses as AsyncAddresses
|
|
20
|
-
from .resources_aio.checks import Checks as AsyncChecks
|
|
21
|
-
from .resources_aio.workflow_runs import WorkflowRuns as AsyncWorkflowRuns
|
|
22
|
-
from .resources_aio.reports import Reports as AsyncReports
|
|
23
|
-
from .resources_aio.live_photos import LivePhotos as AsyncLivePhotos
|
|
24
|
-
from .resources_aio.live_videos import LiveVideos as AsyncLiveVideos
|
|
25
|
-
from .resources_aio.motion_captures import MotionCaptures as AsyncMotionCaptures
|
|
26
|
-
from .resources_aio.webhooks import Webhooks as AsyncWebhooks
|
|
27
|
-
from .resources_aio.sdk_tokens import SdkToken as AsyncSdkToken
|
|
28
|
-
from .resources_aio.extraction import Extraction as AsyncExtraction
|
|
29
|
-
from .resources_aio.watchlist_monitors import WatchlistMonitors as AsyncWatchlistMonitors
|
|
30
|
-
|
|
31
|
-
class Api:
|
|
32
|
-
def __init__(self, api_token, region, timeout=None):
|
|
33
|
-
self.applicant = Applicants(api_token, region, timeout)
|
|
34
|
-
self.document = Documents(api_token, region, timeout)
|
|
35
|
-
self.address = Addresses(api_token, region, timeout)
|
|
36
|
-
self.check = Checks(api_token, region, timeout)
|
|
37
|
-
self.report = Reports(api_token, region, timeout)
|
|
38
|
-
self.sdk_token = SdkToken(api_token, region, timeout)
|
|
39
|
-
self.webhook = Webhooks(api_token, region, timeout)
|
|
40
|
-
self.live_photo = LivePhotos(api_token, region, timeout)
|
|
41
|
-
self.live_video = LiveVideos(api_token, region, timeout)
|
|
42
|
-
self.motion_capture = MotionCaptures(api_token, region, timeout)
|
|
43
|
-
self.extraction = Extraction(api_token, region, timeout)
|
|
44
|
-
self.watchlist_monitor = WatchlistMonitors(api_token, region, timeout)
|
|
45
|
-
self.workflowrun = WorkflowRuns(api_token, region, timeout)
|
|
46
|
-
|
|
47
|
-
if region in [Region.EU, Region.US, Region.CA]:
|
|
48
|
-
pass
|
|
49
|
-
elif "api.onfido.com" in region:
|
|
50
|
-
raise OnfidoRegionError("The region must be one of Region.EU, Region.US or Region.CA. We previously defaulted to Region.EU, so if you previously didn’t set a region or used api.onfido.com, please set your region to Region.EU")
|
|
51
|
-
|
|
52
|
-
class AsyncApi:
|
|
53
|
-
def __init__(self, api_token, region, aio_session, timeout=None):
|
|
54
|
-
self.applicant = AsyncApplicants(api_token, region, aio_session, timeout)
|
|
55
|
-
self.document = AsyncDocuments(api_token, region, aio_session, timeout)
|
|
56
|
-
self.address = AsyncAddresses(api_token, region, aio_session, timeout)
|
|
57
|
-
self.check = AsyncChecks(api_token, region, aio_session, timeout)
|
|
58
|
-
self.report = AsyncReports(api_token, region, aio_session, timeout)
|
|
59
|
-
self.sdk_token = AsyncSdkToken(api_token, region, aio_session, timeout)
|
|
60
|
-
self.webhook = AsyncWebhooks(api_token, region, aio_session, timeout)
|
|
61
|
-
self.live_photo = AsyncLivePhotos(api_token, region, aio_session, timeout)
|
|
62
|
-
self.live_video = AsyncLiveVideos(api_token, region, aio_session, timeout)
|
|
63
|
-
self.motion_capture = AsyncMotionCaptures(api_token, region, aio_session, timeout)
|
|
64
|
-
self.extraction = AsyncExtraction(api_token, region, aio_session, timeout)
|
|
65
|
-
self.watchlist_monitor = AsyncWatchlistMonitors(api_token, region, aio_session, timeout)
|
|
66
|
-
self.workflowrun = AsyncWorkflowRuns(api_token, region, aio_session, timeout)
|
|
67
|
-
|
|
68
|
-
if region in [Region.EU, Region.US, Region.CA]:
|
|
69
|
-
pass
|
|
70
|
-
elif "api.onfido.com" in region:
|
|
71
|
-
raise OnfidoRegionError("The region must be one of Region.EU, Region.US or Region.CA. We previously defaulted to Region.EU, so if you previously didn’t set a region or used api.onfido.com, please set your region to Region.EU")
|
onfido/onfido_download.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from aiohttp.client_reqrep import ClientResponse
|
|
2
|
-
|
|
3
|
-
class OnfidoDownload:
|
|
4
|
-
def __init__(self, response):
|
|
5
|
-
self.content = response.content
|
|
6
|
-
self.content_type = response.headers['content-type']
|
|
7
|
-
|
|
8
|
-
class OnfidoAioDownload:
|
|
9
|
-
def __init__(self, response: ClientResponse):
|
|
10
|
-
self.content = response.content
|
|
11
|
-
self.content_type = response.content_type
|
onfido/regions.py
DELETED
onfido/resource.py
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
from .onfido_download import OnfidoDownload
|
|
3
|
-
from .exceptions import error_decorator, OnfidoUnknownError
|
|
4
|
-
from .mimetype import mimetype_from_name
|
|
5
|
-
from .utils import form_data_converter
|
|
6
|
-
|
|
7
|
-
try:
|
|
8
|
-
import importlib.metadata as importlib_metadata
|
|
9
|
-
except ImportError:
|
|
10
|
-
import importlib_metadata
|
|
11
|
-
|
|
12
|
-
CURRENT_VERSION = importlib_metadata.version("onfido-python")
|
|
13
|
-
|
|
14
|
-
class Resource:
|
|
15
|
-
def __init__(self, api_token, region, timeout):
|
|
16
|
-
self._api_token = api_token
|
|
17
|
-
self._region = region
|
|
18
|
-
self._timeout = timeout
|
|
19
|
-
|
|
20
|
-
@property
|
|
21
|
-
def _url(self):
|
|
22
|
-
return getattr(self._region, "region_url", self._region)
|
|
23
|
-
|
|
24
|
-
def _build_url(self, path):
|
|
25
|
-
return self._url + path
|
|
26
|
-
|
|
27
|
-
@property
|
|
28
|
-
def _headers(self):
|
|
29
|
-
return {
|
|
30
|
-
"User-Agent": f"onfido-python/{CURRENT_VERSION}",
|
|
31
|
-
"Authorization": f"Token token={self._api_token}"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
def _handle_response(self, response):
|
|
35
|
-
response.raise_for_status()
|
|
36
|
-
if response.status_code == 204:
|
|
37
|
-
return None
|
|
38
|
-
|
|
39
|
-
try:
|
|
40
|
-
return response.json()
|
|
41
|
-
except ValueError as e:
|
|
42
|
-
raise OnfidoUnknownError("Onfido returned invalid JSON") from e
|
|
43
|
-
|
|
44
|
-
@error_decorator
|
|
45
|
-
def _upload_request(self, path, file, **request_body):
|
|
46
|
-
files = {
|
|
47
|
-
'file': (file.name, file, mimetype_from_name(file.name))
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
response = requests.post(self._build_url(path), data=form_data_converter(request_body),
|
|
51
|
-
files=files, headers=self._headers, timeout=self._timeout)
|
|
52
|
-
|
|
53
|
-
return self._handle_response(response)
|
|
54
|
-
|
|
55
|
-
@error_decorator
|
|
56
|
-
def _post(self, path, **request_body):
|
|
57
|
-
response = requests.post(self._build_url(path), json=request_body, headers=self._headers, timeout=self._timeout)
|
|
58
|
-
|
|
59
|
-
return self._handle_response(response)
|
|
60
|
-
|
|
61
|
-
@error_decorator
|
|
62
|
-
def _put(self, path, data=None):
|
|
63
|
-
response = requests.put(self._build_url(path), json=data, headers=self._headers, timeout=self._timeout)
|
|
64
|
-
|
|
65
|
-
return self._handle_response(response)
|
|
66
|
-
|
|
67
|
-
@error_decorator
|
|
68
|
-
def _get(self, path, payload=None):
|
|
69
|
-
response = requests.get(self._build_url(path), headers=self._headers, params=payload, timeout=self._timeout)
|
|
70
|
-
|
|
71
|
-
return self._handle_response(response)
|
|
72
|
-
|
|
73
|
-
@error_decorator
|
|
74
|
-
def _download_request(self, path):
|
|
75
|
-
response = requests.get(self._build_url(path), headers=self._headers, timeout=self._timeout)
|
|
76
|
-
|
|
77
|
-
response.raise_for_status()
|
|
78
|
-
|
|
79
|
-
try:
|
|
80
|
-
return OnfidoDownload(response)
|
|
81
|
-
except ValueError as e:
|
|
82
|
-
raise OnfidoUnknownError("Onfido returned invalid JSON") from e
|
|
83
|
-
|
|
84
|
-
@error_decorator
|
|
85
|
-
def _delete_request(self, path):
|
|
86
|
-
response = requests.delete(self._build_url(path), headers=self._headers, timeout=self._timeout)
|
|
87
|
-
|
|
88
|
-
return self._handle_response(response)
|
onfido/resources/applicants.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Applicants(Resource):
|
|
5
|
-
def create(self, request_body:dict):
|
|
6
|
-
return self._post("applicants/", **request_body)
|
|
7
|
-
|
|
8
|
-
def update(self, applicant_id:str, request_body:dict):
|
|
9
|
-
return self._put(f"applicants/{applicant_id}", request_body)
|
|
10
|
-
|
|
11
|
-
def find(self, applicant_id:str):
|
|
12
|
-
return self._get(f"applicants/{applicant_id}")
|
|
13
|
-
|
|
14
|
-
def delete(self, applicant_id:str):
|
|
15
|
-
self._delete_request(f"applicants/{applicant_id}")
|
|
16
|
-
|
|
17
|
-
def all(self, **user_payload:dict):
|
|
18
|
-
payload = {"include_deleted": False, "per_page": 20, "page": 1}
|
|
19
|
-
payload.update(user_payload)
|
|
20
|
-
return self._get("applicants", payload=payload)
|
|
21
|
-
|
|
22
|
-
def restore(self, applicant_id:str):
|
|
23
|
-
self._post(f"applicants/{applicant_id}/restore")
|
onfido/resources/checks.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Checks(Resource):
|
|
5
|
-
def create(self, request_body:dict):
|
|
6
|
-
return self._post("checks/", **request_body)
|
|
7
|
-
|
|
8
|
-
def find(self, check_id:str):
|
|
9
|
-
return self._get(f"checks/{check_id}")
|
|
10
|
-
|
|
11
|
-
def all(self, applicant_id:str):
|
|
12
|
-
payload = {"applicant_id": applicant_id}
|
|
13
|
-
return self._get("checks/", payload=payload)
|
|
14
|
-
|
|
15
|
-
def resume(self, check_id:str):
|
|
16
|
-
self._post(f"checks/{check_id}/resume")
|
|
17
|
-
|
|
18
|
-
def download(self, check_id:str):
|
|
19
|
-
return self._download_request(f"checks/{check_id}/download")
|
onfido/resources/documents.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
from typing import BinaryIO
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Documents(Resource):
|
|
6
|
-
def upload(self, sample_file:BinaryIO, request_body):
|
|
7
|
-
return self._upload_request("documents/", sample_file, **request_body)
|
|
8
|
-
|
|
9
|
-
def find(self, document_id:str):
|
|
10
|
-
return self._get(f"documents/{document_id}")
|
|
11
|
-
|
|
12
|
-
def all(self, applicant_id:str):
|
|
13
|
-
return self._get(f"documents?applicant_id={applicant_id}")
|
|
14
|
-
|
|
15
|
-
def download(self, document_id:str):
|
|
16
|
-
return self._download_request(f"documents/{document_id}/download")
|
onfido/resources/extraction.py
DELETED
onfido/resources/live_photos.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
from typing import BinaryIO
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class LivePhotos(Resource):
|
|
6
|
-
def upload(self, sample_file:BinaryIO, request_body):
|
|
7
|
-
return self._upload_request("live_photos/", sample_file, **request_body)
|
|
8
|
-
|
|
9
|
-
def find(self, live_photo_id:str):
|
|
10
|
-
return self._get(f"live_photos/{live_photo_id}")
|
|
11
|
-
|
|
12
|
-
def all(self, applicant_id:str):
|
|
13
|
-
payload = {"applicant_id": applicant_id}
|
|
14
|
-
return self._get("live_photos/", payload=payload)
|
|
15
|
-
|
|
16
|
-
def download(self, live_photo_id:str):
|
|
17
|
-
return self._download_request(f"live_photos/{live_photo_id}/download")
|
onfido/resources/live_videos.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class LiveVideos(Resource):
|
|
5
|
-
def find(self, live_video_id:str):
|
|
6
|
-
return self._get(f"live_videos/{live_video_id}")
|
|
7
|
-
|
|
8
|
-
def all(self, applicant_id:str):
|
|
9
|
-
payload = {"applicant_id": applicant_id}
|
|
10
|
-
return self._get("live_videos/", payload=payload)
|
|
11
|
-
|
|
12
|
-
def download(self, live_video_id:str):
|
|
13
|
-
return self._download_request(f"live_videos/{live_video_id}/download")
|
|
14
|
-
|
|
15
|
-
def download_frame(self, live_video_id:str):
|
|
16
|
-
return self._download_request(f"live_videos/{live_video_id}/frame")
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class MotionCaptures(Resource):
|
|
5
|
-
def find(self, motion_capture_id:str):
|
|
6
|
-
return self._get(f"motion_captures/{motion_capture_id}")
|
|
7
|
-
|
|
8
|
-
def all(self, applicant_id:str):
|
|
9
|
-
payload = {"applicant_id": applicant_id}
|
|
10
|
-
return self._get("motion_captures/", payload=payload)
|
|
11
|
-
|
|
12
|
-
def download(self, motion_capture_id:str):
|
|
13
|
-
return self._download_request(f"motion_captures/{motion_capture_id}/download")
|
|
14
|
-
|
|
15
|
-
def download_frame(self, motion_capture_id:str):
|
|
16
|
-
return self._download_request(f"motion_captures/{motion_capture_id}/frame")
|
onfido/resources/reports.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Reports(Resource):
|
|
5
|
-
def find(self, report_id:str):
|
|
6
|
-
return self._get(f"reports/{report_id}")
|
|
7
|
-
|
|
8
|
-
def all(self, check_id:str):
|
|
9
|
-
payload = {"check_id": check_id}
|
|
10
|
-
return self._get("reports/", payload=payload)
|
|
11
|
-
|
|
12
|
-
def resume(self, report_id:str):
|
|
13
|
-
return self._post(f"reports/{report_id}/resume")
|
|
14
|
-
|
|
15
|
-
def cancel(self, report_id:str):
|
|
16
|
-
self._post(f"reports/{report_id}/cancel")
|
onfido/resources/sdk_tokens.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class WatchlistMonitors(Resource):
|
|
5
|
-
def create(self, request_body:dict):
|
|
6
|
-
return self._post("watchlist_monitors/", **request_body)
|
|
7
|
-
|
|
8
|
-
def find(self, monitor_id:str):
|
|
9
|
-
return self._get(f"watchlist_monitors/{monitor_id}")
|
|
10
|
-
|
|
11
|
-
def all(self, applicant_id:str):
|
|
12
|
-
payload = {"applicant_id": applicant_id}
|
|
13
|
-
return self._get("watchlist_monitors/", payload=payload)
|
|
14
|
-
|
|
15
|
-
def delete(self, monitor_id:str):
|
|
16
|
-
self._delete_request(f"watchlist_monitors/{monitor_id}")
|
onfido/resources/webhooks.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Webhooks(Resource):
|
|
5
|
-
def create(self, request_body:dict):
|
|
6
|
-
return self._post("webhooks", **request_body)
|
|
7
|
-
|
|
8
|
-
def all(self):
|
|
9
|
-
return self._get("webhooks")
|
|
10
|
-
|
|
11
|
-
def find(self, webhook_id:str):
|
|
12
|
-
return self._get(f"webhooks/{webhook_id}")
|
|
13
|
-
|
|
14
|
-
def edit(self, webhook_id:str, request_body:dict):
|
|
15
|
-
return self._put(f"webhooks/{webhook_id}", request_body)
|
|
16
|
-
|
|
17
|
-
def delete(self, webhook_id:str):
|
|
18
|
-
self._delete_request(f"webhooks/{webhook_id}")
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from ..resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class WorkflowRuns(Resource):
|
|
5
|
-
def create(self, request_body: dict):
|
|
6
|
-
return self._post("workflow_runs/", **request_body)
|
|
7
|
-
|
|
8
|
-
def all(self, **user_payload: dict):
|
|
9
|
-
payload = {"page": 1, "sort": "desc"}
|
|
10
|
-
payload.update(user_payload)
|
|
11
|
-
return self._get("workflow_runs", payload=payload)
|
|
12
|
-
|
|
13
|
-
def find(self, workflow_run_id: str):
|
|
14
|
-
return self._get(f"workflow_runs/{workflow_run_id}")
|
|
15
|
-
|
|
16
|
-
def evidence(self, workflow_run_id: str):
|
|
17
|
-
return self._download_request(f"workflow_runs/{workflow_run_id}/signed_evidence_file")
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Applicants(Resource):
|
|
5
|
-
def create(self, request_body: dict):
|
|
6
|
-
return self._post("applicants/", **request_body)
|
|
7
|
-
|
|
8
|
-
def update(self, applicant_id: str, request_body: dict):
|
|
9
|
-
return self._put(f"applicants/{applicant_id}", request_body)
|
|
10
|
-
|
|
11
|
-
def find(self, applicant_id: str):
|
|
12
|
-
return self._get(f"applicants/{applicant_id}")
|
|
13
|
-
|
|
14
|
-
def delete(self, applicant_id: str):
|
|
15
|
-
return self._delete_request(f"applicants/{applicant_id}")
|
|
16
|
-
|
|
17
|
-
def all(self, **user_payload: dict):
|
|
18
|
-
payload = {"include_deleted": False, "per_page": 20, "page": 1}
|
|
19
|
-
payload.update(user_payload)
|
|
20
|
-
return self._get("applicants", payload=payload)
|
|
21
|
-
|
|
22
|
-
def restore(self, applicant_id: str):
|
|
23
|
-
return self._post(f"applicants/{applicant_id}/restore")
|
onfido/resources_aio/checks.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Checks(Resource):
|
|
5
|
-
def create(self, request_body: dict):
|
|
6
|
-
return self._post("checks/", **request_body)
|
|
7
|
-
|
|
8
|
-
def find(self, check_id: str):
|
|
9
|
-
return self._get(f"checks/{check_id}")
|
|
10
|
-
|
|
11
|
-
def all(self, applicant_id: str):
|
|
12
|
-
payload = {"applicant_id": applicant_id}
|
|
13
|
-
return self._get("checks/", payload=payload)
|
|
14
|
-
|
|
15
|
-
def resume(self, check_id: str):
|
|
16
|
-
return self._post(f"checks/{check_id}/resume")
|
|
17
|
-
|
|
18
|
-
def download(self, check_id: str):
|
|
19
|
-
return self._download_request(f"checks/{check_id}/download")
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
from typing import BinaryIO
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Documents(Resource):
|
|
6
|
-
def upload(self, sample_file: BinaryIO, request_body):
|
|
7
|
-
return self._upload_request("documents/", sample_file, **request_body)
|
|
8
|
-
|
|
9
|
-
def find(self, document_id: str):
|
|
10
|
-
return self._get(f"documents/{document_id}")
|
|
11
|
-
|
|
12
|
-
def all(self, applicant_id: str):
|
|
13
|
-
return self._get(f"documents?applicant_id={applicant_id}")
|
|
14
|
-
|
|
15
|
-
def download(self, document_id: str):
|
|
16
|
-
return self._download_request(f"documents/{document_id}/download")
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
from typing import BinaryIO
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class LivePhotos(Resource):
|
|
6
|
-
def upload(self, sample_file: BinaryIO, request_body):
|
|
7
|
-
return self._upload_request("live_photos/", sample_file, **request_body)
|
|
8
|
-
|
|
9
|
-
def find(self, live_photo_id: str):
|
|
10
|
-
return self._get(f"live_photos/{live_photo_id}")
|
|
11
|
-
|
|
12
|
-
def all(self, applicant_id: str):
|
|
13
|
-
payload = {"applicant_id": applicant_id}
|
|
14
|
-
return self._get("live_photos/", payload=payload)
|
|
15
|
-
|
|
16
|
-
def download(self, live_photo_id: str):
|
|
17
|
-
return self._download_request(f"live_photos/{live_photo_id}/download")
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class LiveVideos(Resource):
|
|
5
|
-
def find(self, live_video_id: str):
|
|
6
|
-
return self._get(f"live_videos/{live_video_id}")
|
|
7
|
-
|
|
8
|
-
def all(self, applicant_id: str):
|
|
9
|
-
payload = {"applicant_id": applicant_id}
|
|
10
|
-
return self._get("live_videos/", payload=payload)
|
|
11
|
-
|
|
12
|
-
def download(self, live_video_id: str):
|
|
13
|
-
return self._download_request(f"live_videos/{live_video_id}/download")
|
|
14
|
-
|
|
15
|
-
def download_frame(self, live_video_id: str):
|
|
16
|
-
return self._download_request(f"live_videos/{live_video_id}/frame")
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from ..aio_resource import Resource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class MotionCaptures(Resource):
|
|
5
|
-
def find(self, motion_capture_id: str):
|
|
6
|
-
return self._get(f"motion_captures/{motion_capture_id}")
|
|
7
|
-
|
|
8
|
-
def all(self, applicant_id: str):
|
|
9
|
-
payload = {"applicant_id": applicant_id}
|
|
10
|
-
return self._get("motion_captures/", payload=payload)
|
|
11
|
-
|
|
12
|
-
def download(self, motion_capture_id: str):
|
|
13
|
-
return self._download_request(f"motion_captures/{motion_capture_id}/download")
|
|
14
|
-
|
|
15
|
-
def download_frame(self, motion_capture_id: str):
|
|
16
|
-
return self._download_request(f"motion_captures/{motion_capture_id}/frame")
|