├── .github ├── CODEOWNERS ├── pull_request_template.md └── workflows │ ├── back-merge-handler.yml │ ├── run-smoke-test.yml │ ├── sast.yaml │ └── trivy-scan.yaml ├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator ├── FILES └── VERSION ├── Pipfile ├── Pipfile.lock ├── README.md ├── dev.md ├── example ├── IR.jpg ├── README.md ├── UV.jpg ├── WHITE.jpg └── example.py ├── generator-config.json ├── generator-templates ├── model_generic.mustache └── partial_header.mustache ├── regula ├── __init__.py └── documentreader │ ├── __init__.py │ └── webclient │ ├── __init__.py │ ├── ext │ ├── __init__.py │ ├── api │ │ ├── __init__.py │ │ └── document_reader_api.py │ └── models │ │ ├── __init__.py │ │ ├── authenticity │ │ ├── __init__.py │ │ ├── authenticity_check_list.py │ │ ├── fiber.py │ │ ├── ident.py │ │ ├── image_ident.py │ │ ├── ocr_security_text.py │ │ └── security_feature.py │ │ ├── images.py │ │ ├── recognition_request.py │ │ ├── recognition_response.py │ │ ├── text.py │ │ └── text_field.py │ └── gen │ ├── __init__.py │ ├── api │ ├── __init__.py │ ├── healthcheck_api.py │ ├── process_api.py │ └── transaction_api.py │ ├── api_client.py │ ├── api_response.py │ ├── configuration.py │ ├── exceptions.py │ ├── models │ ├── __init__.py │ ├── area_array.py │ ├── area_container.py │ ├── auth_params.py │ ├── authenticity_check_list.py │ ├── authenticity_check_list_item.py │ ├── authenticity_check_result.py │ ├── authenticity_check_result_item.py │ ├── authenticity_check_result_list_inner.py │ ├── authenticity_result.py │ ├── authenticity_result_type.py │ ├── bar_code_module_type.py │ ├── barcode_type.py │ ├── bc_pdf417_info.py │ ├── bc_roidetect.py │ ├── binary_data.py │ ├── byte_array_item.py │ ├── byte_array_result.py │ ├── candidates_list_item.py │ ├── certificate_data.py │ ├── check_diagnose.py │ ├── check_result.py │ ├── chosen_document_type.py │ ├── chosen_document_type_result.py │ ├── container_list.py │ ├── container_list_list_inner.py │ ├── critical.py │ ├── cross_source_value_comparison.py │ ├── data_module.py │ ├── details_optical.py │ ├── details_rfid.py │ ├── device_info.py │ ├── device_info_documents_database.py │ ├── doc_bar_code_info.py │ ├── doc_bar_code_info_fields_list.py │ ├── doc_bar_code_info_item.py │ ├── doc_graphics_info_item.py │ ├── doc_visual_extended_field.py │ ├── doc_visual_extended_field_item.py │ ├── doc_visual_extended_info.py │ ├── doc_visual_extended_info_item.py │ ├── document_binary_info_result.py │ ├── document_format.py │ ├── document_image.py │ ├── document_image_result.py │ ├── document_position.py │ ├── document_position_item.py │ ├── document_position_result.py │ ├── document_type.py │ ├── document_type_recognition_result.py │ ├── document_types_candidates.py │ ├── document_types_candidates_list.py │ ├── document_types_candidates_result.py │ ├── documents_database.py │ ├── encrypted_rcl_item.py │ ├── encrypted_rcl_result.py │ ├── error_coordinates.py │ ├── face_api.py │ ├── face_api_search.py │ ├── face_detection.py │ ├── face_detection_item.py │ ├── face_detection_result.py │ ├── face_item.py │ ├── fdsid_list.py │ ├── fiber_item.py │ ├── fiber_result.py │ ├── field_item.py │ ├── file_image.py │ ├── get_transactions_by_tag_response.py │ ├── graph_data.py │ ├── graphic_field.py │ ├── graphic_field_type.py │ ├── graphic_fields_list.py │ ├── graphics_result.py │ ├── healthcheck.py │ ├── healthcheck_documents_database.py │ ├── ident_item.py │ ├── ident_result.py │ ├── image_data.py │ ├── image_qa.py │ ├── image_quality_check.py │ ├── image_quality_check_list.py │ ├── image_quality_check_list_item.py │ ├── image_quality_check_type.py │ ├── image_quality_result.py │ ├── image_transaction_data.py │ ├── images.py │ ├── images_available_source.py │ ├── images_field.py │ ├── images_field_value.py │ ├── images_item.py │ ├── images_result.py │ ├── in_data.py │ ├── in_data_transaction_images_field_value.py │ ├── in_data_video.py │ ├── input_barcode_type.py │ ├── input_image_quality_checks.py │ ├── lcid.py │ ├── lexical_analysis_result.py │ ├── license_item.py │ ├── license_result.py │ ├── light.py │ ├── list_transactions_by_tag_response.py │ ├── list_verified_fields.py │ ├── list_verified_fields_item.py │ ├── liveness_params.py │ ├── log_level.py │ ├── measure_system.py │ ├── mrz_detect_mode_enum.py │ ├── mrz_detector_result.py │ ├── mrz_format.py │ ├── mrz_position.py │ ├── mrz_position_item.py │ ├── mrz_position_result.py │ ├── mrz_rows_item.py │ ├── mrz_test_quality.py │ ├── mrz_test_quality_item.py │ ├── mrz_test_quality_result.py │ ├── ocr_security_text_item.py │ ├── ocr_security_text_result.py │ ├── one_candidate.py │ ├── one_candidate_item.py │ ├── original_symbol.py │ ├── out_data.py │ ├── out_data_transaction_images_field_value.py │ ├── p_array_field.py │ ├── parsed_data.py │ ├── parsing_error_codes.py │ ├── parsing_notification_codes.py │ ├── per_document_config.py │ ├── photo_ident_item.py │ ├── photo_ident_result.py │ ├── point.py │ ├── point_array.py │ ├── points_container.py │ ├── process_params.py │ ├── process_params_rfid.py │ ├── process_request.py │ ├── process_request_image.py │ ├── process_response.py │ ├── process_system_info.py │ ├── processing_status.py │ ├── raw_image_container_item.py │ ├── raw_image_container_list.py │ ├── rectangle_coordinates.py │ ├── result.py │ ├── result_item.py │ ├── result_mrz_detector.py │ ├── result_mrz_detector_item.py │ ├── rfid_a_chip.py │ ├── rfid_access_control_info.py │ ├── rfid_access_control_procedure_type.py │ ├── rfid_access_key.py │ ├── rfid_application.py │ ├── rfid_application_type.py │ ├── rfid_attribute_data.py │ ├── rfid_attribute_name.py │ ├── rfid_authentication_procedure_type.py │ ├── rfid_baud_rate.py │ ├── rfid_card_properties_ext.py │ ├── rfid_certificate_ex.py │ ├── rfid_certificate_origin.py │ ├── rfid_certificate_type.py │ ├── rfid_data_file.py │ ├── rfid_data_file_type.py │ ├── rfid_data_group_type_tag.py │ ├── rfid_dg1.py │ ├── rfid_distinguished_name.py │ ├── rfid_doc_visual_extended_field.py │ ├── rfid_doc_visual_extended_field_item.py │ ├── rfid_doc_visual_extended_info.py │ ├── rfid_doc_visual_extended_info_item.py │ ├── rfid_error_codes.py │ ├── rfid_graphics_info_result.py │ ├── rfid_location.py │ ├── rfid_origin.py │ ├── rfid_password_type.py │ ├── rfid_pki_extension.py │ ├── rfid_raw_data.py │ ├── rfid_security_object.py │ ├── rfid_session_data.py │ ├── rfid_signer_info_ex.py │ ├── rfid_terminal.py │ ├── rfid_terminal_type.py │ ├── rfid_text_data_result.py │ ├── rfid_type.py │ ├── rfid_validity.py │ ├── rfidpkd_resource_type.py │ ├── scenario.py │ ├── security_feature_item.py │ ├── security_feature_result.py │ ├── security_feature_type.py │ ├── security_object_certificates.py │ ├── source.py │ ├── source_validity.py │ ├── status.py │ ├── status_item.py │ ├── status_result.py │ ├── string_item.py │ ├── string_recognition_result.py │ ├── symbol.py │ ├── symbol_candidate.py │ ├── symbol_estimation_item.py │ ├── symbol_recognition_result.py │ ├── t_doc_binary_info.py │ ├── t_doc_binary_info_item.py │ ├── t_original_rfid_graphics_info.py │ ├── t_original_rfid_graphics_info_item.py │ ├── text.py │ ├── text_available_source.py │ ├── text_data_result.py │ ├── text_field.py │ ├── text_field_type.py │ ├── text_field_value.py │ ├── text_item.py │ ├── text_post_processing.py │ ├── text_result.py │ ├── transaction_image.py │ ├── transaction_info.py │ ├── transaction_process_get_response.py │ ├── transaction_process_request.py │ ├── transaction_process_response.py │ ├── transaction_process_response_item.py │ ├── transaction_process_result.py │ ├── trf_ft_bytes.py │ ├── trf_ft_string.py │ ├── verification_result.py │ ├── verified_field_map.py │ ├── visibility.py │ └── visual_extended_field_item.py │ ├── py.typed │ └── rest.py ├── setup.py ├── setup.sh └── update-models.sh /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @regulaforensics/backend-team 2 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | 4 | 5 | # Ticket link 6 | 7 | 8 | 9 | # Change type 10 | 11 | 12 | 13 | - [ ] Bug fix 14 | - [ ] New feature 15 | - [ ] Breaking change 16 | - [ ] Add/Update documentation 17 | 18 | # Notes 19 | 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/back-merge-handler.yml: -------------------------------------------------------------------------------- 1 | name: Back Merge handler 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - stable 8 | 9 | jobs: 10 | pr_master_to_stable: 11 | runs-on: ubuntu-latest 12 | if: github.ref_name == 'master' 13 | steps: 14 | - uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 0 17 | 18 | - name: Check if PR exists 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | run: | 22 | prs=$(gh pr list \ 23 | --repo "$GITHUB_REPOSITORY" \ 24 | --json baseRefName,headRefName \ 25 | --jq ' 26 | map(select(.baseRefName == "stable" and .headRefName == "master")) 27 | | length 28 | ') 29 | if ((prs > 0)); then 30 | echo "Pull Request already exists" 31 | echo "SKIP=true" >> $GITHUB_ENV 32 | fi 33 | 34 | - name: Check if stable is ahead 35 | run: | 36 | commits=$(git rev-list origin/stable..origin/master --count) 37 | if ((commits == 0)); then 38 | echo "No diffs was found between branches" 39 | echo "SKIP=true" >> $GITHUB_ENV 40 | fi 41 | 42 | - name: Create Pull Request 43 | if: env.SKIP != 'true' 44 | run: gh pr create -B stable -H master --title '[GitHub Actions] Merge master -> stable' --label back-merge --body 'Autogenerated Pull Request for `back-merge` triggered by Github Actions' 45 | env: 46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 47 | 48 | pr_stable_to_develop: 49 | runs-on: ubuntu-latest 50 | if: github.ref_name == 'stable' 51 | steps: 52 | - uses: actions/checkout@v4 53 | with: 54 | fetch-depth: 0 55 | 56 | - name: Check if PR exists 57 | env: 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | run: | 60 | prs=$(gh pr list \ 61 | --repo "$GITHUB_REPOSITORY" \ 62 | --json baseRefName,headRefName \ 63 | --jq ' 64 | map(select(.baseRefName == "develop" and .headRefName == "stable")) 65 | | length 66 | ') 67 | if ((prs > 0)); then 68 | echo "Pull Request already exists" 69 | echo "SKIP=true" >> $GITHUB_ENV 70 | fi 71 | 72 | - name: Check if stable is ahead 73 | run: | 74 | commits=$(git rev-list origin/develop..origin/stable --count) 75 | if ((commits == 0)); then 76 | echo "No diffs was found between branches" 77 | echo "SKIP=true" >> $GITHUB_ENV 78 | fi 79 | 80 | - name: Create Pull Request 81 | if: env.SKIP != 'true' 82 | run: gh pr create -B develop -H stable --title '[GitHub Actions] Merge stable -> develop' --label back-merge --body 'Autogenerated Pull Request for `back-merge` triggered by Github Actions' 83 | env: 84 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 85 | -------------------------------------------------------------------------------- /.github/workflows/run-smoke-test.yml: -------------------------------------------------------------------------------- 1 | name: run smoke test 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - develop 7 | - master 8 | - stable 9 | 10 | jobs: 11 | run_smoke_test: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Python 16 | uses: actions/setup-python@v2 17 | with: 18 | python-version: 3.9 19 | - name: Install pipenv 20 | run: | 21 | python -m pip install --upgrade pip 22 | python -m pip install --upgrade setuptools wheel 23 | - name: Install test dependencies 24 | run: pip install -e ./ 25 | - name: Run smoke test 26 | run: python example.py 27 | working-directory: example 28 | env: 29 | API_BASE_PATH: "https://nightly-api.regulaforensics.com" 30 | -------------------------------------------------------------------------------- /.github/workflows/sast.yaml: -------------------------------------------------------------------------------- 1 | name: Semgrep SAST 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - develop 7 | - staging 8 | - production 9 | - stable 10 | - main 11 | - master 12 | 13 | env: 14 | # Fail workflow or not if vulnerabilities found 15 | FAIL_ON_VULNERABILITIES: true 16 | # List of paths (space separated) to ignore 17 | # Supports PATTERNS 18 | # EXCLUDE_PATHS: 'foo bar/baz file.txt dir/*.yml' 19 | EXCLUDE_PATHS: 'generator-templates regula/documentreader/webclient/gen' 20 | # List of rules (space separated) to ignore 21 | # EXCLUDE_RULES: 'generic.secrets.security.detected-aws-account-id.detected-aws-account-id' 22 | # See https://github.com/semgrep/semgrep-rules for rules registry 23 | EXCLUDE_RULES: '' 24 | 25 | jobs: 26 | semgrep: 27 | name: semgrep-oss/scan 28 | runs-on: ubuntu-latest 29 | container: 30 | image: semgrep/semgrep 31 | steps: 32 | - uses: actions/checkout@v4 33 | - name: Scan 34 | shell: bash 35 | run: | 36 | EXCLUDED_PATHS=() 37 | if [[ ! -z $EXCLUDE_PATHS ]]; then 38 | for path in $EXCLUDE_PATHS; do 39 | EXCLUDED_PATHS+=("--exclude $path") 40 | done 41 | fi 42 | 43 | EXCLUDED_RULES=() 44 | if [[ ! -z $EXCLUDE_RULES ]]; then 45 | for rule in $EXCLUDE_RULES; do 46 | EXCLUDED_RULES+=("--exclude-rule $rule") 47 | done 48 | fi 49 | 50 | if [[ $FAIL_ON_VULNERABILITIES == "true" ]]; then 51 | semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose 52 | elif [[ $FAIL_ON_VULNERABILITIES == "false" ]]; then 53 | semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose || true 54 | else 55 | echo "Bad FAIL_ON_VULNERABILITIES env var value" 56 | exit 1 57 | fi 58 | 59 | -------------------------------------------------------------------------------- /.github/workflows/trivy-scan.yaml: -------------------------------------------------------------------------------- 1 | name: Trivy Scan 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | - master 8 | - develop 9 | - stable 10 | 11 | jobs: 12 | trivy-scan: 13 | name: Scanner 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v3 18 | 19 | - name: Run Trivy vulnerability scanner in fs mode 20 | uses: aquasecurity/trivy-action@master 21 | with: 22 | scan-type: 'fs' 23 | exit-code: '1' 24 | ignore-unfixed: true 25 | severity: 'CRITICAL,HIGH,MEDIUM,LOW' 26 | env: 27 | TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | example/portrait.jpg 3 | example/document-image.jpg 4 | example/regula.license 5 | 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *$py.class 11 | 12 | # C extensions 13 | *.so 14 | 15 | # Distribution / packaging 16 | .Python 17 | env/ 18 | build/ 19 | develop-eggs/ 20 | dist/ 21 | downloads/ 22 | eggs/ 23 | .eggs/ 24 | lib/ 25 | lib64/ 26 | parts/ 27 | sdist/ 28 | var/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | # PyInstaller 33 | # Usually these files are written by a python script from a template 34 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 35 | *.manifest 36 | *.spec 37 | 38 | # Installer logs 39 | pip-log.txt 40 | pip-delete-this-directory.txt 41 | 42 | # Unit test / coverage reports 43 | htmlcov/ 44 | .tox/ 45 | .coverage 46 | .coverage.* 47 | .cache 48 | nosetests.xml 49 | coverage.xml 50 | *,cover 51 | .hypothesis/ 52 | venv/ 53 | .venv/ 54 | .python-version 55 | .pytest_cache 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | #Ipython Notebook 71 | .ipynb_checkpoints 72 | 73 | model.json -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | test/ 3 | .gitlab-ci.yml 4 | .travis.yml 5 | git_push.sh 6 | test-requirements.txt 7 | requirements.txt 8 | tox.ini 9 | setup.cfg 10 | README.md 11 | .gitignore 12 | setup.py 13 | regula/documentreader/webclient/__init__.py 14 | pyproject.toml 15 | .github/workflows/python.yml 16 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 7.13.0 2 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.python.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | certifi = ">=2024.07.04" 8 | six = ">=1.10" 9 | python-dateutil = ">=2.8.2" 10 | urllib3 = ">=1.25.3, <3.0.0" 11 | vistir = ">=0.4.0, <=0.6.1" 12 | idna = "==3.7" 13 | requests = ">=2.32.3" 14 | pydantic = ">=2" 15 | typing-extensions = ">=4.7.1" 16 | 17 | [dev-packages] 18 | wheel = "*" 19 | twine = "*" 20 | chardet = "*" 21 | packaging = ">=22.0" 22 | types-python-dateutil = ">=2.8.19.14" 23 | mypy = ">=1.5" 24 | setuptools = "==78.1.1" 25 | 26 | [requires] 27 | python_version = "3.9" 28 | -------------------------------------------------------------------------------- /dev.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | Models generation based on [openapi spec](https://github.com/regulaforensics/DocumentReader-api-openapi). 4 | 5 | ## Generation 6 | 7 | To regenerate models from openapi definition, 8 | clone [latest open api definitions](https://github.com/regulaforensics/DocumentReader-api-openapi) 9 | and use next command from the project root. 10 | ```bash 11 | ./update-models.sh 12 | ``` 13 | 14 | ## Generator configuration Features 15 | 16 | 1. When generating oneOf schemas, the generator creates its 17 | own abstract class, which does not look like it would like. 18 | The problem was solved by replacing the abstract generator 19 | class with ours using typeMappings in the generator config. 20 | 2. The generator treats the discriminator value as a string, 21 | but in our case it's numbers. To solve this problem, changes 22 | have been made to the model_generic.mustache template. 23 | 24 | ## Problem solving 25 | 26 | To solve new problems, use the generator 27 | settings ([python](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python.md), 28 | [common](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md)) 29 | and [templates](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/python). 30 | 31 | **Do not edit the generated files! They will be overwritten after generation!** -------------------------------------------------------------------------------- /example/IR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/example/IR.jpg -------------------------------------------------------------------------------- /example/UV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/example/UV.jpg -------------------------------------------------------------------------------- /example/WHITE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/example/WHITE.jpg -------------------------------------------------------------------------------- /generator-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageName": "regula.documentreader.webclient.gen", 3 | "extPackageName": "regula.documentreader.webclient.ext", 4 | "typeMappings" : { 5 | "ContainerListListInner": "ResultItem", 6 | "AuthenticityCheckResultListInner": "AuthenticityCheckResultItem" 7 | } 8 | } -------------------------------------------------------------------------------- /generator-templates/partial_header.mustache: -------------------------------------------------------------------------------- 1 | """ 2 | Generated by: https://openapi-generator.tech 3 | """ -------------------------------------------------------------------------------- /regula/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/regula/__init__.py -------------------------------------------------------------------------------- /regula/documentreader/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/regula/documentreader/__init__.py -------------------------------------------------------------------------------- /regula/documentreader/webclient/__init__.py: -------------------------------------------------------------------------------- 1 | from regula.documentreader.webclient.gen import * 2 | from regula.documentreader.webclient.ext import * 3 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/__init__.py: -------------------------------------------------------------------------------- 1 | from regula.documentreader.webclient.ext.api.document_reader_api import DocumentReaderApi 2 | from regula.documentreader.webclient.ext.models.authenticity.authenticity_check_list import AuthenticityCheckList 3 | from regula.documentreader.webclient.ext.models.authenticity.fiber import FiberChecks 4 | from regula.documentreader.webclient.ext.models.authenticity.ident import IdentChecks 5 | from regula.documentreader.webclient.ext.models.authenticity.image_ident import ImageIdentChecks 6 | from regula.documentreader.webclient.ext.models.authenticity.ocr_security_text import OCRSecurityTextChecks 7 | from regula.documentreader.webclient.ext.models.authenticity.security_feature import SecurityFeatureChecks 8 | from regula.documentreader.webclient.ext.models.images import Images, ImagesField 9 | from regula.documentreader.webclient.ext.models.recognition_request import RecognitionRequest, RecognitionImage 10 | from regula.documentreader.webclient.ext.models.recognition_response import RecognitionResponse 11 | from regula.documentreader.webclient.ext.models.text import Text 12 | from regula.documentreader.webclient.ext.models.text_field import TextField 13 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/api/__init__.py: -------------------------------------------------------------------------------- 1 | from regula.documentreader.webclient.ext.api.document_reader_api import DocumentReaderApi 2 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/api/document_reader_api.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from regula.documentreader.webclient import ProcessResponse 4 | from regula.documentreader.webclient.gen import ApiClient 5 | from regula.documentreader.webclient.ext.models.recognition_response import RecognitionResponse 6 | from regula.documentreader.webclient.gen.api import HealthcheckApi, ProcessApi 7 | from regula.documentreader.webclient.gen.configuration import Configuration 8 | from regula.documentreader.webclient.gen.models import ProcessRequest 9 | 10 | Base64String = str 11 | 12 | 13 | class DocumentReaderApi(HealthcheckApi, ProcessApi): 14 | 15 | def __init__(self, host=None, debug=False, verify_ssl=True, api_client=None): 16 | if api_client: 17 | self.api_client = api_client 18 | else: 19 | configuration = Configuration(host=host) 20 | configuration.debug = debug 21 | configuration.verify_ssl = verify_ssl 22 | self.api_client = ApiClient(configuration=configuration) 23 | super().__init__(self.api_client) 24 | 25 | def __enter__(self): 26 | return self 27 | 28 | def __exit__(self, exc_type, exc_value, traceback): 29 | pass 30 | 31 | def set_configuration(self, configuration) -> None: 32 | self.api_client.configuration = configuration 33 | 34 | def process(self, process_request: ProcessRequest) -> RecognitionResponse: 35 | return RecognitionResponse(self.api_process(process_request)) 36 | 37 | def deserialize_to_recognition_response(self, content: Union[bytes, bytearray, str]) -> RecognitionResponse: 38 | response = self.__to_response_object(content) 39 | response = self.api_client.deserialize(response, ProcessResponse) 40 | return RecognitionResponse(response) 41 | 42 | @staticmethod 43 | def __to_response_object(content: Union[bytes, bytearray, str]): 44 | return type(ProcessResponse.__name__, (object,), {"data": content})() 45 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/__init__.py: -------------------------------------------------------------------------------- 1 | from regula.documentreader.webclient.ext.models.authenticity.authenticity_check_list import AuthenticityCheckList 2 | from regula.documentreader.webclient.ext.models.authenticity.fiber import FiberChecks 3 | from regula.documentreader.webclient.ext.models.authenticity.ident import IdentChecks 4 | from regula.documentreader.webclient.ext.models.authenticity.image_ident import ImageIdentChecks 5 | from regula.documentreader.webclient.ext.models.authenticity.ocr_security_text import OCRSecurityTextChecks 6 | from regula.documentreader.webclient.ext.models.authenticity.security_feature import SecurityFeatureChecks 7 | from regula.documentreader.webclient.ext.models.images import Images, ImagesField 8 | from regula.documentreader.webclient.ext.models.recognition_request import RecognitionImage 9 | from regula.documentreader.webclient.ext.models.recognition_request import RecognitionRequest 10 | from regula.documentreader.webclient.ext.models.recognition_response import RecognitionResponse 11 | from regula.documentreader.webclient.ext.models.text import Text 12 | from regula.documentreader.webclient.ext.models.text_field import TextField 13 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/__init__.py: -------------------------------------------------------------------------------- 1 | from regula.documentreader.webclient.ext.models.authenticity.authenticity_check_list import AuthenticityCheckList 2 | from regula.documentreader.webclient.ext.models.authenticity.fiber import FiberChecks 3 | from regula.documentreader.webclient.ext.models.authenticity.ident import IdentChecks 4 | from regula.documentreader.webclient.ext.models.authenticity.image_ident import ImageIdentChecks 5 | from regula.documentreader.webclient.ext.models.authenticity.ocr_security_text import OCRSecurityTextChecks 6 | from regula.documentreader.webclient.ext.models.authenticity.security_feature import SecurityFeatureChecks -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/fiber.py: -------------------------------------------------------------------------------- 1 | from typing import List, cast 2 | 3 | from regula.documentreader.webclient.gen.models import FiberResult, AuthenticityCheckResult 4 | 5 | 6 | class FiberChecks(AuthenticityCheckResult): 7 | 8 | @property 9 | def checks_list(self) -> List[FiberResult]: 10 | fiber_list: List[FiberResult] = cast(List[FiberResult], self.list) 11 | return fiber_list 12 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/ident.py: -------------------------------------------------------------------------------- 1 | from typing import List, cast 2 | 3 | from regula.documentreader.webclient.gen.models import AuthenticityCheckResult, IdentResult 4 | 5 | 6 | class IdentChecks(AuthenticityCheckResult): 7 | 8 | @property 9 | def checks_list(self) -> List[IdentResult]: 10 | ident_list: List[IdentResult] = cast(List[IdentResult], self.list) 11 | return ident_list 12 | 13 | # element_type is SecurityFeatureType 14 | def checks_by_element(self, element_type: int) -> List[IdentResult]: 15 | return [check for check in self.checks_list if check.element_type == element_type] -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/image_ident.py: -------------------------------------------------------------------------------- 1 | from typing import List, cast 2 | 3 | from regula.documentreader.webclient.gen.models import AuthenticityCheckResult, PhotoIdentResult 4 | 5 | 6 | class ImageIdentChecks(AuthenticityCheckResult): 7 | 8 | @property 9 | def checks_list(self) -> List[PhotoIdentResult]: 10 | image_ident_list: List[PhotoIdentResult] = cast(List[PhotoIdentResult], self.list) 11 | return image_ident_list 12 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/ocr_security_text.py: -------------------------------------------------------------------------------- 1 | from typing import List, cast 2 | 3 | from regula.documentreader.webclient.gen.models import AuthenticityCheckResult, OCRSecurityTextResult 4 | 5 | 6 | class OCRSecurityTextChecks(AuthenticityCheckResult): 7 | 8 | @property 9 | def checks_list(self) -> List[OCRSecurityTextResult]: 10 | ocr_security_text_list: List[OCRSecurityTextResult] = cast(List[OCRSecurityTextResult], self.list) 11 | return ocr_security_text_list 12 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/authenticity/security_feature.py: -------------------------------------------------------------------------------- 1 | from typing import List, cast 2 | 3 | from regula.documentreader.webclient.gen.models import AuthenticityCheckResult, SecurityFeatureResult 4 | 5 | 6 | class SecurityFeatureChecks(AuthenticityCheckResult): 7 | 8 | @property 9 | def checks_list(self) -> List[SecurityFeatureResult]: 10 | security_feature_list: List[SecurityFeatureResult] = cast(List[SecurityFeatureResult], self.list) 11 | return security_feature_list 12 | 13 | # element_type is SecurityFeatureType 14 | def checks_by_element(self, element_type: int) -> List[SecurityFeatureResult]: 15 | return [check for check in self.checks_list if check.element_type == element_type] 16 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/images.py: -------------------------------------------------------------------------------- 1 | import base64 2 | from typing import Optional, List 3 | 4 | from regula.documentreader.webclient.gen.models import Images as GenImages, ImagesField as GenImagesField, Source 5 | 6 | 7 | class ImagesField(GenImagesField): 8 | 9 | def get_value(self, source: str = None, original=False) -> Optional[bytes]: 10 | 11 | if not source: 12 | value = self.get_value(Source.RFID) 13 | if not value: value = self.get_value(Source.VISUAL) 14 | if not value: value = self.get_value(Source.BARCODE) 15 | if not value: value = self.get_value("UNKNOWN") # temp fix, will be removed 16 | return value 17 | else: 18 | field_value = None 19 | for v in self.value_list: 20 | if v.source == source: 21 | field_value = v 22 | 23 | if not field_value: 24 | return None 25 | 26 | if original: 27 | return base64.b64decode(field_value.original_value) 28 | return base64.b64decode(field_value.value) 29 | 30 | 31 | class Images(GenImages): 32 | 33 | def get_field(self, field_type: int) -> Optional[ImagesField]: 34 | for field in self.field_list: 35 | if field.field_type == field_type: 36 | return ImagesField.from_json(field.to_json()) 37 | return None 38 | 39 | def get_fields(self, field_type: int) -> List[ImagesField]: 40 | return [ImagesField.from_json(field.to_json()) for field in self.field_list if field.field_type == field_type] 41 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/text.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from regula.documentreader.webclient.ext.models.text_field import TextField 4 | from regula.documentreader.webclient.gen.models import LCID, Text as GenText 5 | 6 | 7 | class Text(GenText): 8 | 9 | def get_field(self, field_type: int, lcid: int = None) -> Optional[TextField]: 10 | result = None 11 | for field in self.field_list: 12 | if field.field_type == field_type: 13 | if lcid is not None and field.lcid == lcid: 14 | return TextField.from_json(field.to_json()) 15 | elif lcid is None and field.lcid == LCID.LATIN: 16 | return TextField.from_json(field.to_json()) 17 | elif lcid is None and result is None: 18 | result = field 19 | return TextField.from_json(result.to_json()) 20 | 21 | def get_field_value(self, field_type: int, lcid: int = None) -> Optional[str]: 22 | field = self.get_field(field_type, lcid) 23 | return field.value if field else None 24 | 25 | def get_field_by_name(self, field_name: str, lcid: int = None) -> Optional[TextField]: 26 | result = None 27 | for field in self.field_list: 28 | if field.field_name == field_name: 29 | if lcid is not None and field.lcid == lcid: 30 | return TextField.from_json(field.to_json()) 31 | elif lcid is None and field.lcid == LCID.LATIN: 32 | return TextField.from_json(field.to_json()) 33 | elif lcid is None and result is None: 34 | result = field 35 | return TextField.from_json(result.to_json()) 36 | 37 | def get_field_value_by_name(self, field_name: str, lcid: int = None) -> Optional[str]: 38 | field = self.get_field_by_name(field_name, lcid) 39 | return field.value if field else None 40 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/ext/models/text_field.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from regula.documentreader.webclient.gen.models.check_result import CheckResult 4 | from regula.documentreader.webclient.gen.models.text_field import TextField as GenTextField 5 | 6 | 7 | class TextField(GenTextField): 8 | 9 | def get_value(self, source: str = None, original=False) -> Optional[str]: 10 | if not source: 11 | return self.value 12 | for i in self.value_list: 13 | if i.source == source: 14 | if original: 15 | return i.original_value 16 | else: 17 | return i.value 18 | return None 19 | 20 | def source_validity(self, source: str) -> CheckResult: 21 | for i in self.validity_list: 22 | if i.source == source: 23 | return i.status 24 | return CheckResult.WAS_NOT_DONE 25 | 26 | def cross_source_comparison(self, one: str, other: str) -> CheckResult: 27 | for i in self.comparison_list: 28 | a = i.source_left == one and i.source_right == other 29 | b = i.source_right == one and i.source_left == other 30 | if a or b: 31 | return i.status 32 | return CheckResult.WAS_NOT_DONE 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/api/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | # import apis into api package 4 | from regula.documentreader.webclient.gen.api.healthcheck_api import HealthcheckApi 5 | from regula.documentreader.webclient.gen.api.process_api import ProcessApi 6 | from regula.documentreader.webclient.gen.api.transaction_api import TransactionApi 7 | 8 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/api_response.py: -------------------------------------------------------------------------------- 1 | """API response object.""" 2 | 3 | from __future__ import annotations 4 | from typing import Optional, Generic, Mapping, TypeVar 5 | from pydantic import Field, StrictInt, StrictBytes, BaseModel 6 | 7 | T = TypeVar("T") 8 | 9 | class ApiResponse(BaseModel, Generic[T]): 10 | """ 11 | API response object 12 | """ 13 | 14 | status_code: StrictInt = Field(description="HTTP status code") 15 | headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") 16 | data: T = Field(description="Deserialized data given the data type") 17 | raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") 18 | 19 | model_config = { 20 | "arbitrary_types_allowed": True 21 | } 22 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/authenticity_check_list_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.authenticity_check_list import AuthenticityCheckList 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class AuthenticityCheckListItem(BaseModel): 19 | """ 20 | AuthenticityCheckListItem 21 | """ # noqa: E501 22 | authenticity_check_list: AuthenticityCheckList = Field(alias="AuthenticityCheckList") 23 | __properties: ClassVar[List[str]] = ["AuthenticityCheckList"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of AuthenticityCheckListItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of authenticity_check_list 65 | if self.authenticity_check_list: 66 | _dict['AuthenticityCheckList'] = self.authenticity_check_list.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of AuthenticityCheckListItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "AuthenticityCheckList": AuthenticityCheckList.from_dict(obj["AuthenticityCheckList"]) if obj.get("AuthenticityCheckList") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/authenticity_result_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class AuthenticityResultType(int, Enum): 14 | """ 15 | Enumeration describes available authenticity checks: https://docs.regulaforensics.com/develop/doc-reader-sdk/web-service/development/enums/authenticity-result-type/. 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UV_LUMINESCENCE = 1 22 | IR_B900 = 2 23 | IMAGE_PATTERN = 4 24 | AXIAL_PROTECTION = 8 25 | UV_FIBERS = 16 26 | IR_VISIBILITY = 32 27 | OCR_SECURITY_TEXT = 64 28 | IPI = 128 29 | PHOTO_EMBED_TYPE = 512 30 | OVI = 1024 31 | HOLOGRAMS = 4096 32 | PHOTO_AREA = 8192 33 | PORTRAIT_COMPARISON = 32768 34 | BARCODE_FORMAT_CHECK = 65536 35 | KINEGRAM = 131072 36 | LETTER_SCREEN = 262144 37 | HOLOGRAM_DETECTION = 524288 38 | FINGERPRINT_COMPARISON = 1048576 39 | LIVENESS = 2097152 40 | EXTENDED_OCR_CHECK = 4194304 41 | EXTENDED_MRZ_CHECK = 8388608 42 | ENCRYPTED_IPI = 16777216 43 | 44 | @classmethod 45 | def from_json(cls, json_str: str) -> Self: 46 | """Create an instance of AuthenticityResultType from a JSON string""" 47 | return cls(json.loads(json_str)) 48 | 49 | 50 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/bar_code_module_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class BarCodeModuleType(int, Enum): 14 | """ 15 | BarCodeModuleType 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | TEXT = 0 22 | BYTE = 1 23 | NUM = 2 24 | SHIFT = 3 25 | ALL = 4 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of BarCodeModuleType from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/barcode_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class BarcodeType(int, Enum): 14 | """ 15 | Enumeration contains the types of barcodes that can be processed 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 0 22 | CODE128 = 1 23 | CODE39 = 2 24 | EAN8 = 3 25 | ITF = 4 26 | PDF417 = 5 27 | STF = 6 28 | MTF = 7 29 | IATA = 8 30 | CODABAR = 9 31 | UPCA = 10 32 | CODE93 = 11 33 | UPCE = 12 34 | EAN13 = 13 35 | QRCODE = 14 36 | AZTEC = 15 37 | DATAMATRIX = 16 38 | ALL_1D = 17 39 | CODE11 = 18 40 | JABCODE = 19 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Self: 44 | """Create an instance of BarcodeType from a JSON string""" 45 | return cls(json.loads(json_str)) 46 | 47 | 48 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/bc_roidetect.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class BcROIDETECT(BaseModel): 18 | """ 19 | BcROIDETECT 20 | """ # noqa: E501 21 | bottom: StrictInt 22 | left: StrictInt 23 | right: StrictInt 24 | top: StrictInt 25 | __properties: ClassVar[List[str]] = ["bottom", "left", "right", "top"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of BcROIDETECT from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of BcROIDETECT from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "bottom": obj.get("bottom"), 79 | "left": obj.get("left"), 80 | "right": obj.get("right"), 81 | "top": obj.get("top") 82 | }) 83 | return _obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/byte_array_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class ByteArrayItem(BaseModel): 18 | """ 19 | ByteArrayItem 20 | """ # noqa: E501 21 | byte_array: StrictStr = Field(description="Byte array in base64", alias="ByteArray") 22 | __properties: ClassVar[List[str]] = ["ByteArray"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of ByteArrayItem from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of ByteArrayItem from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "ByteArray": obj.get("ByteArray") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/byte_array_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.result import Result 15 | from regula.documentreader.webclient.gen.models.result_item import ResultItem 16 | from typing import Optional, Set 17 | from typing_extensions import Self 18 | 19 | class ByteArrayResult(ResultItem): 20 | """ 21 | ByteArrayResult 22 | """ # noqa: E501 23 | byte_array: StrictStr = Field(description="Byte array in base64", alias="ByteArray") 24 | __properties: ClassVar[List[str]] = ["buf_length", "light", "list_idx", "page_idx", "result_type", "ByteArray"] 25 | 26 | model_config = ConfigDict( 27 | populate_by_name=True, 28 | validate_assignment=True, 29 | protected_namespaces=(), 30 | ) 31 | 32 | 33 | def to_str(self) -> str: 34 | """Returns the string representation of the model using alias""" 35 | return pprint.pformat(self.model_dump(by_alias=True)) 36 | 37 | def to_json(self) -> str: 38 | """Returns the JSON representation of the model using alias""" 39 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 40 | return json.dumps(self.to_dict()) 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Optional[Self]: 44 | """Create an instance of ByteArrayResult from a JSON string""" 45 | return cls.from_dict(json.loads(json_str)) 46 | 47 | def to_dict(self) -> Dict[str, Any]: 48 | """Return the dictionary representation of the model using alias. 49 | 50 | This has the following differences from calling pydantic's 51 | `self.model_dump(by_alias=True)`: 52 | 53 | * `None` is only added to the output dict for nullable fields that 54 | were set at model initialization. Other fields with value `None` 55 | are ignored. 56 | """ 57 | excluded_fields: Set[str] = set([ 58 | ]) 59 | 60 | _dict = self.model_dump( 61 | by_alias=True, 62 | exclude=excluded_fields, 63 | exclude_none=True, 64 | ) 65 | return _dict 66 | 67 | @classmethod 68 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 69 | """Create an instance of ByteArrayResult from a dict""" 70 | if obj is None: 71 | return None 72 | 73 | if not isinstance(obj, dict): 74 | return cls.model_validate(obj) 75 | 76 | _obj = cls.model_validate({ 77 | "buf_length": obj.get("buf_length"), 78 | "light": obj.get("light"), 79 | "list_idx": obj.get("list_idx"), 80 | "page_idx": obj.get("page_idx"), 81 | "result_type": obj.get("result_type"), 82 | "ByteArray": obj.get("ByteArray") 83 | }) 84 | return _obj 85 | 86 | 87 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/candidates_list_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.document_types_candidates_list import DocumentTypesCandidatesList 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class CandidatesListItem(BaseModel): 19 | """ 20 | CandidatesListItem 21 | """ # noqa: E501 22 | candidates_list: Optional[DocumentTypesCandidatesList] = Field(default=None, alias="CandidatesList") 23 | __properties: ClassVar[List[str]] = ["CandidatesList"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of CandidatesListItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of candidates_list 65 | if self.candidates_list: 66 | _dict['CandidatesList'] = self.candidates_list.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of CandidatesListItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "CandidatesList": DocumentTypesCandidatesList.from_dict(obj["CandidatesList"]) if obj.get("CandidatesList") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/certificate_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class CertificateData(BaseModel): 18 | """ 19 | CertificateData 20 | """ # noqa: E501 21 | data: StrictStr = Field(alias="Data") 22 | length: StrictStr = Field(alias="Length") 23 | __properties: ClassVar[List[str]] = ["Data", "Length"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of CertificateData from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of CertificateData from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "Data": obj.get("Data"), 77 | "Length": obj.get("Length") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/check_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class CheckResult(int, Enum): 14 | """ 15 | 0 - result is negative; 1 - result is positive; 2 - сheck was not performed 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | ERROR = 0 22 | OK = 1 23 | WAS_NOT_DONE = 2 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of CheckResult from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/critical.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Critical(int, Enum): 14 | """ 15 | Enumeration contains identifiers determining the criticality of the security element 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | NOT_CRITICAL = 0 22 | CRITICAL = 1 23 | 24 | @classmethod 25 | def from_json(cls, json_str: str) -> Self: 26 | """Create an instance of Critical from a JSON string""" 27 | return cls(json.loads(json_str)) 28 | 29 | 30 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/cross_source_value_comparison.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.check_result import CheckResult 15 | from regula.documentreader.webclient.gen.models.source import Source 16 | from typing import Optional, Set 17 | from typing_extensions import Self 18 | 19 | class CrossSourceValueComparison(BaseModel): 20 | """ 21 | CrossSourceValueComparison 22 | """ # noqa: E501 23 | source_left: Source = Field(alias="sourceLeft") 24 | source_right: Source = Field(alias="sourceRight") 25 | status: CheckResult 26 | __properties: ClassVar[List[str]] = ["sourceLeft", "sourceRight", "status"] 27 | 28 | model_config = ConfigDict( 29 | populate_by_name=True, 30 | validate_assignment=True, 31 | protected_namespaces=(), 32 | ) 33 | 34 | 35 | def to_str(self) -> str: 36 | """Returns the string representation of the model using alias""" 37 | return pprint.pformat(self.model_dump(by_alias=True)) 38 | 39 | def to_json(self) -> str: 40 | """Returns the JSON representation of the model using alias""" 41 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 42 | return json.dumps(self.to_dict()) 43 | 44 | @classmethod 45 | def from_json(cls, json_str: str) -> Optional[Self]: 46 | """Create an instance of CrossSourceValueComparison from a JSON string""" 47 | return cls.from_dict(json.loads(json_str)) 48 | 49 | def to_dict(self) -> Dict[str, Any]: 50 | """Return the dictionary representation of the model using alias. 51 | 52 | This has the following differences from calling pydantic's 53 | `self.model_dump(by_alias=True)`: 54 | 55 | * `None` is only added to the output dict for nullable fields that 56 | were set at model initialization. Other fields with value `None` 57 | are ignored. 58 | """ 59 | excluded_fields: Set[str] = set([ 60 | ]) 61 | 62 | _dict = self.model_dump( 63 | by_alias=True, 64 | exclude=excluded_fields, 65 | exclude_none=True, 66 | ) 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of CrossSourceValueComparison from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "sourceLeft": obj.get("sourceLeft"), 80 | "sourceRight": obj.get("sourceRight"), 81 | "status": obj.get("status") 82 | }) 83 | return _obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/doc_bar_code_info_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.doc_bar_code_info_fields_list import DocBarCodeInfoFieldsList 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class DocBarCodeInfoItem(BaseModel): 19 | """ 20 | DocBarCodeInfoItem 21 | """ # noqa: E501 22 | doc_bar_code_info: DocBarCodeInfoFieldsList = Field(alias="DocBarCodeInfo") 23 | __properties: ClassVar[List[str]] = ["DocBarCodeInfo"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocBarCodeInfoItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of doc_bar_code_info 65 | if self.doc_bar_code_info: 66 | _dict['DocBarCodeInfo'] = self.doc_bar_code_info.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of DocBarCodeInfoItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "DocBarCodeInfo": DocBarCodeInfoFieldsList.from_dict(obj["DocBarCodeInfo"]) if obj.get("DocBarCodeInfo") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/doc_graphics_info_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.graphic_fields_list import GraphicFieldsList 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class DocGraphicsInfoItem(BaseModel): 19 | """ 20 | DocGraphicsInfoItem 21 | """ # noqa: E501 22 | doc_graphics_info: GraphicFieldsList = Field(alias="DocGraphicsInfo") 23 | __properties: ClassVar[List[str]] = ["DocGraphicsInfo"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocGraphicsInfoItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of doc_graphics_info 65 | if self.doc_graphics_info: 66 | _dict['DocGraphicsInfo'] = self.doc_graphics_info.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of DocGraphicsInfoItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "DocGraphicsInfo": GraphicFieldsList.from_dict(obj["DocGraphicsInfo"]) if obj.get("DocGraphicsInfo") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/doc_visual_extended_field_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.rectangle_coordinates import RectangleCoordinates 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class DocVisualExtendedFieldItem(BaseModel): 19 | """ 20 | DocVisualExtendedFieldItem 21 | """ # noqa: E501 22 | field_rect: RectangleCoordinates = Field(alias="FieldRect") 23 | __properties: ClassVar[List[str]] = ["FieldRect"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocVisualExtendedFieldItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of field_rect 65 | if self.field_rect: 66 | _dict['FieldRect'] = self.field_rect.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of DocVisualExtendedFieldItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "FieldRect": RectangleCoordinates.from_dict(obj["FieldRect"]) if obj.get("FieldRect") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/doc_visual_extended_info_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.doc_visual_extended_info import DocVisualExtendedInfo 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class DocVisualExtendedInfoItem(BaseModel): 19 | """ 20 | DocVisualExtendedInfoItem 21 | """ # noqa: E501 22 | doc_visual_extended_info: DocVisualExtendedInfo = Field(alias="DocVisualExtendedInfo") 23 | __properties: ClassVar[List[str]] = ["DocVisualExtendedInfo"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocVisualExtendedInfoItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of doc_visual_extended_info 65 | if self.doc_visual_extended_info: 66 | _dict['DocVisualExtendedInfo'] = self.doc_visual_extended_info.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of DocVisualExtendedInfoItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "DocVisualExtendedInfo": DocVisualExtendedInfo.from_dict(obj["DocVisualExtendedInfo"]) if obj.get("DocVisualExtendedInfo") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/document_format.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class DocumentFormat(int, Enum): 14 | """ 15 | Defining the geometric format of documents in accordance with ISO / IEC 7810 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = -1 22 | ID1 = 0 23 | ID2 = 1 24 | ID3 = 2 25 | NON = 3 26 | A4 = 4 27 | ID3_X2 = 5 28 | ID1_90 = 10 29 | ID1_180 = 11 30 | ID1_270 = 12 31 | ID2_180 = 13 32 | ID3_180 = 14 33 | CUSTOM = 1000 34 | FLEXIBLE = 1002 35 | 36 | @classmethod 37 | def from_json(cls, json_str: str) -> Self: 38 | """Create an instance of DocumentFormat from a JSON string""" 39 | return cls(json.loads(json_str)) 40 | 41 | 42 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/document_image.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class DocumentImage(BaseModel): 18 | """ 19 | DocumentImage 20 | """ # noqa: E501 21 | image: Optional[StrictStr] = Field(default=None, description="Base64 encoded image") 22 | format: Optional[StrictStr] = Field(default=None, description="Image format") 23 | __properties: ClassVar[List[str]] = ["image", "format"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocumentImage from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of DocumentImage from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "image": obj.get("image"), 77 | "format": obj.get("format") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/document_position_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.document_position import DocumentPosition 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class DocumentPositionItem(BaseModel): 19 | """ 20 | DocumentPositionItem 21 | """ # noqa: E501 22 | document_position: DocumentPosition = Field(alias="DocumentPosition") 23 | __properties: ClassVar[List[str]] = ["DocumentPosition"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of DocumentPositionItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of document_position 65 | if self.document_position: 66 | _dict['DocumentPosition'] = self.document_position.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of DocumentPositionItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "DocumentPosition": DocumentPosition.from_dict(obj["DocumentPosition"]) if obj.get("DocumentPosition") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/document_type_recognition_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class DocumentTypeRecognitionResult(int, Enum): 14 | """ 15 | DocumentTypeRecognitionResult 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | OK = 0 22 | UNKNOWN = 15 23 | NEED_MORE_IMAGES = 29 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of DocumentTypeRecognitionResult from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/encrypted_rcl_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Union 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class EncryptedRCLItem(BaseModel): 18 | """ 19 | EncryptedRCLItem 20 | """ # noqa: E501 21 | encrypted_rcl: Union[StrictBytes, StrictStr] = Field(description="Base64 encoded data", alias="EncryptedRCL") 22 | __properties: ClassVar[List[str]] = ["EncryptedRCL"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of EncryptedRCLItem from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of EncryptedRCLItem from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "EncryptedRCL": obj.get("EncryptedRCL") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/encrypted_rcl_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import ConfigDict, Field, StrictBytes, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Union 14 | from regula.documentreader.webclient.gen.models.result import Result 15 | from regula.documentreader.webclient.gen.models.result_item import ResultItem 16 | from typing import Optional, Set 17 | from typing_extensions import Self 18 | 19 | class EncryptedRCLResult(ResultItem): 20 | """ 21 | Contains encrypted result container list 22 | """ # noqa: E501 23 | encrypted_rcl: Union[StrictBytes, StrictStr] = Field(description="Base64 encoded data", alias="EncryptedRCL") 24 | __properties: ClassVar[List[str]] = ["buf_length", "light", "list_idx", "page_idx", "result_type", "EncryptedRCL"] 25 | 26 | model_config = ConfigDict( 27 | populate_by_name=True, 28 | validate_assignment=True, 29 | protected_namespaces=(), 30 | ) 31 | 32 | 33 | def to_str(self) -> str: 34 | """Returns the string representation of the model using alias""" 35 | return pprint.pformat(self.model_dump(by_alias=True)) 36 | 37 | def to_json(self) -> str: 38 | """Returns the JSON representation of the model using alias""" 39 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 40 | return json.dumps(self.to_dict()) 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Optional[Self]: 44 | """Create an instance of EncryptedRCLResult from a JSON string""" 45 | return cls.from_dict(json.loads(json_str)) 46 | 47 | def to_dict(self) -> Dict[str, Any]: 48 | """Return the dictionary representation of the model using alias. 49 | 50 | This has the following differences from calling pydantic's 51 | `self.model_dump(by_alias=True)`: 52 | 53 | * `None` is only added to the output dict for nullable fields that 54 | were set at model initialization. Other fields with value `None` 55 | are ignored. 56 | """ 57 | excluded_fields: Set[str] = set([ 58 | ]) 59 | 60 | _dict = self.model_dump( 61 | by_alias=True, 62 | exclude=excluded_fields, 63 | exclude_none=True, 64 | ) 65 | return _dict 66 | 67 | @classmethod 68 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 69 | """Create an instance of EncryptedRCLResult from a dict""" 70 | if obj is None: 71 | return None 72 | 73 | if not isinstance(obj, dict): 74 | return cls.model_validate(obj) 75 | 76 | _obj = cls.model_validate({ 77 | "buf_length": obj.get("buf_length"), 78 | "light": obj.get("light"), 79 | "list_idx": obj.get("list_idx"), 80 | "page_idx": obj.get("page_idx"), 81 | "result_type": obj.get("result_type"), 82 | "EncryptedRCL": obj.get("EncryptedRCL") 83 | }) 84 | return _obj 85 | 86 | 87 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/error_coordinates.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt 13 | from typing import Any, ClassVar, Dict, List, Optional, Union 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class ErrorCoordinates(BaseModel): 18 | """ 19 | ErrorCoordinates 20 | """ # noqa: E501 21 | left: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="Left") 22 | top: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="Top") 23 | right: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="Right") 24 | bottom: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="Bottom") 25 | __properties: ClassVar[List[str]] = ["Left", "Top", "Right", "Bottom"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of ErrorCoordinates from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of ErrorCoordinates from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "Left": obj.get("Left"), 79 | "Top": obj.get("Top"), 80 | "Right": obj.get("Right"), 81 | "Bottom": obj.get("Bottom") 82 | }) 83 | return _obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/face_detection_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.face_detection import FaceDetection 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class FaceDetectionItem(BaseModel): 19 | """ 20 | FaceDetectionItem 21 | """ # noqa: E501 22 | face_detection: Optional[FaceDetection] = Field(default=None, alias="FaceDetection") 23 | __properties: ClassVar[List[str]] = ["FaceDetection"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of FaceDetectionItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of face_detection 65 | if self.face_detection: 66 | _dict['FaceDetection'] = self.face_detection.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of FaceDetectionItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "FaceDetection": FaceDetection.from_dict(obj["FaceDetection"]) if obj.get("FaceDetection") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/file_image.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class FileImage(BaseModel): 18 | """ 19 | FileImage 20 | """ # noqa: E501 21 | data: StrictStr = Field(alias="Data") 22 | length: StrictInt = Field(alias="Length") 23 | __properties: ClassVar[List[str]] = ["Data", "Length"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of FileImage from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of FileImage from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "Data": obj.get("Data"), 77 | "Length": obj.get("Length") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/get_transactions_by_tag_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from datetime import datetime 13 | from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr 14 | from typing import Any, ClassVar, Dict, List, Optional 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class GetTransactionsByTagResponse(BaseModel): 19 | """ 20 | GetTransactionsByTagResponse 21 | """ # noqa: E501 22 | id: Optional[StrictStr] = Field(default=None, description="Transaction id") 23 | state: Optional[StrictInt] = Field(default=None, description="Transaction status") 24 | updated_at: Optional[datetime] = Field(default=None, description="Last time updated", alias="updatedAt") 25 | __properties: ClassVar[List[str]] = ["id", "state", "updatedAt"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of GetTransactionsByTagResponse from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of GetTransactionsByTagResponse from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "id": obj.get("id"), 79 | "state": obj.get("state"), 80 | "updatedAt": obj.get("updatedAt") 81 | }) 82 | return _obj 83 | 84 | 85 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/graphic_field_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class GraphicFieldType(int, Enum): 14 | """ 15 | GraphicFieldType 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | PORTRAIT = 201 22 | FINGERPRINT = 202 23 | EYE = 203 24 | SIGNATURE = 204 25 | BAR_CODE = 205 26 | PROOF_OF_CITIZENSHIP = 206 27 | DOCUMENT_FRONT = 207 28 | DOCUMENT_REAR = 208 29 | COLOR_DYNAMIC = 209 30 | GHOST_PORTRAIT = 210 31 | STAMP = 211 32 | PORTRAIT_OF_CHILD = 212 33 | CONTACT_CHIP = 213 34 | OTHER = 250 35 | FINGER_LEFT_THUMB = 300 36 | FINGER_LEFT_INDEX = 301 37 | FINGER_LEFT_MIDDLE = 302 38 | FINGER_LEFT_RING = 303 39 | FINGER_LEFT_LITTLE = 304 40 | FINGER_RIGHT_THUMB = 305 41 | FINGER_RIGHT_INDEX = 306 42 | FINGER_RIGHT_MIDDLE = 307 43 | FINGER_RIGHT_RING = 308 44 | FINGER_RIGHT_LITTLE = 309 45 | FINGER_RIGHT_FOUR_FINGERS = 313 46 | FINGER_LEFT_FOUR_FINGERS = 314 47 | FINGER_TWO_THUMBS = 315 48 | 49 | @classmethod 50 | def from_json(cls, json_str: str) -> Self: 51 | """Create an instance of GraphicFieldType from a JSON string""" 52 | return cls(json.loads(json_str)) 53 | 54 | 55 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/image_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class ImageData(BaseModel): 18 | """ 19 | ImageData 20 | """ # noqa: E501 21 | image: Optional[StrictStr] = Field(default=None, description="Base64 encoded image") 22 | format: Optional[StrictStr] = Field(default=None, description="Image format") 23 | __properties: ClassVar[List[str]] = ["image", "format"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ImageData from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of ImageData from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "image": obj.get("image"), 77 | "format": obj.get("format") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/image_quality_check_list_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.image_quality_check_list import ImageQualityCheckList 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ImageQualityCheckListItem(BaseModel): 19 | """ 20 | ImageQualityCheckListItem 21 | """ # noqa: E501 22 | image_quality_check_list: ImageQualityCheckList = Field(alias="ImageQualityCheckList") 23 | __properties: ClassVar[List[str]] = ["ImageQualityCheckList"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ImageQualityCheckListItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of image_quality_check_list 65 | if self.image_quality_check_list: 66 | _dict['ImageQualityCheckList'] = self.image_quality_check_list.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of ImageQualityCheckListItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "ImageQualityCheckList": ImageQualityCheckList.from_dict(obj["ImageQualityCheckList"]) if obj.get("ImageQualityCheckList") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/image_quality_check_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class ImageQualityCheckType(int, Enum): 14 | """ 15 | Image quality check type 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | ImageGlares = 0 22 | ImageFocus = 1 23 | ImageResolution = 2 24 | ImageColorness = 3 25 | Perspective = 4 26 | Bounds = 5 27 | Portrait = 7 28 | Brightness = 9 29 | Occlusion = 10 30 | 31 | @classmethod 32 | def from_json(cls, json_str: str) -> Self: 33 | """Create an instance of ImageQualityCheckType from a JSON string""" 34 | return cls(json.loads(json_str)) 35 | 36 | 37 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/image_transaction_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.images_field_value import ImagesFieldValue 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ImageTransactionData(BaseModel): 19 | """ 20 | ImageTransactionData 21 | """ # noqa: E501 22 | image: Optional[ImagesFieldValue] = None 23 | __properties: ClassVar[List[str]] = ["image"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ImageTransactionData from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of image 65 | if self.image: 66 | _dict['image'] = self.image.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of ImageTransactionData from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "image": ImagesFieldValue.from_dict(obj["image"]) if obj.get("image") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/images_available_source.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.source import Source 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ImagesAvailableSource(BaseModel): 19 | """ 20 | ImagesAvailableSource 21 | """ # noqa: E501 22 | container_type: StrictInt = Field(description="Same as Result type, but used for safe parsing of not-described values. See Result type.", alias="containerType") 23 | source: Source 24 | __properties: ClassVar[List[str]] = ["containerType", "source"] 25 | 26 | model_config = ConfigDict( 27 | populate_by_name=True, 28 | validate_assignment=True, 29 | protected_namespaces=(), 30 | ) 31 | 32 | 33 | def to_str(self) -> str: 34 | """Returns the string representation of the model using alias""" 35 | return pprint.pformat(self.model_dump(by_alias=True)) 36 | 37 | def to_json(self) -> str: 38 | """Returns the JSON representation of the model using alias""" 39 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 40 | return json.dumps(self.to_dict()) 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Optional[Self]: 44 | """Create an instance of ImagesAvailableSource from a JSON string""" 45 | return cls.from_dict(json.loads(json_str)) 46 | 47 | def to_dict(self) -> Dict[str, Any]: 48 | """Return the dictionary representation of the model using alias. 49 | 50 | This has the following differences from calling pydantic's 51 | `self.model_dump(by_alias=True)`: 52 | 53 | * `None` is only added to the output dict for nullable fields that 54 | were set at model initialization. Other fields with value `None` 55 | are ignored. 56 | """ 57 | excluded_fields: Set[str] = set([ 58 | ]) 59 | 60 | _dict = self.model_dump( 61 | by_alias=True, 62 | exclude=excluded_fields, 63 | exclude_none=True, 64 | ) 65 | return _dict 66 | 67 | @classmethod 68 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 69 | """Create an instance of ImagesAvailableSource from a dict""" 70 | if obj is None: 71 | return None 72 | 73 | if not isinstance(obj, dict): 74 | return cls.model_validate(obj) 75 | 76 | _obj = cls.model_validate({ 77 | "containerType": obj.get("containerType") if obj.get("containerType") is not None else 0, 78 | "source": obj.get("source") 79 | }) 80 | return _obj 81 | 82 | 83 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/images_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.images import Images 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ImagesItem(BaseModel): 19 | """ 20 | ImagesItem 21 | """ # noqa: E501 22 | images: Images = Field(alias="Images") 23 | __properties: ClassVar[List[str]] = ["Images"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ImagesItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of images 65 | if self.images: 66 | _dict['Images'] = self.images.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of ImagesItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "Images": Images.from_dict(obj["Images"]) if obj.get("Images") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/in_data_video.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class InDataVideo(BaseModel): 18 | """ 19 | Video 20 | """ # noqa: E501 21 | metadata: Optional[Dict[str, Any]] = Field(default=None, description="A free-form object containing video's extended attributes.") 22 | url: Optional[StrictStr] = Field(default=None, description="Video url") 23 | __properties: ClassVar[List[str]] = ["metadata", "url"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of InDataVideo from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of InDataVideo from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "metadata": obj.get("metadata"), 77 | "url": obj.get("url") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/input_barcode_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class InputBarcodeType(str, Enum): 14 | """ 15 | Enumeration contains the types of barcodes that can be processed 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 'bct_unknown' 22 | CODE128 = 'bct_Code128' 23 | CODE39 = 'bct_Code39' 24 | EAN8 = 'bct_EAN8' 25 | ITF = 'bct_ITF' 26 | PDF417 = 'bct_PDF417' 27 | STF = 'bct_STF' 28 | MTF = 'bct_MTF' 29 | IATA = 'bct_IATA' 30 | CODABAR = 'bct_CODABAR' 31 | UPCA = 'bct_UPCA' 32 | CODE93 = 'bct_CODE93' 33 | UPCE = 'bct_UPCE' 34 | EAN13 = 'bct_EAN13' 35 | QRCODE = 'bct_QRCODE' 36 | AZTEC = 'bct_AZTEC' 37 | DATAMATRIX = 'bct_DATAMATRIX' 38 | ALL_1D = 'bct_ALL_1D' 39 | CODE11 = 'bct_Code11' 40 | JABCODE = 'bct_JABCODE' 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Self: 44 | """Create an instance of InputBarcodeType from a JSON string""" 45 | return cls(json.loads(json_str)) 46 | 47 | 48 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/input_image_quality_checks.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class InputImageQualityChecks(str, Enum): 14 | """ 15 | Input image quality checks for the document processing 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | Glares = 'glaresCheck' 22 | Focus = 'focusCheck' 23 | Resolution = 'dpiThreshold' 24 | Colorness = 'colornessCheck' 25 | Perspective = 'perspectiveCheck' 26 | Bounds = 'documentPosition' 27 | Portrait = 'portraitCheck' 28 | Brightness = 'brightnessCheck' 29 | Occlusion = 'occlusionCheck' 30 | 31 | @classmethod 32 | def from_json(cls, json_str: str) -> Self: 33 | """Create an instance of InputImageQualityChecks from a JSON string""" 34 | return cls(json.loads(json_str)) 35 | 36 | 37 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/license_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Union 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class LicenseItem(BaseModel): 18 | """ 19 | LicenseItem 20 | """ # noqa: E501 21 | license: Union[StrictBytes, StrictStr] = Field(description="Base64 encoded data", alias="License") 22 | __properties: ClassVar[List[str]] = ["License"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of LicenseItem from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of LicenseItem from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "License": obj.get("License") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/license_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import ConfigDict, Field, StrictBytes, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Union 14 | from regula.documentreader.webclient.gen.models.result import Result 15 | from regula.documentreader.webclient.gen.models.result_item import ResultItem 16 | from typing import Optional, Set 17 | from typing_extensions import Self 18 | 19 | class LicenseResult(ResultItem): 20 | """ 21 | Contains license 22 | """ # noqa: E501 23 | license: Union[StrictBytes, StrictStr] = Field(description="Base64 encoded data", alias="License") 24 | __properties: ClassVar[List[str]] = ["buf_length", "light", "list_idx", "page_idx", "result_type", "License"] 25 | 26 | model_config = ConfigDict( 27 | populate_by_name=True, 28 | validate_assignment=True, 29 | protected_namespaces=(), 30 | ) 31 | 32 | 33 | def to_str(self) -> str: 34 | """Returns the string representation of the model using alias""" 35 | return pprint.pformat(self.model_dump(by_alias=True)) 36 | 37 | def to_json(self) -> str: 38 | """Returns the JSON representation of the model using alias""" 39 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 40 | return json.dumps(self.to_dict()) 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Optional[Self]: 44 | """Create an instance of LicenseResult from a JSON string""" 45 | return cls.from_dict(json.loads(json_str)) 46 | 47 | def to_dict(self) -> Dict[str, Any]: 48 | """Return the dictionary representation of the model using alias. 49 | 50 | This has the following differences from calling pydantic's 51 | `self.model_dump(by_alias=True)`: 52 | 53 | * `None` is only added to the output dict for nullable fields that 54 | were set at model initialization. Other fields with value `None` 55 | are ignored. 56 | """ 57 | excluded_fields: Set[str] = set([ 58 | ]) 59 | 60 | _dict = self.model_dump( 61 | by_alias=True, 62 | exclude=excluded_fields, 63 | exclude_none=True, 64 | ) 65 | return _dict 66 | 67 | @classmethod 68 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 69 | """Create an instance of LicenseResult from a dict""" 70 | if obj is None: 71 | return None 72 | 73 | if not isinstance(obj, dict): 74 | return cls.model_validate(obj) 75 | 76 | _obj = cls.model_validate({ 77 | "buf_length": obj.get("buf_length"), 78 | "light": obj.get("light"), 79 | "list_idx": obj.get("list_idx"), 80 | "page_idx": obj.get("page_idx"), 81 | "result_type": obj.get("result_type"), 82 | "License": obj.get("License") 83 | }) 84 | return _obj 85 | 86 | 87 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/light.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Light(int, Enum): 14 | """ 15 | Image light index 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | OFF = 0 22 | WHITE = 6 23 | IR = 24 24 | UV = 128 25 | AXIAL_WHITE_FULL = 3072 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of Light from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/list_verified_fields_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ListVerifiedFieldsItem(BaseModel): 19 | """ 20 | ListVerifiedFieldsItem 21 | """ # noqa: E501 22 | list_verified_fields: ListVerifiedFields = Field(alias="ListVerifiedFields") 23 | __properties: ClassVar[List[str]] = ["ListVerifiedFields"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ListVerifiedFieldsItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of list_verified_fields 65 | if self.list_verified_fields: 66 | _dict['ListVerifiedFields'] = self.list_verified_fields.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of ListVerifiedFieldsItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "ListVerifiedFields": ListVerifiedFields.from_dict(obj["ListVerifiedFields"]) if obj.get("ListVerifiedFields") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/log_level.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class LogLevel(str, Enum): 14 | """ 15 | LogLevel 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | FATAL_ERROR = 'FatalError' 22 | ERROR = 'Error' 23 | WARNING = 'Warning' 24 | INFO = 'Info' 25 | DEBUG = 'Debug' 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of LogLevel from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/measure_system.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class MeasureSystem(int, Enum): 14 | """ 15 | MeasureSystem 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | METRIC = 0 22 | IMPERIAL = 1 23 | 24 | @classmethod 25 | def from_json(cls, json_str: str) -> Self: 26 | """Create an instance of MeasureSystem from a JSON string""" 27 | return cls(json.loads(json_str)) 28 | 29 | 30 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/mrz_detect_mode_enum.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class MrzDetectModeEnum(int, Enum): 14 | """ 15 | Make better MRZ detection on complex noisy backgrounds, like BW photocopy of some documents. 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | eMDM_Default = 0 22 | eMDM_ResizeBinarizeWindow = 1 23 | eMDM_BlurBeforeBinarization = 2 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of MrzDetectModeEnum from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/mrz_format.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class MRZFormat(str, Enum): 14 | """ 15 | MRZFormat 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | IDL = '1x30' 22 | ID1 = '3x30' 23 | ID2 = '2x36' 24 | ID3 = '2x44' 25 | CAN = '1x6' 26 | ID1_2_30 = '2x30' 27 | 28 | @classmethod 29 | def from_json(cls, json_str: str) -> Self: 30 | """Create an instance of MRZFormat from a JSON string""" 31 | return cls(json.loads(json_str)) 32 | 33 | 34 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/mrz_position_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.mrz_position import MrzPosition 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class MrzPositionItem(BaseModel): 19 | """ 20 | MrzPositionItem 21 | """ # noqa: E501 22 | mrz_position: MrzPosition = Field(alias="MrzPosition") 23 | __properties: ClassVar[List[str]] = ["MrzPosition"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of MrzPositionItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of mrz_position 65 | if self.mrz_position: 66 | _dict['MrzPosition'] = self.mrz_position.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of MrzPositionItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "MrzPosition": MrzPosition.from_dict(obj["MrzPosition"]) if obj.get("MrzPosition") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/mrz_test_quality_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.mrz_test_quality import MRZTestQuality 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class MRZTestQualityItem(BaseModel): 19 | """ 20 | MRZTestQualityItem 21 | """ # noqa: E501 22 | mrz_test_quality: MRZTestQuality = Field(alias="MRZTestQuality") 23 | __properties: ClassVar[List[str]] = ["MRZTestQuality"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of MRZTestQualityItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of mrz_test_quality 65 | if self.mrz_test_quality: 66 | _dict['MRZTestQuality'] = self.mrz_test_quality.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of MRZTestQualityItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "MRZTestQuality": MRZTestQuality.from_dict(obj["MRZTestQuality"]) if obj.get("MRZTestQuality") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/parsed_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class ParsedData(BaseModel): 18 | """ 19 | ParsedData 20 | """ # noqa: E501 21 | parsing_notifications: Optional[List[StrictInt]] = Field(default=None, alias="ParsingNotifications") 22 | __properties: ClassVar[List[str]] = ["ParsingNotifications"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of ParsedData from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of ParsedData from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "ParsingNotifications": obj.get("ParsingNotifications") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/per_document_config.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class PerDocumentConfig(BaseModel): 18 | """ 19 | PerDocumentConfig 20 | """ # noqa: E501 21 | doc_id: Optional[List[StrictInt]] = Field(default=None, description="Specific template IDs, for which apply current custom configuration", alias="docID") 22 | exclude_auth_checks: Optional[StrictInt] = Field(default=None, description="Contains items from AuthenticityResultType as sum via OR operation", alias="excludeAuthChecks") 23 | __properties: ClassVar[List[str]] = ["docID", "excludeAuthChecks"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of PerDocumentConfig from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of PerDocumentConfig from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "docID": obj.get("docID"), 77 | "excludeAuthChecks": obj.get("excludeAuthChecks") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/point.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class Point(BaseModel): 18 | """ 19 | Point 20 | """ # noqa: E501 21 | x: StrictInt 22 | y: StrictInt 23 | __properties: ClassVar[List[str]] = ["x", "y"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of Point from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of Point from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "x": obj.get("x"), 77 | "y": obj.get("y") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/point_array.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.point import Point 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class PointArray(BaseModel): 19 | """ 20 | PointArray 21 | """ # noqa: E501 22 | points_list: List[Point] = Field(alias="PointsList") 23 | __properties: ClassVar[List[str]] = ["PointsList"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of PointArray from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of each item in points_list (list) 65 | _items = [] 66 | if self.points_list: 67 | for _item_points_list in self.points_list: 68 | if _item_points_list: 69 | _items.append(_item_points_list.to_dict()) 70 | _dict['PointsList'] = _items 71 | return _dict 72 | 73 | @classmethod 74 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 75 | """Create an instance of PointArray from a dict""" 76 | if obj is None: 77 | return None 78 | 79 | if not isinstance(obj, dict): 80 | return cls.model_validate(obj) 81 | 82 | _obj = cls.model_validate({ 83 | "PointsList": [Point.from_dict(_item) for _item in obj["PointsList"]] if obj.get("PointsList") is not None else None 84 | }) 85 | return _obj 86 | 87 | 88 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/process_params_rfid.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.parsing_notification_codes import ParsingNotificationCodes 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ProcessParamsRfid(BaseModel): 19 | """ 20 | Params for the RFID chip data reprocessing 21 | """ # noqa: E501 22 | pa_ignore_notification_codes: Optional[List[ParsingNotificationCodes]] = Field(default=None, description="A list of notification codes that should be ignored during passive authentication (PA)", alias="paIgnoreNotificationCodes") 23 | __properties: ClassVar[List[str]] = ["paIgnoreNotificationCodes"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ProcessParamsRfid from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of ProcessParamsRfid from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "paIgnoreNotificationCodes": obj.get("paIgnoreNotificationCodes") 77 | }) 78 | return _obj 79 | 80 | 81 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/process_system_info.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class ProcessSystemInfo(BaseModel): 18 | """ 19 | ProcessSystemInfo 20 | """ # noqa: E501 21 | license: Optional[StrictStr] = Field(default=None, description="Base64 encoded license file") 22 | recaptcha_token: Optional[StrictStr] = Field(default=None, description="For internal use. Demo-sites recaptcha token.") 23 | __properties: ClassVar[List[str]] = ["license", "recaptcha_token"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ProcessSystemInfo from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of ProcessSystemInfo from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "license": obj.get("license"), 77 | "recaptcha_token": obj.get("recaptcha_token") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/processing_status.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class ProcessingStatus(int, Enum): 14 | """ 15 | ProcessingStatus 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | NOT_FINISHED = 0 22 | FINISHED = 1 23 | TIMEOUT = 2 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of ProcessingStatus from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/raw_image_container_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.image_data import ImageData 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class RawImageContainerItem(BaseModel): 19 | """ 20 | RawImageContainerItem 21 | """ # noqa: E501 22 | raw_image_container: ImageData = Field(alias="RawImageContainer") 23 | __properties: ClassVar[List[str]] = ["RawImageContainer"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of RawImageContainerItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of raw_image_container 65 | if self.raw_image_container: 66 | _dict['RawImageContainer'] = self.raw_image_container.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of RawImageContainerItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "RawImageContainer": ImageData.from_dict(obj["RawImageContainer"]) if obj.get("RawImageContainer") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rectangle_coordinates.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class RectangleCoordinates(BaseModel): 18 | """ 19 | Coordinates of the rectangle region on a document image(result type 1). Represented by two points - (left, top) + (right, bottom) 20 | """ # noqa: E501 21 | left: StrictInt 22 | top: StrictInt 23 | right: StrictInt 24 | bottom: StrictInt 25 | __properties: ClassVar[List[str]] = ["left", "top", "right", "bottom"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of RectangleCoordinates from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of RectangleCoordinates from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "left": obj.get("left"), 79 | "top": obj.get("top"), 80 | "right": obj.get("right"), 81 | "bottom": obj.get("bottom") 82 | }) 83 | return _obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Result(int, Enum): 14 | """ 15 | Result 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | DOCUMENT_IMAGE = 1 22 | MRZ_TEXT = 3 23 | BARCODES = 5 24 | VISUAL_GRAPHICS = 6 25 | MRZ_TEST_QUALITY = 7 26 | DOCUMENT_TYPE_CANDIDATES = 8 27 | DOCUMENT_TYPE = 9 28 | LEXICAL_ANALYSIS = 15 29 | RAW_UNCROPPED_IMAGE = 16 30 | VISUAL_TEXT = 17 31 | BARCODE_TEXT = 18 32 | BARCODE_GRAPHICS = 19 33 | AUTHENTICITY = 20 34 | MAGNETIC_STRIPE_TEXT_DATA = 26 35 | IMAGE_QUALITY = 30 36 | LIVE_PORTRAIT = 32 37 | STATUS = 33 38 | PORTRAIT_COMPARISON = 34 39 | EXT_PORTRAIT = 35 40 | TEXT = 36 41 | IMAGES = 37 42 | FINGERPRINTS = 38 43 | FINGERPRINT_COMPARISON = 39 44 | ENCRYPTED_RCL = 49 45 | LICENSE = 50 46 | MRZ_POSITION = 61 47 | BARCODE_POSITION = 62 48 | DOCUMENT_POSITION = 85 49 | MRZ_DETECTOR = 87 50 | FACE_DETECTION = 97 51 | RFID_RAW_DATA = 101 52 | RFID_TEXT = 102 53 | RFID_GRAPHICS = 103 54 | RFID_BINARY_DATA = 104 55 | RFID_ORIGINAL_GRAPHICS = 105 56 | DTC_VC = 109 57 | 58 | @classmethod 59 | def from_json(cls, json_str: str) -> Self: 60 | """Create an instance of Result from a JSON string""" 61 | return cls(json.loads(json_str)) 62 | 63 | 64 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/result_mrz_detector_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.result_mrz_detector import ResultMRZDetector 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class ResultMRZDetectorItem(BaseModel): 19 | """ 20 | ResultMRZDetectorItem 21 | """ # noqa: E501 22 | result_mrz_detector: ResultMRZDetector = Field(alias="ResultMRZDetector") 23 | __properties: ClassVar[List[str]] = ["ResultMRZDetector"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of ResultMRZDetectorItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of result_mrz_detector 65 | if self.result_mrz_detector: 66 | _dict['ResultMRZDetector'] = self.result_mrz_detector.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of ResultMRZDetectorItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "ResultMRZDetector": ResultMRZDetector.from_dict(obj["ResultMRZDetector"]) if obj.get("ResultMRZDetector") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_a_chip.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidAChip(int, Enum): 14 | """ 15 | Enumeration contains a set of constants specifying the type of the RFIDchip from MIFARE® family (for chips of type A) 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 0 22 | MIFARE_1K = 1 23 | MIFARE_4K = 2 24 | MIFARE_ULTRALIGHT = 3 25 | MIFARE_DES_FIRE = 4 26 | MIFARE_PROX = 5 27 | 28 | @classmethod 29 | def from_json(cls, json_str: str) -> Self: 30 | """Create an instance of RfidAChip from a JSON string""" 31 | return cls(json.loads(json_str)) 32 | 33 | 34 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_access_control_procedure_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidAccessControlProcedureType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of authentication or secure data access procedure 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNDEFINED = 0 22 | BAC = 1 23 | PACE = 2 24 | CA = 3 25 | TA = 4 26 | AA = 5 27 | RI = 6 28 | CARD_INFO = 10 29 | 30 | @classmethod 31 | def from_json(cls, json_str: str) -> Self: 32 | """Create an instance of RfidAccessControlProcedureType from a JSON string""" 33 | return cls(json.loads(json_str)) 34 | 35 | 36 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_application_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidApplicationType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of application within the context of the communication session with electronic document 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNSPECIFIED = 0 22 | E_PASSPORT = 1 23 | E_ID = 2 24 | E_SIGN = 3 25 | E_DL = 4 26 | LDS2_TravelRecords = 5 27 | LDS2_VisaRecords = 6 28 | LDS2_AddBiometrics = 7 29 | eDTC_PC = 8 30 | ROOT_FILES = 0 31 | 32 | @classmethod 33 | def from_json(cls, json_str: str) -> Self: 34 | """Create an instance of RfidApplicationType from a JSON string""" 35 | return cls(json.loads(json_str)) 36 | 37 | 38 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_attribute_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class RfidAttributeData(BaseModel): 18 | """ 19 | Structure contains the data of one attribute of the digital signature object. 20 | """ # noqa: E501 21 | type: StrictStr = Field(description="Contents of the identifier in the format S1 (S2), where S1 – attribute name, S2 – identifier (OID string)", alias="Type") 22 | data: StrictStr = Field(description="Attribute binary data. Base64 encoded.", alias="Data") 23 | __properties: ClassVar[List[str]] = ["Type", "Data"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of RfidAttributeData from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of RfidAttributeData from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "Type": obj.get("Type"), 77 | "Data": obj.get("Data") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_authentication_procedure_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidAuthenticationProcedureType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of performed procedure of document authentication within the current session 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNDEFINED = 0 22 | STANDARD = 1 23 | ADVANCED = 2 24 | GENERAL = 3 25 | 26 | @classmethod 27 | def from_json(cls, json_str: str) -> Self: 28 | """Create an instance of RfidAuthenticationProcedureType from a JSON string""" 29 | return cls(json.loads(json_str)) 30 | 31 | 32 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_baud_rate.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidBaudRate(int, Enum): 14 | """ 15 | Enumeration contains a set of constants specifying the rate of data exchange between the reader and the RFID-chip 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 0 22 | RFBR_106 = 1 23 | RFBR_212 = 2 24 | RFBR_424 = 4 25 | RFBR_848 = 8 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of RfidBaudRate from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_certificate_origin.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidCertificateOrigin(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the source of certificate used in the procedure of document security object digital signature verification 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNDEFINED = 0 22 | PKD = 1 23 | SECURITY_OBJECT = 2 24 | USER_DEFINED = 3 25 | MASTER_LIST_PKD = 4 26 | MASTER_LIST_SO = 5 27 | DEFECT_LIST_SO = 6 28 | DEVIATION_LIST_SO = 7 29 | BLACK_LIST_SO = 8 30 | 31 | @classmethod 32 | def from_json(cls, json_str: str) -> Self: 33 | """Create an instance of RfidCertificateOrigin from a JSON string""" 34 | return cls(json.loads(json_str)) 35 | 36 | 37 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_certificate_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidCertificateType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of certificate used in the procedure of document security object digital signature verification 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNDEFINED = 0 22 | CSCA = 1 23 | CSCA_LINK = 2 24 | DS = 3 25 | MLS = 4 26 | DEV_LS = 5 27 | DEF_LS = 6 28 | BLS = 7 29 | 30 | @classmethod 31 | def from_json(cls, json_str: str) -> Self: 32 | """Create an instance of RfidCertificateType from a JSON string""" 33 | return cls(json.loads(json_str)) 34 | 35 | 36 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_data_file_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidDataFileType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the file type (or logical belonging of the data object) within the context of the communication session with electronic document 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNSPECIFIED = 0 22 | PASSPORT_DG1 = 1 23 | PASSPORT_DG2 = 2 24 | PASSPORT_DG3 = 3 25 | PASSPORT_DG4 = 4 26 | PASSPORT_DG5 = 5 27 | PASSPORT_DG6 = 6 28 | PASSPORT_DG7 = 7 29 | PASSPORT_DG8 = 8 30 | PASSPORT_DG9 = 9 31 | PASSPORT_DG10 = 10 32 | PASSPORT_DG11 = 11 33 | PASSPORT_DG12 = 12 34 | PASSPORT_DG13 = 13 35 | PASSPORT_DG14 = 14 36 | PASSPORT_DG15 = 15 37 | PASSPORT_DG16 = 16 38 | PASSPORT_DG17 = 17 39 | PASSPORT_DG18 = 18 40 | PASSPORT_DG19 = 19 41 | PASSPORT_DG20 = 20 42 | PASSPORT_SOD = 21 43 | PASSPORT_CVCA = 22 44 | PASSPORT_COM = 23 45 | DTC_DG17 = 57 46 | DTC_DG18 = 58 47 | DTC_DG22 = 62 48 | DTC_DG23 = 63 49 | DTC_DG24 = 64 50 | ID_DG1 = 101 51 | ID_DG2 = 102 52 | ID_DG3 = 103 53 | ID_DG4 = 104 54 | ID_DG5 = 105 55 | ID_DG6 = 106 56 | ID_DG7 = 107 57 | ID_DG8 = 108 58 | ID_DG9 = 109 59 | ID_DG10 = 110 60 | ID_DG11 = 111 61 | ID_DG12 = 112 62 | ID_DG13 = 113 63 | ID_DG14 = 114 64 | ID_DG15 = 115 65 | ID_DG16 = 116 66 | ID_DG17 = 117 67 | ID_DG18 = 118 68 | ID_DG19 = 119 69 | ID_DG20 = 120 70 | ID_DG21 = 121 71 | DL_COM = 150 72 | DL_DG1 = 151 73 | DL_DG2 = 152 74 | DL_DG3 = 153 75 | DL_DG4 = 154 76 | DL_DG5 = 155 77 | DL_DG6 = 156 78 | DL_DG7 = 157 79 | DL_DG8 = 158 80 | DL_DG9 = 159 81 | DL_DG10 = 160 82 | DL_DG11 = 161 83 | DL_DG12 = 162 84 | DL_DG13 = 163 85 | DL_DG14 = 164 86 | DL_SOD = 165 87 | DL_CE = 166 88 | DL_CVCA = 167 89 | PACE_CARD_ACCESS = 200 90 | PACE_CARD_SECURITY = 201 91 | PACE_CHIP_SECURITY = 202 92 | MIFARE_DATA = 300 93 | MIFARE_VALIDITY = 301 94 | AUTHENTICITY_V2 = 302 95 | ATR = 400 96 | _E_SIGN_PK = 500 97 | _E_SIGN_SIGNED_DATA = 501 98 | CERTIFICATE = 600 99 | MASTER_LIST = 601 100 | DEFECT_LIST = 602 101 | BLACK_LIST = 603 102 | APP_DIRECTORY = 700 103 | SESSION = 701 104 | LOG_DATA = 702 105 | CHIP_PROPERTIES = 703 106 | POST_CA_RESPONSE = 710 107 | POST_CA_PUBLIC_KEY = 711 108 | POST_CA_INFO = 712 109 | POST_CA_D_PARAMS = 713 110 | POST_CA_CHECK_PK = 714 111 | POST_CA_CHECK_SK = 715 112 | USER_DEFINED = 1000 113 | 114 | @classmethod 115 | def from_json(cls, json_str: str) -> Self: 116 | """Create an instance of RfidDataFileType from a JSON string""" 117 | return cls(json.loads(json_str)) 118 | 119 | 120 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_data_group_type_tag.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidDataGroupTypeTag(int, Enum): 14 | """ 15 | Enumeration representing RFID Data Group Types. Constants with prefix correspond to the informational data groups of ePassport application, with prefix EID_ – those of eID application, with prefix EDL_ – eDL application 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | COM = 96 22 | DG1 = 97 23 | DG2 = 117 24 | DG3 = 99 25 | DG4 = 118 26 | DG5 = 101 27 | DG6 = 102 28 | DG7 = 103 29 | DG8 = 104 30 | DG9 = 105 31 | DG10 = 106 32 | DG11 = 107 33 | DG12 = 108 34 | DG13 = 109 35 | DG14 = 110 36 | DG15 = 111 37 | DG16 = 112 38 | SOD = 119 39 | EID_DG1 = 97 40 | EID_DG2 = 98 41 | EID_DG3 = 99 42 | EID_DG4 = 100 43 | EID_DG5 = 101 44 | EID_DG6 = 102 45 | EID_DG7 = 103 46 | EID_DG8 = 104 47 | EID_DG9 = 105 48 | EID_DG10 = 106 49 | EID_DG11 = 107 50 | EID_DG12 = 108 51 | EID_DG13 = 109 52 | EID_DG14 = 110 53 | EID_DG15 = 111 54 | EID_DG16 = 112 55 | EID_DG17 = 113 56 | EID_DG18 = 114 57 | EID_DG19 = 115 58 | EID_DG20 = 116 59 | EID_DG21 = 117 60 | EDL_COM = 96 61 | EDL_SOD = 119 62 | EDL_CE = 119 63 | EDL_DG1 = 97 64 | EDL_DG2 = 107 65 | EDL_DG3 = 108 66 | EDL_DG4 = 101 67 | EDL_DG5 = 103 68 | EDL_DG6 = 117 69 | EDL_DG7 = 99 70 | EDL_DG8 = 118 71 | EDL_DG9 = 112 72 | EDL_DG11 = 109 73 | EDL_DG12 = 113 74 | EDL_DG13 = 111 75 | EDL_DG14 = 110 76 | 77 | @classmethod 78 | def from_json(cls, json_str: str) -> Self: 79 | """Create an instance of RfidDataGroupTypeTag from a JSON string""" 80 | return cls(json.loads(json_str)) 81 | 82 | 83 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_location.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidLocation(int, Enum): 14 | """ 15 | Determines the presence and location of an RFID chip in a document. 0 - no rfid chip; 1 - chip is located in the document data page; 2 - chip is located in the back page or inlay of the document 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | NONE = 0 22 | MAIN_PAGE = 1 23 | BACK_PAGE = 2 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of RfidLocation from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_origin.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class RfidOrigin(BaseModel): 18 | """ 19 | Location of data in RFID chip 20 | """ # noqa: E501 21 | dg: StrictInt = Field(description="Source data group file") 22 | dg_tag: StrictInt = Field(description="Index of the source record of the image with biometric information in the information data group", alias="dgTag") 23 | tag_entry: StrictInt = Field(description="Index of the template in the record with biometric data", alias="tagEntry") 24 | entry_view: StrictInt = Field(description="Index of the variant of the biometric data template", alias="entryView") 25 | __properties: ClassVar[List[str]] = ["dg", "dgTag", "tagEntry", "entryView"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of RfidOrigin from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of RfidOrigin from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "dg": obj.get("dg"), 79 | "dgTag": obj.get("dgTag"), 80 | "tagEntry": obj.get("tagEntry"), 81 | "entryView": obj.get("entryView") 82 | }) 83 | return _obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_password_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidPasswordType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants specifying the rate of data exchange between the reader and the RFID-chip 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 0 22 | MRZ = 1 23 | CAN = 2 24 | PIN = 3 25 | PUK = 4 26 | PIN_E_SIGN = 5 27 | SAI = 6 28 | 29 | @classmethod 30 | def from_json(cls, json_str: str) -> Self: 31 | """Create an instance of RfidPasswordType from a JSON string""" 32 | return cls(json.loads(json_str)) 33 | 34 | 35 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_pki_extension.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class RfidPkiExtension(BaseModel): 18 | """ 19 | Extension identifier (OID, ASCII string); Contents of the identifier in the format S1 (S2), where S1 – attribute name, S2 – identifier (OID string) 20 | """ # noqa: E501 21 | type: StrictStr = Field(description="Extension identifier (OID, ASCII string); Contents of the identifier in the format S1 (S2), where S1 – attribute name, S2 – identifier (OID string)", alias="Type") 22 | data: StrictStr = Field(description="Extension binary data. Base64 encoded.", alias="Data") 23 | __properties: ClassVar[List[str]] = ["Type", "Data"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of RfidPkiExtension from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of RfidPkiExtension from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "Type": obj.get("Type"), 77 | "Data": obj.get("Data") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_raw_data.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class RfidRawData(BaseModel): 18 | """ 19 | RfidRawData 20 | """ # noqa: E501 21 | data: StrictStr = Field(alias="Data") 22 | field_type: StrictInt = Field(alias="FieldType") 23 | __properties: ClassVar[List[str]] = ["Data", "FieldType"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of RfidRawData from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | return _dict 65 | 66 | @classmethod 67 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 68 | """Create an instance of RfidRawData from a dict""" 69 | if obj is None: 70 | return None 71 | 72 | if not isinstance(obj, dict): 73 | return cls.model_validate(obj) 74 | 75 | _obj = cls.model_validate({ 76 | "Data": obj.get("Data"), 77 | "FieldType": obj.get("FieldType") 78 | }) 79 | return _obj 80 | 81 | 82 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_terminal_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidTerminalType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of terminal within the context of the communication session with electronic document 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNDEFINED = 0 22 | INSPECTION_SYSTEM = 1 23 | AUTHENTICATION_TERMINAL = 2 24 | SIGNATURE_TERMINAL = 3 25 | UNAUTHENTICATED_TERMINAL = 4 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of RfidTerminalType from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfid_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RfidType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants specifying the type of the RFID-chip by the physical parameters of connection between antennas of the chip and the reader 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | UNKNOWN = 0 22 | A = 1 23 | B = 2 24 | 25 | @classmethod 26 | def from_json(cls, json_str: str) -> Self: 27 | """Create an instance of RfidType from a JSON string""" 28 | return cls(json.loads(json_str)) 29 | 30 | 31 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/rfidpkd_resource_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class RFIDPKDResourceType(int, Enum): 14 | """ 15 | Enumeration contains a set of constants that define the type of certificate 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | CERTIFICATE_PA = 0 22 | CERTIFICATE_TA = 1 23 | LDIF = 2 24 | CRL = 3 25 | ML = 4 26 | DEFL = 5 27 | DEVL = 6 28 | BL = 7 29 | 30 | @classmethod 31 | def from_json(cls, json_str: str) -> Self: 32 | """Create an instance of RFIDPKDResourceType from a JSON string""" 33 | return cls(json.loads(json_str)) 34 | 35 | 36 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/scenario.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Scenario(str, Enum): 14 | """ 15 | Document processing scenario 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | MRZ = 'Mrz' 22 | BARCODE = 'Barcode' 23 | LOCATE = 'Locate' 24 | OCR = 'Ocr' 25 | DOCTYPE = 'DocType' 26 | MRZ_OR_BARCODE = 'MrzOrBarcode' 27 | MRZ_OR_LOCATE = 'MrzOrLocate' 28 | MRZ_AND_LOCATE = 'MrzAndLocate' 29 | BARCODE_AND_LOCATE = 'BarcodeAndLocate' 30 | MRZ_OR_OCR = 'MrzOrOcr' 31 | MRZ_OR_BARCODE_OR_OCR = 'MrzOrBarcodeOrOcr' 32 | LOCATE_VISUAL_AND_MRZ_OR_OCR = 'LocateVisual_And_MrzOrOcr' 33 | FULL_PROCESS = 'FullProcess' 34 | FULL_AUTH = 'FullAuth' 35 | RUS_STAMP = 'RusStamp' 36 | OCR_FREE = 'OcrFree' 37 | CREDIT_CARD = 'CreditCard' 38 | CAPTURE = 'Capture' 39 | DTC = 'DTC' 40 | RFID = 'RFID' 41 | 42 | @classmethod 43 | def from_json(cls, json_str: str) -> Self: 44 | """Create an instance of Scenario from a JSON string""" 45 | return cls(json.loads(json_str)) 46 | 47 | 48 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/security_feature_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class SecurityFeatureType(int, Enum): 14 | """ 15 | Enumeration contains identifiers determining type of features for a document authenticity checks: https://docs.regulaforensics.com/develop/doc-reader-sdk/web-service/development/enums/security-feature-type/ 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | BLANK = 0 22 | FILL = 1 23 | PHOTO = 2 24 | MRZ = 3 25 | FALSE_LUMINESCENCE = 4 26 | HOLO_SIMPLE = 5 27 | HOLO_VERIFY_STATIC = 6 28 | HOLO_VERIFY_MULTI_STATIC = 7 29 | HOLO_VERIFY_DYNAMIC = 8 30 | PATTERN_NOT_INTERRUPTED = 9 31 | PATTERN_NOT_SHIFTED = 10 32 | PATTERN_SAME_COLORS = 11 33 | PATTERN_IR_INVISIBLE = 12 34 | PHOTO_SIZE_CHECK = 13 35 | PORTRAIT_COMPARISON_VS_GHOST = 14 36 | PORTRAIT_COMPARISON_VS_RFID = 15 37 | PORTRAIT_COMPARISON_VS_VISUAL = 16 38 | BARCODE = 17 39 | PATTERN_DIFFERENT_LINES_THICKNESS = 18 40 | PORTRAIT_COMPARISON_VS_CAMERA = 19 41 | PORTRAIT_COMPARISON_RFID_VS_CAMERA = 20 42 | GHOST_PHOTO = 21 43 | CLEAR_GHOST_PHOTO = 22 44 | INVISIBLE_OBJECT = 23 45 | LOW_CONTRAST_OBJECT = 24 46 | PHOTO_COLOR = 25 47 | PHOTO_SHAPE = 26 48 | PHOTO_CORNERS = 27 49 | OCR = 28 50 | PORTRAIT_COMPARISON_EXT_VS_VISUAL = 29 51 | PORTRAIT_COMPARISON_EXT_VS_RFID = 30 52 | PORTRAIT_COMPARISON_EXT_VS_CAMERA = 31 53 | LIVENESS_DEPTH = 32 54 | MICRO_TEXT = 33 55 | FLUORESCENT_OBJECT = 34 56 | LANDMARK_CHECK = 35 57 | FACE_PRESENCE = 36 58 | FACE_ABSENCE = 38 59 | LIVENESS_SCREEN_CAPTURE = 39 60 | LIVENESS_ELECTRONIC_DEVICE = 40 61 | LIVENESS_OVI = 41 62 | BARCODE_SIZE_CHECK = 42 63 | LASINK = 43 64 | LIVENESS_MLI = 44 65 | LIVENESS_BARCODE_BACKGROUND = 45 66 | PORTRAIT_COMPARISON_VS_BARCODE = 46 67 | PORTRAIT_COMPARISON_RFID_VS_BARCODE = 47 68 | PORTRAIT_COMPARISON_EXT_VS_BARCODE = 48 69 | PORTRAIT_COMPARISON_BARCODE_VS_CAMERA = 49 70 | CHECK_DIGITAL_SIGNATURE = 50 71 | CONTACT_CHIP_CLASSIFICATION = 51 72 | HEAD_POSITION_CHECK = 52 73 | LIVENESS_BLACK_AND_WHITE_COPY_CHECK = 53 74 | LIVENESS_DYNAPRINT = 54 75 | LIVENESS_GEOMETRY_CHECK = 55 76 | 77 | @classmethod 78 | def from_json(cls, json_str: str) -> Self: 79 | """Create an instance of SecurityFeatureType from a JSON string""" 80 | return cls(json.loads(json_str)) 81 | 82 | 83 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/security_object_certificates.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.certificate_data import CertificateData 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class SecurityObjectCertificates(BaseModel): 19 | """ 20 | SecurityObjectCertificates 21 | """ # noqa: E501 22 | certificate_data: Optional[CertificateData] = Field(default=None, alias="Certificate_Data") 23 | __properties: ClassVar[List[str]] = ["Certificate_Data"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of SecurityObjectCertificates from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of certificate_data 65 | if self.certificate_data: 66 | _dict['Certificate_Data'] = self.certificate_data.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of SecurityObjectCertificates from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "Certificate_Data": CertificateData.from_dict(obj["Certificate_Data"]) if obj.get("Certificate_Data") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/source.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Source(str, Enum): 14 | """ 15 | Document data sources 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | MRZ = 'MRZ' 22 | VISUAL = 'VISUAL' 23 | BARCODE = 'BARCODE' 24 | RFID = 'RFID' 25 | MAGNETIC = 'MAGNETIC' 26 | EXTERNAL = 'EXTERNAL' 27 | 28 | @classmethod 29 | def from_json(cls, json_str: str) -> Self: 30 | """Create an instance of Source from a JSON string""" 31 | return cls(json.loads(json_str)) 32 | 33 | 34 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/source_validity.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.check_result import CheckResult 15 | from regula.documentreader.webclient.gen.models.source import Source 16 | from typing import Optional, Set 17 | from typing_extensions import Self 18 | 19 | class SourceValidity(BaseModel): 20 | """ 21 | SourceValidity 22 | """ # noqa: E501 23 | source: Source 24 | status: CheckResult 25 | __properties: ClassVar[List[str]] = ["source", "status"] 26 | 27 | model_config = ConfigDict( 28 | populate_by_name=True, 29 | validate_assignment=True, 30 | protected_namespaces=(), 31 | ) 32 | 33 | 34 | def to_str(self) -> str: 35 | """Returns the string representation of the model using alias""" 36 | return pprint.pformat(self.model_dump(by_alias=True)) 37 | 38 | def to_json(self) -> str: 39 | """Returns the JSON representation of the model using alias""" 40 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 41 | return json.dumps(self.to_dict()) 42 | 43 | @classmethod 44 | def from_json(cls, json_str: str) -> Optional[Self]: 45 | """Create an instance of SourceValidity from a JSON string""" 46 | return cls.from_dict(json.loads(json_str)) 47 | 48 | def to_dict(self) -> Dict[str, Any]: 49 | """Return the dictionary representation of the model using alias. 50 | 51 | This has the following differences from calling pydantic's 52 | `self.model_dump(by_alias=True)`: 53 | 54 | * `None` is only added to the output dict for nullable fields that 55 | were set at model initialization. Other fields with value `None` 56 | are ignored. 57 | """ 58 | excluded_fields: Set[str] = set([ 59 | ]) 60 | 61 | _dict = self.model_dump( 62 | by_alias=True, 63 | exclude=excluded_fields, 64 | exclude_none=True, 65 | ) 66 | return _dict 67 | 68 | @classmethod 69 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 70 | """Create an instance of SourceValidity from a dict""" 71 | if obj is None: 72 | return None 73 | 74 | if not isinstance(obj, dict): 75 | return cls.model_validate(obj) 76 | 77 | _obj = cls.model_validate({ 78 | "source": obj.get("source"), 79 | "status": obj.get("status") 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/status_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.status import Status 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class StatusItem(BaseModel): 19 | """ 20 | StatusItem 21 | """ # noqa: E501 22 | status: Status = Field(alias="Status") 23 | __properties: ClassVar[List[str]] = ["Status"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of StatusItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of status 65 | if self.status: 66 | _dict['Status'] = self.status.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of StatusItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "Status": Status.from_dict(obj["Status"]) if obj.get("Status") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/symbol.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class Symbol(BaseModel): 18 | """ 19 | Symbol 20 | """ # noqa: E501 21 | bounding_rect: List[StrictInt] = Field(alias="boundingRect") 22 | __properties: ClassVar[List[str]] = ["boundingRect"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of Symbol from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of Symbol from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "boundingRect": obj.get("boundingRect") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/t_doc_binary_info_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.t_doc_binary_info import TDocBinaryInfo 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class TDocBinaryInfoItem(BaseModel): 19 | """ 20 | TDocBinaryInfoItem 21 | """ # noqa: E501 22 | t_doc_binary_info: TDocBinaryInfo = Field(alias="TDocBinaryInfo") 23 | __properties: ClassVar[List[str]] = ["TDocBinaryInfo"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of TDocBinaryInfoItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of t_doc_binary_info 65 | if self.t_doc_binary_info: 66 | _dict['TDocBinaryInfo'] = self.t_doc_binary_info.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of TDocBinaryInfoItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "TDocBinaryInfo": TDocBinaryInfo.from_dict(obj["TDocBinaryInfo"]) if obj.get("TDocBinaryInfo") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/text_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field 13 | from typing import Any, ClassVar, Dict, List 14 | from regula.documentreader.webclient.gen.models.text import Text 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class TextItem(BaseModel): 19 | """ 20 | TextItem 21 | """ # noqa: E501 22 | text: Text = Field(alias="Text") 23 | __properties: ClassVar[List[str]] = ["Text"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of TextItem from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of text 65 | if self.text: 66 | _dict['Text'] = self.text.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of TextItem from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "Text": Text.from_dict(obj["Text"]) if obj.get("Text") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/text_post_processing.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class TextPostProcessing(int, Enum): 14 | """ 15 | TextPostProcessing 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | NO_CHANGE = 0 22 | UPPERCASE = 1 23 | LOWERCASE = 2 24 | CAPITAL = 3 25 | 26 | @classmethod 27 | def from_json(cls, json_str: str) -> Self: 28 | """Create an instance of TextPostProcessing from a JSON string""" 29 | return cls(json.loads(json_str)) 30 | 31 | 32 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/transaction_image.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict 13 | from typing import Any, ClassVar, Dict, List, Optional 14 | from regula.documentreader.webclient.gen.models.images_field_value import ImagesFieldValue 15 | from typing import Optional, Set 16 | from typing_extensions import Self 17 | 18 | class TransactionImage(BaseModel): 19 | """ 20 | TransactionImage 21 | """ # noqa: E501 22 | image: Optional[ImagesFieldValue] = None 23 | __properties: ClassVar[List[str]] = ["image"] 24 | 25 | model_config = ConfigDict( 26 | populate_by_name=True, 27 | validate_assignment=True, 28 | protected_namespaces=(), 29 | ) 30 | 31 | 32 | def to_str(self) -> str: 33 | """Returns the string representation of the model using alias""" 34 | return pprint.pformat(self.model_dump(by_alias=True)) 35 | 36 | def to_json(self) -> str: 37 | """Returns the JSON representation of the model using alias""" 38 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 39 | return json.dumps(self.to_dict()) 40 | 41 | @classmethod 42 | def from_json(cls, json_str: str) -> Optional[Self]: 43 | """Create an instance of TransactionImage from a JSON string""" 44 | return cls.from_dict(json.loads(json_str)) 45 | 46 | def to_dict(self) -> Dict[str, Any]: 47 | """Return the dictionary representation of the model using alias. 48 | 49 | This has the following differences from calling pydantic's 50 | `self.model_dump(by_alias=True)`: 51 | 52 | * `None` is only added to the output dict for nullable fields that 53 | were set at model initialization. Other fields with value `None` 54 | are ignored. 55 | """ 56 | excluded_fields: Set[str] = set([ 57 | ]) 58 | 59 | _dict = self.model_dump( 60 | by_alias=True, 61 | exclude=excluded_fields, 62 | exclude_none=True, 63 | ) 64 | # override the default output from pydantic by calling `to_dict()` of image 65 | if self.image: 66 | _dict['image'] = self.image.to_dict() 67 | return _dict 68 | 69 | @classmethod 70 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 71 | """Create an instance of TransactionImage from a dict""" 72 | if obj is None: 73 | return None 74 | 75 | if not isinstance(obj, dict): 76 | return cls.model_validate(obj) 77 | 78 | _obj = cls.model_validate({ 79 | "image": ImagesFieldValue.from_dict(obj["image"]) if obj.get("image") is not None else None 80 | }) 81 | return _obj 82 | 83 | 84 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/transaction_process_response_item.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import pprint 9 | import re # noqa: F401 10 | import json 11 | 12 | from pydantic import BaseModel, ConfigDict, Field, StrictInt 13 | from typing import Any, ClassVar, Dict, List 14 | from typing import Optional, Set 15 | from typing_extensions import Self 16 | 17 | class TransactionProcessResponseItem(BaseModel): 18 | """ 19 | TransactionProcessResponseItem 20 | """ # noqa: E501 21 | core_lib_result_code: StrictInt = Field(alias="CoreLibResultCode") 22 | __properties: ClassVar[List[str]] = ["CoreLibResultCode"] 23 | 24 | model_config = ConfigDict( 25 | populate_by_name=True, 26 | validate_assignment=True, 27 | protected_namespaces=(), 28 | ) 29 | 30 | 31 | def to_str(self) -> str: 32 | """Returns the string representation of the model using alias""" 33 | return pprint.pformat(self.model_dump(by_alias=True)) 34 | 35 | def to_json(self) -> str: 36 | """Returns the JSON representation of the model using alias""" 37 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 38 | return json.dumps(self.to_dict()) 39 | 40 | @classmethod 41 | def from_json(cls, json_str: str) -> Optional[Self]: 42 | """Create an instance of TransactionProcessResponseItem from a JSON string""" 43 | return cls.from_dict(json.loads(json_str)) 44 | 45 | def to_dict(self) -> Dict[str, Any]: 46 | """Return the dictionary representation of the model using alias. 47 | 48 | This has the following differences from calling pydantic's 49 | `self.model_dump(by_alias=True)`: 50 | 51 | * `None` is only added to the output dict for nullable fields that 52 | were set at model initialization. Other fields with value `None` 53 | are ignored. 54 | """ 55 | excluded_fields: Set[str] = set([ 56 | ]) 57 | 58 | _dict = self.model_dump( 59 | by_alias=True, 60 | exclude=excluded_fields, 61 | exclude_none=True, 62 | ) 63 | return _dict 64 | 65 | @classmethod 66 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 67 | """Create an instance of TransactionProcessResponseItem from a dict""" 68 | if obj is None: 69 | return None 70 | 71 | if not isinstance(obj, dict): 72 | return cls.model_validate(obj) 73 | 74 | _obj = cls.model_validate({ 75 | "CoreLibResultCode": obj.get("CoreLibResultCode") 76 | }) 77 | return _obj 78 | 79 | 80 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/verification_result.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class VerificationResult(int, Enum): 14 | """ 15 | VerificationResult 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | DISABLED = 0 22 | VERIFIED = 1 23 | NOT_VERIFIED = 2 24 | COMPARE_MATCH = 3 25 | COMPARE_NOT_MATCH = 4 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of VerificationResult from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/models/visibility.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Generated by: https://openapi-generator.tech 5 | """ 6 | 7 | from __future__ import annotations 8 | import json 9 | from enum import Enum 10 | from typing_extensions import Self 11 | 12 | 13 | class Visibility(int, Enum): 14 | """ 15 | Enumeration contains visibility status of the security element 16 | """ 17 | 18 | """ 19 | allowed enum values 20 | """ 21 | INVISIBLE = 0 22 | VISIBLE = 1 23 | COLORED = 2 24 | GRAYSCALE = 4 25 | WHITE_IR_MATCHING = 8 26 | 27 | @classmethod 28 | def from_json(cls, json_str: str) -> Self: 29 | """Create an instance of Visibility from a JSON string""" 30 | return cls(json.loads(json_str)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /regula/documentreader/webclient/gen/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/DocumentReader-web-python-client/1ab57bcfc343bdfd6d7e158c7008f833074832c8/regula/documentreader/webclient/gen/py.typed -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | import os 3 | 4 | from setuptools import setup, find_packages 5 | 6 | with open("README.md", "r") as fh: 7 | long_description = fh.read() 8 | 9 | setup( 10 | name="regula_documentreader_webclient", 11 | version=os.getenv("PACKAGE_VERSION_TO_PUBLISH", "7.4.45"), 12 | python_requires=">=3.9", 13 | description="Regula's Document Reader python client", 14 | long_description=long_description, 15 | long_description_content_type="text/markdown", 16 | author="Regula Forensics, Inc.", 17 | author_email="support@regulaforensics.com", 18 | url="https://regulaforensics.com", 19 | keywords=[ 20 | "document-reader-client", 21 | "document reader", 22 | "document recognition", 23 | "regulaforensics", 24 | "regula", 25 | ], 26 | install_requires=[ 27 | "certifi>=2024.07.04", 28 | "six>=1.10", 29 | "python-dateutil>=2.8.2", 30 | "urllib3>=1.25.3, <3.0.0", 31 | "vistir>=0.4.0, <=0.6.1", 32 | "idna==3.7", 33 | "requests>=2.32.3", 34 | "pydantic>=2", 35 | "typing-extensions>=4.7.1", 36 | ], 37 | packages=find_packages(exclude=["test", "tests", "example"]), 38 | include_package_data=True, 39 | ) 40 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | python3 -m venv venv 2 | 3 | source venv/bin/activate 4 | 5 | pip install -e ./ 6 | 7 | cd example || exit 8 | 9 | python3 example.py 10 | -------------------------------------------------------------------------------- /update-models.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DOCS_DEFINITION_FOLDER="${PWD}/../DocumentReader-web-openapi" \ 4 | \ 5 | && docker run --user "$(id -u):$(id -g)" --rm \ 6 | -v "${PWD}:/client" \ 7 | -v "$DOCS_DEFINITION_FOLDER:/definitions" \ 8 | openapitools/openapi-generator-cli:v7.13.0 generate \ 9 | -g python \ 10 | -i /definitions/index.yml \ 11 | -o /client \ 12 | -t /client/generator-templates \ 13 | -c /client/generator-config.json || exit 1 14 | --------------------------------------------------------------------------------