Skip to content

SP-18211 - update models #214

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

Merged
merged 3 commits into from
Jun 11, 2025
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: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python-dateutil = ">=2.8.2"
urllib3 = ">=1.25.3, <3.0.0"
vistir = ">=0.4.0, <=0.6.1"
idna = "==3.7"
requests = ">=2.32.3"
requests = ">=2.32.4"
pydantic = ">=2"
typing-extensions = ">=4.7.1"

Expand Down
432 changes: 236 additions & 196 deletions Pipfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -19,7 +19,7 @@ class CertificateData(BaseModel):
CertificateData
""" # noqa: E501
data: StrictStr = Field(alias="Data")
length: StrictStr = Field(alias="Length")
length: StrictInt = Field(alias="Length")
__properties: ClassVar[List[str]] = ["Data", "Length"]

model_config = ConfigDict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class DocVisualExtendedField(BaseModel):
"""
DocVisualExtendedField
""" # noqa: E501
field_type: StrictInt = Field(alias="FieldType")
w_field_type: TextFieldType = Field(alias="wFieldType")
field_name: StrictStr = Field(description="Field symbolic name (null-terminated string)", alias="FieldName")
strings_count: Union[StrictFloat, StrictInt] = Field(description="Number of StringsResult array elements", alias="StringsCount")
Expand All @@ -35,7 +34,7 @@ class DocVisualExtendedField(BaseModel):
reserved2: Optional[StrictInt] = Field(default=None, alias="Reserved2")
reserved3: Optional[StrictInt] = Field(default=None, alias="Reserved3")
field_rect: RectangleCoordinates = Field(alias="FieldRect")
__properties: ClassVar[List[str]] = ["FieldType", "wFieldType", "FieldName", "StringsCount", "StringsResult", "Buf_Length", "Buf_Text", "FieldMask", "Validity", "InComparison", "wLCID", "Reserved2", "Reserved3", "FieldRect"]
__properties: ClassVar[List[str]] = ["wFieldType", "FieldName", "StringsCount", "StringsResult", "Buf_Length", "Buf_Text", "FieldMask", "Validity", "InComparison", "wLCID", "Reserved2", "Reserved3", "FieldRect"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -98,7 +97,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"FieldType": obj.get("FieldType"),
"wFieldType": obj.get("wFieldType"),
"FieldName": obj.get("FieldName"),
"StringsCount": obj.get("StringsCount"),
Expand Down
6 changes: 2 additions & 4 deletions regula/documentreader/webclient/gen/models/fiber_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class FiberItem(BaseModel):
length: List[StrictInt] = Field(description="Fibers length value for located areas (in pixels)", alias="Length")
area: List[StrictInt] = Field(description="Fibers value for areas (in pixels)", alias="Area")
color_values: List[StrictInt] = Field(description="Fibers color value", alias="ColorValues")
error_code: Optional[StrictInt] = Field(default=None, alias="ErrorCode")
__properties: ClassVar[List[str]] = ["RectCount", "ExpectedCount", "LightValue", "LightDisp", "RectArray", "Width", "Length", "Area", "ColorValues", "ErrorCode"]
__properties: ClassVar[List[str]] = ["RectCount", "ExpectedCount", "LightValue", "LightDisp", "RectArray", "Width", "Length", "Area", "ColorValues"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -98,8 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"Width": obj.get("Width"),
"Length": obj.get("Length"),
"Area": obj.get("Area"),
"ColorValues": obj.get("ColorValues"),
"ErrorCode": obj.get("ErrorCode")
"ColorValues": obj.get("ColorValues")
})
return _obj

Expand Down
6 changes: 2 additions & 4 deletions regula/documentreader/webclient/gen/models/fiber_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class FiberResult(AuthenticityCheckResultItem):
length: List[StrictInt] = Field(description="Fibers length value for located areas (in pixels)", alias="Length")
area: List[StrictInt] = Field(description="Fibers value for areas (in pixels)", alias="Area")
color_values: List[StrictInt] = Field(description="Fibers color value", alias="ColorValues")
error_code: Optional[StrictInt] = Field(default=None, alias="ErrorCode")
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "RectCount", "ExpectedCount", "LightValue", "LightDisp", "RectArray", "Width", "Length", "Area", "ColorValues", "ErrorCode"]
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "RectCount", "ExpectedCount", "LightValue", "LightDisp", "RectArray", "Width", "Length", "Area", "ColorValues"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -106,8 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"Width": obj.get("Width"),
"Length": obj.get("Length"),
"Area": obj.get("Area"),
"ColorValues": obj.get("ColorValues"),
"ErrorCode": obj.get("ErrorCode")
"ColorValues": obj.get("ColorValues")
})
return _obj

Expand Down
6 changes: 2 additions & 4 deletions regula/documentreader/webclient/gen/models/ident_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class IdentItem(BaseModel):
etalon_image: ImageData = Field(alias="EtalonImage")
area_list: Optional[AreaContainer] = Field(default=None, alias="AreaList")
element_id: Optional[StrictInt] = Field(default=None, alias="ElementID")
result: Optional[StrictInt] = Field(default=None, alias="Result")
__properties: ClassVar[List[str]] = ["ElementType", "LightIndex", "Area", "Image", "EtalonImage", "AreaList", "ElementID", "Result"]
__properties: ClassVar[List[str]] = ["ElementType", "LightIndex", "Area", "Image", "EtalonImage", "AreaList", "ElementID"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -102,8 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"Image": ImageData.from_dict(obj["Image"]) if obj.get("Image") is not None else None,
"EtalonImage": ImageData.from_dict(obj["EtalonImage"]) if obj.get("EtalonImage") is not None else None,
"AreaList": AreaContainer.from_dict(obj["AreaList"]) if obj.get("AreaList") is not None else None,
"ElementID": obj.get("ElementID"),
"Result": obj.get("Result")
"ElementID": obj.get("ElementID")
})
return _obj

Expand Down
6 changes: 2 additions & 4 deletions regula/documentreader/webclient/gen/models/ident_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class IdentResult(AuthenticityCheckResultItem):
etalon_image: ImageData = Field(alias="EtalonImage")
area_list: Optional[AreaContainer] = Field(default=None, alias="AreaList")
element_id: Optional[StrictInt] = Field(default=None, alias="ElementID")
result: Optional[StrictInt] = Field(default=None, alias="Result")
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "ElementType", "LightIndex", "Area", "Image", "EtalonImage", "AreaList", "ElementID", "Result"]
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "ElementType", "LightIndex", "Area", "Image", "EtalonImage", "AreaList", "ElementID"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -110,8 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"Image": ImageData.from_dict(obj["Image"]) if obj.get("Image") is not None else None,
"EtalonImage": ImageData.from_dict(obj["EtalonImage"]) if obj.get("EtalonImage") is not None else None,
"AreaList": AreaContainer.from_dict(obj["AreaList"]) if obj.get("AreaList") is not None else None,
"ElementID": obj.get("ElementID"),
"Result": obj.get("Result")
"ElementID": obj.get("ElementID")
})
return _obj

Expand Down
4 changes: 3 additions & 1 deletion regula/documentreader/webclient/gen/models/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ class Light(int, Enum):
allowed enum values
"""
OFF = 0
WHITE_TOP = 2
WHITE_SIDE = 4
WHITE = 6
IR = 24
UV = 128
AXIAL_WHITE_FULL = 3072
AXIAL_WHITE = 3072

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from regula.documentreader.webclient.gen.models.critical import Critical
from regula.documentreader.webclient.gen.models.light import Light
from regula.documentreader.webclient.gen.models.rectangle_coordinates import RectangleCoordinates
from regula.documentreader.webclient.gen.models.text_field_type import TextFieldType
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -24,16 +25,15 @@ class OCRSecurityTextItem(BaseModel):
critical_flag: Critical = Field(alias="CriticalFlag")
light_type: Light = Field(alias="LightType")
field_rect: RectangleCoordinates = Field(alias="FieldRect")
etalon_result_type: StrictInt = Field(alias="EtalonResultType")
etalon_field_type: StrictInt = Field(alias="EtalonFieldType")
etalon_light_type: StrictInt = Field(alias="EtalonLightType")
etalon_result_type: StrictInt = Field(description="Same as Result type, but used for safe parsing of not-described values. See Result type.", alias="EtalonResultType")
etalon_field_type: TextFieldType = Field(alias="EtalonFieldType")
etalon_light_type: Light = Field(alias="EtalonLightType")
etalon_field_rect: RectangleCoordinates = Field(alias="EtalonFieldRect")
security_text_result_ocr: StrictStr = Field(alias="SecurityTextResultOCR")
etalon_result_ocr: StrictStr = Field(alias="EtalonResultOCR")
result_code: Optional[StrictInt] = Field(default=None, alias="ResultCode")
reserved1: Optional[StrictInt] = Field(default=None, alias="Reserved1")
reserved2: Optional[StrictInt] = Field(default=None, alias="Reserved2")
__properties: ClassVar[List[str]] = ["CriticalFlag", "LightType", "FieldRect", "EtalonResultType", "EtalonFieldType", "EtalonLightType", "EtalonFieldRect", "SecurityTextResultOCR", "EtalonResultOCR", "ResultCode", "Reserved1", "Reserved2"]
__properties: ClassVar[List[str]] = ["CriticalFlag", "LightType", "FieldRect", "EtalonResultType", "EtalonFieldType", "EtalonLightType", "EtalonFieldRect", "SecurityTextResultOCR", "EtalonResultOCR", "Reserved1", "Reserved2"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -95,13 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"CriticalFlag": obj.get("CriticalFlag"),
"LightType": obj.get("LightType"),
"FieldRect": RectangleCoordinates.from_dict(obj["FieldRect"]) if obj.get("FieldRect") is not None else None,
"EtalonResultType": obj.get("EtalonResultType"),
"EtalonResultType": obj.get("EtalonResultType") if obj.get("EtalonResultType") is not None else 0,
"EtalonFieldType": obj.get("EtalonFieldType"),
"EtalonLightType": obj.get("EtalonLightType"),
"EtalonFieldRect": RectangleCoordinates.from_dict(obj["EtalonFieldRect"]) if obj.get("EtalonFieldRect") is not None else None,
"SecurityTextResultOCR": obj.get("SecurityTextResultOCR"),
"EtalonResultOCR": obj.get("EtalonResultOCR"),
"ResultCode": obj.get("ResultCode"),
"Reserved1": obj.get("Reserved1"),
"Reserved2": obj.get("Reserved2")
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from regula.documentreader.webclient.gen.models.critical import Critical
from regula.documentreader.webclient.gen.models.light import Light
from regula.documentreader.webclient.gen.models.rectangle_coordinates import RectangleCoordinates
from regula.documentreader.webclient.gen.models.text_field_type import TextFieldType
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -28,16 +29,15 @@ class OCRSecurityTextResult(AuthenticityCheckResultItem):
critical_flag: Critical = Field(alias="CriticalFlag")
light_type: Light = Field(alias="LightType")
field_rect: RectangleCoordinates = Field(alias="FieldRect")
etalon_result_type: StrictInt = Field(alias="EtalonResultType")
etalon_field_type: StrictInt = Field(alias="EtalonFieldType")
etalon_light_type: StrictInt = Field(alias="EtalonLightType")
etalon_result_type: StrictInt = Field(description="Same as Result type, but used for safe parsing of not-described values. See Result type.", alias="EtalonResultType")
etalon_field_type: TextFieldType = Field(alias="EtalonFieldType")
etalon_light_type: Light = Field(alias="EtalonLightType")
etalon_field_rect: RectangleCoordinates = Field(alias="EtalonFieldRect")
security_text_result_ocr: StrictStr = Field(alias="SecurityTextResultOCR")
etalon_result_ocr: StrictStr = Field(alias="EtalonResultOCR")
result_code: Optional[StrictInt] = Field(default=None, alias="ResultCode")
reserved1: Optional[StrictInt] = Field(default=None, alias="Reserved1")
reserved2: Optional[StrictInt] = Field(default=None, alias="Reserved2")
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "CriticalFlag", "LightType", "FieldRect", "EtalonResultType", "EtalonFieldType", "EtalonLightType", "EtalonFieldRect", "SecurityTextResultOCR", "EtalonResultOCR", "ResultCode", "Reserved1", "Reserved2"]
__properties: ClassVar[List[str]] = ["Type", "ElementResult", "ElementDiagnose", "PercentValue", "CriticalFlag", "LightType", "FieldRect", "EtalonResultType", "EtalonFieldType", "EtalonLightType", "EtalonFieldRect", "SecurityTextResultOCR", "EtalonResultOCR", "Reserved1", "Reserved2"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -103,13 +103,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"CriticalFlag": obj.get("CriticalFlag"),
"LightType": obj.get("LightType"),
"FieldRect": RectangleCoordinates.from_dict(obj["FieldRect"]) if obj.get("FieldRect") is not None else None,
"EtalonResultType": obj.get("EtalonResultType"),
"EtalonResultType": obj.get("EtalonResultType") if obj.get("EtalonResultType") is not None else 0,
"EtalonFieldType": obj.get("EtalonFieldType"),
"EtalonLightType": obj.get("EtalonLightType"),
"EtalonFieldRect": RectangleCoordinates.from_dict(obj["EtalonFieldRect"]) if obj.get("EtalonFieldRect") is not None else None,
"SecurityTextResultOCR": obj.get("SecurityTextResultOCR"),
"EtalonResultOCR": obj.get("EtalonResultOCR"),
"ResultCode": obj.get("ResultCode"),
"Reserved1": obj.get("Reserved1"),
"Reserved2": obj.get("Reserved2")
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from regula.documentreader.webclient.gen.models.bc_pdf417_info import BcPDF417INFO
from regula.documentreader.webclient.gen.models.bc_roidetect import BcROIDETECT
from regula.documentreader.webclient.gen.models.data_module import DataModule
from regula.documentreader.webclient.gen.models.text_field_type import TextFieldType
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -29,7 +30,7 @@ class PArrayField(BaseModel):
bc_pdf417_info: Optional[BcPDF417INFO] = Field(default=None, alias="bcPDF417INFO")
bc_roi_detect: BcROIDETECT = Field(alias="bcROI_DETECT")
bc_text_decoder_types: Optional[StrictInt] = Field(default=None, alias="bcTextDecoderTypes")
bc_text_field_type: Optional[StrictInt] = Field(default=None, alias="bcTextFieldType")
bc_text_field_type: Optional[TextFieldType] = Field(default=None, alias="bcTextFieldType")
bc_type_decode: BarcodeType = Field(alias="bcType_DECODE")
bc_type_detect: StrictInt = Field(alias="bcType_DETECT")
__properties: ClassVar[List[str]] = ["bcAngle_DETECT", "bcCodeResult", "bcCountModule", "bcDataModule", "bcPDF417INFO", "bcROI_DETECT", "bcTextDecoderTypes", "bcTextFieldType", "bcType_DECODE", "bcType_DETECT"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class ParsingErrorCodes(int, Enum):
errLDS_ASN_SignerInfo_SignAlg_IncorrectData = 2147483685
errLDS_ASN_SignerInfo_Signature_IncorrectData = 2147483686
errLDS_ASN_SignerInfo_UnsignedAttrs_IncorrectData = 2147483687
errLDS_ASN_DTC_SignerInfo_IncorrectData = 2147483712
errLDS_ASN_DTC_SignerInfo_Certificate_IncorrectData = 2147483713
errLDS_ASN_DTC_SignerInfo_DigestAlg_IncorrectData = 2147483714
errLDS_ASN_DTC_SignerInfo_SignedAttrs_IncorrectData = 2147483715
errLDS_ASN_DTC_SignerInfo_SignAlg_IncorrectData = 2147483716
errLDS_ASN_DTC_SignerInfo_Signature_IncorrectData = 2147483717
errLDS_ASN_DTC_SecurityInfo_IncorrectData = 2147483718
errLDS_ASN_DTC_ContentInfo_IncorrectData = 2147483719
errLDS_ICAO_LDSObject_UnsupportedDigestAlgorithm = 2147483696
errLDS_ICAO_SignedData_SignerInfos_Empty = 2147483697
errLDS_ICAO_SignerInfo_UnsupportedDigestAlgorithm = 2147483698
Expand Down
Loading