Skip to content

Commit

Permalink
Upgrade after onfido-openapi-spec change 6c4e429
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido authored and github-actions[bot] committed Jul 10, 2024
1 parent 3cae303 commit 13c976d
Show file tree
Hide file tree
Showing 9 changed files with 300 additions and 15 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": "01ed1b5",
"long_sha": "01ed1b5fe0f7490bfce54816504a9fec13b33862",
"version": "v3.1.0"
"short_sha": "6c4e429",
"long_sha": "6c4e4292c7f692f73e178003c3086e352b0809aa",
"version": "v3.2.0"
},
"release": "v3.2.0"
"release": "v3.3.0"
}
2 changes: 1 addition & 1 deletion onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "3.2.0"
__version__ = "3.3.0"

# import apis into sdk package
from onfido.api.default_api import DefaultApi
Expand Down
281 changes: 281 additions & 0 deletions onfido/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5359,6 +5359,287 @@ def _download_motion_capture_frame_serialize(



@validate_call
def download_qes_document(
self,
workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> bytearray:
"""Retrieves the signed document or application form

Retrieves the signed document or application form depending on the file_id provided.

:param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
:type workflow_run_id: str
:param file_id: The unique identifier of the file which you want to retrieve. (required)
:type file_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._download_qes_document_serialize(
workflow_run_id=workflow_run_id,
file_id=file_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'302': None,
'200': "bytearray",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def download_qes_document_with_http_info(
self,
workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[bytearray]:
"""Retrieves the signed document or application form

Retrieves the signed document or application form depending on the file_id provided.

:param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
:type workflow_run_id: str
:param file_id: The unique identifier of the file which you want to retrieve. (required)
:type file_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._download_qes_document_serialize(
workflow_run_id=workflow_run_id,
file_id=file_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'302': None,
'200': "bytearray",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def download_qes_document_without_preload_content(
self,
workflow_run_id: Annotated[StrictStr, Field(description="The unique identifier of the Workflow Run for which you want to retrieve the signed document.")],
file_id: Annotated[StrictStr, Field(description="The unique identifier of the file which you want to retrieve.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Retrieves the signed document or application form

Retrieves the signed document or application form depending on the file_id provided.

:param workflow_run_id: The unique identifier of the Workflow Run for which you want to retrieve the signed document. (required)
:type workflow_run_id: str
:param file_id: The unique identifier of the file which you want to retrieve. (required)
:type file_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._download_qes_document_serialize(
workflow_run_id=workflow_run_id,
file_id=file_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'302': None,
'200': "bytearray",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _download_qes_document_serialize(
self,
workflow_run_id,
file_id,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
if workflow_run_id is not None:

_query_params.append(('workflow_run_id', workflow_run_id))

if file_id is not None:

_query_params.append(('file_id', file_id))

# process the header parameters
# process the form parameters
# process the body parameter


# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/pdf',
'application/json'
]
)


# authentication setting
_auth_settings: List[str] = [
'Token'
]

return self.api_client.param_serialize(
method='POST',
resource_path='/qualified_electronic_signature/documents',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)




@validate_call
def download_signed_evidence_file(
self,
Expand Down
2 changes: 1 addition & 1 deletion onfido/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'onfido-python/3.2.0'
self.user_agent = 'onfido-python/3.3.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 @@ -383,7 +383,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v3.6\n"\
"SDK Package Version: 3.2.0".\
"SDK Package Version: 3.3.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
8 changes: 5 additions & 3 deletions onfido/models/document_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class DocumentProperties(BaseModel):
document_numbers: Optional[List[DocumentPropertiesDocumentNumbersInner]] = None
document_type: Optional[StrictStr] = None
first_name: Optional[StrictStr] = None
middle_name: Optional[StrictStr] = None
last_name: Optional[StrictStr] = None
gender: Optional[StrictStr] = None
issuing_country: Optional[StrictStr] = None
last_name: Optional[StrictStr] = None
nationality: Optional[StrictStr] = None
issuing_state: Optional[StrictStr] = None
issuing_date: Optional[date] = None
Expand Down Expand Up @@ -79,7 +80,7 @@ class DocumentProperties(BaseModel):
document_classification: Optional[DocumentPropertiesDocumentClassification] = None
extracted_data: Optional[DocumentPropertiesExtractedData] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "personal_number", "document_numbers", "document_type", "first_name", "gender", "issuing_country", "last_name", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "remarks", "civil_state", "expatriation", "father_name", "mother_name", "religion", "type_of_permit", "version_number", "document_subtype", "profession", "security_document_number", "tax_number", "nist_identity_evidence_strength", "has_issuance_confirmation", "real_id_compliance", "security_tier", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data"]
__properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "personal_number", "document_numbers", "document_type", "first_name", "middle_name", "last_name", "gender", "issuing_country", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "remarks", "civil_state", "expatriation", "father_name", "mother_name", "religion", "type_of_permit", "version_number", "document_subtype", "profession", "security_document_number", "tax_number", "nist_identity_evidence_strength", "has_issuance_confirmation", "real_id_compliance", "security_tier", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data"]

@field_validator('nist_identity_evidence_strength')
def nist_identity_evidence_strength_validate_enum(cls, value):
Expand Down Expand Up @@ -204,9 +205,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"document_numbers": [DocumentPropertiesDocumentNumbersInner.from_dict(_item) for _item in obj["document_numbers"]] if obj.get("document_numbers") is not None else None,
"document_type": obj.get("document_type"),
"first_name": obj.get("first_name"),
"middle_name": obj.get("middle_name"),
"last_name": obj.get("last_name"),
"gender": obj.get("gender"),
"issuing_country": obj.get("issuing_country"),
"last_name": obj.get("last_name"),
"nationality": obj.get("nationality"),
"issuing_state": obj.get("issuing_state"),
"issuing_date": obj.get("issuing_date"),
Expand Down
Loading

0 comments on commit 13c976d

Please sign in to comment.