From f56442fc83da71d8217780bbfd8d143cb2111b96 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 19 Feb 2025 08:45:44 +0000 Subject: [PATCH] Commit: 5d3dfe7e --- .openapi-generator/FILES | 2 + .../documentreader/webclient/gen/__init__.py | 2 + .../webclient/gen/models/__init__.py | 2 + .../webclient/gen/models/face_api.py | 62 +++++++- .../webclient/gen/models/image_qa.py | 34 ++++- .../gen/models/input_barcode_type.py | 133 ++++++++++++++++++ .../gen/models/input_image_quality_checks.py | 109 ++++++++++++++ .../webclient/gen/models/process_params.py | 34 ++++- .../gen/models/process_request_image.py | 5 +- 9 files changed, 371 insertions(+), 12 deletions(-) create mode 100644 regula/documentreader/webclient/gen/models/input_barcode_type.py create mode 100644 regula/documentreader/webclient/gen/models/input_image_quality_checks.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b8ef140..8093789 100755 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -89,6 +89,8 @@ regula/documentreader/webclient/gen/models/in_data_transaction_images_field_valu regula/documentreader/webclient/gen/models/in_data_video.py regula/documentreader/webclient/gen/models/inline_response200.py regula/documentreader/webclient/gen/models/inline_response2001.py +regula/documentreader/webclient/gen/models/input_barcode_type.py +regula/documentreader/webclient/gen/models/input_image_quality_checks.py regula/documentreader/webclient/gen/models/lcid.py regula/documentreader/webclient/gen/models/lexical_analysis_result.py regula/documentreader/webclient/gen/models/lexical_analysis_result_all_of.py diff --git a/regula/documentreader/webclient/gen/__init__.py b/regula/documentreader/webclient/gen/__init__.py index 4c8dbfb..6f8c6ec 100755 --- a/regula/documentreader/webclient/gen/__init__.py +++ b/regula/documentreader/webclient/gen/__init__.py @@ -105,6 +105,8 @@ from regula.documentreader.webclient.gen.models.in_data_video import InDataVideo from regula.documentreader.webclient.gen.models.inline_response200 import InlineResponse200 from regula.documentreader.webclient.gen.models.inline_response2001 import InlineResponse2001 +from regula.documentreader.webclient.gen.models.input_barcode_type import InputBarcodeType +from regula.documentreader.webclient.gen.models.input_image_quality_checks import InputImageQualityChecks from regula.documentreader.webclient.gen.models.lcid import LCID from regula.documentreader.webclient.gen.models.lexical_analysis_result import LexicalAnalysisResult from regula.documentreader.webclient.gen.models.lexical_analysis_result_all_of import LexicalAnalysisResultAllOf diff --git a/regula/documentreader/webclient/gen/models/__init__.py b/regula/documentreader/webclient/gen/models/__init__.py index 995da58..d175856 100755 --- a/regula/documentreader/webclient/gen/models/__init__.py +++ b/regula/documentreader/webclient/gen/models/__init__.py @@ -88,6 +88,8 @@ from regula.documentreader.webclient.gen.models.in_data_video import InDataVideo from regula.documentreader.webclient.gen.models.inline_response200 import InlineResponse200 from regula.documentreader.webclient.gen.models.inline_response2001 import InlineResponse2001 +from regula.documentreader.webclient.gen.models.input_barcode_type import InputBarcodeType +from regula.documentreader.webclient.gen.models.input_image_quality_checks import InputImageQualityChecks from regula.documentreader.webclient.gen.models.lcid import LCID from regula.documentreader.webclient.gen.models.lexical_analysis_result import LexicalAnalysisResult from regula.documentreader.webclient.gen.models.lexical_analysis_result_all_of import LexicalAnalysisResultAllOf diff --git a/regula/documentreader/webclient/gen/models/face_api.py b/regula/documentreader/webclient/gen/models/face_api.py index bce7cbe..4543033 100644 --- a/regula/documentreader/webclient/gen/models/face_api.py +++ b/regula/documentreader/webclient/gen/models/face_api.py @@ -39,7 +39,9 @@ class FaceApi(object): 'service_timeout': 'int', 'proxy': 'str', 'proxy_userpwd': 'str', - 'proxy_type': 'int' + 'proxy_type': 'int', + 'child_age_threshold': 'int', + 'child_doc_validity_years': 'int' } attribute_map = { @@ -50,10 +52,12 @@ class FaceApi(object): 'service_timeout': 'serviceTimeout', 'proxy': 'proxy', 'proxy_userpwd': 'proxy_userpwd', - 'proxy_type': 'proxy_type' + 'proxy_type': 'proxy_type', + 'child_age_threshold': 'childAgeThreshold', + 'child_doc_validity_years': 'childDocValidityYears' } - def __init__(self, url=None, mode=None, search=None, threshold=None, service_timeout=None, proxy=None, proxy_userpwd=None, proxy_type=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, url=None, mode=None, search=None, threshold=None, service_timeout=None, proxy=None, proxy_userpwd=None, proxy_type=None, child_age_threshold=None, child_doc_validity_years=None, local_vars_configuration=None): # noqa: E501 """FaceApi - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -67,6 +71,8 @@ def __init__(self, url=None, mode=None, search=None, threshold=None, service_tim self._proxy = None self._proxy_userpwd = None self._proxy_type = None + self._child_age_threshold = None + self._child_doc_validity_years = None self.discriminator = None if url is not None: @@ -85,6 +91,10 @@ def __init__(self, url=None, mode=None, search=None, threshold=None, service_tim self.proxy_userpwd = proxy_userpwd if proxy_type is not None: self.proxy_type = proxy_type + if child_age_threshold is not None: + self.child_age_threshold = child_age_threshold + if child_doc_validity_years is not None: + self.child_doc_validity_years = child_doc_validity_years @property def url(self): @@ -268,6 +278,52 @@ def proxy_type(self, proxy_type): self._proxy_type = proxy_type + @property + def child_age_threshold(self): + """Gets the child_age_threshold of this FaceApi. # noqa: E501 + + Minimum age of a child, at which portrait comparison result will be effective. Default: 13. # noqa: E501 + + :return: The child_age_threshold of this FaceApi. # noqa: E501 + :rtype: int + """ + return self._child_age_threshold + + @child_age_threshold.setter + def child_age_threshold(self, child_age_threshold): + """Sets the child_age_threshold of this FaceApi. + + Minimum age of a child, at which portrait comparison result will be effective. Default: 13. # noqa: E501 + + :param child_age_threshold: The child_age_threshold of this FaceApi. # noqa: E501 + :type child_age_threshold: int + """ + + self._child_age_threshold = child_age_threshold + + @property + def child_doc_validity_years(self): + """Gets the child_doc_validity_years of this FaceApi. # noqa: E501 + + Estimated duration of validity for a child's passport, years. Default: 5. # noqa: E501 + + :return: The child_doc_validity_years of this FaceApi. # noqa: E501 + :rtype: int + """ + return self._child_doc_validity_years + + @child_doc_validity_years.setter + def child_doc_validity_years(self, child_doc_validity_years): + """Sets the child_doc_validity_years of this FaceApi. + + Estimated duration of validity for a child's passport, years. Default: 5. # noqa: E501 + + :param child_doc_validity_years: The child_doc_validity_years of this FaceApi. # noqa: E501 + :type child_doc_validity_years: int + """ + + self._child_doc_validity_years = child_doc_validity_years + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/regula/documentreader/webclient/gen/models/image_qa.py b/regula/documentreader/webclient/gen/models/image_qa.py index 52aca2e..6f0ed7f 100644 --- a/regula/documentreader/webclient/gen/models/image_qa.py +++ b/regula/documentreader/webclient/gen/models/image_qa.py @@ -38,7 +38,8 @@ class ImageQA(object): 'focus_check': 'bool', 'glares_check': 'bool', 'colorness_check': 'bool', - 'document_position_indent': 'int' + 'document_position_indent': 'int', + 'expected_pass': 'list[InputImageQualityChecks]' } attribute_map = { @@ -48,10 +49,11 @@ class ImageQA(object): 'focus_check': 'focusCheck', 'glares_check': 'glaresCheck', 'colorness_check': 'colornessCheck', - 'document_position_indent': 'documentPositionIndent' + 'document_position_indent': 'documentPositionIndent', + 'expected_pass': 'expectedPass' } - def __init__(self, brightness_threshold=None, dpi_threshold=None, angle_threshold=None, focus_check=None, glares_check=None, colorness_check=None, document_position_indent=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, brightness_threshold=None, dpi_threshold=None, angle_threshold=None, focus_check=None, glares_check=None, colorness_check=None, document_position_indent=None, expected_pass=None, local_vars_configuration=None): # noqa: E501 """ImageQA - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -64,6 +66,7 @@ def __init__(self, brightness_threshold=None, dpi_threshold=None, angle_threshol self._glares_check = None self._colorness_check = None self._document_position_indent = None + self._expected_pass = None self.discriminator = None if brightness_threshold is not None: @@ -80,6 +83,8 @@ def __init__(self, brightness_threshold=None, dpi_threshold=None, angle_threshol self.colorness_check = colorness_check if document_position_indent is not None: self.document_position_indent = document_position_indent + if expected_pass is not None: + self.expected_pass = expected_pass @property def brightness_threshold(self): @@ -242,6 +247,29 @@ def document_position_indent(self, document_position_indent): self._document_position_indent = document_position_indent + @property + def expected_pass(self): + """Gets the expected_pass of this ImageQA. # noqa: E501 + + This parameter controls the quality checks that the image should pass to be considered a valid input during the scanning process. # noqa: E501 + + :return: The expected_pass of this ImageQA. # noqa: E501 + :rtype: list[InputImageQualityChecks] + """ + return self._expected_pass + + @expected_pass.setter + def expected_pass(self, expected_pass): + """Sets the expected_pass of this ImageQA. + + This parameter controls the quality checks that the image should pass to be considered a valid input during the scanning process. # noqa: E501 + + :param expected_pass: The expected_pass of this ImageQA. # noqa: E501 + :type expected_pass: list[InputImageQualityChecks] + """ + + self._expected_pass = expected_pass + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/regula/documentreader/webclient/gen/models/input_barcode_type.py b/regula/documentreader/webclient/gen/models/input_barcode_type.py new file mode 100644 index 0000000..d818cb1 --- /dev/null +++ b/regula/documentreader/webclient/gen/models/input_barcode_type.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +import pprint +import re # noqa: F401 + +import six + +from regula.documentreader.webclient.gen.configuration import Configuration +# this line was added to enable pycharm type hinting +from regula.documentreader.webclient.gen.models import * + + +""" +Enumeration contains the types of barcodes that can be processed +""" +class InputBarcodeType(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + UNKNOWN = "bct_unknown" + + CODE128 = "bct_Code128" + + CODE39 = "bct_Code39" + + EAN8 = "bct_EAN8" + + ITF = "bct_ITF" + + PDF417 = "bct_PDF417" + + STF = "bct_STF" + + MTF = "bct_MTF" + + IATA = "bct_IATA" + + CODABAR = "bct_CODABAR" + + UPCA = "bct_UPCA" + + CODE93 = "bct_CODE93" + + UPCE = "bct_UPCE" + + EAN13 = "bct_EAN13" + + QRCODE = "bct_QRCODE" + + AZTEC = "bct_AZTEC" + + DATAMATRIX = "bct_DATAMATRIX" + + ALL_1D = "bct_ALL_1D" + + CODE11 = "bct_Code11" + + JABCODE = "bct_JABCODE" + + allowable_values = [UNKNOWN, CODE128, CODE39, EAN8, ITF, PDF417, STF, MTF, IATA, CODABAR, UPCA, CODE93, UPCE, EAN13, QRCODE, AZTEC, DATAMATRIX, ALL_1D, CODE11, JABCODE] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + """InputBarcodeType - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InputBarcodeType): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InputBarcodeType): + return True + + return self.to_dict() != other.to_dict() diff --git a/regula/documentreader/webclient/gen/models/input_image_quality_checks.py b/regula/documentreader/webclient/gen/models/input_image_quality_checks.py new file mode 100644 index 0000000..36c3602 --- /dev/null +++ b/regula/documentreader/webclient/gen/models/input_image_quality_checks.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +import pprint +import re # noqa: F401 + +import six + +from regula.documentreader.webclient.gen.configuration import Configuration +# this line was added to enable pycharm type hinting +from regula.documentreader.webclient.gen.models import * + + +""" +Input image quality checks for the document processing +""" +class InputImageQualityChecks(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + Glares = "glaresCheck" + + Focus = "focusCheck" + + Resolution = "dpiThreshold" + + Colorness = "colornessCheck" + + Perspective = "perspectiveCheck" + + Bounds = "documentPosition" + + Portrait = "portraitCheck" + + Brightness = "brightnessCheck" + + allowable_values = [Glares, Focus, Resolution, Colorness, Perspective, Bounds, Portrait, Brightness] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + """InputImageQualityChecks - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InputImageQualityChecks): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InputImageQualityChecks): + return True + + return self.to_dict() != other.to_dict() diff --git a/regula/documentreader/webclient/gen/models/process_params.py b/regula/documentreader/webclient/gen/models/process_params.py index ad99dd8..d1cc357 100755 --- a/regula/documentreader/webclient/gen/models/process_params.py +++ b/regula/documentreader/webclient/gen/models/process_params.py @@ -89,7 +89,8 @@ class ProcessParams(object): 'mrz_detect_mode': 'MrzDetectModeEnum', 'generate_numeric_codes': 'bool', 'strict_barcode_digital_signature_check': 'bool', - 'select_longest_names': 'bool' + 'select_longest_names': 'bool', + 'do_barcodes': 'list[InputBarcodeType]' } attribute_map = { @@ -150,10 +151,11 @@ class ProcessParams(object): 'mrz_detect_mode': 'mrzDetectMode', 'generate_numeric_codes': 'generateNumericCodes', 'strict_barcode_digital_signature_check': 'strictBarcodeDigitalSignatureCheck', - 'select_longest_names': 'selectLongestNames' + 'select_longest_names': 'selectLongestNames', + 'do_barcodes': 'doBarcodes' } - def __init__(self, generate_dtcvc=None, lcid_filter=None, lcid_ignore_filter=None, one_shot_identification=None, use_face_api=None, face_api=None, do_detect_can=None, image_output_max_height=None, image_output_max_width=None, scenario=None, result_type_output=None, double_page_spread=None, generate_double_page_spread_image=None, field_types_filter=None, date_format=None, measure_system=None, image_dpi_out_max=None, already_cropped=None, custom_params=None, config=None, log=None, log_level=None, force_doc_id=None, match_text_field_mask=None, fast_doc_detect=None, update_ocr_validity_by_glare=None, check_required_text_fields=None, return_cropped_barcode=None, image_qa=None, strict_image_quality=None, respect_image_quality=None, force_doc_format=None, no_graphics=None, depersonalize_log=None, multi_doc_on_image=None, shift_expiry_date=None, minimal_holder_age=None, return_uncropped_image=None, mrz_formats_filter=None, force_read_mrz_before_locate=None, parse_barcodes=None, convert_case=None, split_names=None, disable_perforation_ocr=None, document_group_filter=None, process_auth=None, device_id=None, device_type=None, device_type_hex=None, ignore_device_id_from_image=None, document_id_list=None, rfid=None, check_auth=None, auth_params=None, mrz_detect_mode=None, generate_numeric_codes=None, strict_barcode_digital_signature_check=None, select_longest_names=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, generate_dtcvc=None, lcid_filter=None, lcid_ignore_filter=None, one_shot_identification=None, use_face_api=None, face_api=None, do_detect_can=None, image_output_max_height=None, image_output_max_width=None, scenario=None, result_type_output=None, double_page_spread=None, generate_double_page_spread_image=None, field_types_filter=None, date_format=None, measure_system=None, image_dpi_out_max=None, already_cropped=None, custom_params=None, config=None, log=None, log_level=None, force_doc_id=None, match_text_field_mask=None, fast_doc_detect=None, update_ocr_validity_by_glare=None, check_required_text_fields=None, return_cropped_barcode=None, image_qa=None, strict_image_quality=None, respect_image_quality=None, force_doc_format=None, no_graphics=None, depersonalize_log=None, multi_doc_on_image=None, shift_expiry_date=None, minimal_holder_age=None, return_uncropped_image=None, mrz_formats_filter=None, force_read_mrz_before_locate=None, parse_barcodes=None, convert_case=None, split_names=None, disable_perforation_ocr=None, document_group_filter=None, process_auth=None, device_id=None, device_type=None, device_type_hex=None, ignore_device_id_from_image=None, document_id_list=None, rfid=None, check_auth=None, auth_params=None, mrz_detect_mode=None, generate_numeric_codes=None, strict_barcode_digital_signature_check=None, select_longest_names=None, do_barcodes=None, local_vars_configuration=None): # noqa: E501 """ProcessParams - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -217,6 +219,7 @@ def __init__(self, generate_dtcvc=None, lcid_filter=None, lcid_ignore_filter=Non self._generate_numeric_codes = None self._strict_barcode_digital_signature_check = None self._select_longest_names = None + self._do_barcodes = None self.discriminator = None if generate_dtcvc is not None: @@ -334,6 +337,8 @@ def __init__(self, generate_dtcvc=None, lcid_filter=None, lcid_ignore_filter=Non self.strict_barcode_digital_signature_check = strict_barcode_digital_signature_check if select_longest_names is not None: self.select_longest_names = select_longest_names + if do_barcodes is not None: + self.do_barcodes = do_barcodes @property def generate_dtcvc(self): @@ -1651,6 +1656,29 @@ def select_longest_names(self, select_longest_names): self._select_longest_names = select_longest_names + @property + def do_barcodes(self): + """Gets the do_barcodes of this ProcessParams. # noqa: E501 + + Set the types of barcodes to process. # noqa: E501 + + :return: The do_barcodes of this ProcessParams. # noqa: E501 + :rtype: list[InputBarcodeType] + """ + return self._do_barcodes + + @do_barcodes.setter + def do_barcodes(self, do_barcodes): + """Sets the do_barcodes of this ProcessParams. + + Set the types of barcodes to process. # noqa: E501 + + :param do_barcodes: The do_barcodes of this ProcessParams. # noqa: E501 + :type do_barcodes: list[InputBarcodeType] + """ + + self._do_barcodes = do_barcodes + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/regula/documentreader/webclient/gen/models/process_request_image.py b/regula/documentreader/webclient/gen/models/process_request_image.py index bf3a0cd..6cd2c40 100755 --- a/regula/documentreader/webclient/gen/models/process_request_image.py +++ b/regula/documentreader/webclient/gen/models/process_request_image.py @@ -54,7 +54,8 @@ def __init__(self, image_data=None, light=None, page_idx=None, local_vars_config self._page_idx = None self.discriminator = None - self.image_data = image_data + if image_data is not None: + self.image_data = image_data if light is not None: self.light = light if page_idx is not None: @@ -78,8 +79,6 @@ def image_data(self, image_data): :param image_data: The image_data of this ProcessRequestImage. # noqa: E501 :type image_data: ImageData """ - if self.local_vars_configuration.client_side_validation and image_data is None: # noqa: E501 - raise ValueError("Invalid value for `image_data`, must not be `None`") # noqa: E501 self._image_data = image_data