Skip to content

Commit

Permalink
Merge pull request #75 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-python after onfido-openapi-spec update (c72181c)
  • Loading branch information
dvacca-onfido authored Nov 19, 2024
2 parents a96d11f + 08b067d commit 2454716
Show file tree
Hide file tree
Showing 15 changed files with 452 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "d180edd",
"long_sha": "d180eddd168dd95bf84bf7c8fe9f8c7e3c0c5494",
"version": "v4.1.0"
"short_sha": "c72181c",
"long_sha": "c72181cc5e450bf727fc5eae2639c58ba45831ac",
"version": "v4.2.0"
},
"release": "v4.1.0"
"release": "v4.2.0"
}
4 changes: 3 additions & 1 deletion onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "4.1.0"
__version__ = "4.2.0"

# import apis into sdk package
from onfido.api.default_api import DefaultApi
Expand Down Expand Up @@ -165,6 +165,8 @@
from onfido.models.facial_similarity_photo_fully_auto_report import FacialSimilarityPhotoFullyAutoReport
from onfido.models.facial_similarity_photo_properties import FacialSimilarityPhotoProperties
from onfido.models.facial_similarity_photo_report import FacialSimilarityPhotoReport
from onfido.models.facial_similarity_report_media import FacialSimilarityReportMedia
from onfido.models.facial_similarity_report_shared import FacialSimilarityReportShared
from onfido.models.facial_similarity_video_breakdown import FacialSimilarityVideoBreakdown
from onfido.models.facial_similarity_video_breakdown_face_comparison import FacialSimilarityVideoBreakdownFaceComparison
from onfido.models.facial_similarity_video_breakdown_image_integrity import FacialSimilarityVideoBreakdownImageIntegrity
Expand Down
2 changes: 1 addition & 1 deletion onfido/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'onfido-python/4.1.0'
self.user_agent = 'onfido-python/4.2.0'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion onfido/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v3.6\n"\
"SDK Package Version: 4.1.0".\
"SDK Package Version: 4.2.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
2 changes: 2 additions & 0 deletions onfido/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
from onfido.models.facial_similarity_photo_fully_auto_report import FacialSimilarityPhotoFullyAutoReport
from onfido.models.facial_similarity_photo_properties import FacialSimilarityPhotoProperties
from onfido.models.facial_similarity_photo_report import FacialSimilarityPhotoReport
from onfido.models.facial_similarity_report_media import FacialSimilarityReportMedia
from onfido.models.facial_similarity_report_shared import FacialSimilarityReportShared
from onfido.models.facial_similarity_video_breakdown import FacialSimilarityVideoBreakdown
from onfido.models.facial_similarity_video_breakdown_face_comparison import FacialSimilarityVideoBreakdownFaceComparison
from onfido.models.facial_similarity_video_breakdown_image_integrity import FacialSimilarityVideoBreakdownImageIntegrity
Expand Down
46 changes: 46 additions & 0 deletions onfido/models/document_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,52 @@ class DocumentTypes(str, Enum):
VEHICLE_REGISTRATION_CERTIFICATE = 'vehicle_registration_certificate'
FORM_FOR_AFFIXING_THE_VISA = 'form_for_affixing_the_visa'
IDENTIFICATION_NUMBER_DOCUMENT = 'identification_number_document'
ADOPTION_CERTIFICATE = 'adoption_certificate'
BANK_BUILDING_SOCIETY_STATEMENT = 'bank_building_society_statement'
BANK_STATEMENT = 'bank_statement'
BENEFIT_LETTERS = 'benefit_letters'
CBT = 'cbt'
CERTIFICATE_OF_SPONSORSHIP = 'certificate_of_sponsorship'
CHARACTER_REFERENCE = 'character_reference'
CIVIL_PARTNERSHIP_CERTIFICATE = 'civil_partnership_certificate'
COUNCIL_TAX = 'council_tax'
CREDIT_CARD_STATEMENT = 'credit_card_statement'
DEED_POLL = 'deed_poll'
DIVORCE_ABSOLUTE_DECREE = 'divorce_absolute_decree'
EDUCATIONAL_STATEMENT = 'educational_statement'
ELECTRICITY_BILL = 'electricity_bill'
GAS_BILL = 'gas_bill'
GOVERNMENT_LETTER = 'government_letter'
INTERNET_BILL = 'internet_bill'
MARRIAGE_CERTIFICATE = 'marriage_certificate'
MOTORCYCLE_INSURANCE = 'motorcycle_insurance'
NATIONAL_INSURANCE_CARD = 'national_insurance_card'
NATURALISATION_CERTIFICATE = 'naturalisation_certificate'
NON_UK_DRIVING_LICENCE = 'non_uk_driving_licence'
P45_P60 = 'p45_p60'
PAYSLIP = 'payslip'
PHONE_BILL = 'phone_bill'
PROFESSIONAL_IDENTIFICATION_CARD = 'professional_identification_card'
RIGHT_TO_WORK_SHARE_CODE_RESULT = 'right_to_work_share_code_result'
STATEMENT_FACT = 'statement_fact'
T4_STUDENT_UNIVERSITY_TERM_DATES_EVIDENCE = 't4_student_university_term_dates_evidence'
UK_BIOMETRIC_RESIDENCE_PERMIT = 'uk_biometric_residence_permit'
UK_DRIVING_LICENCE = 'uk_driving_licence'
UNKNOWN = 'unknown'
UTILITY_BILL = 'utility_bill'
UTILITY_BILL_ELECTRIC = 'utility_bill_electric'
UTILITY_BILL_GAS = 'utility_bill_gas'
UTILITY_BILL_OTHER = 'utility_bill_other'
WATER_BILL = 'water_bill'
ADDRESS_CERTIFICATE = 'address_certificate'
GENERAL_LETTER = 'general_letter'
INSURANCE_STATEMENT = 'insurance_statement'
PENSION_PROPERTY_STATEMENT_LETTER = 'pension_property_statement_letter'
MORTGAGE_STATEMENT = 'mortgage_statement'
MOBILE_PHONE_BILL = 'mobile_phone_bill'
IDENTITY_DOCUMENT_WITH_ADDRESS = 'identity_document_with_address'
EXCHANGE_HOUSE_STATEMENT = 'exchange_house_statement'
ACCOMMODATION_TENANCY_CERTIFICATE = 'accommodation_tenancy_certificate'

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
39 changes: 38 additions & 1 deletion onfido/models/facial_similarity_motion_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.facial_similarity_motion_breakdown import FacialSimilarityMotionBreakdown
from onfido.models.facial_similarity_motion_properties import FacialSimilarityMotionProperties
from onfido.models.facial_similarity_report_media import FacialSimilarityReportMedia
from onfido.models.report_document import ReportDocument
from onfido.models.report_name import ReportName
from onfido.models.report_result import ReportResult
Expand All @@ -43,10 +44,14 @@ class FacialSimilarityMotionReport(BaseModel):
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine. [ONLY POPULATED FOR DOCUMENT AND FACIAL SIMILARITY REPORTS]")
name: ReportName
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
id_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with id photo ids that were used in the Onfido engine.")
breakdown: Optional[FacialSimilarityMotionBreakdown] = None
properties: Optional[FacialSimilarityMotionProperties] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "breakdown", "properties"]
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -96,6 +101,34 @@ def to_dict(self) -> Dict[str, Any]:
if _item_documents:
_items.append(_item_documents.to_dict())
_dict['documents'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in live_photos (list)
_items = []
if self.live_photos:
for _item_live_photos in self.live_photos:
if _item_live_photos:
_items.append(_item_live_photos.to_dict())
_dict['live_photos'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in live_videos (list)
_items = []
if self.live_videos:
for _item_live_videos in self.live_videos:
if _item_live_videos:
_items.append(_item_live_videos.to_dict())
_dict['live_videos'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in motion_captures (list)
_items = []
if self.motion_captures:
for _item_motion_captures in self.motion_captures:
if _item_motion_captures:
_items.append(_item_motion_captures.to_dict())
_dict['motion_captures'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in id_photos (list)
_items = []
if self.id_photos:
for _item_id_photos in self.id_photos:
if _item_id_photos:
_items.append(_item_id_photos.to_dict())
_dict['id_photos'] = _items
# override the default output from pydantic by calling `to_dict()` of breakdown
if self.breakdown:
_dict['breakdown'] = self.breakdown.to_dict()
Expand Down Expand Up @@ -128,6 +161,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"check_id": obj.get("check_id"),
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
"name": obj.get("name"),
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
"id_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["id_photos"]] if obj.get("id_photos") is not None else None,
"breakdown": FacialSimilarityMotionBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
"properties": FacialSimilarityMotionProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
})
Expand Down
39 changes: 38 additions & 1 deletion onfido/models/facial_similarity_photo_fully_auto_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.facial_similarity_photo_fully_auto_breakdown import FacialSimilarityPhotoFullyAutoBreakdown
from onfido.models.facial_similarity_photo_fully_auto_properties import FacialSimilarityPhotoFullyAutoProperties
from onfido.models.facial_similarity_report_media import FacialSimilarityReportMedia
from onfido.models.report_document import ReportDocument
from onfido.models.report_name import ReportName
from onfido.models.report_result import ReportResult
Expand All @@ -43,10 +44,14 @@ class FacialSimilarityPhotoFullyAutoReport(BaseModel):
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine. [ONLY POPULATED FOR DOCUMENT AND FACIAL SIMILARITY REPORTS]")
name: ReportName
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
id_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with id photo ids that were used in the Onfido engine.")
breakdown: Optional[FacialSimilarityPhotoFullyAutoBreakdown] = None
properties: Optional[FacialSimilarityPhotoFullyAutoProperties] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "breakdown", "properties"]
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -96,6 +101,34 @@ def to_dict(self) -> Dict[str, Any]:
if _item_documents:
_items.append(_item_documents.to_dict())
_dict['documents'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in live_photos (list)
_items = []
if self.live_photos:
for _item_live_photos in self.live_photos:
if _item_live_photos:
_items.append(_item_live_photos.to_dict())
_dict['live_photos'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in live_videos (list)
_items = []
if self.live_videos:
for _item_live_videos in self.live_videos:
if _item_live_videos:
_items.append(_item_live_videos.to_dict())
_dict['live_videos'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in motion_captures (list)
_items = []
if self.motion_captures:
for _item_motion_captures in self.motion_captures:
if _item_motion_captures:
_items.append(_item_motion_captures.to_dict())
_dict['motion_captures'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in id_photos (list)
_items = []
if self.id_photos:
for _item_id_photos in self.id_photos:
if _item_id_photos:
_items.append(_item_id_photos.to_dict())
_dict['id_photos'] = _items
# override the default output from pydantic by calling `to_dict()` of breakdown
if self.breakdown:
_dict['breakdown'] = self.breakdown.to_dict()
Expand Down Expand Up @@ -128,6 +161,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"check_id": obj.get("check_id"),
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
"name": obj.get("name"),
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
"id_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["id_photos"]] if obj.get("id_photos") is not None else None,
"breakdown": FacialSimilarityPhotoFullyAutoBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
"properties": FacialSimilarityPhotoFullyAutoProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
})
Expand Down
Loading

0 comments on commit 2454716

Please sign in to comment.