Skip to content

Commit 4159b6d

Browse files
actions-userhleb-albau
authored andcommitted
add mrz filter
1 parent b21401f commit 4159b6d

File tree

5 files changed

+139
-3
lines changed

5 files changed

+139
-3
lines changed

.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ regula/documentreader/webclient/gen/models/light.py
6767
regula/documentreader/webclient/gen/models/list_verified_fields.py
6868
regula/documentreader/webclient/gen/models/log_level.py
6969
regula/documentreader/webclient/gen/models/measure_system.py
70+
regula/documentreader/webclient/gen/models/mrz_format.py
7071
regula/documentreader/webclient/gen/models/ocr_security_text_result.py
7172
regula/documentreader/webclient/gen/models/ocr_security_text_result_all_of.py
7273
regula/documentreader/webclient/gen/models/one_candidate.py

regula/documentreader/webclient/gen/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
from regula.documentreader.webclient.gen.models.light import Light
8585
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
8686
from regula.documentreader.webclient.gen.models.log_level import LogLevel
87+
from regula.documentreader.webclient.gen.models.mrz_format import MRZFormat
8788
from regula.documentreader.webclient.gen.models.measure_system import MeasureSystem
8889
from regula.documentreader.webclient.gen.models.ocr_security_text_result import OCRSecurityTextResult
8990
from regula.documentreader.webclient.gen.models.ocr_security_text_result_all_of import OCRSecurityTextResultAllOf

regula/documentreader/webclient/gen/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from regula.documentreader.webclient.gen.models.light import Light
6969
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
7070
from regula.documentreader.webclient.gen.models.log_level import LogLevel
71+
from regula.documentreader.webclient.gen.models.mrz_format import MRZFormat
7172
from regula.documentreader.webclient.gen.models.measure_system import MeasureSystem
7273
from regula.documentreader.webclient.gen.models.ocr_security_text_result import OCRSecurityTextResult
7374
from regula.documentreader.webclient.gen.models.ocr_security_text_result_all_of import OCRSecurityTextResultAllOf
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# coding: utf-8
2+
3+
"""
4+
Generated by: https://openapi-generator.tech
5+
"""
6+
7+
import pprint
8+
import re # noqa: F401
9+
10+
import six
11+
12+
from regula.documentreader.webclient.gen.configuration import Configuration
13+
# this line was added to enable pycharm type hinting
14+
from regula.documentreader.webclient.gen.models import *
15+
16+
17+
"""
18+
19+
"""
20+
class MRZFormat(object):
21+
"""NOTE: This class is auto generated by OpenAPI Generator.
22+
Ref: https://openapi-generator.tech
23+
24+
Do not edit the class manually.
25+
"""
26+
27+
IDL = "1x30"
28+
29+
ID1 = "3x30"
30+
31+
ID2 = "2x36"
32+
33+
ID3 = "2x44"
34+
35+
CAN = "1x6"
36+
37+
ID1_2_30 = "2x30"
38+
39+
allowable_values = [IDL, ID1, ID2, ID3, CAN, ID1_2_30] # noqa: E501
40+
41+
"""
42+
Attributes:
43+
openapi_types (dict): The key is attribute name
44+
and the value is attribute type.
45+
attribute_map (dict): The key is attribute name
46+
and the value is json key in definition.
47+
"""
48+
openapi_types = {
49+
}
50+
51+
attribute_map = {
52+
}
53+
54+
def __init__(self, local_vars_configuration=None): # noqa: E501
55+
"""MRZFormat - a model defined in OpenAPI""" # noqa: E501
56+
if local_vars_configuration is None:
57+
local_vars_configuration = Configuration()
58+
self.local_vars_configuration = local_vars_configuration
59+
self.discriminator = None
60+
61+
def to_dict(self):
62+
"""Returns the model properties as a dict"""
63+
result = {}
64+
65+
for attr, _ in six.iteritems(self.openapi_types):
66+
value = getattr(self, attr)
67+
if isinstance(value, list):
68+
result[attr] = list(map(
69+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
70+
value
71+
))
72+
elif hasattr(value, "to_dict"):
73+
result[attr] = value.to_dict()
74+
elif isinstance(value, dict):
75+
result[attr] = dict(map(
76+
lambda item: (item[0], item[1].to_dict())
77+
if hasattr(item[1], "to_dict") else item,
78+
value.items()
79+
))
80+
else:
81+
result[attr] = value
82+
83+
return result
84+
85+
def to_str(self):
86+
"""Returns the string representation of the model"""
87+
return pprint.pformat(self.to_dict())
88+
89+
def __repr__(self):
90+
"""For `print` and `pprint`"""
91+
return self.to_str()
92+
93+
def __eq__(self, other):
94+
"""Returns true if both objects are equal"""
95+
if not isinstance(other, MRZFormat):
96+
return False
97+
98+
return self.to_dict() == other.to_dict()
99+
100+
def __ne__(self, other):
101+
"""Returns true if both objects are not equal"""
102+
if not isinstance(other, MRZFormat):
103+
return True
104+
105+
return self.to_dict() != other.to_dict()

