onfido-python 3.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onfido/__init__.py +311 -0
- onfido/api/__init__.py +5 -0
- onfido/api/default_api.py +17488 -0
- onfido/api_client.py +770 -0
- onfido/api_response.py +21 -0
- onfido/configuration.py +460 -0
- onfido/exceptions.py +199 -0
- onfido/models/__init__.py +291 -0
- onfido/models/address.py +169 -0
- onfido/models/address_builder.py +169 -0
- onfido/models/address_shared.py +169 -0
- onfido/models/addresses_list.py +108 -0
- onfido/models/applicant.py +162 -0
- onfido/models/applicant_builder.py +152 -0
- onfido/models/applicant_create.py +117 -0
- onfido/models/applicant_request.py +116 -0
- onfido/models/applicant_response.py +146 -0
- onfido/models/applicant_shared.py +115 -0
- onfido/models/applicant_update.py +123 -0
- onfido/models/applicant_updater.py +158 -0
- onfido/models/applicants_list.py +108 -0
- onfido/models/check.py +147 -0
- onfido/models/check_builder.py +127 -0
- onfido/models/check_request.py +119 -0
- onfido/models/check_response.py +137 -0
- onfido/models/check_shared.py +108 -0
- onfido/models/checks_list.py +108 -0
- onfido/models/complete_task_builder.py +104 -0
- onfido/models/complete_task_data_builder.py +143 -0
- onfido/models/consent_item.py +109 -0
- onfido/models/consents_builder.py +98 -0
- onfido/models/country_codes.py +285 -0
- onfido/models/device_intelligence_breakdown.py +110 -0
- onfido/models/device_intelligence_breakdown_breakdown.py +104 -0
- onfido/models/device_intelligence_breakdown_breakdown_device.py +104 -0
- onfido/models/device_intelligence_breakdown_breakdown_device_breakdown.py +114 -0
- onfido/models/device_intelligence_breakdown_properties.py +116 -0
- onfido/models/device_intelligence_breakdown_properties_device.py +189 -0
- onfido/models/device_intelligence_breakdown_properties_geolocation.py +105 -0
- onfido/models/device_intelligence_breakdown_properties_ip.py +106 -0
- onfido/models/device_intelligence_report.py +135 -0
- onfido/models/document.py +142 -0
- onfido/models/document_breakdown.py +152 -0
- onfido/models/document_breakdown_age_validation.py +106 -0
- onfido/models/document_breakdown_age_validation_breakdown.py +104 -0
- onfido/models/document_breakdown_compromised_document.py +106 -0
- onfido/models/document_breakdown_compromised_document_breakdown.py +109 -0
- onfido/models/document_breakdown_data_comparison.py +106 -0
- onfido/models/document_breakdown_data_comparison_breakdown.py +139 -0
- onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.py +102 -0
- onfido/models/document_breakdown_data_consistency.py +106 -0
- onfido/models/document_breakdown_data_consistency_breakdown.py +149 -0
- onfido/models/document_breakdown_data_validation.py +106 -0
- onfido/models/document_breakdown_data_validation_breakdown.py +136 -0
- onfido/models/document_breakdown_data_validation_breakdown_document_expiration.py +102 -0
- onfido/models/document_breakdown_data_validation_breakdown_expiry_date.py +102 -0
- onfido/models/document_breakdown_image_integrity.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown.py +122 -0
- onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.py +102 -0
- onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown_image_quality.py +106 -0
- onfido/models/document_breakdown_image_integrity_breakdown_supported_document.py +102 -0
- onfido/models/document_breakdown_issuing_authority.py +106 -0
- onfido/models/document_breakdown_issuing_authority_breakdown.py +110 -0
- onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.py +102 -0
- onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.py +102 -0
- onfido/models/document_breakdown_police_record.py +100 -0
- onfido/models/document_breakdown_visual_authenticity.py +106 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown.py +146 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.py +106 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_other.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.py +102 -0
- onfido/models/document_breakdown_visual_authenticity_breakdown_template.py +102 -0
- onfido/models/document_cdq_reasons.py +114 -0
- onfido/models/document_iq_reasons.py +118 -0
- onfido/models/document_odp_reasons.py +106 -0
- onfido/models/document_properties.py +255 -0
- onfido/models/document_properties_address_lines.py +110 -0
- onfido/models/document_properties_barcode_inner.py +135 -0
- onfido/models/document_properties_document_classification.py +104 -0
- onfido/models/document_properties_document_numbers_inner.py +102 -0
- onfido/models/document_properties_driving_licence_information.py +107 -0
- onfido/models/document_properties_extracted_data.py +141 -0
- onfido/models/document_properties_nfc.py +125 -0
- onfido/models/document_report.py +141 -0
- onfido/models/document_response.py +111 -0
- onfido/models/document_shared.py +129 -0
- onfido/models/document_types.py +60 -0
- onfido/models/document_video_report.py +141 -0
- onfido/models/document_video_with_address_information_report.py +141 -0
- onfido/models/document_with_address_information_report.py +141 -0
- onfido/models/document_with_driver_verification_report.py +141 -0
- onfido/models/document_with_driver_verification_report_all_of_properties.py +279 -0
- onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.py +105 -0
- onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.py +107 -0
- onfido/models/document_with_driving_licence_information_report.py +141 -0
- onfido/models/documents_list.py +108 -0
- onfido/models/error.py +104 -0
- onfido/models/error1.py +106 -0
- onfido/models/error_properties.py +104 -0
- onfido/models/error_properties1.py +102 -0
- onfido/models/extract_request.py +100 -0
- onfido/models/extraction.py +112 -0
- onfido/models/extraction_document_classification.py +120 -0
- onfido/models/extraction_extracted_data.py +176 -0
- onfido/models/facial_similarity_motion_breakdown.py +116 -0
- onfido/models/facial_similarity_motion_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.py +110 -0
- onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_motion_properties.py +100 -0
- onfido/models/facial_similarity_motion_report.py +141 -0
- onfido/models/facial_similarity_photo_breakdown.py +116 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.py +104 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.py +102 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.py +104 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.py +100 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown.py +116 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_photo_fully_auto_properties.py +100 -0
- onfido/models/facial_similarity_photo_fully_auto_report.py +141 -0
- onfido/models/facial_similarity_photo_properties.py +100 -0
- onfido/models/facial_similarity_photo_report.py +141 -0
- onfido/models/facial_similarity_video_breakdown.py +116 -0
- onfido/models/facial_similarity_video_breakdown_face_comparison.py +106 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.py +110 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.py +102 -0
- onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity.py +106 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.py +110 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.py +102 -0
- onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
- onfido/models/facial_similarity_video_properties.py +100 -0
- onfido/models/facial_similarity_video_report.py +141 -0
- onfido/models/id_number.py +114 -0
- onfido/models/id_photo.py +113 -0
- onfido/models/id_photo_response.py +113 -0
- onfido/models/id_photos_list.py +108 -0
- onfido/models/identity_enhanced_breakdown.py +122 -0
- onfido/models/identity_enhanced_breakdown_address.py +106 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown.py +116 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.py +106 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.py +100 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.py +102 -0
- onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.py +102 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth.py +106 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.py +110 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.py +102 -0
- onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.py +102 -0
- onfido/models/identity_enhanced_breakdown_mortality.py +100 -0
- onfido/models/identity_enhanced_breakdown_sources.py +106 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown.py +104 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.py +106 -0
- onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.py +100 -0
- onfido/models/identity_enhanced_properties.py +110 -0
- onfido/models/identity_enhanced_properties_matched_addresses_inner.py +102 -0
- onfido/models/identity_enhanced_report.py +141 -0
- onfido/models/india_pan_report.py +141 -0
- onfido/models/india_pan_report_all_of_breakdown.py +104 -0
- onfido/models/india_pan_report_all_of_breakdown_device.py +104 -0
- onfido/models/india_pan_report_all_of_breakdown_device_breakdown.py +109 -0
- onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.py +100 -0
- onfido/models/india_pan_report_all_of_properties.py +104 -0
- onfido/models/india_pan_report_all_of_properties_device.py +102 -0
- onfido/models/known_faces_breakdown.py +110 -0
- onfido/models/known_faces_breakdown_image_integrity.py +100 -0
- onfido/models/known_faces_breakdown_previously_seen_faces.py +100 -0
- onfido/models/known_faces_properties.py +108 -0
- onfido/models/known_faces_properties_matches_inner.py +108 -0
- onfido/models/known_faces_report.py +141 -0
- onfido/models/live_photo.py +113 -0
- onfido/models/live_photo_response.py +113 -0
- onfido/models/live_photos_list.py +108 -0
- onfido/models/live_video.py +115 -0
- onfido/models/live_videos_list.py +108 -0
- onfido/models/location.py +103 -0
- onfido/models/location_builder.py +103 -0
- onfido/models/location_shared.py +103 -0
- onfido/models/motion_capture.py +113 -0
- onfido/models/motion_captures_list.py +108 -0
- onfido/models/photo_auto_reasons.py +108 -0
- onfido/models/photo_reasons.py +108 -0
- onfido/models/proof_of_address_breakdown.py +116 -0
- onfido/models/proof_of_address_breakdown_data_comparison.py +106 -0
- onfido/models/proof_of_address_breakdown_data_comparison_breakdown.py +114 -0
- onfido/models/proof_of_address_breakdown_document_classification.py +106 -0
- onfido/models/proof_of_address_breakdown_document_classification_breakdown.py +104 -0
- onfido/models/proof_of_address_breakdown_image_integrity.py +106 -0
- onfido/models/proof_of_address_breakdown_image_integrity_breakdown.py +104 -0
- onfido/models/proof_of_address_properties.py +125 -0
- onfido/models/proof_of_address_report.py +141 -0
- onfido/models/repeat_attempts_list.py +117 -0
- onfido/models/repeat_attempts_list_repeat_attempts_inner.py +143 -0
- onfido/models/report.py +621 -0
- onfido/models/report_document.py +100 -0
- onfido/models/report_name.py +56 -0
- onfido/models/report_result.py +38 -0
- onfido/models/report_shared.py +129 -0
- onfido/models/report_status.py +40 -0
- onfido/models/report_sub_result.py +39 -0
- onfido/models/reports_list.py +108 -0
- onfido/models/results_feedback.py +116 -0
- onfido/models/sdk_token.py +100 -0
- onfido/models/sdk_token_builder.py +106 -0
- onfido/models/sdk_token_request.py +106 -0
- onfido/models/sdk_token_response.py +100 -0
- onfido/models/task.py +146 -0
- onfido/models/task_item.py +128 -0
- onfido/models/timeline_file_reference.py +102 -0
- onfido/models/us_driving_licence_breakdown.py +116 -0
- onfido/models/us_driving_licence_breakdown_address.py +106 -0
- onfido/models/us_driving_licence_breakdown_address_breakdown.py +129 -0
- onfido/models/us_driving_licence_breakdown_document.py +106 -0
- onfido/models/us_driving_licence_breakdown_document_breakdown.py +119 -0
- onfido/models/us_driving_licence_breakdown_personal.py +106 -0
- onfido/models/us_driving_licence_breakdown_personal_breakdown.py +164 -0
- onfido/models/us_driving_licence_builder.py +185 -0
- onfido/models/us_driving_licence_report.py +141 -0
- onfido/models/us_driving_licence_shared.py +185 -0
- onfido/models/video_reasons.py +106 -0
- onfido/models/watchlist_aml_breakdown.py +122 -0
- onfido/models/watchlist_aml_breakdown_adverse_media.py +100 -0
- onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.py +100 -0
- onfido/models/watchlist_aml_breakdown_politically_exposed_person.py +100 -0
- onfido/models/watchlist_aml_breakdown_sanction.py +100 -0
- onfido/models/watchlist_aml_properties.py +100 -0
- onfido/models/watchlist_aml_report.py +141 -0
- onfido/models/watchlist_enhanced_breakdown.py +122 -0
- onfido/models/watchlist_enhanced_properties.py +100 -0
- onfido/models/watchlist_enhanced_report.py +141 -0
- onfido/models/watchlist_monitor.py +120 -0
- onfido/models/watchlist_monitor_builder.py +111 -0
- onfido/models/watchlist_monitor_match.py +102 -0
- onfido/models/watchlist_monitor_matches_list.py +108 -0
- onfido/models/watchlist_monitor_matches_updater.py +102 -0
- onfido/models/watchlist_monitor_response.py +107 -0
- onfido/models/watchlist_monitor_shared.py +111 -0
- onfido/models/watchlist_monitors_list.py +108 -0
- onfido/models/watchlist_peps_only_report.py +141 -0
- onfido/models/watchlist_sanctions_only_report.py +141 -0
- onfido/models/watchlist_standard_breakdown.py +116 -0
- onfido/models/watchlist_standard_properties.py +100 -0
- onfido/models/watchlist_standard_report.py +141 -0
- onfido/models/webhook.py +115 -0
- onfido/models/webhook_builder.py +109 -0
- onfido/models/webhook_create.py +100 -0
- onfido/models/webhook_event.py +104 -0
- onfido/models/webhook_event_payload.py +111 -0
- onfido/models/webhook_event_payload_object.py +109 -0
- onfido/models/webhook_event_type.py +52 -0
- onfido/models/webhook_resend.py +108 -0
- onfido/models/webhook_response.py +106 -0
- onfido/models/webhook_shared.py +107 -0
- onfido/models/webhook_update.py +100 -0
- onfido/models/webhook_updater.py +109 -0
- onfido/models/webhooks_list.py +108 -0
- onfido/models/webhooks_resend_item.py +103 -0
- onfido/models/workflow_run.py +158 -0
- onfido/models/workflow_run_builder.py +125 -0
- onfido/models/workflow_run_request.py +100 -0
- onfido/models/workflow_run_response.py +133 -0
- onfido/models/workflow_run_response_error.py +102 -0
- onfido/models/workflow_run_shared.py +123 -0
- onfido/models/workflow_run_shared_link.py +119 -0
- onfido/py.typed +0 -0
- onfido/rest.py +258 -0
- onfido/webhook_event_verifier.py +27 -0
- onfido_python-3.4.0.dist-info/LICENSE +21 -0
- onfido_python-3.4.0.dist-info/METADATA +18 -0
- onfido_python-3.4.0.dist-info/RECORD +291 -0
- onfido_python-3.4.0.dist-info/WHEEL +5 -0
- onfido_python-3.4.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ConsentItem(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The applicant's consents
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr
|
|
30
|
+
granted: StrictBool
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["name", "granted"]
|
|
33
|
+
|
|
34
|
+
@field_validator('name')
|
|
35
|
+
def name_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['privacy_notices_read', 'ssn_verification', 'phone_number_verification']):
|
|
38
|
+
raise ValueError("must be one of enum values ('privacy_notices_read', 'ssn_verification', 'phone_number_verification')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of ConsentItem from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
"additional_properties",
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# puts key-value pairs in additional_properties in the top level
|
|
83
|
+
if self.additional_properties is not None:
|
|
84
|
+
for _key, _value in self.additional_properties.items():
|
|
85
|
+
_dict[_key] = _value
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of ConsentItem from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"name": obj.get("name"),
|
|
100
|
+
"granted": obj.get("granted")
|
|
101
|
+
})
|
|
102
|
+
# store additional fields in additional_properties
|
|
103
|
+
for _key in obj.keys():
|
|
104
|
+
if _key not in cls.__properties:
|
|
105
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
106
|
+
|
|
107
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ConsentsBuilder(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ConsentsBuilder
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
additional_properties: Dict[str, Any] = {}
|
|
30
|
+
__properties: ClassVar[List[str]] = []
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of ConsentsBuilder from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
"additional_properties",
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# puts key-value pairs in additional_properties in the top level
|
|
74
|
+
if self.additional_properties is not None:
|
|
75
|
+
for _key, _value in self.additional_properties.items():
|
|
76
|
+
_dict[_key] = _value
|
|
77
|
+
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of ConsentsBuilder from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
})
|
|
91
|
+
# store additional fields in additional_properties
|
|
92
|
+
for _key in obj.keys():
|
|
93
|
+
if _key not in cls.__properties:
|
|
94
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
95
|
+
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class CountryCodes(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
CountryCodes
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
ABW = 'ABW'
|
|
30
|
+
AFG = 'AFG'
|
|
31
|
+
AGO = 'AGO'
|
|
32
|
+
AIA = 'AIA'
|
|
33
|
+
ALA = 'ALA'
|
|
34
|
+
ALB = 'ALB'
|
|
35
|
+
AND = 'AND'
|
|
36
|
+
ARE = 'ARE'
|
|
37
|
+
ARG = 'ARG'
|
|
38
|
+
ARM = 'ARM'
|
|
39
|
+
ASM = 'ASM'
|
|
40
|
+
ATA = 'ATA'
|
|
41
|
+
ATF = 'ATF'
|
|
42
|
+
ATG = 'ATG'
|
|
43
|
+
AUS = 'AUS'
|
|
44
|
+
AUT = 'AUT'
|
|
45
|
+
AZE = 'AZE'
|
|
46
|
+
BDI = 'BDI'
|
|
47
|
+
BEL = 'BEL'
|
|
48
|
+
BEN = 'BEN'
|
|
49
|
+
BES = 'BES'
|
|
50
|
+
BFA = 'BFA'
|
|
51
|
+
BGD = 'BGD'
|
|
52
|
+
BGR = 'BGR'
|
|
53
|
+
BHR = 'BHR'
|
|
54
|
+
BHS = 'BHS'
|
|
55
|
+
BIH = 'BIH'
|
|
56
|
+
BLM = 'BLM'
|
|
57
|
+
BLR = 'BLR'
|
|
58
|
+
BLZ = 'BLZ'
|
|
59
|
+
BMU = 'BMU'
|
|
60
|
+
BOL = 'BOL'
|
|
61
|
+
BRA = 'BRA'
|
|
62
|
+
BRB = 'BRB'
|
|
63
|
+
BRN = 'BRN'
|
|
64
|
+
BTN = 'BTN'
|
|
65
|
+
BVT = 'BVT'
|
|
66
|
+
BWA = 'BWA'
|
|
67
|
+
CAF = 'CAF'
|
|
68
|
+
CAN = 'CAN'
|
|
69
|
+
CCK = 'CCK'
|
|
70
|
+
CHE = 'CHE'
|
|
71
|
+
CHL = 'CHL'
|
|
72
|
+
CHN = 'CHN'
|
|
73
|
+
CIV = 'CIV'
|
|
74
|
+
CMR = 'CMR'
|
|
75
|
+
COD = 'COD'
|
|
76
|
+
COG = 'COG'
|
|
77
|
+
COK = 'COK'
|
|
78
|
+
COL = 'COL'
|
|
79
|
+
COM = 'COM'
|
|
80
|
+
CPV = 'CPV'
|
|
81
|
+
CRI = 'CRI'
|
|
82
|
+
CUB = 'CUB'
|
|
83
|
+
CUW = 'CUW'
|
|
84
|
+
CXR = 'CXR'
|
|
85
|
+
CYM = 'CYM'
|
|
86
|
+
CYP = 'CYP'
|
|
87
|
+
CZE = 'CZE'
|
|
88
|
+
DEU = 'DEU'
|
|
89
|
+
DJI = 'DJI'
|
|
90
|
+
DMA = 'DMA'
|
|
91
|
+
DNK = 'DNK'
|
|
92
|
+
DOM = 'DOM'
|
|
93
|
+
DZA = 'DZA'
|
|
94
|
+
ECU = 'ECU'
|
|
95
|
+
EGY = 'EGY'
|
|
96
|
+
ERI = 'ERI'
|
|
97
|
+
ESH = 'ESH'
|
|
98
|
+
ESP = 'ESP'
|
|
99
|
+
EST = 'EST'
|
|
100
|
+
ETH = 'ETH'
|
|
101
|
+
FIN = 'FIN'
|
|
102
|
+
FJI = 'FJI'
|
|
103
|
+
FLK = 'FLK'
|
|
104
|
+
FRA = 'FRA'
|
|
105
|
+
FRO = 'FRO'
|
|
106
|
+
FSM = 'FSM'
|
|
107
|
+
GAB = 'GAB'
|
|
108
|
+
GBR = 'GBR'
|
|
109
|
+
GEO = 'GEO'
|
|
110
|
+
GGY = 'GGY'
|
|
111
|
+
GHA = 'GHA'
|
|
112
|
+
GIB = 'GIB'
|
|
113
|
+
GIN = 'GIN'
|
|
114
|
+
GLP = 'GLP'
|
|
115
|
+
GMB = 'GMB'
|
|
116
|
+
GNB = 'GNB'
|
|
117
|
+
GNQ = 'GNQ'
|
|
118
|
+
GRC = 'GRC'
|
|
119
|
+
GRD = 'GRD'
|
|
120
|
+
GRL = 'GRL'
|
|
121
|
+
GTM = 'GTM'
|
|
122
|
+
GUF = 'GUF'
|
|
123
|
+
GUM = 'GUM'
|
|
124
|
+
GUY = 'GUY'
|
|
125
|
+
HKG = 'HKG'
|
|
126
|
+
HMD = 'HMD'
|
|
127
|
+
HND = 'HND'
|
|
128
|
+
HRV = 'HRV'
|
|
129
|
+
HTI = 'HTI'
|
|
130
|
+
HUN = 'HUN'
|
|
131
|
+
IDN = 'IDN'
|
|
132
|
+
IMN = 'IMN'
|
|
133
|
+
IND = 'IND'
|
|
134
|
+
IOT = 'IOT'
|
|
135
|
+
IRL = 'IRL'
|
|
136
|
+
IRN = 'IRN'
|
|
137
|
+
IRQ = 'IRQ'
|
|
138
|
+
ISL = 'ISL'
|
|
139
|
+
ISR = 'ISR'
|
|
140
|
+
ITA = 'ITA'
|
|
141
|
+
JAM = 'JAM'
|
|
142
|
+
JEY = 'JEY'
|
|
143
|
+
JOR = 'JOR'
|
|
144
|
+
JPN = 'JPN'
|
|
145
|
+
KAZ = 'KAZ'
|
|
146
|
+
KEN = 'KEN'
|
|
147
|
+
KGZ = 'KGZ'
|
|
148
|
+
KHM = 'KHM'
|
|
149
|
+
KIR = 'KIR'
|
|
150
|
+
KNA = 'KNA'
|
|
151
|
+
KOR = 'KOR'
|
|
152
|
+
KWT = 'KWT'
|
|
153
|
+
LAO = 'LAO'
|
|
154
|
+
LBN = 'LBN'
|
|
155
|
+
LBR = 'LBR'
|
|
156
|
+
LBY = 'LBY'
|
|
157
|
+
LCA = 'LCA'
|
|
158
|
+
LIE = 'LIE'
|
|
159
|
+
LKA = 'LKA'
|
|
160
|
+
LSO = 'LSO'
|
|
161
|
+
LTU = 'LTU'
|
|
162
|
+
LUX = 'LUX'
|
|
163
|
+
LVA = 'LVA'
|
|
164
|
+
MAC = 'MAC'
|
|
165
|
+
MAF = 'MAF'
|
|
166
|
+
MAR = 'MAR'
|
|
167
|
+
MCO = 'MCO'
|
|
168
|
+
MDA = 'MDA'
|
|
169
|
+
MDG = 'MDG'
|
|
170
|
+
MDV = 'MDV'
|
|
171
|
+
MEX = 'MEX'
|
|
172
|
+
MHL = 'MHL'
|
|
173
|
+
MKD = 'MKD'
|
|
174
|
+
MLI = 'MLI'
|
|
175
|
+
MLT = 'MLT'
|
|
176
|
+
MMR = 'MMR'
|
|
177
|
+
MNE = 'MNE'
|
|
178
|
+
MNG = 'MNG'
|
|
179
|
+
MNP = 'MNP'
|
|
180
|
+
MOZ = 'MOZ'
|
|
181
|
+
MRT = 'MRT'
|
|
182
|
+
MSR = 'MSR'
|
|
183
|
+
MTQ = 'MTQ'
|
|
184
|
+
MUS = 'MUS'
|
|
185
|
+
MWI = 'MWI'
|
|
186
|
+
MYS = 'MYS'
|
|
187
|
+
MYT = 'MYT'
|
|
188
|
+
NAM = 'NAM'
|
|
189
|
+
NCL = 'NCL'
|
|
190
|
+
NER = 'NER'
|
|
191
|
+
NFK = 'NFK'
|
|
192
|
+
NGA = 'NGA'
|
|
193
|
+
NIC = 'NIC'
|
|
194
|
+
NIU = 'NIU'
|
|
195
|
+
NLD = 'NLD'
|
|
196
|
+
NOR = 'NOR'
|
|
197
|
+
NPL = 'NPL'
|
|
198
|
+
NRU = 'NRU'
|
|
199
|
+
NZL = 'NZL'
|
|
200
|
+
OMN = 'OMN'
|
|
201
|
+
PAK = 'PAK'
|
|
202
|
+
PAN = 'PAN'
|
|
203
|
+
PCN = 'PCN'
|
|
204
|
+
PER = 'PER'
|
|
205
|
+
PHL = 'PHL'
|
|
206
|
+
PLW = 'PLW'
|
|
207
|
+
PNG = 'PNG'
|
|
208
|
+
POL = 'POL'
|
|
209
|
+
PRI = 'PRI'
|
|
210
|
+
PRK = 'PRK'
|
|
211
|
+
PRT = 'PRT'
|
|
212
|
+
PRY = 'PRY'
|
|
213
|
+
PSE = 'PSE'
|
|
214
|
+
PYF = 'PYF'
|
|
215
|
+
QAT = 'QAT'
|
|
216
|
+
REU = 'REU'
|
|
217
|
+
RKS = 'RKS'
|
|
218
|
+
ROU = 'ROU'
|
|
219
|
+
RUS = 'RUS'
|
|
220
|
+
RWA = 'RWA'
|
|
221
|
+
SAU = 'SAU'
|
|
222
|
+
SDN = 'SDN'
|
|
223
|
+
SEN = 'SEN'
|
|
224
|
+
SGP = 'SGP'
|
|
225
|
+
SGS = 'SGS'
|
|
226
|
+
SHN = 'SHN'
|
|
227
|
+
SJM = 'SJM'
|
|
228
|
+
SLB = 'SLB'
|
|
229
|
+
SLE = 'SLE'
|
|
230
|
+
SLV = 'SLV'
|
|
231
|
+
SMR = 'SMR'
|
|
232
|
+
SOM = 'SOM'
|
|
233
|
+
SPM = 'SPM'
|
|
234
|
+
SRB = 'SRB'
|
|
235
|
+
SSD = 'SSD'
|
|
236
|
+
STP = 'STP'
|
|
237
|
+
SUR = 'SUR'
|
|
238
|
+
SVK = 'SVK'
|
|
239
|
+
SVN = 'SVN'
|
|
240
|
+
SWE = 'SWE'
|
|
241
|
+
SWZ = 'SWZ'
|
|
242
|
+
SXM = 'SXM'
|
|
243
|
+
SYC = 'SYC'
|
|
244
|
+
SYR = 'SYR'
|
|
245
|
+
TCA = 'TCA'
|
|
246
|
+
TCD = 'TCD'
|
|
247
|
+
TGO = 'TGO'
|
|
248
|
+
THA = 'THA'
|
|
249
|
+
TJK = 'TJK'
|
|
250
|
+
TKL = 'TKL'
|
|
251
|
+
TKM = 'TKM'
|
|
252
|
+
TLS = 'TLS'
|
|
253
|
+
TON = 'TON'
|
|
254
|
+
TTO = 'TTO'
|
|
255
|
+
TUN = 'TUN'
|
|
256
|
+
TUR = 'TUR'
|
|
257
|
+
TUV = 'TUV'
|
|
258
|
+
TWN = 'TWN'
|
|
259
|
+
TZA = 'TZA'
|
|
260
|
+
UGA = 'UGA'
|
|
261
|
+
UKR = 'UKR'
|
|
262
|
+
UMI = 'UMI'
|
|
263
|
+
URY = 'URY'
|
|
264
|
+
USA = 'USA'
|
|
265
|
+
UZB = 'UZB'
|
|
266
|
+
VAT = 'VAT'
|
|
267
|
+
VCT = 'VCT'
|
|
268
|
+
VEN = 'VEN'
|
|
269
|
+
VGB = 'VGB'
|
|
270
|
+
VIR = 'VIR'
|
|
271
|
+
VNM = 'VNM'
|
|
272
|
+
VUT = 'VUT'
|
|
273
|
+
WLF = 'WLF'
|
|
274
|
+
WSM = 'WSM'
|
|
275
|
+
YEM = 'YEM'
|
|
276
|
+
ZAF = 'ZAF'
|
|
277
|
+
ZMB = 'ZMB'
|
|
278
|
+
ZWE = 'ZWE'
|
|
279
|
+
|
|
280
|
+
@classmethod
|
|
281
|
+
def from_json(cls, json_str: str) -> Self:
|
|
282
|
+
"""Create an instance of CountryCodes from a JSON string"""
|
|
283
|
+
return cls(json.loads(json_str))
|
|
284
|
+
|
|
285
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
|
|
23
|
+
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class DeviceIntelligenceBreakdown(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
DeviceIntelligenceBreakdown
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
breakdown: Optional[DeviceIntelligenceBreakdownBreakdown] = None
|
|
32
|
+
properties: Optional[DeviceIntelligenceBreakdownProperties] = None
|
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
|
34
|
+
__properties: ClassVar[List[str]] = ["breakdown", "properties"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of DeviceIntelligenceBreakdown from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of breakdown
|
|
78
|
+
if self.breakdown:
|
|
79
|
+
_dict['breakdown'] = self.breakdown.to_dict()
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of properties
|
|
81
|
+
if self.properties:
|
|
82
|
+
_dict['properties'] = self.properties.to_dict()
|
|
83
|
+
# puts key-value pairs in additional_properties in the top level
|
|
84
|
+
if self.additional_properties is not None:
|
|
85
|
+
for _key, _value in self.additional_properties.items():
|
|
86
|
+
_dict[_key] = _value
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of DeviceIntelligenceBreakdown from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"breakdown": DeviceIntelligenceBreakdownBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
101
|
+
"properties": DeviceIntelligenceBreakdownProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
102
|
+
})
|
|
103
|
+
# store additional fields in additional_properties
|
|
104
|
+
for _key in obj.keys():
|
|
105
|
+
if _key not in cls.__properties:
|
|
106
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
107
|
+
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from onfido.models.device_intelligence_breakdown_breakdown_device import DeviceIntelligenceBreakdownBreakdownDevice
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class DeviceIntelligenceBreakdownBreakdown(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DeviceIntelligenceBreakdownBreakdown
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
device: Optional[DeviceIntelligenceBreakdownBreakdownDevice] = None
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["device"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of DeviceIntelligenceBreakdownBreakdown from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of device
|
|
76
|
+
if self.device:
|
|
77
|
+
_dict['device'] = self.device.to_dict()
|
|
78
|
+
# puts key-value pairs in additional_properties in the top level
|
|
79
|
+
if self.additional_properties is not None:
|
|
80
|
+
for _key, _value in self.additional_properties.items():
|
|
81
|
+
_dict[_key] = _value
|
|
82
|
+
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of DeviceIntelligenceBreakdownBreakdown from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({
|
|
95
|
+
"device": DeviceIntelligenceBreakdownBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None
|
|
96
|
+
})
|
|
97
|
+
# store additional fields in additional_properties
|
|
98
|
+
for _key in obj.keys():
|
|
99
|
+
if _key not in cls.__properties:
|
|
100
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
|
+
|
|
102
|
+
return _obj
|
|
103
|
+
|
|
104
|
+
|