Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh onfido-python after onfido-openapi-spec update (10f8380) #72

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
release:
types:
- published
schedule:
- cron: "0 14 * * 0" # Every Sunday, 2 hours after midday

jobs:
integration-tests:
Expand Down
6 changes: 3 additions & 3 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": "08508b9",
"long_sha": "08508b9517238b3becb4265130633a418a8ee319",
"version": "v3.5.0"
"short_sha": "10f8380",
"long_sha": "10f83806efa080edbf022ac48d5eeac90fbceb0c",
"version": ""
},
"release": "v3.5.0"
}
13 changes: 9 additions & 4 deletions onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
from onfido.models.addresses_list import AddressesList
from onfido.models.applicant import Applicant
from onfido.models.applicant_builder import ApplicantBuilder
from onfido.models.applicant_consent_builder import ApplicantConsentBuilder
from onfido.models.applicant_consent_name import ApplicantConsentName
from onfido.models.applicant_create import ApplicantCreate
from onfido.models.applicant_request import ApplicantRequest
from onfido.models.applicant_response import ApplicantResponse
Expand All @@ -49,11 +51,10 @@
from onfido.models.check_request import CheckRequest
from onfido.models.check_response import CheckResponse
from onfido.models.check_shared import CheckShared
from onfido.models.check_status import CheckStatus
from onfido.models.checks_list import ChecksList
from onfido.models.complete_task_builder import CompleteTaskBuilder
from onfido.models.complete_task_data_builder import CompleteTaskDataBuilder
from onfido.models.consent_item import ConsentItem
from onfido.models.consents_builder import ConsentsBuilder
from onfido.models.country_codes import CountryCodes
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
Expand Down Expand Up @@ -297,8 +298,11 @@
from onfido.models.webhook_builder import WebhookBuilder
from onfido.models.webhook_create import WebhookCreate
from onfido.models.webhook_event import WebhookEvent
from onfido.models.webhook_event_object_status import WebhookEventObjectStatus
from onfido.models.webhook_event_payload import WebhookEventPayload
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource
from onfido.models.webhook_event_resource_type import WebhookEventResourceType
from onfido.models.webhook_event_type import WebhookEventType
from onfido.models.webhook_resend import WebhookResend
from onfido.models.webhook_response import WebhookResponse
Expand All @@ -309,11 +313,12 @@
from onfido.models.webhooks_resend_item import WebhooksResendItem
from onfido.models.workflow_run import WorkflowRun
from onfido.models.workflow_run_builder import WorkflowRunBuilder
from onfido.models.workflow_run_error import WorkflowRunError
from onfido.models.workflow_run_link import WorkflowRunLink
from onfido.models.workflow_run_request import WorkflowRunRequest
from onfido.models.workflow_run_response import WorkflowRunResponse
from onfido.models.workflow_run_response_error import WorkflowRunResponseError
from onfido.models.workflow_run_shared import WorkflowRunShared
from onfido.models.workflow_run_shared_link import WorkflowRunSharedLink
from onfido.models.workflow_run_status import WorkflowRunStatus