regula/documentreader/webclient/gen/models/process_params.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class ProcessParams(object):
5858
'multi_doc_on_image': 'bool',
5959
'shift_expiry_date': 'int',
6060
'minimal_holder_age': 'int',
61-
'return_uncropped_image': 'bool'
61+
'return_uncropped_image': 'bool',
62+
'mrz_formats_filter': 'list[MRZFormat]'
6263
}
6364

6465
attribute_map = {
@@ -88,10 +89,11 @@ class ProcessParams(object):
8889
'multi_doc_on_image': 'multiDocOnImage',
8990
'shift_expiry_date': 'shiftExpiryDate',
9091
'minimal_holder_age': 'minimalHolderAge',
91-
'return_uncropped_image': 'returnUncroppedImage'
92+
'return_uncropped_image': 'returnUncroppedImage',
93+
'mrz_formats_filter': 'mrzFormatsFilter'
9294
}
9395

94-
def __init__(self, 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, 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, force_doc_format=None, no_graphics=None, document_area_min=None, depersonalize_log=None, multi_doc_on_image=None, shift_expiry_date=None, minimal_holder_age=None, return_uncropped_image=None, local_vars_configuration=None): # noqa: E501
96+
def __init__(self, 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, 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, force_doc_format=None, no_graphics=None, document_area_min=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, local_vars_configuration=None): # noqa: E501
9597
"""ProcessParams - a model defined in OpenAPI""" # noqa: E501
9698
if local_vars_configuration is None:
9799
local_vars_configuration = Configuration()
@@ -124,6 +126,7 @@ def __init__(self, scenario=None, result_type_output=None, double_page_spread=No
124126
self._shift_expiry_date = None
125127
self._minimal_holder_age = None
126128
self._return_uncropped_image = None
129+
self._mrz_formats_filter = None
127130
self.discriminator = None
128131

129132
self.scenario = scenario
@@ -179,6 +182,8 @@ def __init__(self, scenario=None, result_type_output=None, double_page_spread=No
179182
self.minimal_holder_age = minimal_holder_age
180183
if return_uncropped_image is not None:
181184
self.return_uncropped_image = return_uncropped_image
185+
if mrz_formats_filter is not None:
186+
self.mrz_formats_filter = mrz_formats_filter
182187

183188
@property
184189
def scenario(self):
@@ -793,6 +798,29 @@ def return_uncropped_image(self, return_uncropped_image):
793798

794799
self._return_uncropped_image = return_uncropped_image
795800

801+
@property
802+
def mrz_formats_filter(self):
803+
"""Gets the mrz_formats_filter of this ProcessParams. # noqa: E501
804+
805+
This option allows limiting MRZ formats to be recognized by specifying them in array. # noqa: E501
806+
807+
:return: The mrz_formats_filter of this ProcessParams. # noqa: E501
808+
:rtype: list[MRZFormat]
809+
"""
810+
return self._mrz_formats_filter
811+
812+
@mrz_formats_filter.setter
813+
def mrz_formats_filter(self, mrz_formats_filter):
814+
"""Sets the mrz_formats_filter of this ProcessParams.
815+
816+
This option allows limiting MRZ formats to be recognized by specifying them in array. # noqa: E501
817+
818+
:param mrz_formats_filter: The mrz_formats_filter of this ProcessParams. # noqa: E501
819+
:type mrz_formats_filter: list[MRZFormat]
820+
"""
821+
822+
self._mrz_formats_filter = mrz_formats_filter
823+
796824
def to_dict(self):
797825
"""Returns the model properties as a dict"""
798826
result = {}

0 commit comments

Comments
 (0)