├── LICENSE ├── README.md ├── docs ├── Address.md ├── AddressesList.md ├── Applicant.md ├── ApplicantsList.md ├── Check.md ├── ChecksList.md ├── DefaultApi.md ├── Document.md ├── DocumentsList.md ├── Error.md ├── ErrorProperties.md ├── IdNumber.md ├── LivePhoto.md ├── LivePhotosList.md ├── LiveVideo.md ├── LiveVideosList.md ├── Report.md ├── ReportDocument.md ├── ReportsList.md ├── SdkToken.md ├── Webhook.md └── WebhooksList.md ├── onfido ├── __init__.py ├── api │ ├── __init__.py │ └── default_api.py ├── api_client.py ├── configuration.py ├── exceptions.py ├── models │ ├── __init__.py │ ├── address.py │ ├── addresses_list.py │ ├── applicant.py │ ├── applicants_list.py │ ├── check.py │ ├── checks_list.py │ ├── document.py │ ├── documents_list.py │ ├── error.py │ ├── error_properties.py │ ├── id_number.py │ ├── live_photo.py │ ├── live_photos_list.py │ ├── live_video.py │ ├── live_videos_list.py │ ├── report.py │ ├── report_document.py │ ├── reports_list.py │ ├── sdk_token.py │ ├── webhook.py │ └── webhooks_list.py └── rest.py ├── requirements.txt ├── setup.py ├── test-requirements.txt ├── test ├── __init__.py ├── test_address.py ├── test_addresses_list.py ├── test_applicant.py ├── test_applicants_list.py ├── test_check.py ├── test_checks_list.py ├── test_default_api.py ├── test_document.py ├── test_documents_list.py ├── test_error.py ├── test_error_properties.py ├── test_id_number.py ├── test_live_photo.py ├── test_live_photos_list.py ├── test_live_video.py ├── test_live_videos_list.py ├── test_report.py ├── test_report_document.py ├── test_reports_list.py ├── test_sdk_token.py ├── test_webhook.py └── test_webhooks_list.py └── tox.ini /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Onfido 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :warning: Please use [onfido-python](https://github.com/onfido/onfido-python) instead :warning: 2 | 3 | This library has been superseded by [onfido-python](https://github.com/onfido/onfido-python) 4 | 5 | # onfido 6 | The Onfido API is used to submit check requests. 7 | 8 | This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: 9 | 10 | - API version: 3.0.0 11 | - Package version: 5.0.0 12 | - Build package: org.openapitools.codegen.languages.PythonClientCodegen 13 | 14 | ## Requirements. 15 | 16 | Python 2.7 and 3.4+ 17 | 18 | ## Installation & Usage 19 | 20 | Install using pip: 21 | 22 | ```sh 23 | pip install onfido 24 | ``` 25 | 26 | Then import the package: 27 | ```python 28 | import onfido 29 | ``` 30 | 31 | ## Getting Started 32 | 33 | Please follow the [installation procedure](#installation--usage) and then run the following: 34 | 35 | ```python 36 | import sys 37 | import onfido 38 | import datetime 39 | from pprint import pprint 40 | from onfido.rest import ApiException 41 | 42 | configuration = onfido.Configuration() 43 | configuration.api_key['Authorization'] = 'token=' + 'YOUR API TOKEN' 44 | configuration.api_key_prefix['Authorization'] = 'Token' 45 | 46 | # Limit the at-rest region, if needed (optional, see https://documentation.onfido.com/#regions) 47 | # configuration.host = configuration.get_host_from_settings(1, {'region': 'us'}) 48 | 49 | api_instance = onfido.DefaultApi(onfido.ApiClient(configuration)) 50 | 51 | # Setting applicant details 52 | 53 | applicant_address = onfido.Address( 54 | building_number=100, 55 | street='Main Street', 56 | town='London', 57 | postcode='SW4 6EH', 58 | country='GBR' 59 | ) 60 | 61 | applicant_details = onfido.Applicant( 62 | first_name='Jane', 63 | last_name='Doe', 64 | address=applicant_address 65 | ) 66 | 67 | # Setting check details 68 | 69 | check_data = onfido.Check() 70 | check_data.report_names = ['identity_standard'] 71 | 72 | # Create an applicant and then a check with an Identity report 73 | 74 | try: 75 | applicant_data = api_instance.create_applicant(applicant_details) 76 | applicant_id = applicant_data.id 77 | pprint('Applicant ID: '+applicant_id) 78 | check_data.applicant_id = applicant_id 79 | new_check = api_instance.create_check(check_data) 80 | pprint(new_check) 81 | except ApiException as e: 82 | pprint(e.body) 83 | 84 | ``` 85 | 86 | ## Documentation for API Endpoints 87 | 88 | All URIs are relative to *https://api.onfido.com/v3* 89 | 90 | Class | Method | HTTP request | Description 91 | ------------ | ------------- | ------------- | ------------- 92 | *DefaultApi* | [**cancel_report**](docs/DefaultApi.md#cancel_report) | **POST** /reports/{report_id}/cancel | This endpoint is for cancelling individual paused reports. 93 | *DefaultApi* | [**create_applicant**](docs/DefaultApi.md#create_applicant) | **POST** /applicants | Create Applicant 94 | *DefaultApi* | [**create_check**](docs/DefaultApi.md#create_check) | **POST** /checks | Create a check 95 | *DefaultApi* | [**create_webhook**](docs/DefaultApi.md#create_webhook) | **POST** /webhooks | Create a webhook 96 | *DefaultApi* | [**delete_webhook**](docs/DefaultApi.md#delete_webhook) | **DELETE** /webhooks/{webhook_id} | Delete a webhook 97 | *DefaultApi* | [**destroy_applicant**](docs/DefaultApi.md#destroy_applicant) | **DELETE** /applicants/{applicant_id} | Delete Applicant 98 | *DefaultApi* | [**download_document**](docs/DefaultApi.md#download_document) | **GET** /documents/{document_id}/download | Download a documents raw data 99 | *DefaultApi* | [**download_live_photo**](docs/DefaultApi.md#download_live_photo) | **GET** /live_photos/{live_photo_id}/download | Download live photo 100 | *DefaultApi* | [**download_live_video**](docs/DefaultApi.md#download_live_video) | **GET** /live_videos/{live_video_id}/download | Download live video 101 | *DefaultApi* | [**edit_webhook**](docs/DefaultApi.md#edit_webhook) | **PUT** /webhooks/{webhook_id} | Edit a webhook 102 | *DefaultApi* | [**find_addresses**](docs/DefaultApi.md#find_addresses) | **GET** /addresses/pick | Search for addresses by postcode 103 | *DefaultApi* | [**find_applicant**](docs/DefaultApi.md#find_applicant) | **GET** /applicants/{applicant_id} | Retrieve Applicant 104 | *DefaultApi* | [**find_check**](docs/DefaultApi.md#find_check) | **GET** /checks/{check_id} | Retrieve a Check 105 | *DefaultApi* | [**find_document**](docs/DefaultApi.md#find_document) | **GET** /documents/{document_id} | A single document can be retrieved by calling this endpoint with the document’s unique identifier. 106 | *DefaultApi* | [**find_live_photo**](docs/DefaultApi.md#find_live_photo) | **GET** /live_photos/{live_photo_id} | Retrieve live photo 107 | *DefaultApi* | [**find_live_video**](docs/DefaultApi.md#find_live_video) | **GET** /live_videos/{live_video_id} | Retrieve live video 108 | *DefaultApi* | [**find_report**](docs/DefaultApi.md#find_report) | **GET** /reports/{report_id} | A single report can be retrieved using this endpoint with the corresponding unique identifier. 109 | *DefaultApi* | [**find_webhook**](docs/DefaultApi.md#find_webhook) | **GET** /webhooks/{webhook_id} | Retrieve a Webhook 110 | *DefaultApi* | [**generate_sdk_token**](docs/DefaultApi.md#generate_sdk_token) | **POST** /sdk_token | Generate a SDK token 111 | *DefaultApi* | [**list_applicants**](docs/DefaultApi.md#list_applicants) | **GET** /applicants | List Applicants 112 | *DefaultApi* | [**list_checks**](docs/DefaultApi.md#list_checks) | **GET** /checks | Retrieve Checks 113 | *DefaultApi* | [**list_documents**](docs/DefaultApi.md#list_documents) | **GET** /documents | List documents 114 | *DefaultApi* | [**list_live_photos**](docs/DefaultApi.md#list_live_photos) | **GET** /live_photos | List live photos 115 | *DefaultApi* | [**list_live_videos**](docs/DefaultApi.md#list_live_videos) | **GET** /live_videos | List live videos 116 | *DefaultApi* | [**list_reports**](docs/DefaultApi.md#list_reports) | **GET** /reports | All the reports belonging to a particular check can be listed from this endpoint. 117 | *DefaultApi* | [**list_webhooks**](docs/DefaultApi.md#list_webhooks) | **GET** /webhooks | List webhooks 118 | *DefaultApi* | [**restore_applicant**](docs/DefaultApi.md#restore_applicant) | **POST** /applicants/{applicant_id}/restore | Restore Applicant 119 | *DefaultApi* | [**resume_check**](docs/DefaultApi.md#resume_check) | **POST** /checks/{check_id}/resume | Resume a Check 120 | *DefaultApi* | [**resume_report**](docs/DefaultApi.md#resume_report) | **POST** /reports/{report_id}/resume | This endpoint is for resuming individual paused reports. 121 | *DefaultApi* | [**update_applicant**](docs/DefaultApi.md#update_applicant) | **PUT** /applicants/{applicant_id} | Update Applicant 122 | *DefaultApi* | [**upload_document**](docs/DefaultApi.md#upload_document) | **POST** /documents | Upload a document 123 | *DefaultApi* | [**upload_live_photo**](docs/DefaultApi.md#upload_live_photo) | **POST** /live_photos | Upload live photo 124 | 125 | 126 | ## Documentation For Models 127 | 128 | - [Address](docs/Address.md) 129 | - [AddressesList](docs/AddressesList.md) 130 | - [Applicant](docs/Applicant.md) 131 | - [ApplicantsList](docs/ApplicantsList.md) 132 | - [Check](docs/Check.md) 133 | - [ChecksList](docs/ChecksList.md) 134 | - [Document](docs/Document.md) 135 | - [DocumentsList](docs/DocumentsList.md) 136 | - [Error](docs/Error.md) 137 | - [ErrorProperties](docs/ErrorProperties.md) 138 | - [IdNumber](docs/IdNumber.md) 139 | - [LivePhoto](docs/LivePhoto.md) 140 | - [LivePhotosList](docs/LivePhotosList.md) 141 | - [LiveVideo](docs/LiveVideo.md) 142 | - [LiveVideosList](docs/LiveVideosList.md) 143 | - [Report](docs/Report.md) 144 | - [ReportDocument](docs/ReportDocument.md) 145 | - [ReportsList](docs/ReportsList.md) 146 | - [SdkToken](docs/SdkToken.md) 147 | - [Webhook](docs/Webhook.md) 148 | - [WebhooksList](docs/WebhooksList.md) 149 | 150 | 151 | ## Documentation For Authorization 152 | 153 | 154 | ## Token 155 | 156 | - **Type**: API key 157 | - **API key parameter name**: Authorization 158 | - **Location**: HTTP header 159 | 160 | 161 | ## Author 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /docs/Address.md: -------------------------------------------------------------------------------- 1 | # Address 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **flat_number** | **str** | The flat number of this address | [optional] 7 | **building_number** | **str** | The building number of this address | [optional] 8 | **building_name** | **str** | The building name of this address | [optional] 9 | **street** | **str** | The street of the applicant’s address | [optional] 10 | **sub_street** | **str** | The sub-street of the applicant’s address | [optional] 11 | **town** | **str** | The town of the applicant’s address | [optional] 12 | **postcode** | **str** | The postcode or ZIP of the applicant’s address | [optional] 13 | **country** | **str** | The 3 character ISO country code of this address. For example, GBR is the country code for the United Kingdom | [optional] 14 | **state** | **str** | The address state. US states must use the USPS abbreviation (see also ISO 3166-2:US), for example AK, CA, or TX. | [optional] 15 | **line1** | **str** | Line 1 of the applicant's address | [optional] 16 | **line2** | **str** | Line 2 of the applicant's address | [optional] 17 | **line3** | **str** | Line 3 of the applicant's address | [optional] 18 | 19 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/AddressesList.md: -------------------------------------------------------------------------------- 1 | # AddressesList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **addresses** | [**list[Address]**](Address.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/Applicant.md: -------------------------------------------------------------------------------- 1 | # Applicant 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the applicant. Read-only. | [optional] 7 | **created_at** | **datetime** | The date and time when this applicant was created. Read-only. | [optional] 8 | **delete_at** | **datetime** | The date and time when this applicant is scheduled to be deleted. Read-only. | [optional] 9 | **href** | **str** | The uri of this resource. Read-only. | [optional] 10 | **sandbox** | **bool** | Read-only. | [optional] 11 | **first_name** | **str** | The applicant’s first name | [optional] 12 | **last_name** | **str** | The applicant’s surname | [optional] 13 | **email** | **str** | The applicant’s email address. Required if doing a US check, or a UK check for which `applicant_provides_data` is `true`. | [optional] 14 | **dob** | **date** | The applicant’s date of birth | [optional] 15 | **address** | [**Address**](Address.md) | | [optional] 16 | **id_numbers** | [**list[IdNumber]**](IdNumber.md) | | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/ApplicantsList.md: -------------------------------------------------------------------------------- 1 | # ApplicantsList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **applicants** | [**list[Applicant]**](Applicant.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/Check.md: -------------------------------------------------------------------------------- 1 | # Check 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the check. Read-only. | [optional] 7 | **created_at** | **datetime** | The date and time when this check was created. Read-only. | [optional] 8 | **href** | **str** | The uri of this resource. Read-only. | [optional] 9 | **status** | **str** | The current state of the check in the checking process. Read-only. | [optional] 10 | **result** | **str** | The overall result of the check, based on the results of the constituent reports. Read-only. | [optional] 11 | **download_uri** | **str** | A link to a PDF output of the check results. Append `.pdf` to get the pdf file. Read-only. | [optional] 12 | **form_uri** | **str** | A link to the applicant form, if `applicant_provides_data` is `true`. Read-only. | [optional] 13 | **redirect_uri** | **str** | For checks where `applicant_provides_data` is `true`, redirect to this URI when the applicant has submitted their data. Read-only. | [optional] 14 | **results_uri** | **str** | A link to the corresponding results page on the Onfido dashboard. | [optional] 15 | **report_names** | **list[str]** | An array of report names (strings). | [optional] 16 | **applicant_id** | **str** | The ID of the applicant to do the check on. | [optional] 17 | **tags** | **list[str]** | Array of tags being assigned to this check. | [optional] 18 | **applicant_provides_data** | **bool** | Send an applicant form to applicant to complete to proceed with check. Defaults to false. | [optional] 19 | **suppress_form_emails** | **bool** | For checks where `applicant_provides_data` is `true`, applicant form will not be automatically sent if `suppress_form_emails` is set to `true`. You can manually send the form at any time after the check has been created, using the link found in the form_uri attribute of the check object. Write-only. Defaults to false. | [optional] 20 | **asynchronous** | **bool** | Defaults to `true`. Write-only. If set to `false`, you will only receive a response when all reports in your check have completed. | [optional] 21 | **report_ids** | **list[str]** | An array of report ids. | [optional] 22 | 23 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/ChecksList.md: -------------------------------------------------------------------------------- 1 | # ChecksList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **checks** | [**list[Check]**](Check.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/Document.md: -------------------------------------------------------------------------------- 1 | # Document 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the document | [optional] 7 | **created_at** | **datetime** | The date and time at which the document was uploaded | [optional] 8 | **file_name** | **str** | The name of the uploaded file | [optional] 9 | **file_size** | **int** | The size of the file in bytes | [optional] 10 | **file_type** | **str** | The file type of the uploaded file | [optional] 11 | **type** | **str** | The type of document | [optional] 12 | **side** | **str** | The side of the document, if applicable. The possible values are front and back | [optional] 13 | **issuing_country** | **str** | The issuing country of the document, a 3-letter ISO code. | [optional] 14 | **href** | **str** | The uri of this resource | [optional] 15 | **download_href** | **str** | The uri that can be used to download the document | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/DocumentsList.md: -------------------------------------------------------------------------------- 1 | # DocumentsList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **documents** | [**list[Document]**](Document.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/Error.md: -------------------------------------------------------------------------------- 1 | # Error 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **error** | [**ErrorProperties**](ErrorProperties.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/ErrorProperties.md: -------------------------------------------------------------------------------- 1 | # ErrorProperties 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **type** | **str** | | [optional] 7 | **message** | **str** | | [optional] 8 | **fields** | **dict(str, object)** | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/IdNumber.md: -------------------------------------------------------------------------------- 1 | # IdNumber 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **type** | **str** | Type of ID number. Valid values are `ssn`, `social_insurance`, `tax_id`, `identity_card`, `passport` and `driving_license` | [optional] 7 | **value** | **str** | Value of ID number | [optional] 8 | **state_code** | **str** | Two letter code of issuing state (state-issued driving licenses only) | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/LivePhoto.md: -------------------------------------------------------------------------------- 1 | # LivePhoto 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the photo. | [optional] 7 | **created_at** | **datetime** | The date and time at which the photo was uploaded. | [optional] 8 | **href** | **str** | The uri of this resource. | [optional] 9 | **download_href** | **str** | The uri that can be used to download the photo. | [optional] 10 | **file_name** | **str** | The name of the uploaded file. | [optional] 11 | **file_size** | **int** | The size of the file in bytes. | [optional] 12 | **file_type** | **str** | The file type of the uploaded file. | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/LivePhotosList.md: -------------------------------------------------------------------------------- 1 | # LivePhotosList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **live_photos** | [**list[LivePhoto]**](LivePhoto.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/LiveVideo.md: -------------------------------------------------------------------------------- 1 | # LiveVideo 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the video. | [optional] 7 | **created_at** | **datetime** | The date and time at which the video was uploaded. | [optional] 8 | **href** | **str** | The uri of this resource. | [optional] 9 | **download_href** | **str** | The uri that can be used to download the video. | [optional] 10 | **file_name** | **str** | The name of the uploaded file. | [optional] 11 | **file_size** | **int** | The size of the file in bytes. | [optional] 12 | **file_type** | **str** | The file type of the uploaded file. | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/LiveVideosList.md: -------------------------------------------------------------------------------- 1 | # LiveVideosList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **live_videos** | [**list[LiveVideo]**](LiveVideo.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/Report.md: -------------------------------------------------------------------------------- 1 | # Report 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier for the report. Read-only. | [optional] 7 | **created_at** | **datetime** | The date and time at which the report was first initiated. Read-only. | [optional] 8 | **href** | **str** | The API endpoint to retrieve the report. Read-only. | [optional] 9 | **status** | **str** | The current state of the report in the checking process. Read-only. | [optional] 10 | **result** | **str** | The result of the report. Read-only. | [optional] 11 | **sub_result** | **str** | The sub_result of the report. It gives a more detailed result for document reports only, and will be null otherwise. Read-only. | [optional] 12 | **breakdown** | **dict(str, object)** | The details of the report. This is specific to each type of report. Read-only. | [optional] 13 | **properties** | **dict(str, object)** | The properties associated with the report, if any. Read-only. | [optional] 14 | **name** | **str** | The name of the report type. | 15 | **documents** | [**list[ReportDocument]**](ReportDocument.md) | Array of objects with document ids that were used in the Onfido engine. [ONLY USED IN A DOCUMENT CHECK] | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/ReportDocument.md: -------------------------------------------------------------------------------- 1 | # ReportDocument 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | ID of uploaded document to use. | 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/ReportsList.md: -------------------------------------------------------------------------------- 1 | # ReportsList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **reports** | [**list[Report]**](Report.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/SdkToken.md: -------------------------------------------------------------------------------- 1 | # SdkToken 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **applicant_id** | **str** | The unique identifier of the applicant | [optional] 7 | **referrer** | **str** | The referrer URL pattern | [optional] 8 | **application_id** | **str** | The application ID (iOS or Android) | [optional] 9 | **token** | **str** | The generated SDK token | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Webhook.md: -------------------------------------------------------------------------------- 1 | # Webhook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | The unique identifier of the webhook. Read-only. | [optional] 7 | **token** | **str** | Webhook secret token used to sign the webhook's payload. Read-only. | [optional] 8 | **href** | **str** | The API endpoint to retrieve the webhook. Read-only. | [optional] 9 | **url** | **str** | The url that will listen to notifications (must be https). | 10 | **enabled** | **bool** | Determine if the webhook is active. | [optional] 11 | **environments** | **list[str]** | The environments from which the webhook will receive events. Allowed values are “sandbox” and “live”. If the environments parameter is omitted the webhook will receive events from both environments. | [optional] 12 | **events** | **list[str]** | The events that will be published to the webhook. The supported events are: `report.completed`, `report.withdrawn`, `check.completed`, `check.started`, `check.form_opened`, `check.form_completed`. If the events parameter is omitted all the events will be subscribed. | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/WebhooksList.md: -------------------------------------------------------------------------------- 1 | # WebhooksList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **webhooks** | [**list[Webhook]**](Webhook.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /onfido/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | Onfido API 7 | 8 | The Onfido API is used to submit check requests. # noqa: E501 9 | 10 | The version of the OpenAPI document: 3.0.0 11 | Generated by: https://openapi-generator.tech 12 | """ 13 | 14 | 15 | from __future__ import absolute_import 16 | 17 | __version__ = "5.0.0" 18 | 19 | # import apis into sdk package 20 | from onfido.api.default_api import DefaultApi 21 | 22 | # import ApiClient 23 | from onfido.api_client import ApiClient 24 | from onfido.configuration import Configuration 25 | from onfido.exceptions import OpenApiException 26 | from onfido.exceptions import ApiTypeError 27 | from onfido.exceptions import ApiValueError 28 | from onfido.exceptions import ApiKeyError 29 | from onfido.exceptions import ApiException 30 | # import models into sdk package 31 | from onfido.models.address import Address 32 | from onfido.models.addresses_list import AddressesList 33 | from onfido.models.applicant import Applicant 34 | from onfido.models.applicants_list import ApplicantsList 35 | from onfido.models.check import Check 36 | from onfido.models.checks_list import ChecksList 37 | from onfido.models.document import Document 38 | from onfido.models.documents_list import DocumentsList 39 | from onfido.models.error import Error 40 | from onfido.models.error_properties import ErrorProperties 41 | from onfido.models.id_number import IdNumber 42 | from onfido.models.live_photo import LivePhoto 43 | from onfido.models.live_photos_list import LivePhotosList 44 | from onfido.models.live_video import LiveVideo 45 | from onfido.models.live_videos_list import LiveVideosList 46 | from onfido.models.report import Report 47 | from onfido.models.report_document import ReportDocument 48 | from onfido.models.reports_list import ReportsList 49 | from onfido.models.sdk_token import SdkToken 50 | from onfido.models.webhook import Webhook 51 | from onfido.models.webhooks_list import WebhooksList 52 | 53 | -------------------------------------------------------------------------------- /onfido/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from onfido.api.default_api import DefaultApi 7 | -------------------------------------------------------------------------------- /onfido/configuration.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import copy 16 | import logging 17 | import multiprocessing 18 | import sys 19 | import urllib3 20 | 21 | import six 22 | from six.moves import http_client as httplib 23 | 24 | 25 | class TypeWithDefault(type): 26 | def __init__(cls, name, bases, dct): 27 | super(TypeWithDefault, cls).__init__(name, bases, dct) 28 | cls._default = None 29 | 30 | def __call__(cls): 31 | if cls._default is None: 32 | cls._default = type.__call__(cls) 33 | return copy.copy(cls._default) 34 | 35 | def set_default(cls, default): 36 | cls._default = copy.copy(default) 37 | 38 | 39 | class Configuration(six.with_metaclass(TypeWithDefault, object)): 40 | """NOTE: This class is auto generated by OpenAPI Generator 41 | 42 | Ref: https://openapi-generator.tech 43 | Do not edit the class manually. 44 | """ 45 | 46 | def __init__(self): 47 | """Constructor""" 48 | # Default Base url 49 | self.host = "https://api.onfido.com/v3" 50 | # Temp file folder for downloading files 51 | self.temp_folder_path = None 52 | 53 | # Authentication Settings 54 | # dict to store API key(s) 55 | self.api_key = {} 56 | # dict to store API prefix (e.g. Bearer) 57 | self.api_key_prefix = {} 58 | # Username for HTTP basic authentication 59 | self.username = "" 60 | # Password for HTTP basic authentication 61 | self.password = "" 62 | # Logging Settings 63 | self.logger = {} 64 | self.logger["package_logger"] = logging.getLogger("onfido") 65 | self.logger["urllib3_logger"] = logging.getLogger("urllib3") 66 | # Log format 67 | self.logger_format = '%(asctime)s %(levelname)s %(message)s' 68 | # Log stream handler 69 | self.logger_stream_handler = None 70 | # Log file handler 71 | self.logger_file_handler = None 72 | # Debug file location 73 | self.logger_file = None 74 | # Debug switch 75 | self.debug = False 76 | 77 | # SSL/TLS verification 78 | # Set this to false to skip verifying SSL certificate when calling API 79 | # from https server. 80 | self.verify_ssl = True 81 | # Set this to customize the certificate file to verify the peer. 82 | self.ssl_ca_cert = None 83 | # client certificate file 84 | self.cert_file = None 85 | # client key file 86 | self.key_file = None 87 | # Set this to True/False to enable/disable SSL hostname verification. 88 | self.assert_hostname = None 89 | 90 | # urllib3 connection pool's maximum number of connections saved 91 | # per pool. urllib3 uses 1 connection as default value, but this is 92 | # not the best value when you are making a lot of possibly parallel 93 | # requests to the same host, which is often the case here. 94 | # cpu_count * 5 is used as default value to increase performance. 95 | self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 96 | 97 | # Proxy URL 98 | self.proxy = None 99 | # Proxy headers 100 | self.proxy_headers = None 101 | # Safe chars for path_param 102 | self.safe_chars_for_path_param = '' 103 | # Adding retries to override urllib3 default value 3 104 | self.retries = None 105 | 106 | @property 107 | def logger_file(self): 108 | """The logger file. 109 | 110 | If the logger_file is None, then add stream handler and remove file 111 | handler. Otherwise, add file handler and remove stream handler. 112 | 113 | :param value: The logger_file path. 114 | :type: str 115 | """ 116 | return self.__logger_file 117 | 118 | @logger_file.setter 119 | def logger_file(self, value): 120 | """The logger file. 121 | 122 | If the logger_file is None, then add stream handler and remove file 123 | handler. Otherwise, add file handler and remove stream handler. 124 | 125 | :param value: The logger_file path. 126 | :type: str 127 | """ 128 | self.__logger_file = value 129 | if self.__logger_file: 130 | # If set logging file, 131 | # then add file handler and remove stream handler. 132 | self.logger_file_handler = logging.FileHandler(self.__logger_file) 133 | self.logger_file_handler.setFormatter(self.logger_formatter) 134 | for _, logger in six.iteritems(self.logger): 135 | logger.addHandler(self.logger_file_handler) 136 | 137 | @property 138 | def debug(self): 139 | """Debug status 140 | 141 | :param value: The debug status, True or False. 142 | :type: bool 143 | """ 144 | return self.__debug 145 | 146 | @debug.setter 147 | def debug(self, value): 148 | """Debug status 149 | 150 | :param value: The debug status, True or False. 151 | :type: bool 152 | """ 153 | self.__debug = value 154 | if self.__debug: 155 | # if debug status is True, turn on debug logging 156 | for _, logger in six.iteritems(self.logger): 157 | logger.setLevel(logging.DEBUG) 158 | # turn on httplib debug 159 | httplib.HTTPConnection.debuglevel = 1 160 | else: 161 | # if debug status is False, turn off debug logging, 162 | # setting log level to default `logging.WARNING` 163 | for _, logger in six.iteritems(self.logger): 164 | logger.setLevel(logging.WARNING) 165 | # turn off httplib debug 166 | httplib.HTTPConnection.debuglevel = 0 167 | 168 | @property 169 | def logger_format(self): 170 | """The logger format. 171 | 172 | The logger_formatter will be updated when sets logger_format. 173 | 174 | :param value: The format string. 175 | :type: str 176 | """ 177 | return self.__logger_format 178 | 179 | @logger_format.setter 180 | def logger_format(self, value): 181 | """The logger format. 182 | 183 | The logger_formatter will be updated when sets logger_format. 184 | 185 | :param value: The format string. 186 | :type: str 187 | """ 188 | self.__logger_format = value 189 | self.logger_formatter = logging.Formatter(self.__logger_format) 190 | 191 | def get_api_key_with_prefix(self, identifier): 192 | """Gets API key (with prefix if set). 193 | 194 | :param identifier: The identifier of apiKey. 195 | :return: The token for api key authentication. 196 | """ 197 | if (self.api_key.get(identifier) and 198 | self.api_key_prefix.get(identifier)): 199 | return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 200 | elif self.api_key.get(identifier): 201 | return self.api_key[identifier] 202 | 203 | def get_basic_auth_token(self): 204 | """Gets HTTP basic authentication header (string). 205 | 206 | :return: The token for basic HTTP authentication. 207 | """ 208 | return urllib3.util.make_headers( 209 | basic_auth=self.username + ':' + self.password 210 | ).get('authorization') 211 | 212 | def auth_settings(self): 213 | """Gets Auth Settings dict for api client. 214 | 215 | :return: The Auth Settings information dict. 216 | """ 217 | return { 218 | 'Token': 219 | { 220 | 'type': 'api_key', 221 | 'in': 'header', 222 | 'key': 'Authorization', 223 | 'value': self.get_api_key_with_prefix('Authorization') 224 | }, 225 | } 226 | 227 | def to_debug_report(self): 228 | """Gets the essential information for debugging. 229 | 230 | :return: The report for debugging. 231 | """ 232 | return "Python SDK Debug Report:\n"\ 233 | "OS: {env}\n"\ 234 | "Python Version: {pyversion}\n"\ 235 | "Version of the API: 3.0.0\n"\ 236 | "SDK Package Version: 5.0.0".\ 237 | format(env=sys.platform, pyversion=sys.version) 238 | 239 | def get_host_settings(self): 240 | """Gets an array of host settings 241 | 242 | :return: An array of host settings 243 | """ 244 | return [ 245 | { 246 | 'url': "https://api.onfido.com/v3", 247 | 'description': "No description provided", 248 | }, 249 | { 250 | 'url': "https://api.{region}.onfido.com/v3", 251 | 'description': "No description provided", 252 | 'variables': { 253 | 'region': { 254 | 'description': "No description provided", 255 | 'default_value': "us", 256 | 'enum_values': [ 257 | "us" 258 | ] 259 | } 260 | } 261 | } 262 | ] 263 | 264 | def get_host_from_settings(self, index, variables={}): 265 | """Gets host URL based on the index and variables 266 | :param index: array index of the host settings 267 | :param variables: hash of variable and the corresponding value 268 | :return: URL based on host settings 269 | """ 270 | 271 | servers = self.get_host_settings() 272 | 273 | # check array index out of bound 274 | if index < 0 or index >= len(servers): 275 | raise ValueError( 276 | "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 277 | .format(index, len(servers))) 278 | 279 | server = servers[index] 280 | url = server['url'] 281 | 282 | # go through variable and assign a value 283 | for variable_name in server['variables']: 284 | if variable_name in variables: 285 | if variables[variable_name] in server['variables'][ 286 | variable_name]['enum_values']: 287 | url = url.replace("{" + variable_name + "}", 288 | variables[variable_name]) 289 | else: 290 | raise ValueError( 291 | "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 292 | .format( 293 | variable_name, variables[variable_name], 294 | server['variables'][variable_name]['enum_values'])) 295 | else: 296 | # use default value 297 | url = url.replace( 298 | "{" + variable_name + "}", 299 | server['variables'][variable_name]['default_value']) 300 | 301 | return url 302 | -------------------------------------------------------------------------------- /onfido/exceptions.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import six 14 | 15 | 16 | class OpenApiException(Exception): 17 | """The base exception class for all OpenAPIExceptions""" 18 | 19 | 20 | class ApiTypeError(OpenApiException, TypeError): 21 | def __init__(self, msg, path_to_item=None, valid_classes=None, 22 | key_type=None): 23 | """ Raises an exception for TypeErrors 24 | 25 | Args: 26 | msg (str): the exception message 27 | 28 | Keyword Args: 29 | path_to_item (list): a list of keys an indices to get to the 30 | current_item 31 | None if unset 32 | valid_classes (tuple): the primitive classes that current item 33 | should be an instance of 34 | None if unset 35 | key_type (bool): False if our value is a value in a dict 36 | True if it is a key in a dict 37 | False if our item is an item in a list 38 | None if unset 39 | """ 40 | self.path_to_item = path_to_item 41 | self.valid_classes = valid_classes 42 | self.key_type = key_type 43 | full_msg = msg 44 | if path_to_item: 45 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 46 | super(ApiTypeError, self).__init__(full_msg) 47 | 48 | 49 | class ApiValueError(OpenApiException, ValueError): 50 | def __init__(self, msg, path_to_item=None): 51 | """ 52 | Args: 53 | msg (str): the exception message 54 | 55 | Keyword Args: 56 | path_to_item (list) the path to the exception in the 57 | received_data dict. None if unset 58 | """ 59 | 60 | self.path_to_item = path_to_item 61 | full_msg = msg 62 | if path_to_item: 63 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 64 | super(ApiValueError, self).__init__(full_msg) 65 | 66 | 67 | class ApiKeyError(OpenApiException, KeyError): 68 | def __init__(self, msg, path_to_item=None): 69 | """ 70 | Args: 71 | msg (str): the exception message 72 | 73 | Keyword Args: 74 | path_to_item (None/list) the path to the exception in the 75 | received_data dict 76 | """ 77 | self.path_to_item = path_to_item 78 | full_msg = msg 79 | if path_to_item: 80 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 81 | super(ApiKeyError, self).__init__(full_msg) 82 | 83 | 84 | class ApiException(OpenApiException): 85 | 86 | def __init__(self, status=None, reason=None, http_resp=None): 87 | if http_resp: 88 | self.status = http_resp.status 89 | self.reason = http_resp.reason 90 | self.body = http_resp.data 91 | self.headers = http_resp.getheaders() 92 | else: 93 | self.status = status 94 | self.reason = reason 95 | self.body = None 96 | self.headers = None 97 | 98 | def __str__(self): 99 | """Custom error messages for exception""" 100 | error_message = "({0})\n"\ 101 | "Reason: {1}\n".format(self.status, self.reason) 102 | if self.headers: 103 | error_message += "HTTP response headers: {0}\n".format( 104 | self.headers) 105 | 106 | if self.body: 107 | error_message += "HTTP response body: {0}\n".format(self.body) 108 | 109 | return error_message 110 | 111 | 112 | def render_path(path_to_item): 113 | """Returns a string representation of a path""" 114 | result = "" 115 | for pth in path_to_item: 116 | if isinstance(pth, six.integer_types): 117 | result += "[{0}]".format(pth) 118 | else: 119 | result += "['{0}']".format(pth) 120 | return result 121 | -------------------------------------------------------------------------------- /onfido/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | """ 5 | Onfido API 6 | 7 | The Onfido API is used to submit check requests. # noqa: E501 8 | 9 | The version of the OpenAPI document: 3.0.0 10 | Generated by: https://openapi-generator.tech 11 | """ 12 | 13 | 14 | from __future__ import absolute_import 15 | 16 | # import models into model package 17 | from onfido.models.address import Address 18 | from onfido.models.addresses_list import AddressesList 19 | from onfido.models.applicant import Applicant 20 | from onfido.models.applicants_list import ApplicantsList 21 | from onfido.models.check import Check 22 | from onfido.models.checks_list import ChecksList 23 | from onfido.models.document import Document 24 | from onfido.models.documents_list import DocumentsList 25 | from onfido.models.error import Error 26 | from onfido.models.error_properties import ErrorProperties 27 | from onfido.models.id_number import IdNumber 28 | from onfido.models.live_photo import LivePhoto 29 | from onfido.models.live_photos_list import LivePhotosList 30 | from onfido.models.live_video import LiveVideo 31 | from onfido.models.live_videos_list import LiveVideosList 32 | from onfido.models.report import Report 33 | from onfido.models.report_document import ReportDocument 34 | from onfido.models.reports_list import ReportsList 35 | from onfido.models.sdk_token import SdkToken 36 | from onfido.models.webhook import Webhook 37 | from onfido.models.webhooks_list import WebhooksList 38 | -------------------------------------------------------------------------------- /onfido/models/address.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Address(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'flat_number': 'str', 35 | 'building_number': 'str', 36 | 'building_name': 'str', 37 | 'street': 'str', 38 | 'sub_street': 'str', 39 | 'town': 'str', 40 | 'postcode': 'str', 41 | 'country': 'str', 42 | 'state': 'str', 43 | 'line1': 'str', 44 | 'line2': 'str', 45 | 'line3': 'str' 46 | } 47 | 48 | attribute_map = { 49 | 'flat_number': 'flat_number', 50 | 'building_number': 'building_number', 51 | 'building_name': 'building_name', 52 | 'street': 'street', 53 | 'sub_street': 'sub_street', 54 | 'town': 'town', 55 | 'postcode': 'postcode', 56 | 'country': 'country', 57 | 'state': 'state', 58 | 'line1': 'line1', 59 | 'line2': 'line2', 60 | 'line3': 'line3' 61 | } 62 | 63 | def __init__(self, flat_number=None, building_number=None, building_name=None, street=None, sub_street=None, town=None, postcode=None, country=None, state=None, line1=None, line2=None, line3=None): # noqa: E501 64 | """Address - a model defined in OpenAPI""" # noqa: E501 65 | 66 | self._flat_number = None 67 | self._building_number = None 68 | self._building_name = None 69 | self._street = None 70 | self._sub_street = None 71 | self._town = None 72 | self._postcode = None 73 | self._country = None 74 | self._state = None 75 | self._line1 = None 76 | self._line2 = None 77 | self._line3 = None 78 | self.discriminator = None 79 | 80 | if flat_number is not None: 81 | self.flat_number = flat_number 82 | if building_number is not None: 83 | self.building_number = building_number 84 | if building_name is not None: 85 | self.building_name = building_name 86 | if street is not None: 87 | self.street = street 88 | if sub_street is not None: 89 | self.sub_street = sub_street 90 | if town is not None: 91 | self.town = town 92 | if postcode is not None: 93 | self.postcode = postcode 94 | if country is not None: 95 | self.country = country 96 | if state is not None: 97 | self.state = state 98 | if line1 is not None: 99 | self.line1 = line1 100 | if line2 is not None: 101 | self.line2 = line2 102 | if line3 is not None: 103 | self.line3 = line3 104 | 105 | @property 106 | def flat_number(self): 107 | """Gets the flat_number of this Address. # noqa: E501 108 | 109 | The flat number of this address # noqa: E501 110 | 111 | :return: The flat_number of this Address. # noqa: E501 112 | :rtype: str 113 | """ 114 | return self._flat_number 115 | 116 | @flat_number.setter 117 | def flat_number(self, flat_number): 118 | """Sets the flat_number of this Address. 119 | 120 | The flat number of this address # noqa: E501 121 | 122 | :param flat_number: The flat_number of this Address. # noqa: E501 123 | :type: str 124 | """ 125 | 126 | self._flat_number = flat_number 127 | 128 | @property 129 | def building_number(self): 130 | """Gets the building_number of this Address. # noqa: E501 131 | 132 | The building number of this address # noqa: E501 133 | 134 | :return: The building_number of this Address. # noqa: E501 135 | :rtype: str 136 | """ 137 | return self._building_number 138 | 139 | @building_number.setter 140 | def building_number(self, building_number): 141 | """Sets the building_number of this Address. 142 | 143 | The building number of this address # noqa: E501 144 | 145 | :param building_number: The building_number of this Address. # noqa: E501 146 | :type: str 147 | """ 148 | 149 | self._building_number = building_number 150 | 151 | @property 152 | def building_name(self): 153 | """Gets the building_name of this Address. # noqa: E501 154 | 155 | The building name of this address # noqa: E501 156 | 157 | :return: The building_name of this Address. # noqa: E501 158 | :rtype: str 159 | """ 160 | return self._building_name 161 | 162 | @building_name.setter 163 | def building_name(self, building_name): 164 | """Sets the building_name of this Address. 165 | 166 | The building name of this address # noqa: E501 167 | 168 | :param building_name: The building_name of this Address. # noqa: E501 169 | :type: str 170 | """ 171 | 172 | self._building_name = building_name 173 | 174 | @property 175 | def street(self): 176 | """Gets the street of this Address. # noqa: E501 177 | 178 | The street of the applicant’s address # noqa: E501 179 | 180 | :return: The street of this Address. # noqa: E501 181 | :rtype: str 182 | """ 183 | return self._street 184 | 185 | @street.setter 186 | def street(self, street): 187 | """Sets the street of this Address. 188 | 189 | The street of the applicant’s address # noqa: E501 190 | 191 | :param street: The street of this Address. # noqa: E501 192 | :type: str 193 | """ 194 | 195 | self._street = street 196 | 197 | @property 198 | def sub_street(self): 199 | """Gets the sub_street of this Address. # noqa: E501 200 | 201 | The sub-street of the applicant’s address # noqa: E501 202 | 203 | :return: The sub_street of this Address. # noqa: E501 204 | :rtype: str 205 | """ 206 | return self._sub_street 207 | 208 | @sub_street.setter 209 | def sub_street(self, sub_street): 210 | """Sets the sub_street of this Address. 211 | 212 | The sub-street of the applicant’s address # noqa: E501 213 | 214 | :param sub_street: The sub_street of this Address. # noqa: E501 215 | :type: str 216 | """ 217 | 218 | self._sub_street = sub_street 219 | 220 | @property 221 | def town(self): 222 | """Gets the town of this Address. # noqa: E501 223 | 224 | The town of the applicant’s address # noqa: E501 225 | 226 | :return: The town of this Address. # noqa: E501 227 | :rtype: str 228 | """ 229 | return self._town 230 | 231 | @town.setter 232 | def town(self, town): 233 | """Sets the town of this Address. 234 | 235 | The town of the applicant’s address # noqa: E501 236 | 237 | :param town: The town of this Address. # noqa: E501 238 | :type: str 239 | """ 240 | 241 | self._town = town 242 | 243 | @property 244 | def postcode(self): 245 | """Gets the postcode of this Address. # noqa: E501 246 | 247 | The postcode or ZIP of the applicant’s address # noqa: E501 248 | 249 | :return: The postcode of this Address. # noqa: E501 250 | :rtype: str 251 | """ 252 | return self._postcode 253 | 254 | @postcode.setter 255 | def postcode(self, postcode): 256 | """Sets the postcode of this Address. 257 | 258 | The postcode or ZIP of the applicant’s address # noqa: E501 259 | 260 | :param postcode: The postcode of this Address. # noqa: E501 261 | :type: str 262 | """ 263 | 264 | self._postcode = postcode 265 | 266 | @property 267 | def country(self): 268 | """Gets the country of this Address. # noqa: E501 269 | 270 | The 3 character ISO country code of this address. For example, GBR is the country code for the United Kingdom # noqa: E501 271 | 272 | :return: The country of this Address. # noqa: E501 273 | :rtype: str 274 | """ 275 | return self._country 276 | 277 | @country.setter 278 | def country(self, country): 279 | """Sets the country of this Address. 280 | 281 | The 3 character ISO country code of this address. For example, GBR is the country code for the United Kingdom # noqa: E501 282 | 283 | :param country: The country of this Address. # noqa: E501 284 | :type: str 285 | """ 286 | 287 | self._country = country 288 | 289 | @property 290 | def state(self): 291 | """Gets the state of this Address. # noqa: E501 292 | 293 | The address state. US states must use the USPS abbreviation (see also ISO 3166-2:US), for example AK, CA, or TX. # noqa: E501 294 | 295 | :return: The state of this Address. # noqa: E501 296 | :rtype: str 297 | """ 298 | return self._state 299 | 300 | @state.setter 301 | def state(self, state): 302 | """Sets the state of this Address. 303 | 304 | The address state. US states must use the USPS abbreviation (see also ISO 3166-2:US), for example AK, CA, or TX. # noqa: E501 305 | 306 | :param state: The state of this Address. # noqa: E501 307 | :type: str 308 | """ 309 | 310 | self._state = state 311 | 312 | @property 313 | def line1(self): 314 | """Gets the line1 of this Address. # noqa: E501 315 | 316 | Line 1 of the applicant's address # noqa: E501 317 | 318 | :return: The line1 of this Address. # noqa: E501 319 | :rtype: str 320 | """ 321 | return self._line1 322 | 323 | @line1.setter 324 | def line1(self, line1): 325 | """Sets the line1 of this Address. 326 | 327 | Line 1 of the applicant's address # noqa: E501 328 | 329 | :param line1: The line1 of this Address. # noqa: E501 330 | :type: str 331 | """ 332 | 333 | self._line1 = line1 334 | 335 | @property 336 | def line2(self): 337 | """Gets the line2 of this Address. # noqa: E501 338 | 339 | Line 2 of the applicant's address # noqa: E501 340 | 341 | :return: The line2 of this Address. # noqa: E501 342 | :rtype: str 343 | """ 344 | return self._line2 345 | 346 | @line2.setter 347 | def line2(self, line2): 348 | """Sets the line2 of this Address. 349 | 350 | Line 2 of the applicant's address # noqa: E501 351 | 352 | :param line2: The line2 of this Address. # noqa: E501 353 | :type: str 354 | """ 355 | 356 | self._line2 = line2 357 | 358 | @property 359 | def line3(self): 360 | """Gets the line3 of this Address. # noqa: E501 361 | 362 | Line 3 of the applicant's address # noqa: E501 363 | 364 | :return: The line3 of this Address. # noqa: E501 365 | :rtype: str 366 | """ 367 | return self._line3 368 | 369 | @line3.setter 370 | def line3(self, line3): 371 | """Sets the line3 of this Address. 372 | 373 | Line 3 of the applicant's address # noqa: E501 374 | 375 | :param line3: The line3 of this Address. # noqa: E501 376 | :type: str 377 | """ 378 | 379 | self._line3 = line3 380 | 381 | def to_dict(self): 382 | """Returns the model properties as a dict""" 383 | result = {} 384 | 385 | for attr, _ in six.iteritems(self.openapi_types): 386 | value = getattr(self, attr) 387 | if isinstance(value, list): 388 | result[attr] = list(map( 389 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 390 | value 391 | )) 392 | elif hasattr(value, "to_dict"): 393 | result[attr] = value.to_dict() 394 | elif isinstance(value, dict): 395 | result[attr] = dict(map( 396 | lambda item: (item[0], item[1].to_dict()) 397 | if hasattr(item[1], "to_dict") else item, 398 | value.items() 399 | )) 400 | else: 401 | result[attr] = value 402 | 403 | return result 404 | 405 | def to_str(self): 406 | """Returns the string representation of the model""" 407 | return pprint.pformat(self.to_dict()) 408 | 409 | def __repr__(self): 410 | """For `print` and `pprint`""" 411 | return self.to_str() 412 | 413 | def __eq__(self, other): 414 | """Returns true if both objects are equal""" 415 | if not isinstance(other, Address): 416 | return False 417 | 418 | return self.__dict__ == other.__dict__ 419 | 420 | def __ne__(self, other): 421 | """Returns true if both objects are not equal""" 422 | return not self == other 423 | -------------------------------------------------------------------------------- /onfido/models/addresses_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class AddressesList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'addresses': 'list[Address]' 35 | } 36 | 37 | attribute_map = { 38 | 'addresses': 'addresses' 39 | } 40 | 41 | def __init__(self, addresses=None): # noqa: E501 42 | """AddressesList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._addresses = None 45 | self.discriminator = None 46 | 47 | if addresses is not None: 48 | self.addresses = addresses 49 | 50 | @property 51 | def addresses(self): 52 | """Gets the addresses of this AddressesList. # noqa: E501 53 | 54 | 55 | :return: The addresses of this AddressesList. # noqa: E501 56 | :rtype: list[Address] 57 | """ 58 | return self._addresses 59 | 60 | @addresses.setter 61 | def addresses(self, addresses): 62 | """Sets the addresses of this AddressesList. 63 | 64 | 65 | :param addresses: The addresses of this AddressesList. # noqa: E501 66 | :type: list[Address] 67 | """ 68 | 69 | self._addresses = addresses 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, AddressesList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/applicant.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Applicant(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'created_at': 'datetime', 36 | 'delete_at': 'datetime', 37 | 'href': 'str', 38 | 'sandbox': 'bool', 39 | 'first_name': 'str', 40 | 'last_name': 'str', 41 | 'email': 'str', 42 | 'dob': 'date', 43 | 'address': 'Address', 44 | 'id_numbers': 'list[IdNumber]' 45 | } 46 | 47 | attribute_map = { 48 | 'id': 'id', 49 | 'created_at': 'created_at', 50 | 'delete_at': 'delete_at', 51 | 'href': 'href', 52 | 'sandbox': 'sandbox', 53 | 'first_name': 'first_name', 54 | 'last_name': 'last_name', 55 | 'email': 'email', 56 | 'dob': 'dob', 57 | 'address': 'address', 58 | 'id_numbers': 'id_numbers' 59 | } 60 | 61 | def __init__(self, id=None, created_at=None, delete_at=None, href=None, sandbox=None, first_name=None, last_name=None, email=None, dob=None, address=None, id_numbers=None): # noqa: E501 62 | """Applicant - a model defined in OpenAPI""" # noqa: E501 63 | 64 | self._id = None 65 | self._created_at = None 66 | self._delete_at = None 67 | self._href = None 68 | self._sandbox = None 69 | self._first_name = None 70 | self._last_name = None 71 | self._email = None 72 | self._dob = None 73 | self._address = None 74 | self._id_numbers = None 75 | self.discriminator = None 76 | 77 | if id is not None: 78 | self.id = id 79 | if created_at is not None: 80 | self.created_at = created_at 81 | if delete_at is not None: 82 | self.delete_at = delete_at 83 | if href is not None: 84 | self.href = href 85 | if sandbox is not None: 86 | self.sandbox = sandbox 87 | if first_name is not None: 88 | self.first_name = first_name 89 | if last_name is not None: 90 | self.last_name = last_name 91 | if email is not None: 92 | self.email = email 93 | if dob is not None: 94 | self.dob = dob 95 | if address is not None: 96 | self.address = address 97 | if id_numbers is not None: 98 | self.id_numbers = id_numbers 99 | 100 | @property 101 | def id(self): 102 | """Gets the id of this Applicant. # noqa: E501 103 | 104 | The unique identifier for the applicant. Read-only. # noqa: E501 105 | 106 | :return: The id of this Applicant. # noqa: E501 107 | :rtype: str 108 | """ 109 | return self._id 110 | 111 | @id.setter 112 | def id(self, id): 113 | """Sets the id of this Applicant. 114 | 115 | The unique identifier for the applicant. Read-only. # noqa: E501 116 | 117 | :param id: The id of this Applicant. # noqa: E501 118 | :type: str 119 | """ 120 | 121 | self._id = id 122 | 123 | @property 124 | def created_at(self): 125 | """Gets the created_at of this Applicant. # noqa: E501 126 | 127 | The date and time when this applicant was created. Read-only. # noqa: E501 128 | 129 | :return: The created_at of this Applicant. # noqa: E501 130 | :rtype: datetime 131 | """ 132 | return self._created_at 133 | 134 | @created_at.setter 135 | def created_at(self, created_at): 136 | """Sets the created_at of this Applicant. 137 | 138 | The date and time when this applicant was created. Read-only. # noqa: E501 139 | 140 | :param created_at: The created_at of this Applicant. # noqa: E501 141 | :type: datetime 142 | """ 143 | 144 | self._created_at = created_at 145 | 146 | @property 147 | def delete_at(self): 148 | """Gets the delete_at of this Applicant. # noqa: E501 149 | 150 | The date and time when this applicant is scheduled to be deleted. Read-only. # noqa: E501 151 | 152 | :return: The delete_at of this Applicant. # noqa: E501 153 | :rtype: datetime 154 | """ 155 | return self._delete_at 156 | 157 | @delete_at.setter 158 | def delete_at(self, delete_at): 159 | """Sets the delete_at of this Applicant. 160 | 161 | The date and time when this applicant is scheduled to be deleted. Read-only. # noqa: E501 162 | 163 | :param delete_at: The delete_at of this Applicant. # noqa: E501 164 | :type: datetime 165 | """ 166 | 167 | self._delete_at = delete_at 168 | 169 | @property 170 | def href(self): 171 | """Gets the href of this Applicant. # noqa: E501 172 | 173 | The uri of this resource. Read-only. # noqa: E501 174 | 175 | :return: The href of this Applicant. # noqa: E501 176 | :rtype: str 177 | """ 178 | return self._href 179 | 180 | @href.setter 181 | def href(self, href): 182 | """Sets the href of this Applicant. 183 | 184 | The uri of this resource. Read-only. # noqa: E501 185 | 186 | :param href: The href of this Applicant. # noqa: E501 187 | :type: str 188 | """ 189 | 190 | self._href = href 191 | 192 | @property 193 | def sandbox(self): 194 | """Gets the sandbox of this Applicant. # noqa: E501 195 | 196 | Read-only. # noqa: E501 197 | 198 | :return: The sandbox of this Applicant. # noqa: E501 199 | :rtype: bool 200 | """ 201 | return self._sandbox 202 | 203 | @sandbox.setter 204 | def sandbox(self, sandbox): 205 | """Sets the sandbox of this Applicant. 206 | 207 | Read-only. # noqa: E501 208 | 209 | :param sandbox: The sandbox of this Applicant. # noqa: E501 210 | :type: bool 211 | """ 212 | 213 | self._sandbox = sandbox 214 | 215 | @property 216 | def first_name(self): 217 | """Gets the first_name of this Applicant. # noqa: E501 218 | 219 | The applicant’s first name # noqa: E501 220 | 221 | :return: The first_name of this Applicant. # noqa: E501 222 | :rtype: str 223 | """ 224 | return self._first_name 225 | 226 | @first_name.setter 227 | def first_name(self, first_name): 228 | """Sets the first_name of this Applicant. 229 | 230 | The applicant’s first name # noqa: E501 231 | 232 | :param first_name: The first_name of this Applicant. # noqa: E501 233 | :type: str 234 | """ 235 | 236 | self._first_name = first_name 237 | 238 | @property 239 | def last_name(self): 240 | """Gets the last_name of this Applicant. # noqa: E501 241 | 242 | The applicant’s surname # noqa: E501 243 | 244 | :return: The last_name of this Applicant. # noqa: E501 245 | :rtype: str 246 | """ 247 | return self._last_name 248 | 249 | @last_name.setter 250 | def last_name(self, last_name): 251 | """Sets the last_name of this Applicant. 252 | 253 | The applicant’s surname # noqa: E501 254 | 255 | :param last_name: The last_name of this Applicant. # noqa: E501 256 | :type: str 257 | """ 258 | 259 | self._last_name = last_name 260 | 261 | @property 262 | def email(self): 263 | """Gets the email of this Applicant. # noqa: E501 264 | 265 | The applicant’s email address. Required if doing a US check, or a UK check for which `applicant_provides_data` is `true`. # noqa: E501 266 | 267 | :return: The email of this Applicant. # noqa: E501 268 | :rtype: str 269 | """ 270 | return self._email 271 | 272 | @email.setter 273 | def email(self, email): 274 | """Sets the email of this Applicant. 275 | 276 | The applicant’s email address. Required if doing a US check, or a UK check for which `applicant_provides_data` is `true`. # noqa: E501 277 | 278 | :param email: The email of this Applicant. # noqa: E501 279 | :type: str 280 | """ 281 | 282 | self._email = email 283 | 284 | @property 285 | def dob(self): 286 | """Gets the dob of this Applicant. # noqa: E501 287 | 288 | The applicant’s date of birth # noqa: E501 289 | 290 | :return: The dob of this Applicant. # noqa: E501 291 | :rtype: date 292 | """ 293 | return self._dob 294 | 295 | @dob.setter 296 | def dob(self, dob): 297 | """Sets the dob of this Applicant. 298 | 299 | The applicant’s date of birth # noqa: E501 300 | 301 | :param dob: The dob of this Applicant. # noqa: E501 302 | :type: date 303 | """ 304 | 305 | self._dob = dob 306 | 307 | @property 308 | def address(self): 309 | """Gets the address of this Applicant. # noqa: E501 310 | 311 | 312 | :return: The address of this Applicant. # noqa: E501 313 | :rtype: Address 314 | """ 315 | return self._address 316 | 317 | @address.setter 318 | def address(self, address): 319 | """Sets the address of this Applicant. 320 | 321 | 322 | :param address: The address of this Applicant. # noqa: E501 323 | :type: Address 324 | """ 325 | 326 | self._address = address 327 | 328 | @property 329 | def id_numbers(self): 330 | """Gets the id_numbers of this Applicant. # noqa: E501 331 | 332 | 333 | :return: The id_numbers of this Applicant. # noqa: E501 334 | :rtype: list[IdNumber] 335 | """ 336 | return self._id_numbers 337 | 338 | @id_numbers.setter 339 | def id_numbers(self, id_numbers): 340 | """Sets the id_numbers of this Applicant. 341 | 342 | 343 | :param id_numbers: The id_numbers of this Applicant. # noqa: E501 344 | :type: list[IdNumber] 345 | """ 346 | 347 | self._id_numbers = id_numbers 348 | 349 | def to_dict(self): 350 | """Returns the model properties as a dict""" 351 | result = {} 352 | 353 | for attr, _ in six.iteritems(self.openapi_types): 354 | value = getattr(self, attr) 355 | if isinstance(value, list): 356 | result[attr] = list(map( 357 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 358 | value 359 | )) 360 | elif hasattr(value, "to_dict"): 361 | result[attr] = value.to_dict() 362 | elif isinstance(value, dict): 363 | result[attr] = dict(map( 364 | lambda item: (item[0], item[1].to_dict()) 365 | if hasattr(item[1], "to_dict") else item, 366 | value.items() 367 | )) 368 | else: 369 | result[attr] = value 370 | 371 | return result 372 | 373 | def to_str(self): 374 | """Returns the string representation of the model""" 375 | return pprint.pformat(self.to_dict()) 376 | 377 | def __repr__(self): 378 | """For `print` and `pprint`""" 379 | return self.to_str() 380 | 381 | def __eq__(self, other): 382 | """Returns true if both objects are equal""" 383 | if not isinstance(other, Applicant): 384 | return False 385 | 386 | return self.__dict__ == other.__dict__ 387 | 388 | def __ne__(self, other): 389 | """Returns true if both objects are not equal""" 390 | return not self == other 391 | -------------------------------------------------------------------------------- /onfido/models/applicants_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ApplicantsList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'applicants': 'list[Applicant]' 35 | } 36 | 37 | attribute_map = { 38 | 'applicants': 'applicants' 39 | } 40 | 41 | def __init__(self, applicants=None): # noqa: E501 42 | """ApplicantsList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._applicants = None 45 | self.discriminator = None 46 | 47 | if applicants is not None: 48 | self.applicants = applicants 49 | 50 | @property 51 | def applicants(self): 52 | """Gets the applicants of this ApplicantsList. # noqa: E501 53 | 54 | 55 | :return: The applicants of this ApplicantsList. # noqa: E501 56 | :rtype: list[Applicant] 57 | """ 58 | return self._applicants 59 | 60 | @applicants.setter 61 | def applicants(self, applicants): 62 | """Sets the applicants of this ApplicantsList. 63 | 64 | 65 | :param applicants: The applicants of this ApplicantsList. # noqa: E501 66 | :type: list[Applicant] 67 | """ 68 | 69 | self._applicants = applicants 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, ApplicantsList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/checks_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ChecksList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'checks': 'list[Check]' 35 | } 36 | 37 | attribute_map = { 38 | 'checks': 'checks' 39 | } 40 | 41 | def __init__(self, checks=None): # noqa: E501 42 | """ChecksList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._checks = None 45 | self.discriminator = None 46 | 47 | if checks is not None: 48 | self.checks = checks 49 | 50 | @property 51 | def checks(self): 52 | """Gets the checks of this ChecksList. # noqa: E501 53 | 54 | 55 | :return: The checks of this ChecksList. # noqa: E501 56 | :rtype: list[Check] 57 | """ 58 | return self._checks 59 | 60 | @checks.setter 61 | def checks(self, checks): 62 | """Sets the checks of this ChecksList. 63 | 64 | 65 | :param checks: The checks of this ChecksList. # noqa: E501 66 | :type: list[Check] 67 | """ 68 | 69 | self._checks = checks 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, ChecksList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/document.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Document(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'created_at': 'datetime', 36 | 'file_name': 'str', 37 | 'file_size': 'int', 38 | 'file_type': 'str', 39 | 'type': 'str', 40 | 'side': 'str', 41 | 'issuing_country': 'str', 42 | 'href': 'str', 43 | 'download_href': 'str' 44 | } 45 | 46 | attribute_map = { 47 | 'id': 'id', 48 | 'created_at': 'created_at', 49 | 'file_name': 'file_name', 50 | 'file_size': 'file_size', 51 | 'file_type': 'file_type', 52 | 'type': 'type', 53 | 'side': 'side', 54 | 'issuing_country': 'issuing_country', 55 | 'href': 'href', 56 | 'download_href': 'download_href' 57 | } 58 | 59 | def __init__(self, id=None, created_at=None, file_name=None, file_size=None, file_type=None, type=None, side=None, issuing_country=None, href=None, download_href=None): # noqa: E501 60 | """Document - a model defined in OpenAPI""" # noqa: E501 61 | 62 | self._id = None 63 | self._created_at = None 64 | self._file_name = None 65 | self._file_size = None 66 | self._file_type = None 67 | self._type = None 68 | self._side = None 69 | self._issuing_country = None 70 | self._href = None 71 | self._download_href = None 72 | self.discriminator = None 73 | 74 | if id is not None: 75 | self.id = id 76 | if created_at is not None: 77 | self.created_at = created_at 78 | if file_name is not None: 79 | self.file_name = file_name 80 | if file_size is not None: 81 | self.file_size = file_size 82 | if file_type is not None: 83 | self.file_type = file_type 84 | if type is not None: 85 | self.type = type 86 | if side is not None: 87 | self.side = side 88 | if issuing_country is not None: 89 | self.issuing_country = issuing_country 90 | if href is not None: 91 | self.href = href 92 | if download_href is not None: 93 | self.download_href = download_href 94 | 95 | @property 96 | def id(self): 97 | """Gets the id of this Document. # noqa: E501 98 | 99 | The unique identifier for the document # noqa: E501 100 | 101 | :return: The id of this Document. # noqa: E501 102 | :rtype: str 103 | """ 104 | return self._id 105 | 106 | @id.setter 107 | def id(self, id): 108 | """Sets the id of this Document. 109 | 110 | The unique identifier for the document # noqa: E501 111 | 112 | :param id: The id of this Document. # noqa: E501 113 | :type: str 114 | """ 115 | 116 | self._id = id 117 | 118 | @property 119 | def created_at(self): 120 | """Gets the created_at of this Document. # noqa: E501 121 | 122 | The date and time at which the document was uploaded # noqa: E501 123 | 124 | :return: The created_at of this Document. # noqa: E501 125 | :rtype: datetime 126 | """ 127 | return self._created_at 128 | 129 | @created_at.setter 130 | def created_at(self, created_at): 131 | """Sets the created_at of this Document. 132 | 133 | The date and time at which the document was uploaded # noqa: E501 134 | 135 | :param created_at: The created_at of this Document. # noqa: E501 136 | :type: datetime 137 | """ 138 | 139 | self._created_at = created_at 140 | 141 | @property 142 | def file_name(self): 143 | """Gets the file_name of this Document. # noqa: E501 144 | 145 | The name of the uploaded file # noqa: E501 146 | 147 | :return: The file_name of this Document. # noqa: E501 148 | :rtype: str 149 | """ 150 | return self._file_name 151 | 152 | @file_name.setter 153 | def file_name(self, file_name): 154 | """Sets the file_name of this Document. 155 | 156 | The name of the uploaded file # noqa: E501 157 | 158 | :param file_name: The file_name of this Document. # noqa: E501 159 | :type: str 160 | """ 161 | 162 | self._file_name = file_name 163 | 164 | @property 165 | def file_size(self): 166 | """Gets the file_size of this Document. # noqa: E501 167 | 168 | The size of the file in bytes # noqa: E501 169 | 170 | :return: The file_size of this Document. # noqa: E501 171 | :rtype: int 172 | """ 173 | return self._file_size 174 | 175 | @file_size.setter 176 | def file_size(self, file_size): 177 | """Sets the file_size of this Document. 178 | 179 | The size of the file in bytes # noqa: E501 180 | 181 | :param file_size: The file_size of this Document. # noqa: E501 182 | :type: int 183 | """ 184 | 185 | self._file_size = file_size 186 | 187 | @property 188 | def file_type(self): 189 | """Gets the file_type of this Document. # noqa: E501 190 | 191 | The file type of the uploaded file # noqa: E501 192 | 193 | :return: The file_type of this Document. # noqa: E501 194 | :rtype: str 195 | """ 196 | return self._file_type 197 | 198 | @file_type.setter 199 | def file_type(self, file_type): 200 | """Sets the file_type of this Document. 201 | 202 | The file type of the uploaded file # noqa: E501 203 | 204 | :param file_type: The file_type of this Document. # noqa: E501 205 | :type: str 206 | """ 207 | 208 | self._file_type = file_type 209 | 210 | @property 211 | def type(self): 212 | """Gets the type of this Document. # noqa: E501 213 | 214 | The type of document # noqa: E501 215 | 216 | :return: The type of this Document. # noqa: E501 217 | :rtype: str 218 | """ 219 | return self._type 220 | 221 | @type.setter 222 | def type(self, type): 223 | """Sets the type of this Document. 224 | 225 | The type of document # noqa: E501 226 | 227 | :param type: The type of this Document. # noqa: E501 228 | :type: str 229 | """ 230 | 231 | self._type = type 232 | 233 | @property 234 | def side(self): 235 | """Gets the side of this Document. # noqa: E501 236 | 237 | The side of the document, if applicable. The possible values are front and back # noqa: E501 238 | 239 | :return: The side of this Document. # noqa: E501 240 | :rtype: str 241 | """ 242 | return self._side 243 | 244 | @side.setter 245 | def side(self, side): 246 | """Sets the side of this Document. 247 | 248 | The side of the document, if applicable. The possible values are front and back # noqa: E501 249 | 250 | :param side: The side of this Document. # noqa: E501 251 | :type: str 252 | """ 253 | 254 | self._side = side 255 | 256 | @property 257 | def issuing_country(self): 258 | """Gets the issuing_country of this Document. # noqa: E501 259 | 260 | The issuing country of the document, a 3-letter ISO code. # noqa: E501 261 | 262 | :return: The issuing_country of this Document. # noqa: E501 263 | :rtype: str 264 | """ 265 | return self._issuing_country 266 | 267 | @issuing_country.setter 268 | def issuing_country(self, issuing_country): 269 | """Sets the issuing_country of this Document. 270 | 271 | The issuing country of the document, a 3-letter ISO code. # noqa: E501 272 | 273 | :param issuing_country: The issuing_country of this Document. # noqa: E501 274 | :type: str 275 | """ 276 | 277 | self._issuing_country = issuing_country 278 | 279 | @property 280 | def href(self): 281 | """Gets the href of this Document. # noqa: E501 282 | 283 | The uri of this resource # noqa: E501 284 | 285 | :return: The href of this Document. # noqa: E501 286 | :rtype: str 287 | """ 288 | return self._href 289 | 290 | @href.setter 291 | def href(self, href): 292 | """Sets the href of this Document. 293 | 294 | The uri of this resource # noqa: E501 295 | 296 | :param href: The href of this Document. # noqa: E501 297 | :type: str 298 | """ 299 | 300 | self._href = href 301 | 302 | @property 303 | def download_href(self): 304 | """Gets the download_href of this Document. # noqa: E501 305 | 306 | The uri that can be used to download the document # noqa: E501 307 | 308 | :return: The download_href of this Document. # noqa: E501 309 | :rtype: str 310 | """ 311 | return self._download_href 312 | 313 | @download_href.setter 314 | def download_href(self, download_href): 315 | """Sets the download_href of this Document. 316 | 317 | The uri that can be used to download the document # noqa: E501 318 | 319 | :param download_href: The download_href of this Document. # noqa: E501 320 | :type: str 321 | """ 322 | 323 | self._download_href = download_href 324 | 325 | def to_dict(self): 326 | """Returns the model properties as a dict""" 327 | result = {} 328 | 329 | for attr, _ in six.iteritems(self.openapi_types): 330 | value = getattr(self, attr) 331 | if isinstance(value, list): 332 | result[attr] = list(map( 333 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 334 | value 335 | )) 336 | elif hasattr(value, "to_dict"): 337 | result[attr] = value.to_dict() 338 | elif isinstance(value, dict): 339 | result[attr] = dict(map( 340 | lambda item: (item[0], item[1].to_dict()) 341 | if hasattr(item[1], "to_dict") else item, 342 | value.items() 343 | )) 344 | else: 345 | result[attr] = value 346 | 347 | return result 348 | 349 | def to_str(self): 350 | """Returns the string representation of the model""" 351 | return pprint.pformat(self.to_dict()) 352 | 353 | def __repr__(self): 354 | """For `print` and `pprint`""" 355 | return self.to_str() 356 | 357 | def __eq__(self, other): 358 | """Returns true if both objects are equal""" 359 | if not isinstance(other, Document): 360 | return False 361 | 362 | return self.__dict__ == other.__dict__ 363 | 364 | def __ne__(self, other): 365 | """Returns true if both objects are not equal""" 366 | return not self == other 367 | -------------------------------------------------------------------------------- /onfido/models/documents_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class DocumentsList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'documents': 'list[Document]' 35 | } 36 | 37 | attribute_map = { 38 | 'documents': 'documents' 39 | } 40 | 41 | def __init__(self, documents=None): # noqa: E501 42 | """DocumentsList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._documents = None 45 | self.discriminator = None 46 | 47 | if documents is not None: 48 | self.documents = documents 49 | 50 | @property 51 | def documents(self): 52 | """Gets the documents of this DocumentsList. # noqa: E501 53 | 54 | 55 | :return: The documents of this DocumentsList. # noqa: E501 56 | :rtype: list[Document] 57 | """ 58 | return self._documents 59 | 60 | @documents.setter 61 | def documents(self, documents): 62 | """Sets the documents of this DocumentsList. 63 | 64 | 65 | :param documents: The documents of this DocumentsList. # noqa: E501 66 | :type: list[Document] 67 | """ 68 | 69 | self._documents = documents 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, DocumentsList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/error.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Error(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'error': 'ErrorProperties' 35 | } 36 | 37 | attribute_map = { 38 | 'error': 'error' 39 | } 40 | 41 | def __init__(self, error=None): # noqa: E501 42 | """Error - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._error = None 45 | self.discriminator = None 46 | 47 | if error is not None: 48 | self.error = error 49 | 50 | @property 51 | def error(self): 52 | """Gets the error of this Error. # noqa: E501 53 | 54 | 55 | :return: The error of this Error. # noqa: E501 56 | :rtype: ErrorProperties 57 | """ 58 | return self._error 59 | 60 | @error.setter 61 | def error(self, error): 62 | """Sets the error of this Error. 63 | 64 | 65 | :param error: The error of this Error. # noqa: E501 66 | :type: ErrorProperties 67 | """ 68 | 69 | self._error = error 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, Error): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/error_properties.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ErrorProperties(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'type': 'str', 35 | 'message': 'str', 36 | 'fields': 'dict(str, object)' 37 | } 38 | 39 | attribute_map = { 40 | 'type': 'type', 41 | 'message': 'message', 42 | 'fields': 'fields' 43 | } 44 | 45 | def __init__(self, type=None, message=None, fields=None): # noqa: E501 46 | """ErrorProperties - a model defined in OpenAPI""" # noqa: E501 47 | 48 | self._type = None 49 | self._message = None 50 | self._fields = None 51 | self.discriminator = None 52 | 53 | if type is not None: 54 | self.type = type 55 | if message is not None: 56 | self.message = message 57 | if fields is not None: 58 | self.fields = fields 59 | 60 | @property 61 | def type(self): 62 | """Gets the type of this ErrorProperties. # noqa: E501 63 | 64 | 65 | :return: The type of this ErrorProperties. # noqa: E501 66 | :rtype: str 67 | """ 68 | return self._type 69 | 70 | @type.setter 71 | def type(self, type): 72 | """Sets the type of this ErrorProperties. 73 | 74 | 75 | :param type: The type of this ErrorProperties. # noqa: E501 76 | :type: str 77 | """ 78 | 79 | self._type = type 80 | 81 | @property 82 | def message(self): 83 | """Gets the message of this ErrorProperties. # noqa: E501 84 | 85 | 86 | :return: The message of this ErrorProperties. # noqa: E501 87 | :rtype: str 88 | """ 89 | return self._message 90 | 91 | @message.setter 92 | def message(self, message): 93 | """Sets the message of this ErrorProperties. 94 | 95 | 96 | :param message: The message of this ErrorProperties. # noqa: E501 97 | :type: str 98 | """ 99 | 100 | self._message = message 101 | 102 | @property 103 | def fields(self): 104 | """Gets the fields of this ErrorProperties. # noqa: E501 105 | 106 | 107 | :return: The fields of this ErrorProperties. # noqa: E501 108 | :rtype: dict(str, object) 109 | """ 110 | return self._fields 111 | 112 | @fields.setter 113 | def fields(self, fields): 114 | """Sets the fields of this ErrorProperties. 115 | 116 | 117 | :param fields: The fields of this ErrorProperties. # noqa: E501 118 | :type: dict(str, object) 119 | """ 120 | 121 | self._fields = fields 122 | 123 | def to_dict(self): 124 | """Returns the model properties as a dict""" 125 | result = {} 126 | 127 | for attr, _ in six.iteritems(self.openapi_types): 128 | value = getattr(self, attr) 129 | if isinstance(value, list): 130 | result[attr] = list(map( 131 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 132 | value 133 | )) 134 | elif hasattr(value, "to_dict"): 135 | result[attr] = value.to_dict() 136 | elif isinstance(value, dict): 137 | result[attr] = dict(map( 138 | lambda item: (item[0], item[1].to_dict()) 139 | if hasattr(item[1], "to_dict") else item, 140 | value.items() 141 | )) 142 | else: 143 | result[attr] = value 144 | 145 | return result 146 | 147 | def to_str(self): 148 | """Returns the string representation of the model""" 149 | return pprint.pformat(self.to_dict()) 150 | 151 | def __repr__(self): 152 | """For `print` and `pprint`""" 153 | return self.to_str() 154 | 155 | def __eq__(self, other): 156 | """Returns true if both objects are equal""" 157 | if not isinstance(other, ErrorProperties): 158 | return False 159 | 160 | return self.__dict__ == other.__dict__ 161 | 162 | def __ne__(self, other): 163 | """Returns true if both objects are not equal""" 164 | return not self == other 165 | -------------------------------------------------------------------------------- /onfido/models/id_number.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class IdNumber(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'type': 'str', 35 | 'value': 'str', 36 | 'state_code': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'type': 'type', 41 | 'value': 'value', 42 | 'state_code': 'state_code' 43 | } 44 | 45 | def __init__(self, type=None, value=None, state_code=None): # noqa: E501 46 | """IdNumber - a model defined in OpenAPI""" # noqa: E501 47 | 48 | self._type = None 49 | self._value = None 50 | self._state_code = None 51 | self.discriminator = None 52 | 53 | if type is not None: 54 | self.type = type 55 | if value is not None: 56 | self.value = value 57 | if state_code is not None: 58 | self.state_code = state_code 59 | 60 | @property 61 | def type(self): 62 | """Gets the type of this IdNumber. # noqa: E501 63 | 64 | Type of ID number. Valid values are `ssn`, `social_insurance`, `tax_id`, `identity_card`, `passport` and `driving_license` # noqa: E501 65 | 66 | :return: The type of this IdNumber. # noqa: E501 67 | :rtype: str 68 | """ 69 | return self._type 70 | 71 | @type.setter 72 | def type(self, type): 73 | """Sets the type of this IdNumber. 74 | 75 | Type of ID number. Valid values are `ssn`, `social_insurance`, `tax_id`, `identity_card`, `passport` and `driving_license` # noqa: E501 76 | 77 | :param type: The type of this IdNumber. # noqa: E501 78 | :type: str 79 | """ 80 | 81 | self._type = type 82 | 83 | @property 84 | def value(self): 85 | """Gets the value of this IdNumber. # noqa: E501 86 | 87 | Value of ID number # noqa: E501 88 | 89 | :return: The value of this IdNumber. # noqa: E501 90 | :rtype: str 91 | """ 92 | return self._value 93 | 94 | @value.setter 95 | def value(self, value): 96 | """Sets the value of this IdNumber. 97 | 98 | Value of ID number # noqa: E501 99 | 100 | :param value: The value of this IdNumber. # noqa: E501 101 | :type: str 102 | """ 103 | 104 | self._value = value 105 | 106 | @property 107 | def state_code(self): 108 | """Gets the state_code of this IdNumber. # noqa: E501 109 | 110 | Two letter code of issuing state (state-issued driving licenses only) # noqa: E501 111 | 112 | :return: The state_code of this IdNumber. # noqa: E501 113 | :rtype: str 114 | """ 115 | return self._state_code 116 | 117 | @state_code.setter 118 | def state_code(self, state_code): 119 | """Sets the state_code of this IdNumber. 120 | 121 | Two letter code of issuing state (state-issued driving licenses only) # noqa: E501 122 | 123 | :param state_code: The state_code of this IdNumber. # noqa: E501 124 | :type: str 125 | """ 126 | 127 | self._state_code = state_code 128 | 129 | def to_dict(self): 130 | """Returns the model properties as a dict""" 131 | result = {} 132 | 133 | for attr, _ in six.iteritems(self.openapi_types): 134 | value = getattr(self, attr) 135 | if isinstance(value, list): 136 | result[attr] = list(map( 137 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 138 | value 139 | )) 140 | elif hasattr(value, "to_dict"): 141 | result[attr] = value.to_dict() 142 | elif isinstance(value, dict): 143 | result[attr] = dict(map( 144 | lambda item: (item[0], item[1].to_dict()) 145 | if hasattr(item[1], "to_dict") else item, 146 | value.items() 147 | )) 148 | else: 149 | result[attr] = value 150 | 151 | return result 152 | 153 | def to_str(self): 154 | """Returns the string representation of the model""" 155 | return pprint.pformat(self.to_dict()) 156 | 157 | def __repr__(self): 158 | """For `print` and `pprint`""" 159 | return self.to_str() 160 | 161 | def __eq__(self, other): 162 | """Returns true if both objects are equal""" 163 | if not isinstance(other, IdNumber): 164 | return False 165 | 166 | return self.__dict__ == other.__dict__ 167 | 168 | def __ne__(self, other): 169 | """Returns true if both objects are not equal""" 170 | return not self == other 171 | -------------------------------------------------------------------------------- /onfido/models/live_photo.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class LivePhoto(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'created_at': 'datetime', 36 | 'href': 'str', 37 | 'download_href': 'str', 38 | 'file_name': 'str', 39 | 'file_size': 'int', 40 | 'file_type': 'str' 41 | } 42 | 43 | attribute_map = { 44 | 'id': 'id', 45 | 'created_at': 'created_at', 46 | 'href': 'href', 47 | 'download_href': 'download_href', 48 | 'file_name': 'file_name', 49 | 'file_size': 'file_size', 50 | 'file_type': 'file_type' 51 | } 52 | 53 | def __init__(self, id=None, created_at=None, href=None, download_href=None, file_name=None, file_size=None, file_type=None): # noqa: E501 54 | """LivePhoto - a model defined in OpenAPI""" # noqa: E501 55 | 56 | self._id = None 57 | self._created_at = None 58 | self._href = None 59 | self._download_href = None 60 | self._file_name = None 61 | self._file_size = None 62 | self._file_type = None 63 | self.discriminator = None 64 | 65 | if id is not None: 66 | self.id = id 67 | if created_at is not None: 68 | self.created_at = created_at 69 | if href is not None: 70 | self.href = href 71 | if download_href is not None: 72 | self.download_href = download_href 73 | if file_name is not None: 74 | self.file_name = file_name 75 | if file_size is not None: 76 | self.file_size = file_size 77 | if file_type is not None: 78 | self.file_type = file_type 79 | 80 | @property 81 | def id(self): 82 | """Gets the id of this LivePhoto. # noqa: E501 83 | 84 | The unique identifier for the photo. # noqa: E501 85 | 86 | :return: The id of this LivePhoto. # noqa: E501 87 | :rtype: str 88 | """ 89 | return self._id 90 | 91 | @id.setter 92 | def id(self, id): 93 | """Sets the id of this LivePhoto. 94 | 95 | The unique identifier for the photo. # noqa: E501 96 | 97 | :param id: The id of this LivePhoto. # noqa: E501 98 | :type: str 99 | """ 100 | 101 | self._id = id 102 | 103 | @property 104 | def created_at(self): 105 | """Gets the created_at of this LivePhoto. # noqa: E501 106 | 107 | The date and time at which the photo was uploaded. # noqa: E501 108 | 109 | :return: The created_at of this LivePhoto. # noqa: E501 110 | :rtype: datetime 111 | """ 112 | return self._created_at 113 | 114 | @created_at.setter 115 | def created_at(self, created_at): 116 | """Sets the created_at of this LivePhoto. 117 | 118 | The date and time at which the photo was uploaded. # noqa: E501 119 | 120 | :param created_at: The created_at of this LivePhoto. # noqa: E501 121 | :type: datetime 122 | """ 123 | 124 | self._created_at = created_at 125 | 126 | @property 127 | def href(self): 128 | """Gets the href of this LivePhoto. # noqa: E501 129 | 130 | The uri of this resource. # noqa: E501 131 | 132 | :return: The href of this LivePhoto. # noqa: E501 133 | :rtype: str 134 | """ 135 | return self._href 136 | 137 | @href.setter 138 | def href(self, href): 139 | """Sets the href of this LivePhoto. 140 | 141 | The uri of this resource. # noqa: E501 142 | 143 | :param href: The href of this LivePhoto. # noqa: E501 144 | :type: str 145 | """ 146 | 147 | self._href = href 148 | 149 | @property 150 | def download_href(self): 151 | """Gets the download_href of this LivePhoto. # noqa: E501 152 | 153 | The uri that can be used to download the photo. # noqa: E501 154 | 155 | :return: The download_href of this LivePhoto. # noqa: E501 156 | :rtype: str 157 | """ 158 | return self._download_href 159 | 160 | @download_href.setter 161 | def download_href(self, download_href): 162 | """Sets the download_href of this LivePhoto. 163 | 164 | The uri that can be used to download the photo. # noqa: E501 165 | 166 | :param download_href: The download_href of this LivePhoto. # noqa: E501 167 | :type: str 168 | """ 169 | 170 | self._download_href = download_href 171 | 172 | @property 173 | def file_name(self): 174 | """Gets the file_name of this LivePhoto. # noqa: E501 175 | 176 | The name of the uploaded file. # noqa: E501 177 | 178 | :return: The file_name of this LivePhoto. # noqa: E501 179 | :rtype: str 180 | """ 181 | return self._file_name 182 | 183 | @file_name.setter 184 | def file_name(self, file_name): 185 | """Sets the file_name of this LivePhoto. 186 | 187 | The name of the uploaded file. # noqa: E501 188 | 189 | :param file_name: The file_name of this LivePhoto. # noqa: E501 190 | :type: str 191 | """ 192 | 193 | self._file_name = file_name 194 | 195 | @property 196 | def file_size(self): 197 | """Gets the file_size of this LivePhoto. # noqa: E501 198 | 199 | The size of the file in bytes. # noqa: E501 200 | 201 | :return: The file_size of this LivePhoto. # noqa: E501 202 | :rtype: int 203 | """ 204 | return self._file_size 205 | 206 | @file_size.setter 207 | def file_size(self, file_size): 208 | """Sets the file_size of this LivePhoto. 209 | 210 | The size of the file in bytes. # noqa: E501 211 | 212 | :param file_size: The file_size of this LivePhoto. # noqa: E501 213 | :type: int 214 | """ 215 | 216 | self._file_size = file_size 217 | 218 | @property 219 | def file_type(self): 220 | """Gets the file_type of this LivePhoto. # noqa: E501 221 | 222 | The file type of the uploaded file. # noqa: E501 223 | 224 | :return: The file_type of this LivePhoto. # noqa: E501 225 | :rtype: str 226 | """ 227 | return self._file_type 228 | 229 | @file_type.setter 230 | def file_type(self, file_type): 231 | """Sets the file_type of this LivePhoto. 232 | 233 | The file type of the uploaded file. # noqa: E501 234 | 235 | :param file_type: The file_type of this LivePhoto. # noqa: E501 236 | :type: str 237 | """ 238 | 239 | self._file_type = file_type 240 | 241 | def to_dict(self): 242 | """Returns the model properties as a dict""" 243 | result = {} 244 | 245 | for attr, _ in six.iteritems(self.openapi_types): 246 | value = getattr(self, attr) 247 | if isinstance(value, list): 248 | result[attr] = list(map( 249 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 250 | value 251 | )) 252 | elif hasattr(value, "to_dict"): 253 | result[attr] = value.to_dict() 254 | elif isinstance(value, dict): 255 | result[attr] = dict(map( 256 | lambda item: (item[0], item[1].to_dict()) 257 | if hasattr(item[1], "to_dict") else item, 258 | value.items() 259 | )) 260 | else: 261 | result[attr] = value 262 | 263 | return result 264 | 265 | def to_str(self): 266 | """Returns the string representation of the model""" 267 | return pprint.pformat(self.to_dict()) 268 | 269 | def __repr__(self): 270 | """For `print` and `pprint`""" 271 | return self.to_str() 272 | 273 | def __eq__(self, other): 274 | """Returns true if both objects are equal""" 275 | if not isinstance(other, LivePhoto): 276 | return False 277 | 278 | return self.__dict__ == other.__dict__ 279 | 280 | def __ne__(self, other): 281 | """Returns true if both objects are not equal""" 282 | return not self == other 283 | -------------------------------------------------------------------------------- /onfido/models/live_photos_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class LivePhotosList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'live_photos': 'list[LivePhoto]' 35 | } 36 | 37 | attribute_map = { 38 | 'live_photos': 'live_photos' 39 | } 40 | 41 | def __init__(self, live_photos=None): # noqa: E501 42 | """LivePhotosList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._live_photos = None 45 | self.discriminator = None 46 | 47 | if live_photos is not None: 48 | self.live_photos = live_photos 49 | 50 | @property 51 | def live_photos(self): 52 | """Gets the live_photos of this LivePhotosList. # noqa: E501 53 | 54 | 55 | :return: The live_photos of this LivePhotosList. # noqa: E501 56 | :rtype: list[LivePhoto] 57 | """ 58 | return self._live_photos 59 | 60 | @live_photos.setter 61 | def live_photos(self, live_photos): 62 | """Sets the live_photos of this LivePhotosList. 63 | 64 | 65 | :param live_photos: The live_photos of this LivePhotosList. # noqa: E501 66 | :type: list[LivePhoto] 67 | """ 68 | 69 | self._live_photos = live_photos 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, LivePhotosList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/live_video.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class LiveVideo(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'created_at': 'datetime', 36 | 'href': 'str', 37 | 'download_href': 'str', 38 | 'file_name': 'str', 39 | 'file_size': 'int', 40 | 'file_type': 'str' 41 | } 42 | 43 | attribute_map = { 44 | 'id': 'id', 45 | 'created_at': 'created_at', 46 | 'href': 'href', 47 | 'download_href': 'download_href', 48 | 'file_name': 'file_name', 49 | 'file_size': 'file_size', 50 | 'file_type': 'file_type' 51 | } 52 | 53 | def __init__(self, id=None, created_at=None, href=None, download_href=None, file_name=None, file_size=None, file_type=None): # noqa: E501 54 | """LiveVideo - a model defined in OpenAPI""" # noqa: E501 55 | 56 | self._id = None 57 | self._created_at = None 58 | self._href = None 59 | self._download_href = None 60 | self._file_name = None 61 | self._file_size = None 62 | self._file_type = None 63 | self.discriminator = None 64 | 65 | if id is not None: 66 | self.id = id 67 | if created_at is not None: 68 | self.created_at = created_at 69 | if href is not None: 70 | self.href = href 71 | if download_href is not None: 72 | self.download_href = download_href 73 | if file_name is not None: 74 | self.file_name = file_name 75 | if file_size is not None: 76 | self.file_size = file_size 77 | if file_type is not None: 78 | self.file_type = file_type 79 | 80 | @property 81 | def id(self): 82 | """Gets the id of this LiveVideo. # noqa: E501 83 | 84 | The unique identifier for the video. # noqa: E501 85 | 86 | :return: The id of this LiveVideo. # noqa: E501 87 | :rtype: str 88 | """ 89 | return self._id 90 | 91 | @id.setter 92 | def id(self, id): 93 | """Sets the id of this LiveVideo. 94 | 95 | The unique identifier for the video. # noqa: E501 96 | 97 | :param id: The id of this LiveVideo. # noqa: E501 98 | :type: str 99 | """ 100 | 101 | self._id = id 102 | 103 | @property 104 | def created_at(self): 105 | """Gets the created_at of this LiveVideo. # noqa: E501 106 | 107 | The date and time at which the video was uploaded. # noqa: E501 108 | 109 | :return: The created_at of this LiveVideo. # noqa: E501 110 | :rtype: datetime 111 | """ 112 | return self._created_at 113 | 114 | @created_at.setter 115 | def created_at(self, created_at): 116 | """Sets the created_at of this LiveVideo. 117 | 118 | The date and time at which the video was uploaded. # noqa: E501 119 | 120 | :param created_at: The created_at of this LiveVideo. # noqa: E501 121 | :type: datetime 122 | """ 123 | 124 | self._created_at = created_at 125 | 126 | @property 127 | def href(self): 128 | """Gets the href of this LiveVideo. # noqa: E501 129 | 130 | The uri of this resource. # noqa: E501 131 | 132 | :return: The href of this LiveVideo. # noqa: E501 133 | :rtype: str 134 | """ 135 | return self._href 136 | 137 | @href.setter 138 | def href(self, href): 139 | """Sets the href of this LiveVideo. 140 | 141 | The uri of this resource. # noqa: E501 142 | 143 | :param href: The href of this LiveVideo. # noqa: E501 144 | :type: str 145 | """ 146 | 147 | self._href = href 148 | 149 | @property 150 | def download_href(self): 151 | """Gets the download_href of this LiveVideo. # noqa: E501 152 | 153 | The uri that can be used to download the video. # noqa: E501 154 | 155 | :return: The download_href of this LiveVideo. # noqa: E501 156 | :rtype: str 157 | """ 158 | return self._download_href 159 | 160 | @download_href.setter 161 | def download_href(self, download_href): 162 | """Sets the download_href of this LiveVideo. 163 | 164 | The uri that can be used to download the video. # noqa: E501 165 | 166 | :param download_href: The download_href of this LiveVideo. # noqa: E501 167 | :type: str 168 | """ 169 | 170 | self._download_href = download_href 171 | 172 | @property 173 | def file_name(self): 174 | """Gets the file_name of this LiveVideo. # noqa: E501 175 | 176 | The name of the uploaded file. # noqa: E501 177 | 178 | :return: The file_name of this LiveVideo. # noqa: E501 179 | :rtype: str 180 | """ 181 | return self._file_name 182 | 183 | @file_name.setter 184 | def file_name(self, file_name): 185 | """Sets the file_name of this LiveVideo. 186 | 187 | The name of the uploaded file. # noqa: E501 188 | 189 | :param file_name: The file_name of this LiveVideo. # noqa: E501 190 | :type: str 191 | """ 192 | 193 | self._file_name = file_name 194 | 195 | @property 196 | def file_size(self): 197 | """Gets the file_size of this LiveVideo. # noqa: E501 198 | 199 | The size of the file in bytes. # noqa: E501 200 | 201 | :return: The file_size of this LiveVideo. # noqa: E501 202 | :rtype: int 203 | """ 204 | return self._file_size 205 | 206 | @file_size.setter 207 | def file_size(self, file_size): 208 | """Sets the file_size of this LiveVideo. 209 | 210 | The size of the file in bytes. # noqa: E501 211 | 212 | :param file_size: The file_size of this LiveVideo. # noqa: E501 213 | :type: int 214 | """ 215 | 216 | self._file_size = file_size 217 | 218 | @property 219 | def file_type(self): 220 | """Gets the file_type of this LiveVideo. # noqa: E501 221 | 222 | The file type of the uploaded file. # noqa: E501 223 | 224 | :return: The file_type of this LiveVideo. # noqa: E501 225 | :rtype: str 226 | """ 227 | return self._file_type 228 | 229 | @file_type.setter 230 | def file_type(self, file_type): 231 | """Sets the file_type of this LiveVideo. 232 | 233 | The file type of the uploaded file. # noqa: E501 234 | 235 | :param file_type: The file_type of this LiveVideo. # noqa: E501 236 | :type: str 237 | """ 238 | 239 | self._file_type = file_type 240 | 241 | def to_dict(self): 242 | """Returns the model properties as a dict""" 243 | result = {} 244 | 245 | for attr, _ in six.iteritems(self.openapi_types): 246 | value = getattr(self, attr) 247 | if isinstance(value, list): 248 | result[attr] = list(map( 249 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 250 | value 251 | )) 252 | elif hasattr(value, "to_dict"): 253 | result[attr] = value.to_dict() 254 | elif isinstance(value, dict): 255 | result[attr] = dict(map( 256 | lambda item: (item[0], item[1].to_dict()) 257 | if hasattr(item[1], "to_dict") else item, 258 | value.items() 259 | )) 260 | else: 261 | result[attr] = value 262 | 263 | return result 264 | 265 | def to_str(self): 266 | """Returns the string representation of the model""" 267 | return pprint.pformat(self.to_dict()) 268 | 269 | def __repr__(self): 270 | """For `print` and `pprint`""" 271 | return self.to_str() 272 | 273 | def __eq__(self, other): 274 | """Returns true if both objects are equal""" 275 | if not isinstance(other, LiveVideo): 276 | return False 277 | 278 | return self.__dict__ == other.__dict__ 279 | 280 | def __ne__(self, other): 281 | """Returns true if both objects are not equal""" 282 | return not self == other 283 | -------------------------------------------------------------------------------- /onfido/models/live_videos_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class LiveVideosList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'live_videos': 'list[LiveVideo]' 35 | } 36 | 37 | attribute_map = { 38 | 'live_videos': 'live_videos' 39 | } 40 | 41 | def __init__(self, live_videos=None): # noqa: E501 42 | """LiveVideosList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._live_videos = None 45 | self.discriminator = None 46 | 47 | if live_videos is not None: 48 | self.live_videos = live_videos 49 | 50 | @property 51 | def live_videos(self): 52 | """Gets the live_videos of this LiveVideosList. # noqa: E501 53 | 54 | 55 | :return: The live_videos of this LiveVideosList. # noqa: E501 56 | :rtype: list[LiveVideo] 57 | """ 58 | return self._live_videos 59 | 60 | @live_videos.setter 61 | def live_videos(self, live_videos): 62 | """Sets the live_videos of this LiveVideosList. 63 | 64 | 65 | :param live_videos: The live_videos of this LiveVideosList. # noqa: E501 66 | :type: list[LiveVideo] 67 | """ 68 | 69 | self._live_videos = live_videos 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, LiveVideosList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/report.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Report(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'created_at': 'datetime', 36 | 'href': 'str', 37 | 'status': 'str', 38 | 'result': 'str', 39 | 'sub_result': 'str', 40 | 'breakdown': 'dict(str, object)', 41 | 'properties': 'dict(str, object)', 42 | 'name': 'str', 43 | 'documents': 'list[ReportDocument]' 44 | } 45 | 46 | attribute_map = { 47 | 'id': 'id', 48 | 'created_at': 'created_at', 49 | 'href': 'href', 50 | 'status': 'status', 51 | 'result': 'result', 52 | 'sub_result': 'sub_result', 53 | 'breakdown': 'breakdown', 54 | 'properties': 'properties', 55 | 'name': 'name', 56 | 'documents': 'documents' 57 | } 58 | 59 | def __init__(self, id=None, created_at=None, href=None, status=None, result=None, sub_result=None, breakdown=None, properties=None, name=None, documents=None): # noqa: E501 60 | """Report - a model defined in OpenAPI""" # noqa: E501 61 | 62 | self._id = None 63 | self._created_at = None 64 | self._href = None 65 | self._status = None 66 | self._result = None 67 | self._sub_result = None 68 | self._breakdown = None 69 | self._properties = None 70 | self._name = None 71 | self._documents = None 72 | self.discriminator = None 73 | 74 | if id is not None: 75 | self.id = id 76 | if created_at is not None: 77 | self.created_at = created_at 78 | if href is not None: 79 | self.href = href 80 | if status is not None: 81 | self.status = status 82 | if result is not None: 83 | self.result = result 84 | if sub_result is not None: 85 | self.sub_result = sub_result 86 | if breakdown is not None: 87 | self.breakdown = breakdown 88 | if properties is not None: 89 | self.properties = properties 90 | self.name = name 91 | if documents is not None: 92 | self.documents = documents 93 | 94 | @property 95 | def id(self): 96 | """Gets the id of this Report. # noqa: E501 97 | 98 | The unique identifier for the report. Read-only. # noqa: E501 99 | 100 | :return: The id of this Report. # noqa: E501 101 | :rtype: str 102 | """ 103 | return self._id 104 | 105 | @id.setter 106 | def id(self, id): 107 | """Sets the id of this Report. 108 | 109 | The unique identifier for the report. Read-only. # noqa: E501 110 | 111 | :param id: The id of this Report. # noqa: E501 112 | :type: str 113 | """ 114 | 115 | self._id = id 116 | 117 | @property 118 | def created_at(self): 119 | """Gets the created_at of this Report. # noqa: E501 120 | 121 | The date and time at which the report was first initiated. Read-only. # noqa: E501 122 | 123 | :return: The created_at of this Report. # noqa: E501 124 | :rtype: datetime 125 | """ 126 | return self._created_at 127 | 128 | @created_at.setter 129 | def created_at(self, created_at): 130 | """Sets the created_at of this Report. 131 | 132 | The date and time at which the report was first initiated. Read-only. # noqa: E501 133 | 134 | :param created_at: The created_at of this Report. # noqa: E501 135 | :type: datetime 136 | """ 137 | 138 | self._created_at = created_at 139 | 140 | @property 141 | def href(self): 142 | """Gets the href of this Report. # noqa: E501 143 | 144 | The API endpoint to retrieve the report. Read-only. # noqa: E501 145 | 146 | :return: The href of this Report. # noqa: E501 147 | :rtype: str 148 | """ 149 | return self._href 150 | 151 | @href.setter 152 | def href(self, href): 153 | """Sets the href of this Report. 154 | 155 | The API endpoint to retrieve the report. Read-only. # noqa: E501 156 | 157 | :param href: The href of this Report. # noqa: E501 158 | :type: str 159 | """ 160 | 161 | self._href = href 162 | 163 | @property 164 | def status(self): 165 | """Gets the status of this Report. # noqa: E501 166 | 167 | The current state of the report in the checking process. Read-only. # noqa: E501 168 | 169 | :return: The status of this Report. # noqa: E501 170 | :rtype: str 171 | """ 172 | return self._status 173 | 174 | @status.setter 175 | def status(self, status): 176 | """Sets the status of this Report. 177 | 178 | The current state of the report in the checking process. Read-only. # noqa: E501 179 | 180 | :param status: The status of this Report. # noqa: E501 181 | :type: str 182 | """ 183 | 184 | self._status = status 185 | 186 | @property 187 | def result(self): 188 | """Gets the result of this Report. # noqa: E501 189 | 190 | The result of the report. Read-only. # noqa: E501 191 | 192 | :return: The result of this Report. # noqa: E501 193 | :rtype: str 194 | """ 195 | return self._result 196 | 197 | @result.setter 198 | def result(self, result): 199 | """Sets the result of this Report. 200 | 201 | The result of the report. Read-only. # noqa: E501 202 | 203 | :param result: The result of this Report. # noqa: E501 204 | :type: str 205 | """ 206 | 207 | self._result = result 208 | 209 | @property 210 | def sub_result(self): 211 | """Gets the sub_result of this Report. # noqa: E501 212 | 213 | The sub_result of the report. It gives a more detailed result for document reports only, and will be null otherwise. Read-only. # noqa: E501 214 | 215 | :return: The sub_result of this Report. # noqa: E501 216 | :rtype: str 217 | """ 218 | return self._sub_result 219 | 220 | @sub_result.setter 221 | def sub_result(self, sub_result): 222 | """Sets the sub_result of this Report. 223 | 224 | The sub_result of the report. It gives a more detailed result for document reports only, and will be null otherwise. Read-only. # noqa: E501 225 | 226 | :param sub_result: The sub_result of this Report. # noqa: E501 227 | :type: str 228 | """ 229 | 230 | self._sub_result = sub_result 231 | 232 | @property 233 | def breakdown(self): 234 | """Gets the breakdown of this Report. # noqa: E501 235 | 236 | The details of the report. This is specific to each type of report. Read-only. # noqa: E501 237 | 238 | :return: The breakdown of this Report. # noqa: E501 239 | :rtype: dict(str, object) 240 | """ 241 | return self._breakdown 242 | 243 | @breakdown.setter 244 | def breakdown(self, breakdown): 245 | """Sets the breakdown of this Report. 246 | 247 | The details of the report. This is specific to each type of report. Read-only. # noqa: E501 248 | 249 | :param breakdown: The breakdown of this Report. # noqa: E501 250 | :type: dict(str, object) 251 | """ 252 | 253 | self._breakdown = breakdown 254 | 255 | @property 256 | def properties(self): 257 | """Gets the properties of this Report. # noqa: E501 258 | 259 | The properties associated with the report, if any. Read-only. # noqa: E501 260 | 261 | :return: The properties of this Report. # noqa: E501 262 | :rtype: dict(str, object) 263 | """ 264 | return self._properties 265 | 266 | @properties.setter 267 | def properties(self, properties): 268 | """Sets the properties of this Report. 269 | 270 | The properties associated with the report, if any. Read-only. # noqa: E501 271 | 272 | :param properties: The properties of this Report. # noqa: E501 273 | :type: dict(str, object) 274 | """ 275 | 276 | self._properties = properties 277 | 278 | @property 279 | def name(self): 280 | """Gets the name of this Report. # noqa: E501 281 | 282 | The name of the report type. # noqa: E501 283 | 284 | :return: The name of this Report. # noqa: E501 285 | :rtype: str 286 | """ 287 | return self._name 288 | 289 | @name.setter 290 | def name(self, name): 291 | """Sets the name of this Report. 292 | 293 | The name of the report type. # noqa: E501 294 | 295 | :param name: The name of this Report. # noqa: E501 296 | :type: str 297 | """ 298 | if name is None: 299 | raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 300 | 301 | self._name = name 302 | 303 | @property 304 | def documents(self): 305 | """Gets the documents of this Report. # noqa: E501 306 | 307 | Array of objects with document ids that were used in the Onfido engine. [ONLY USED IN A DOCUMENT CHECK] # noqa: E501 308 | 309 | :return: The documents of this Report. # noqa: E501 310 | :rtype: list[ReportDocument] 311 | """ 312 | return self._documents 313 | 314 | @documents.setter 315 | def documents(self, documents): 316 | """Sets the documents of this Report. 317 | 318 | Array of objects with document ids that were used in the Onfido engine. [ONLY USED IN A DOCUMENT CHECK] # noqa: E501 319 | 320 | :param documents: The documents of this Report. # noqa: E501 321 | :type: list[ReportDocument] 322 | """ 323 | 324 | self._documents = documents 325 | 326 | def to_dict(self): 327 | """Returns the model properties as a dict""" 328 | result = {} 329 | 330 | for attr, _ in six.iteritems(self.openapi_types): 331 | value = getattr(self, attr) 332 | if isinstance(value, list): 333 | result[attr] = list(map( 334 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 335 | value 336 | )) 337 | elif hasattr(value, "to_dict"): 338 | result[attr] = value.to_dict() 339 | elif isinstance(value, dict): 340 | result[attr] = dict(map( 341 | lambda item: (item[0], item[1].to_dict()) 342 | if hasattr(item[1], "to_dict") else item, 343 | value.items() 344 | )) 345 | else: 346 | result[attr] = value 347 | 348 | return result 349 | 350 | def to_str(self): 351 | """Returns the string representation of the model""" 352 | return pprint.pformat(self.to_dict()) 353 | 354 | def __repr__(self): 355 | """For `print` and `pprint`""" 356 | return self.to_str() 357 | 358 | def __eq__(self, other): 359 | """Returns true if both objects are equal""" 360 | if not isinstance(other, Report): 361 | return False 362 | 363 | return self.__dict__ == other.__dict__ 364 | 365 | def __ne__(self, other): 366 | """Returns true if both objects are not equal""" 367 | return not self == other 368 | -------------------------------------------------------------------------------- /onfido/models/report_document.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ReportDocument(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'id': 'id' 39 | } 40 | 41 | def __init__(self, id=None): # noqa: E501 42 | """ReportDocument - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._id = None 45 | self.discriminator = None 46 | 47 | self.id = id 48 | 49 | @property 50 | def id(self): 51 | """Gets the id of this ReportDocument. # noqa: E501 52 | 53 | ID of uploaded document to use. # noqa: E501 54 | 55 | :return: The id of this ReportDocument. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._id 59 | 60 | @id.setter 61 | def id(self, id): 62 | """Sets the id of this ReportDocument. 63 | 64 | ID of uploaded document to use. # noqa: E501 65 | 66 | :param id: The id of this ReportDocument. # noqa: E501 67 | :type: str 68 | """ 69 | if id is None: 70 | raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 71 | 72 | self._id = id 73 | 74 | def to_dict(self): 75 | """Returns the model properties as a dict""" 76 | result = {} 77 | 78 | for attr, _ in six.iteritems(self.openapi_types): 79 | value = getattr(self, attr) 80 | if isinstance(value, list): 81 | result[attr] = list(map( 82 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 83 | value 84 | )) 85 | elif hasattr(value, "to_dict"): 86 | result[attr] = value.to_dict() 87 | elif isinstance(value, dict): 88 | result[attr] = dict(map( 89 | lambda item: (item[0], item[1].to_dict()) 90 | if hasattr(item[1], "to_dict") else item, 91 | value.items() 92 | )) 93 | else: 94 | result[attr] = value 95 | 96 | return result 97 | 98 | def to_str(self): 99 | """Returns the string representation of the model""" 100 | return pprint.pformat(self.to_dict()) 101 | 102 | def __repr__(self): 103 | """For `print` and `pprint`""" 104 | return self.to_str() 105 | 106 | def __eq__(self, other): 107 | """Returns true if both objects are equal""" 108 | if not isinstance(other, ReportDocument): 109 | return False 110 | 111 | return self.__dict__ == other.__dict__ 112 | 113 | def __ne__(self, other): 114 | """Returns true if both objects are not equal""" 115 | return not self == other 116 | -------------------------------------------------------------------------------- /onfido/models/reports_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ReportsList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'reports': 'list[Report]' 35 | } 36 | 37 | attribute_map = { 38 | 'reports': 'reports' 39 | } 40 | 41 | def __init__(self, reports=None): # noqa: E501 42 | """ReportsList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._reports = None 45 | self.discriminator = None 46 | 47 | if reports is not None: 48 | self.reports = reports 49 | 50 | @property 51 | def reports(self): 52 | """Gets the reports of this ReportsList. # noqa: E501 53 | 54 | 55 | :return: The reports of this ReportsList. # noqa: E501 56 | :rtype: list[Report] 57 | """ 58 | return self._reports 59 | 60 | @reports.setter 61 | def reports(self, reports): 62 | """Sets the reports of this ReportsList. 63 | 64 | 65 | :param reports: The reports of this ReportsList. # noqa: E501 66 | :type: list[Report] 67 | """ 68 | 69 | self._reports = reports 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, ReportsList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/models/sdk_token.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class SdkToken(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'applicant_id': 'str', 35 | 'referrer': 'str', 36 | 'application_id': 'str', 37 | 'token': 'str' 38 | } 39 | 40 | attribute_map = { 41 | 'applicant_id': 'applicant_id', 42 | 'referrer': 'referrer', 43 | 'application_id': 'application_id', 44 | 'token': 'token' 45 | } 46 | 47 | def __init__(self, applicant_id=None, referrer=None, application_id=None, token=None): # noqa: E501 48 | """SdkToken - a model defined in OpenAPI""" # noqa: E501 49 | 50 | self._applicant_id = None 51 | self._referrer = None 52 | self._application_id = None 53 | self._token = None 54 | self.discriminator = None 55 | 56 | if applicant_id is not None: 57 | self.applicant_id = applicant_id 58 | if referrer is not None: 59 | self.referrer = referrer 60 | if application_id is not None: 61 | self.application_id = application_id 62 | if token is not None: 63 | self.token = token 64 | 65 | @property 66 | def applicant_id(self): 67 | """Gets the applicant_id of this SdkToken. # noqa: E501 68 | 69 | The unique identifier of the applicant # noqa: E501 70 | 71 | :return: The applicant_id of this SdkToken. # noqa: E501 72 | :rtype: str 73 | """ 74 | return self._applicant_id 75 | 76 | @applicant_id.setter 77 | def applicant_id(self, applicant_id): 78 | """Sets the applicant_id of this SdkToken. 79 | 80 | The unique identifier of the applicant # noqa: E501 81 | 82 | :param applicant_id: The applicant_id of this SdkToken. # noqa: E501 83 | :type: str 84 | """ 85 | 86 | self._applicant_id = applicant_id 87 | 88 | @property 89 | def referrer(self): 90 | """Gets the referrer of this SdkToken. # noqa: E501 91 | 92 | The referrer URL pattern # noqa: E501 93 | 94 | :return: The referrer of this SdkToken. # noqa: E501 95 | :rtype: str 96 | """ 97 | return self._referrer 98 | 99 | @referrer.setter 100 | def referrer(self, referrer): 101 | """Sets the referrer of this SdkToken. 102 | 103 | The referrer URL pattern # noqa: E501 104 | 105 | :param referrer: The referrer of this SdkToken. # noqa: E501 106 | :type: str 107 | """ 108 | 109 | self._referrer = referrer 110 | 111 | @property 112 | def application_id(self): 113 | """Gets the application_id of this SdkToken. # noqa: E501 114 | 115 | The application ID (iOS or Android) # noqa: E501 116 | 117 | :return: The application_id of this SdkToken. # noqa: E501 118 | :rtype: str 119 | """ 120 | return self._application_id 121 | 122 | @application_id.setter 123 | def application_id(self, application_id): 124 | """Sets the application_id of this SdkToken. 125 | 126 | The application ID (iOS or Android) # noqa: E501 127 | 128 | :param application_id: The application_id of this SdkToken. # noqa: E501 129 | :type: str 130 | """ 131 | 132 | self._application_id = application_id 133 | 134 | @property 135 | def token(self): 136 | """Gets the token of this SdkToken. # noqa: E501 137 | 138 | The generated SDK token # noqa: E501 139 | 140 | :return: The token of this SdkToken. # noqa: E501 141 | :rtype: str 142 | """ 143 | return self._token 144 | 145 | @token.setter 146 | def token(self, token): 147 | """Sets the token of this SdkToken. 148 | 149 | The generated SDK token # noqa: E501 150 | 151 | :param token: The token of this SdkToken. # noqa: E501 152 | :type: str 153 | """ 154 | 155 | self._token = token 156 | 157 | def to_dict(self): 158 | """Returns the model properties as a dict""" 159 | result = {} 160 | 161 | for attr, _ in six.iteritems(self.openapi_types): 162 | value = getattr(self, attr) 163 | if isinstance(value, list): 164 | result[attr] = list(map( 165 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 166 | value 167 | )) 168 | elif hasattr(value, "to_dict"): 169 | result[attr] = value.to_dict() 170 | elif isinstance(value, dict): 171 | result[attr] = dict(map( 172 | lambda item: (item[0], item[1].to_dict()) 173 | if hasattr(item[1], "to_dict") else item, 174 | value.items() 175 | )) 176 | else: 177 | result[attr] = value 178 | 179 | return result 180 | 181 | def to_str(self): 182 | """Returns the string representation of the model""" 183 | return pprint.pformat(self.to_dict()) 184 | 185 | def __repr__(self): 186 | """For `print` and `pprint`""" 187 | return self.to_str() 188 | 189 | def __eq__(self, other): 190 | """Returns true if both objects are equal""" 191 | if not isinstance(other, SdkToken): 192 | return False 193 | 194 | return self.__dict__ == other.__dict__ 195 | 196 | def __ne__(self, other): 197 | """Returns true if both objects are not equal""" 198 | return not self == other 199 | -------------------------------------------------------------------------------- /onfido/models/webhook.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Webhook(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'id': 'str', 35 | 'token': 'str', 36 | 'href': 'str', 37 | 'url': 'str', 38 | 'enabled': 'bool', 39 | 'environments': 'list[str]', 40 | 'events': 'list[str]' 41 | } 42 | 43 | attribute_map = { 44 | 'id': 'id', 45 | 'token': 'token', 46 | 'href': 'href', 47 | 'url': 'url', 48 | 'enabled': 'enabled', 49 | 'environments': 'environments', 50 | 'events': 'events' 51 | } 52 | 53 | def __init__(self, id=None, token=None, href=None, url=None, enabled=None, environments=None, events=None): # noqa: E501 54 | """Webhook - a model defined in OpenAPI""" # noqa: E501 55 | 56 | self._id = None 57 | self._token = None 58 | self._href = None 59 | self._url = None 60 | self._enabled = None 61 | self._environments = None 62 | self._events = None 63 | self.discriminator = None 64 | 65 | if id is not None: 66 | self.id = id 67 | if token is not None: 68 | self.token = token 69 | if href is not None: 70 | self.href = href 71 | self.url = url 72 | if enabled is not None: 73 | self.enabled = enabled 74 | if environments is not None: 75 | self.environments = environments 76 | if events is not None: 77 | self.events = events 78 | 79 | @property 80 | def id(self): 81 | """Gets the id of this Webhook. # noqa: E501 82 | 83 | The unique identifier of the webhook. Read-only. # noqa: E501 84 | 85 | :return: The id of this Webhook. # noqa: E501 86 | :rtype: str 87 | """ 88 | return self._id 89 | 90 | @id.setter 91 | def id(self, id): 92 | """Sets the id of this Webhook. 93 | 94 | The unique identifier of the webhook. Read-only. # noqa: E501 95 | 96 | :param id: The id of this Webhook. # noqa: E501 97 | :type: str 98 | """ 99 | 100 | self._id = id 101 | 102 | @property 103 | def token(self): 104 | """Gets the token of this Webhook. # noqa: E501 105 | 106 | Webhook secret token used to sign the webhook's payload. Read-only. # noqa: E501 107 | 108 | :return: The token of this Webhook. # noqa: E501 109 | :rtype: str 110 | """ 111 | return self._token 112 | 113 | @token.setter 114 | def token(self, token): 115 | """Sets the token of this Webhook. 116 | 117 | Webhook secret token used to sign the webhook's payload. Read-only. # noqa: E501 118 | 119 | :param token: The token of this Webhook. # noqa: E501 120 | :type: str 121 | """ 122 | 123 | self._token = token 124 | 125 | @property 126 | def href(self): 127 | """Gets the href of this Webhook. # noqa: E501 128 | 129 | The API endpoint to retrieve the webhook. Read-only. # noqa: E501 130 | 131 | :return: The href of this Webhook. # noqa: E501 132 | :rtype: str 133 | """ 134 | return self._href 135 | 136 | @href.setter 137 | def href(self, href): 138 | """Sets the href of this Webhook. 139 | 140 | The API endpoint to retrieve the webhook. Read-only. # noqa: E501 141 | 142 | :param href: The href of this Webhook. # noqa: E501 143 | :type: str 144 | """ 145 | 146 | self._href = href 147 | 148 | @property 149 | def url(self): 150 | """Gets the url of this Webhook. # noqa: E501 151 | 152 | The url that will listen to notifications (must be https). # noqa: E501 153 | 154 | :return: The url of this Webhook. # noqa: E501 155 | :rtype: str 156 | """ 157 | return self._url 158 | 159 | @url.setter 160 | def url(self, url): 161 | """Sets the url of this Webhook. 162 | 163 | The url that will listen to notifications (must be https). # noqa: E501 164 | 165 | :param url: The url of this Webhook. # noqa: E501 166 | :type: str 167 | """ 168 | if url is None: 169 | raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 170 | 171 | self._url = url 172 | 173 | @property 174 | def enabled(self): 175 | """Gets the enabled of this Webhook. # noqa: E501 176 | 177 | Determine if the webhook is active. # noqa: E501 178 | 179 | :return: The enabled of this Webhook. # noqa: E501 180 | :rtype: bool 181 | """ 182 | return self._enabled 183 | 184 | @enabled.setter 185 | def enabled(self, enabled): 186 | """Sets the enabled of this Webhook. 187 | 188 | Determine if the webhook is active. # noqa: E501 189 | 190 | :param enabled: The enabled of this Webhook. # noqa: E501 191 | :type: bool 192 | """ 193 | 194 | self._enabled = enabled 195 | 196 | @property 197 | def environments(self): 198 | """Gets the environments of this Webhook. # noqa: E501 199 | 200 | The environments from which the webhook will receive events. Allowed values are “sandbox” and “live”. If the environments parameter is omitted the webhook will receive events from both environments. # noqa: E501 201 | 202 | :return: The environments of this Webhook. # noqa: E501 203 | :rtype: list[str] 204 | """ 205 | return self._environments 206 | 207 | @environments.setter 208 | def environments(self, environments): 209 | """Sets the environments of this Webhook. 210 | 211 | The environments from which the webhook will receive events. Allowed values are “sandbox” and “live”. If the environments parameter is omitted the webhook will receive events from both environments. # noqa: E501 212 | 213 | :param environments: The environments of this Webhook. # noqa: E501 214 | :type: list[str] 215 | """ 216 | 217 | self._environments = environments 218 | 219 | @property 220 | def events(self): 221 | """Gets the events of this Webhook. # noqa: E501 222 | 223 | The events that will be published to the webhook. The supported events are: `report.completed`, `report.withdrawn`, `check.completed`, `check.started`, `check.form_opened`, `check.form_completed`. If the events parameter is omitted all the events will be subscribed. # noqa: E501 224 | 225 | :return: The events of this Webhook. # noqa: E501 226 | :rtype: list[str] 227 | """ 228 | return self._events 229 | 230 | @events.setter 231 | def events(self, events): 232 | """Sets the events of this Webhook. 233 | 234 | The events that will be published to the webhook. The supported events are: `report.completed`, `report.withdrawn`, `check.completed`, `check.started`, `check.form_opened`, `check.form_completed`. If the events parameter is omitted all the events will be subscribed. # noqa: E501 235 | 236 | :param events: The events of this Webhook. # noqa: E501 237 | :type: list[str] 238 | """ 239 | 240 | self._events = events 241 | 242 | def to_dict(self): 243 | """Returns the model properties as a dict""" 244 | result = {} 245 | 246 | for attr, _ in six.iteritems(self.openapi_types): 247 | value = getattr(self, attr) 248 | if isinstance(value, list): 249 | result[attr] = list(map( 250 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 251 | value 252 | )) 253 | elif hasattr(value, "to_dict"): 254 | result[attr] = value.to_dict() 255 | elif isinstance(value, dict): 256 | result[attr] = dict(map( 257 | lambda item: (item[0], item[1].to_dict()) 258 | if hasattr(item[1], "to_dict") else item, 259 | value.items() 260 | )) 261 | else: 262 | result[attr] = value 263 | 264 | return result 265 | 266 | def to_str(self): 267 | """Returns the string representation of the model""" 268 | return pprint.pformat(self.to_dict()) 269 | 270 | def __repr__(self): 271 | """For `print` and `pprint`""" 272 | return self.to_str() 273 | 274 | def __eq__(self, other): 275 | """Returns true if both objects are equal""" 276 | if not isinstance(other, Webhook): 277 | return False 278 | 279 | return self.__dict__ == other.__dict__ 280 | 281 | def __ne__(self, other): 282 | """Returns true if both objects are not equal""" 283 | return not self == other 284 | -------------------------------------------------------------------------------- /onfido/models/webhooks_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class WebhooksList(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'webhooks': 'list[Webhook]' 35 | } 36 | 37 | attribute_map = { 38 | 'webhooks': 'webhooks' 39 | } 40 | 41 | def __init__(self, webhooks=None): # noqa: E501 42 | """WebhooksList - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._webhooks = None 45 | self.discriminator = None 46 | 47 | if webhooks is not None: 48 | self.webhooks = webhooks 49 | 50 | @property 51 | def webhooks(self): 52 | """Gets the webhooks of this WebhooksList. # noqa: E501 53 | 54 | 55 | :return: The webhooks of this WebhooksList. # noqa: E501 56 | :rtype: list[Webhook] 57 | """ 58 | return self._webhooks 59 | 60 | @webhooks.setter 61 | def webhooks(self, webhooks): 62 | """Sets the webhooks of this WebhooksList. 63 | 64 | 65 | :param webhooks: The webhooks of this WebhooksList. # noqa: E501 66 | :type: list[Webhook] 67 | """ 68 | 69 | self._webhooks = webhooks 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, WebhooksList): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /onfido/rest.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import io 16 | import json 17 | import logging 18 | import re 19 | import ssl 20 | 21 | import certifi 22 | # python 2 and python 3 compatibility library 23 | import six 24 | from six.moves.urllib.parse import urlencode 25 | import urllib3 26 | 27 | from onfido.exceptions import ApiException, ApiValueError 28 | 29 | 30 | logger = logging.getLogger(__name__) 31 | 32 | 33 | class RESTResponse(io.IOBase): 34 | 35 | def __init__(self, resp): 36 | self.urllib3_response = resp 37 | self.status = resp.status 38 | self.reason = resp.reason 39 | self.data = resp.data 40 | 41 | def getheaders(self): 42 | """Returns a dictionary of the response headers.""" 43 | return self.urllib3_response.getheaders() 44 | 45 | def getheader(self, name, default=None): 46 | """Returns a given response header.""" 47 | return self.urllib3_response.getheader(name, default) 48 | 49 | 50 | class RESTClientObject(object): 51 | 52 | def __init__(self, configuration, pools_size=4, maxsize=None): 53 | # urllib3.PoolManager will pass all kw parameters to connectionpool 54 | # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 55 | # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 56 | # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 57 | # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 58 | 59 | # cert_reqs 60 | if configuration.verify_ssl: 61 | cert_reqs = ssl.CERT_REQUIRED 62 | else: 63 | cert_reqs = ssl.CERT_NONE 64 | 65 | # ca_certs 66 | if configuration.ssl_ca_cert: 67 | ca_certs = configuration.ssl_ca_cert 68 | else: 69 | # if not set certificate file, use Mozilla's root certificates. 70 | ca_certs = certifi.where() 71 | 72 | addition_pool_args = {} 73 | if configuration.assert_hostname is not None: 74 | addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 75 | 76 | if configuration.retries is not None: 77 | addition_pool_args['retries'] = configuration.retries 78 | 79 | if maxsize is None: 80 | if configuration.connection_pool_maxsize is not None: 81 | maxsize = configuration.connection_pool_maxsize 82 | else: 83 | maxsize = 4 84 | 85 | # https pool manager 86 | if configuration.proxy: 87 | self.pool_manager = urllib3.ProxyManager( 88 | num_pools=pools_size, 89 | maxsize=maxsize, 90 | cert_reqs=cert_reqs, 91 | ca_certs=ca_certs, 92 | cert_file=configuration.cert_file, 93 | key_file=configuration.key_file, 94 | proxy_url=configuration.proxy, 95 | proxy_headers=configuration.proxy_headers, 96 | **addition_pool_args 97 | ) 98 | else: 99 | self.pool_manager = urllib3.PoolManager( 100 | num_pools=pools_size, 101 | maxsize=maxsize, 102 | cert_reqs=cert_reqs, 103 | ca_certs=ca_certs, 104 | cert_file=configuration.cert_file, 105 | key_file=configuration.key_file, 106 | **addition_pool_args 107 | ) 108 | 109 | def request(self, method, url, query_params=None, headers=None, 110 | body=None, post_params=None, _preload_content=True, 111 | _request_timeout=None): 112 | """Perform requests. 113 | 114 | :param method: http request method 115 | :param url: http request url 116 | :param query_params: query parameters in the url 117 | :param headers: http request headers 118 | :param body: request json body, for `application/json` 119 | :param post_params: request post parameters, 120 | `application/x-www-form-urlencoded` 121 | and `multipart/form-data` 122 | :param _preload_content: if False, the urllib3.HTTPResponse object will 123 | be returned without reading/decoding response 124 | data. Default is True. 125 | :param _request_timeout: timeout setting for this request. If one 126 | number provided, it will be total request 127 | timeout. It can also be a pair (tuple) of 128 | (connection, read) timeouts. 129 | """ 130 | method = method.upper() 131 | assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 132 | 'PATCH', 'OPTIONS'] 133 | 134 | if post_params and body: 135 | raise ApiValueError( 136 | "body parameter cannot be used with post_params parameter." 137 | ) 138 | 139 | post_params = post_params or {} 140 | headers = headers or {} 141 | 142 | timeout = None 143 | if _request_timeout: 144 | if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 145 | timeout = urllib3.Timeout(total=_request_timeout) 146 | elif (isinstance(_request_timeout, tuple) and 147 | len(_request_timeout) == 2): 148 | timeout = urllib3.Timeout( 149 | connect=_request_timeout[0], read=_request_timeout[1]) 150 | 151 | if 'Content-Type' not in headers: 152 | headers['Content-Type'] = 'application/json' 153 | 154 | try: 155 | # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` 156 | if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: 157 | if query_params: 158 | url += '?' + urlencode(query_params) 159 | if re.search('json', headers['Content-Type'], re.IGNORECASE): 160 | request_body = None 161 | if body is not None: 162 | request_body = json.dumps(body) 163 | r = self.pool_manager.request( 164 | method, url, 165 | body=request_body, 166 | preload_content=_preload_content, 167 | timeout=timeout, 168 | headers=headers) 169 | elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 170 | r = self.pool_manager.request( 171 | method, url, 172 | fields=post_params, 173 | encode_multipart=False, 174 | preload_content=_preload_content, 175 | timeout=timeout, 176 | headers=headers) 177 | elif headers['Content-Type'] == 'multipart/form-data': 178 | # must del headers['Content-Type'], or the correct 179 | # Content-Type which generated by urllib3 will be 180 | # overwritten. 181 | del headers['Content-Type'] 182 | r = self.pool_manager.request( 183 | method, url, 184 | fields=post_params, 185 | encode_multipart=True, 186 | preload_content=_preload_content, 187 | timeout=timeout, 188 | headers=headers) 189 | # Pass a `string` parameter directly in the body to support 190 | # other content types than Json when `body` argument is 191 | # provided in serialized form 192 | elif isinstance(body, str) or isinstance(body, bytes): 193 | request_body = body 194 | r = self.pool_manager.request( 195 | method, url, 196 | body=request_body, 197 | preload_content=_preload_content, 198 | timeout=timeout, 199 | headers=headers) 200 | else: 201 | # Cannot generate the request from given parameters 202 | msg = """Cannot prepare a request message for provided 203 | arguments. Please check that your arguments match 204 | declared content type.""" 205 | raise ApiException(status=0, reason=msg) 206 | # For `GET`, `HEAD` 207 | else: 208 | r = self.pool_manager.request(method, url, 209 | fields=query_params, 210 | preload_content=_preload_content, 211 | timeout=timeout, 212 | headers=headers) 213 | except urllib3.exceptions.SSLError as e: 214 | msg = "{0}\n{1}".format(type(e).__name__, str(e)) 215 | raise ApiException(status=0, reason=msg) 216 | 217 | if _preload_content: 218 | r = RESTResponse(r) 219 | 220 | # In the python 3, the response.data is bytes. 221 | # we need to decode it to string. 222 | if six.PY3: 223 | r.data = r.data.decode('utf8') 224 | 225 | # log response body 226 | logger.debug("response body: %s", r.data) 227 | 228 | if not 200 <= r.status <= 299: 229 | raise ApiException(http_resp=r) 230 | 231 | return r 232 | 233 | def GET(self, url, headers=None, query_params=None, _preload_content=True, 234 | _request_timeout=None): 235 | return self.request("GET", url, 236 | headers=headers, 237 | _preload_content=_preload_content, 238 | _request_timeout=_request_timeout, 239 | query_params=query_params) 240 | 241 | def HEAD(self, url, headers=None, query_params=None, _preload_content=True, 242 | _request_timeout=None): 243 | return self.request("HEAD", url, 244 | headers=headers, 245 | _preload_content=_preload_content, 246 | _request_timeout=_request_timeout, 247 | query_params=query_params) 248 | 249 | def OPTIONS(self, url, headers=None, query_params=None, post_params=None, 250 | body=None, _preload_content=True, _request_timeout=None): 251 | return self.request("OPTIONS", url, 252 | headers=headers, 253 | query_params=query_params, 254 | post_params=post_params, 255 | _preload_content=_preload_content, 256 | _request_timeout=_request_timeout, 257 | body=body) 258 | 259 | def DELETE(self, url, headers=None, query_params=None, body=None, 260 | _preload_content=True, _request_timeout=None): 261 | return self.request("DELETE", url, 262 | headers=headers, 263 | query_params=query_params, 264 | _preload_content=_preload_content, 265 | _request_timeout=_request_timeout, 266 | body=body) 267 | 268 | def POST(self, url, headers=None, query_params=None, post_params=None, 269 | body=None, _preload_content=True, _request_timeout=None): 270 | return self.request("POST", url, 271 | headers=headers, 272 | query_params=query_params, 273 | post_params=post_params, 274 | _preload_content=_preload_content, 275 | _request_timeout=_request_timeout, 276 | body=body) 277 | 278 | def PUT(self, url, headers=None, query_params=None, post_params=None, 279 | body=None, _preload_content=True, _request_timeout=None): 280 | return self.request("PUT", url, 281 | headers=headers, 282 | query_params=query_params, 283 | post_params=post_params, 284 | _preload_content=_preload_content, 285 | _request_timeout=_request_timeout, 286 | body=body) 287 | 288 | def PATCH(self, url, headers=None, query_params=None, post_params=None, 289 | body=None, _preload_content=True, _request_timeout=None): 290 | return self.request("PATCH", url, 291 | headers=headers, 292 | query_params=query_params, 293 | post_params=post_params, 294 | _preload_content=_preload_content, 295 | _request_timeout=_request_timeout, 296 | body=body) 297 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | six >= 1.10 3 | python_dateutil >= 2.5.3 4 | setuptools >= 21.0.0 5 | urllib3 >= 1.15.1 6 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from setuptools import setup, find_packages # noqa: H301 14 | 15 | NAME = "onfido" 16 | VERSION = "5.0.0" 17 | # To install the library, run the following 18 | # 19 | # python setup.py install 20 | # 21 | # prerequisite: setuptools 22 | # http://pypi.python.org/pypi/setuptools 23 | 24 | REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] 25 | 26 | setup( 27 | name=NAME, 28 | version=VERSION, 29 | description="Onfido API", 30 | author_email="", 31 | url="", 32 | keywords=["OpenAPI", "OpenAPI-Generator", "Onfido API"], 33 | install_requires=REQUIRES, 34 | packages=find_packages(), 35 | include_package_data=True, 36 | long_description="""\ 37 | The Onfido API is used to submit check requests. # noqa: E501 38 | """ 39 | ) 40 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | coverage>=4.0.3 2 | nose>=1.3.7 3 | pluggy>=0.3.1 4 | py>=1.4.31 5 | randomize>=0.13 6 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onfido/api-python-client/9e05fcb1c1c511da74a822740a59a67057c50f03/test/__init__.py -------------------------------------------------------------------------------- /test/test_address.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.address import Address # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestAddress(unittest.TestCase): 23 | """Address unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testAddress(self): 32 | """Test Address""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.address.Address() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_addresses_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.addresses_list import AddressesList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestAddressesList(unittest.TestCase): 23 | """AddressesList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testAddressesList(self): 32 | """Test AddressesList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.addresses_list.AddressesList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_applicant.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.applicant import Applicant # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestApplicant(unittest.TestCase): 23 | """Applicant unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testApplicant(self): 32 | """Test Applicant""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.applicant.Applicant() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_applicants_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.applicants_list import ApplicantsList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestApplicantsList(unittest.TestCase): 23 | """ApplicantsList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testApplicantsList(self): 32 | """Test ApplicantsList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.applicants_list.ApplicantsList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_check.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.check import Check # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestCheck(unittest.TestCase): 23 | """Check unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testCheck(self): 32 | """Test Check""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.check.Check() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_checks_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.checks_list import ChecksList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestChecksList(unittest.TestCase): 23 | """ChecksList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testChecksList(self): 32 | """Test ChecksList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.checks_list.ChecksList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_default_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.api.default_api import DefaultApi # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestDefaultApi(unittest.TestCase): 23 | """DefaultApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = onfido.api.default_api.DefaultApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_report(self): 32 | """Test case for cancel_report 33 | 34 | This endpoint is for cancelling individual paused reports. # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_applicant(self): 39 | """Test case for create_applicant 40 | 41 | Create Applicant # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_create_check(self): 46 | """Test case for create_check 47 | 48 | Create a check # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_create_webhook(self): 53 | """Test case for create_webhook 54 | 55 | Create a webhook # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_delete_webhook(self): 60 | """Test case for delete_webhook 61 | 62 | Delete a webhook # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_destroy_applicant(self): 67 | """Test case for destroy_applicant 68 | 69 | Delete Applicant # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_download_document(self): 74 | """Test case for download_document 75 | 76 | Download a documents raw data # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_download_live_photo(self): 81 | """Test case for download_live_photo 82 | 83 | Download live photo # noqa: E501 84 | """ 85 | pass 86 | 87 | def test_download_live_video(self): 88 | """Test case for download_live_video 89 | 90 | Download live video # noqa: E501 91 | """ 92 | pass 93 | 94 | def test_edit_webhook(self): 95 | """Test case for edit_webhook 96 | 97 | Edit a webhook # noqa: E501 98 | """ 99 | pass 100 | 101 | def test_find_addresses(self): 102 | """Test case for find_addresses 103 | 104 | Search for addresses by postcode # noqa: E501 105 | """ 106 | pass 107 | 108 | def test_find_applicant(self): 109 | """Test case for find_applicant 110 | 111 | Retrieve Applicant # noqa: E501 112 | """ 113 | pass 114 | 115 | def test_find_check(self): 116 | """Test case for find_check 117 | 118 | Retrieve a Check # noqa: E501 119 | """ 120 | pass 121 | 122 | def test_find_document(self): 123 | """Test case for find_document 124 | 125 | A single document can be retrieved by calling this endpoint with the document’s unique identifier. # noqa: E501 126 | """ 127 | pass 128 | 129 | def test_find_live_photo(self): 130 | """Test case for find_live_photo 131 | 132 | Retrieve live photo # noqa: E501 133 | """ 134 | pass 135 | 136 | def test_find_live_video(self): 137 | """Test case for find_live_video 138 | 139 | Retrieve live video # noqa: E501 140 | """ 141 | pass 142 | 143 | def test_find_report(self): 144 | """Test case for find_report 145 | 146 | A single report can be retrieved using this endpoint with the corresponding unique identifier. # noqa: E501 147 | """ 148 | pass 149 | 150 | def test_find_webhook(self): 151 | """Test case for find_webhook 152 | 153 | Retrieve a Webhook # noqa: E501 154 | """ 155 | pass 156 | 157 | def test_generate_sdk_token(self): 158 | """Test case for generate_sdk_token 159 | 160 | Generate a SDK token # noqa: E501 161 | """ 162 | pass 163 | 164 | def test_list_applicants(self): 165 | """Test case for list_applicants 166 | 167 | List Applicants # noqa: E501 168 | """ 169 | pass 170 | 171 | def test_list_checks(self): 172 | """Test case for list_checks 173 | 174 | Retrieve Checks # noqa: E501 175 | """ 176 | pass 177 | 178 | def test_list_documents(self): 179 | """Test case for list_documents 180 | 181 | List documents # noqa: E501 182 | """ 183 | pass 184 | 185 | def test_list_live_photos(self): 186 | """Test case for list_live_photos 187 | 188 | List live photos # noqa: E501 189 | """ 190 | pass 191 | 192 | def test_list_live_videos(self): 193 | """Test case for list_live_videos 194 | 195 | List live videos # noqa: E501 196 | """ 197 | pass 198 | 199 | def test_list_reports(self): 200 | """Test case for list_reports 201 | 202 | All the reports belonging to a particular check can be listed from this endpoint. # noqa: E501 203 | """ 204 | pass 205 | 206 | def test_list_webhooks(self): 207 | """Test case for list_webhooks 208 | 209 | List webhooks # noqa: E501 210 | """ 211 | pass 212 | 213 | def test_restore_applicant(self): 214 | """Test case for restore_applicant 215 | 216 | Restore Applicant # noqa: E501 217 | """ 218 | pass 219 | 220 | def test_resume_check(self): 221 | """Test case for resume_check 222 | 223 | Resume a Check # noqa: E501 224 | """ 225 | pass 226 | 227 | def test_resume_report(self): 228 | """Test case for resume_report 229 | 230 | This endpoint is for resuming individual paused reports. # noqa: E501 231 | """ 232 | pass 233 | 234 | def test_update_applicant(self): 235 | """Test case for update_applicant 236 | 237 | Update Applicant # noqa: E501 238 | """ 239 | pass 240 | 241 | def test_upload_document(self): 242 | """Test case for upload_document 243 | 244 | Upload a document # noqa: E501 245 | """ 246 | pass 247 | 248 | def test_upload_live_photo(self): 249 | """Test case for upload_live_photo 250 | 251 | Upload live photo # noqa: E501 252 | """ 253 | pass 254 | 255 | 256 | if __name__ == '__main__': 257 | unittest.main() 258 | -------------------------------------------------------------------------------- /test/test_document.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.document import Document # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestDocument(unittest.TestCase): 23 | """Document unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testDocument(self): 32 | """Test Document""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.document.Document() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_documents_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.documents_list import DocumentsList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestDocumentsList(unittest.TestCase): 23 | """DocumentsList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testDocumentsList(self): 32 | """Test DocumentsList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.documents_list.DocumentsList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_error.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.error import Error # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestError(unittest.TestCase): 23 | """Error unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testError(self): 32 | """Test Error""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.error.Error() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_error_properties.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.error_properties import ErrorProperties # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestErrorProperties(unittest.TestCase): 23 | """ErrorProperties unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testErrorProperties(self): 32 | """Test ErrorProperties""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.error_properties.ErrorProperties() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_id_number.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.id_number import IdNumber # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestIdNumber(unittest.TestCase): 23 | """IdNumber unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testIdNumber(self): 32 | """Test IdNumber""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.id_number.IdNumber() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_live_photo.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.live_photo import LivePhoto # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestLivePhoto(unittest.TestCase): 23 | """LivePhoto unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testLivePhoto(self): 32 | """Test LivePhoto""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.live_photo.LivePhoto() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_live_photos_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.live_photos_list import LivePhotosList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestLivePhotosList(unittest.TestCase): 23 | """LivePhotosList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testLivePhotosList(self): 32 | """Test LivePhotosList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.live_photos_list.LivePhotosList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_live_video.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.live_video import LiveVideo # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestLiveVideo(unittest.TestCase): 23 | """LiveVideo unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testLiveVideo(self): 32 | """Test LiveVideo""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.live_video.LiveVideo() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_live_videos_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.live_videos_list import LiveVideosList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestLiveVideosList(unittest.TestCase): 23 | """LiveVideosList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testLiveVideosList(self): 32 | """Test LiveVideosList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.live_videos_list.LiveVideosList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_report.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.report import Report # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestReport(unittest.TestCase): 23 | """Report unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testReport(self): 32 | """Test Report""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.report.Report() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_report_document.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.report_document import ReportDocument # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestReportDocument(unittest.TestCase): 23 | """ReportDocument unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testReportDocument(self): 32 | """Test ReportDocument""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.report_document.ReportDocument() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_reports_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.reports_list import ReportsList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestReportsList(unittest.TestCase): 23 | """ReportsList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testReportsList(self): 32 | """Test ReportsList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.reports_list.ReportsList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_sdk_token.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.sdk_token import SdkToken # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestSdkToken(unittest.TestCase): 23 | """SdkToken unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testSdkToken(self): 32 | """Test SdkToken""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.sdk_token.SdkToken() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_webhook.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.webhook import Webhook # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestWebhook(unittest.TestCase): 23 | """Webhook unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testWebhook(self): 32 | """Test Webhook""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.webhook.Webhook() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_webhooks_list.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Onfido API 5 | 6 | The Onfido API is used to submit check requests. # noqa: E501 7 | 8 | The version of the OpenAPI document: 3.0.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import onfido 18 | from onfido.models.webhooks_list import WebhooksList # noqa: E501 19 | from onfido.rest import ApiException 20 | 21 | 22 | class TestWebhooksList(unittest.TestCase): 23 | """WebhooksList unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testWebhooksList(self): 32 | """Test WebhooksList""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = onfido.models.webhooks_list.WebhooksList() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27, py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | nosetests \ 10 | [] 11 | --------------------------------------------------------------------------------