from onfido.webhook_event_verifier import OnfidoInvalidSignatureError
from onfido.webhook_event_verifier import WebhookEventVerifier
6 changes: 3 additions & 3 deletions onfido/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16554,7 +16554,7 @@ def upload_document(
Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.

:param type: The type of document (required)
:type type: str
:type type: DocumentTypes
:param applicant_id: The ID of the applicant whose document is being uploaded. (required)
:type applicant_id: str
:param file: The file to be uploaded. (required)
Expand Down Expand Up @@ -16649,7 +16649,7 @@ def upload_document_with_http_info(
Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.

:param type: The type of document (required)
:type type: str
:type type: DocumentTypes
:param applicant_id: The ID of the applicant whose document is being uploaded. (required)
:type applicant_id: str
:param file: The file to be uploaded. (required)
Expand Down Expand Up @@ -16744,7 +16744,7 @@ def upload_document_without_preload_content(
Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.

:param type: The type of document (required)
:type type: str
:type type: DocumentTypes
:param applicant_id: The ID of the applicant whose document is being uploaded. (required)
:type applicant_id: str
:param file: The file to be uploaded. (required)
Expand Down
13 changes: 9 additions & 4 deletions onfido/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from onfido.models.addresses_list import AddressesList
from onfido.models.applicant import Applicant
from onfido.models.applicant_builder import ApplicantBuilder
from onfido.models.applicant_consent_builder import ApplicantConsentBuilder
from onfido.models.applicant_consent_name import ApplicantConsentName
from onfido.models.applicant_create import ApplicantCreate
from onfido.models.applicant_request import ApplicantRequest
from onfido.models.applicant_response import ApplicantResponse
Expand All @@ -32,11 +34,10 @@
from onfido.models.check_request import CheckRequest
from onfido.models.check_response import CheckResponse
from onfido.models.check_shared import CheckShared
from onfido.models.check_status import CheckStatus
from onfido.models.checks_list import ChecksList
from onfido.models.complete_task_builder import CompleteTaskBuilder
from onfido.models.complete_task_data_builder import CompleteTaskDataBuilder
from onfido.models.consent_item import ConsentItem
from onfido.models.consents_builder import ConsentsBuilder
from onfido.models.country_codes import CountryCodes
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
Expand Down Expand Up @@ -280,8 +281,11 @@
from onfido.models.webhook_builder import WebhookBuilder
from onfido.models.webhook_create import WebhookCreate
from onfido.models.webhook_event import WebhookEvent
from onfido.models.webhook_event_object_status import WebhookEventObjectStatus
from onfido.models.webhook_event_payload import WebhookEventPayload
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource
from onfido.models.webhook_event_resource_type import WebhookEventResourceType
from onfido.models.webhook_event_type import WebhookEventType
from onfido.models.webhook_resend import WebhookResend
from onfido.models.webhook_response import WebhookResponse
Expand All @@ -292,8 +296,9 @@
from onfido.models.webhooks_resend_item import WebhooksResendItem
from onfido.models.workflow_run import WorkflowRun
from onfido.models.workflow_run_builder import WorkflowRunBuilder
from onfido.models.workflow_run_error import WorkflowRunError
from onfido.models.workflow_run_link import WorkflowRunLink
from onfido.models.workflow_run_request import WorkflowRunRequest
from onfido.models.workflow_run_response import WorkflowRunResponse
from onfido.models.workflow_run_response_error import WorkflowRunResponseError
from onfido.models.workflow_run_shared import WorkflowRunShared
from onfido.models.workflow_run_shared_link import WorkflowRunSharedLink
from onfido.models.workflow_run_status import WorkflowRunStatus
14 changes: 9 additions & 5 deletions onfido/models/applicant_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from onfido.models.address_builder import AddressBuilder
from onfido.models.consents_builder import ConsentsBuilder
from onfido.models.applicant_consent_builder import ApplicantConsentBuilder
from onfido.models.id_number import IdNumber
from onfido.models.location_builder import LocationBuilder
from typing import Optional, Set
Expand All @@ -36,7 +36,7 @@ class ApplicantBuilder(BaseModel):
dob: Optional[date] = Field(default=None, description="The applicant's date of birth")
id_numbers: Optional[List[IdNumber]] = None
phone_number: Optional[StrictStr] = Field(default=None, description="The applicant's phone number")
consents: Optional[ConsentsBuilder] = None
consents: Optional[List[ApplicantConsentBuilder]] = Field(default=None, description="The applicant's consents")
address: Optional[AddressBuilder] = None
location: Optional[LocationBuilder] = None
first_name: Annotated[str, Field(strict=True)] = Field(description="The applicant's first name")
Expand Down Expand Up @@ -106,9 +106,13 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict['id_numbers'] = _items
# override the default output from pydantic by calling `to_dict()` of consents
# override the default output from pydantic by calling `to_dict()` of each item in consents (list)
_items = []
if self.consents:
_dict['consents'] = self.consents.to_dict()
for _item in self.consents:
if _item:
_items.append(_item.to_dict())
_dict['consents'] = _items
# override the default output from pydantic by calling `to_dict()` of address
if self.address:
_dict['address'] = self.address.to_dict()
Expand Down Expand Up @@ -136,7 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"dob": obj.get("dob"),
"id_numbers": [IdNumber.from_dict(_item) for _item in obj["id_numbers"]] if obj.get("id_numbers") is not None else None,
"phone_number": obj.get("phone_number"),
"consents": ConsentsBuilder.from_dict(obj["consents"]) if obj.get("consents") is not None else None,
"consents": [ApplicantConsentBuilder.from_dict(_item) for _item in obj["consents"]] if obj.get("consents") is not None else None,
"address": AddressBuilder.from_dict(obj["address"]) if obj.get("address") is not None else None,
"location": LocationBuilder.from_dict(obj["location"]) if obj.get("location") is not None else None,
"first_name": obj.get("first_name"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, StrictBool
from typing import Any, ClassVar, Dict, List
from onfido.models.applicant_consent_name import ApplicantConsentName
from typing import Optional, Set
from typing_extensions import Self

class ConsentsBuilder(BaseModel):
class ApplicantConsentBuilder(BaseModel):
"""
ConsentsBuilder
ApplicantConsentBuilder
""" # noqa: E501
name: ApplicantConsentName
granted: StrictBool
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = []
__properties: ClassVar[List[str]] = ["name", "granted"]

model_config = ConfigDict(
populate_by_name=True,
Expand All @@ -47,7 +50,7 @@ def to_json(self) -> str:

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ConsentsBuilder from a JSON string"""
"""Create an instance of ApplicantConsentBuilder from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -79,14 +82,16 @@ def to_dict(self) -> Dict[str, Any]:

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ConsentsBuilder from a dict"""
"""Create an instance of ApplicantConsentBuilder from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"name": obj.get("name"),
"granted": obj.get("granted")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
38 changes: 38 additions & 0 deletions onfido/models/applicant_consent_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding: utf-8

"""
Onfido API v3.6
The Onfido API (v3.6)
The version of the OpenAPI document: v3.6
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class ApplicantConsentName(str, Enum):
"""
ApplicantConsentName
"""

"""
allowed enum values
"""
PRIVACY_NOTICES_READ = 'privacy_notices_read'
SSN_VERIFICATION = 'ssn_verification'
PHONE_NUMBER_VERIFICATION = 'phone_number_verification'

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ApplicantConsentName from a JSON string"""
return cls(json.loads(json_str))


16 changes: 10 additions & 6 deletions onfido/models/applicant_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.address_builder import AddressBuilder
from onfido.models.consents_builder import ConsentsBuilder
from onfido.models.applicant_consent_builder import ApplicantConsentBuilder
from onfido.models.location_builder import LocationBuilder
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -29,7 +29,7 @@ class ApplicantRequest(BaseModel):
"""
ApplicantRequest
""" # noqa: E501
consents: Optional[ConsentsBuilder] = None
consents: Optional[List[ApplicantConsentBuilder]] = Field(default=None, description="The applicant's consents")
address: Optional[AddressBuilder] = None
location: Optional[LocationBuilder] = None
additional_properties: Dict[str, Any] = {}
Expand Down Expand Up @@ -76,9 +76,13 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of consents
# override the default output from pydantic by calling `to_dict()` of each item in consents (list)
_items = []
if self.consents:
_dict['consents'] = self.consents.to_dict()
for _item in self.consents:
if _item:
_items.append(_item.to_dict())
_dict['consents'] = _items
# override the default output from pydantic by calling `to_dict()` of address
if self.address:
_dict['address'] = self.address.to_dict()
Expand All @@ -102,7 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"consents": ConsentsBuilder.from_dict(obj["consents"]) if obj.get("consents") is not None else None,
"consents": [ApplicantConsentBuilder.from_dict(_item) for _item in obj["consents"]] if obj.get("consents") is not None else None,
"address": AddressBuilder.from_dict(obj["address"]) if obj.get("address") is not None else None,
"location": LocationBuilder.from_dict(obj["location"]) if obj.get("location") is not None else None
})
Expand Down
14 changes: 9 additions & 5 deletions onfido/models/applicant_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from onfido.models.address_builder import AddressBuilder
from onfido.models.consents_builder import ConsentsBuilder
from onfido.models.applicant_consent_builder import ApplicantConsentBuilder
from onfido.models.id_number import IdNumber
from onfido.models.location_builder import LocationBuilder
from typing import Optional, Set
Expand All @@ -36,7 +36,7 @@ class ApplicantUpdater(BaseModel):
dob: Optional[date] = Field(default=None, description="The applicant's date of birth")
id_numbers: Optional[List[IdNumber]] = None
phone_number: Optional[StrictStr] = Field(default=None, description="The applicant's phone number")
consents: Optional[ConsentsBuilder] = None
consents: Optional[List[ApplicantConsentBuilder]] = Field(default=None, description="The applicant's consents")
address: Optional[AddressBuilder] = None
location: Optional[LocationBuilder] = None
first_name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The applicant's first name")
Expand Down Expand Up @@ -112,9 +112,13 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict['id_numbers'] = _items
# override the default output from pydantic by calling `to_dict()` of consents
# override the default output from pydantic by calling `to_dict()` of each item in consents (list)
_items = []
if self.consents:
_dict['consents'] = self.consents.to_dict()
for _item in self.consents:
if _item:
_items.append(_item.to_dict())
_dict['consents'] = _items
# override the default output from pydantic by calling `to_dict()` of address
if self.address:
_dict['address'] = self.address.to_dict()
Expand Down Expand Up @@ -142,7 +146,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"dob": obj.get("dob"),
"id_numbers": [IdNumber.from_dict(_item) for _item in obj["id_numbers"]] if obj.get("id_numbers") is not None else None,
"phone_number": obj.get("phone_number"),
"consents": ConsentsBuilder.from_dict(obj["consents"]) if obj.get("consents") is not None else None,
"consents": [ApplicantConsentBuilder.from_dict(_item) for _item in obj["consents"]] if obj.get("consents") is not None else None,
"address": AddressBuilder.from_dict(obj["address"]) if obj.get("address") is not None else None,
"location": LocationBuilder.from_dict(obj["location"]) if obj.get("location") is not None else None,
"first_name": obj.get("first_name"),
Expand Down
Loading