|
| 1 | +from typing import Optional |
| 2 | + |
| 3 | +from regula.documentreader.webclient import gen, AuthenticityResultType |
| 4 | +from regula.documentreader.webclient.ext.models.authenticity.fiber import FiberChecks |
| 5 | +from regula.documentreader.webclient.ext.models.authenticity.ident import IdentChecks |
| 6 | +from regula.documentreader.webclient.ext.models.authenticity.image_ident import ImageIdentChecks |
| 7 | +from regula.documentreader.webclient.ext.models.authenticity.ocr_security_text import OCRSecurityTextChecks |
| 8 | +from regula.documentreader.webclient.ext.models.authenticity.security_feature import SecurityFeatureChecks |
| 9 | + |
| 10 | + |
| 11 | +class AuthenticityCheckList(gen.AuthenticityCheckList): |
| 12 | + |
| 13 | + @property |
| 14 | + def uv_luminescence_checks(self) -> Optional[SecurityFeatureChecks]: |
| 15 | + return self.__result_by_type(AuthenticityResultType.UV_LUMINESCENCE, SecurityFeatureChecks) |
| 16 | + |
| 17 | + @property |
| 18 | + def ir_b900_checks(self) -> Optional[SecurityFeatureChecks]: |
| 19 | + return self.__result_by_type(AuthenticityResultType.IR_B900, SecurityFeatureChecks) |
| 20 | + |
| 21 | + @property |
| 22 | + def image_pattern_checks(self) -> Optional[IdentChecks]: |
| 23 | + return self.__result_by_type(AuthenticityResultType.IMAGE_PATTERN, IdentChecks) |
| 24 | + |
| 25 | + @property |
| 26 | + def axial_protection_checks(self) -> Optional[SecurityFeatureChecks]: |
| 27 | + return self.__result_by_type(AuthenticityResultType.AXIAL_PROTECTION, SecurityFeatureChecks) |
| 28 | + |
| 29 | + @property |
| 30 | + def uv_fiber_checks(self) -> Optional[FiberChecks]: |
| 31 | + return self.__result_by_type(AuthenticityResultType.UV_FIBERS, FiberChecks) |
| 32 | + |
| 33 | + @property |
| 34 | + def ir_visibility_checks(self) -> Optional[IdentChecks]: |
| 35 | + return self.__result_by_type(AuthenticityResultType.IR_VISIBILITY, IdentChecks) |
| 36 | + |
| 37 | + @property |
| 38 | + def ocr_security_text_checks(self) -> Optional[OCRSecurityTextChecks]: |
| 39 | + return self.__result_by_type(AuthenticityResultType.OCR_SECURITY_TEXT, OCRSecurityTextChecks) |
| 40 | + |
| 41 | + @property |
| 42 | + def ipi_checks(self) -> Optional[ImageIdentChecks]: |
| 43 | + return self.__result_by_type(AuthenticityResultType.IPI, ImageIdentChecks) |
| 44 | + |
| 45 | + @property |
| 46 | + def embed_image_checks(self) -> Optional[SecurityFeatureChecks]: |
| 47 | + return self.__result_by_type(AuthenticityResultType.PHOTO_EMBED_TYPE, SecurityFeatureChecks) |
| 48 | + |
| 49 | + @property |
| 50 | + def holograms_checks(self) -> Optional[SecurityFeatureChecks]: |
| 51 | + return self.__result_by_type(AuthenticityResultType.HOLOGRAMS, SecurityFeatureChecks) |
| 52 | + |
| 53 | + @property |
| 54 | + def photo_area_checks(self) -> Optional[SecurityFeatureChecks]: |
| 55 | + return self.__result_by_type(AuthenticityResultType.PHOTO_AREA, SecurityFeatureChecks) |
| 56 | + |
| 57 | + @property |
| 58 | + def portrait_comparison_checks(self) -> Optional[IdentChecks]: |
| 59 | + return self.__result_by_type(AuthenticityResultType.PORTRAIT_COMPARISON, IdentChecks) |
| 60 | + |
| 61 | + @property |
| 62 | + def barcode_format_checks(self) -> Optional[SecurityFeatureChecks]: |
| 63 | + return self.__result_by_type(AuthenticityResultType.BARCODE_FORMAT_CHECK, SecurityFeatureChecks) |
| 64 | + |
| 65 | + @property |
| 66 | + def kinegram_checks(self) -> Optional[IdentChecks]: |
| 67 | + return self.__result_by_type(AuthenticityResultType.KINEGRAM, IdentChecks) |
| 68 | + |
| 69 | + @property |
| 70 | + def letter_screen_checks(self) -> Optional[IdentChecks]: |
| 71 | + return self.__result_by_type(AuthenticityResultType.LETTER_SCREEN, IdentChecks) |
| 72 | + |
| 73 | + def __result_by_type(self, authenticity_type: int, parent_class: type) -> Optional[gen.AuthenticityCheckResult]: |
| 74 | + for result in self.list: |
| 75 | + if result.type == authenticity_type: |
| 76 | + result.__class__ = parent_class |
| 77 | + return result |
| 78 | + return None |
0 commit comments