regula.documentreader.webclient 9.1.2.dev0__py3-none-any.whl → 9.1.3.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. regula/documentreader/webclient/gen/__init__.py +45 -0
  2. regula/documentreader/webclient/gen/models/__init__.py +30 -0
  3. regula/documentreader/webclient/gen/models/container_list_list_inner.py +36 -8
  4. regula/documentreader/webclient/gen/models/details_age.py +93 -0
  5. regula/documentreader/webclient/gen/models/doc_feature.py +88 -0
  6. regula/documentreader/webclient/gen/models/mdl_device_engagement.py +29 -0
  7. regula/documentreader/webclient/gen/models/mdl_device_retrieval.py +30 -0
  8. regula/documentreader/webclient/gen/models/mdl_server_retrieval.py +29 -0
  9. regula/documentreader/webclient/gen/models/message.py +98 -0
  10. regula/documentreader/webclient/gen/models/pid.py +88 -0
  11. regula/documentreader/webclient/gen/models/result.py +6 -0
  12. regula/documentreader/webclient/gen/models/result_item.py +9 -3
  13. regula/documentreader/webclient/gen/models/status.py +12 -2
  14. regula/documentreader/webclient/gen/models/text_field_type.py +3 -0
  15. regula/documentreader/webclient/gen/models/trf_ft_string.py +1 -1
  16. regula/documentreader/webclient/gen/models/vd_item.py +90 -0
  17. regula/documentreader/webclient/gen/models/vds_data.py +126 -0
  18. regula/documentreader/webclient/gen/models/vds_data_item.py +86 -0
  19. regula/documentreader/webclient/gen/models/vds_data_result.py +93 -0
  20. regula/documentreader/webclient/gen/models/vdsnc_data.py +117 -0
  21. regula/documentreader/webclient/gen/models/vdsnc_data_item.py +86 -0
  22. regula/documentreader/webclient/gen/models/vdsnc_data_result.py +93 -0
  23. regula/documentreader/webclient/gen/models/ve_item.py +96 -0
  24. {regula_documentreader_webclient-9.1.2.dev0.dist-info → regula_documentreader_webclient-9.1.3.dev0.dist-info}/METADATA +1 -1
  25. {regula_documentreader_webclient-9.1.2.dev0.dist-info → regula_documentreader_webclient-9.1.3.dev0.dist-info}/RECORD +27 -12
  26. {regula_documentreader_webclient-9.1.2.dev0.dist-info → regula_documentreader_webclient-9.1.3.dev0.dist-info}/WHEEL +0 -0
  27. {regula_documentreader_webclient-9.1.2.dev0.dist-info → regula_documentreader_webclient-9.1.3.dev0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,29 @@
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 MDLServerRetrieval(int, Enum):
14
+ """
15
+ MDLServerRetrieval
16
+ """
17
+
18
+ """
19
+ allowed enum values
20
+ """
21
+ WEB_API = 0
22
+ OIDC = 1
23
+
24
+ @classmethod
25
+ def from_json(cls, json_str: str) -> Self:
26
+ """Create an instance of MDLServerRetrieval from a JSON string"""
27
+ return cls(json.loads(json_str))
28
+
29
+
@@ -0,0 +1,98 @@
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, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional
14
+ from regula.documentreader.webclient.gen.models.pid import PID
15
+ from regula.documentreader.webclient.gen.models.ve_item import VEItem
16
+ from typing import Optional, Set
17
+ from typing_extensions import Self
18
+ from pydantic import SkipValidation, Field
19
+
20
+ class Message(BaseModel):
21
+ """
22
+ Message
23
+ """ # noqa: E501
24
+ pid: SkipValidation[Optional[PID]] = Field(alias="pid", default=None)
25
+ uvci: SkipValidation[Optional[str]] = Field(alias="uvci", default=None)
26
+ ve: SkipValidation[Optional[List[VEItem]]] = Field(alias="ve", default=None)
27
+ __properties: ClassVar[List[str]] = ["pid", "uvci", "ve"]
28
+
29
+ model_config = ConfigDict(
30
+ populate_by_name=True,
31
+ validate_assignment=True,
32
+ protected_namespaces=(),
33
+ arbitrary_types_allowed=True,
34
+ use_enum_values=True
35
+ )
36
+
37
+
38
+ def to_str(self) -> str:
39
+ """Returns the string representation of the model using alias"""
40
+ return pprint.pformat(self.model_dump(by_alias=True))
41
+
42
+ def to_json(self) -> str:
43
+ """Returns the JSON representation of the model using alias"""
44
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
45
+ return json.dumps(self.to_dict())
46
+
47
+ @classmethod
48
+ def from_json(cls, json_str: str) -> Optional[Self]:
49
+ """Create an instance of Message from a JSON string"""
50
+ return cls.from_dict(json.loads(json_str))
51
+
52
+ def to_dict(self) -> Dict[str, Any]:
53
+ """Return the dictionary representation of the model using alias.
54
+
55
+ This has the following differences from calling pydantic's
56
+ `self.model_dump(by_alias=True)`:
57
+
58
+ * `None` is only added to the output dict for nullable fields that
59
+ were set at model initialization. Other fields with value `None`
60
+ are ignored.
61
+ """
62
+ excluded_fields: Set[str] = set([
63
+ ])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ # override the default output from pydantic by calling `to_dict()` of pid
71
+ if self.pid:
72
+ _dict['pid'] = self.pid.to_dict()
73
+ # override the default output from pydantic by calling `to_dict()` of each item in ve (list)
74
+ _items = []
75
+ if self.ve:
76
+ for _item_ve in self.ve:
77
+ if _item_ve:
78
+ _items.append(_item_ve.to_dict())
79
+ _dict['ve'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of Message from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "pid": PID.from_dict(obj["pid"]) if obj.get("pid") is not None else None,
93
+ "uvci": obj.get("uvci"),
94
+ "ve": [VEItem.from_dict(_item) for _item in obj.get("ve", []) if VEItem.from_dict(_item) is not None]
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,88 @@
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, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional
14
+ from typing import Optional, Set
15
+ from typing_extensions import Self
16
+ from pydantic import SkipValidation, Field
17
+
18
+ class PID(BaseModel):
19
+ """
20
+ PID
21
+ """ # noqa: E501
22
+ dob: SkipValidation[Optional[str]] = Field(alias="dob", default=None)
23
+ i: SkipValidation[Optional[str]] = Field(alias="i", default=None)
24
+ n: SkipValidation[Optional[str]] = Field(alias="n", default=None)
25
+ sex: SkipValidation[Optional[str]] = Field(alias="sex", default=None)
26
+ __properties: ClassVar[List[str]] = ["dob", "i", "n", "sex"]
27
+
28
+ model_config = ConfigDict(
29
+ populate_by_name=True,
30
+ validate_assignment=True,
31
+ protected_namespaces=(),
32
+ arbitrary_types_allowed=True,
33
+ use_enum_values=True
34
+ )
35
+
36
+
37
+ def to_str(self) -> str:
38
+ """Returns the string representation of the model using alias"""
39
+ return pprint.pformat(self.model_dump(by_alias=True))
40
+
41
+ def to_json(self) -> str:
42
+ """Returns the JSON representation of the model using alias"""
43
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
44
+ return json.dumps(self.to_dict())
45
+
46
+ @classmethod
47
+ def from_json(cls, json_str: str) -> Optional[Self]:
48
+ """Create an instance of PID from a JSON string"""
49
+ return cls.from_dict(json.loads(json_str))
50
+
51
+ def to_dict(self) -> Dict[str, Any]:
52
+ """Return the dictionary representation of the model using alias.
53
+
54
+ This has the following differences from calling pydantic's
55
+ `self.model_dump(by_alias=True)`:
56
+
57
+ * `None` is only added to the output dict for nullable fields that
58
+ were set at model initialization. Other fields with value `None`
59
+ are ignored.
60
+ """
61
+ excluded_fields: Set[str] = set([
62
+ ])
63
+
64
+ _dict = self.model_dump(
65
+ by_alias=True,
66
+ exclude=excluded_fields,
67
+ exclude_none=True,
68
+ )
69
+ return _dict
70
+
71
+ @classmethod
72
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
73
+ """Create an instance of PID from a dict"""
74
+ if obj is None:
75
+ return None
76
+
77
+ if not isinstance(obj, dict):
78
+ return cls.model_validate(obj)
79
+
80
+ _obj = cls.model_validate({
81
+ "dob": obj.get("dob"),
82
+ "i": obj.get("i"),
83
+ "n": obj.get("n"),
84
+ "sex": obj.get("sex")
85
+ })
86
+ return _obj
87
+
88
+
@@ -54,6 +54,12 @@ class Result(int, Enum):
54
54
  RFID_BINARY_DATA = 104
55
55
  RFID_ORIGINAL_GRAPHICS = 105
56
56
  DTC_VC = 109
57
+ MDL_DEVICE_RAW_RESPONSE = 120
58
+ MDL_DEVICE_PARSED_RESPONSE = 121
59
+ MDL_SERVER_RAW_RESPONSE = 122
60
+ MDL_SERVER_PARSED_RESPONSE = 123
61
+ VDS_NC = 124
62
+ VDS = 125
57
63
 
58
64
  @classmethod
59
65
  def from_json(cls, json_str: str) -> Self:
@@ -26,6 +26,8 @@ if TYPE_CHECKING:
26
26
  from regula.documentreader.webclient.gen.models.document_binary_info_result import DocumentBinaryInfoResult
27
27
  from regula.documentreader.webclient.gen.models.rfid_graphics_info_result import RFIDGraphicsInfoResult
28
28
  from regula.documentreader.webclient.gen.models.byte_array_result import ByteArrayResult
29
+ from regula.documentreader.webclient.gen.models.vdsnc_data_result import VDSNCDataResult
30
+ from regula.documentreader.webclient.gen.models.vds_data_result import VDSDataResult
29
31
  from regula.documentreader.webclient.gen.models.lexical_analysis_result import LexicalAnalysisResult
30
32
  from regula.documentreader.webclient.gen.models.document_image_result import DocumentImageResult
31
33
  from regula.documentreader.webclient.gen.models.text_data_result import TextDataResult
@@ -81,7 +83,7 @@ class ResultItem(BaseModel):
81
83
 
82
84
  # discriminator mappings
83
85
  __discriminator_value_class_map: ClassVar[Dict[str, str]] = {
84
- '1': 'DocumentImageResult','101': 'DocumentBinaryInfoResult','102': 'RFIDTextDataResult','103': 'GraphicsResult','104': 'DocumentBinaryInfoResult','105': 'RFIDGraphicsInfoResult','109': 'ByteArrayResult','15': 'LexicalAnalysisResult','16': 'DocumentImageResult','17': 'TextDataResult','18': 'TextDataResult','19': 'GraphicsResult','20': 'AuthenticityResult','26': 'TextDataResult','3': 'TextDataResult','30': 'ImageQualityResult','32': 'GraphicsResult','33': 'StatusResult','34': 'AuthenticityResult','35': 'GraphicsResult','36': 'TextResult','37': 'ImagesResult','38': 'GraphicsResult','39': 'AuthenticityResult','49': 'EncryptedRCLResult','5': 'DocBarCodeInfo','50': 'LicenseResult','6': 'GraphicsResult','61': 'MRZPositionResult','62': 'BarcodePositionResult','7': 'MRZTestQualityResult','8': 'DocumentTypesCandidatesResult','85': 'DocumentPositionResult','87': 'MRZDetectorResult','9': 'ChosenDocumentTypeResult','97': 'FaceDetectionResult'
86
+ '1': 'DocumentImageResult','101': 'DocumentBinaryInfoResult','102': 'RFIDTextDataResult','103': 'GraphicsResult','104': 'DocumentBinaryInfoResult','105': 'RFIDGraphicsInfoResult','109': 'ByteArrayResult','124': 'VDSNCDataResult','125': 'VDSDataResult','15': 'LexicalAnalysisResult','16': 'DocumentImageResult','17': 'TextDataResult','18': 'TextDataResult','19': 'GraphicsResult','20': 'AuthenticityResult','26': 'TextDataResult','3': 'TextDataResult','30': 'ImageQualityResult','32': 'GraphicsResult','33': 'StatusResult','34': 'AuthenticityResult','35': 'GraphicsResult','36': 'TextResult','37': 'ImagesResult','38': 'GraphicsResult','39': 'AuthenticityResult','49': 'EncryptedRCLResult','5': 'DocBarCodeInfo','50': 'LicenseResult','6': 'GraphicsResult','61': 'MRZPositionResult','62': 'BarcodePositionResult','7': 'MRZTestQualityResult','8': 'DocumentTypesCandidatesResult','85': 'DocumentPositionResult','87': 'MRZDetectorResult','9': 'ChosenDocumentTypeResult','97': 'FaceDetectionResult'
85
87
  }
86
88
 
87
89
  @classmethod
@@ -103,7 +105,7 @@ class ResultItem(BaseModel):
103
105
  return json.dumps(self.to_dict())
104
106
 
105
107
  @classmethod
106
- def from_json(cls, json_str: str) -> Optional[Union[DocumentImageResult, DocumentBinaryInfoResult, RFIDTextDataResult, GraphicsResult, DocumentBinaryInfoResult, RFIDGraphicsInfoResult, ByteArrayResult, LexicalAnalysisResult, DocumentImageResult, TextDataResult, TextDataResult, GraphicsResult, AuthenticityResult, TextDataResult, TextDataResult, ImageQualityResult, GraphicsResult, StatusResult, AuthenticityResult, GraphicsResult, TextResult, ImagesResult, GraphicsResult, AuthenticityResult, EncryptedRCLResult, DocBarCodeInfo, LicenseResult, GraphicsResult, MRZPositionResult, BarcodePositionResult, MRZTestQualityResult, DocumentTypesCandidatesResult, DocumentPositionResult, MRZDetectorResult, ChosenDocumentTypeResult, FaceDetectionResult]]:
108
+ def from_json(cls, json_str: str) -> Optional[Union[DocumentImageResult, DocumentBinaryInfoResult, RFIDTextDataResult, GraphicsResult, DocumentBinaryInfoResult, RFIDGraphicsInfoResult, ByteArrayResult, VDSNCDataResult, VDSDataResult, LexicalAnalysisResult, DocumentImageResult, TextDataResult, TextDataResult, GraphicsResult, AuthenticityResult, TextDataResult, TextDataResult, ImageQualityResult, GraphicsResult, StatusResult, AuthenticityResult, GraphicsResult, TextResult, ImagesResult, GraphicsResult, AuthenticityResult, EncryptedRCLResult, DocBarCodeInfo, LicenseResult, GraphicsResult, MRZPositionResult, BarcodePositionResult, MRZTestQualityResult, DocumentTypesCandidatesResult, DocumentPositionResult, MRZDetectorResult, ChosenDocumentTypeResult, FaceDetectionResult]]:
107
109
  """Create an instance of ResultItem from a JSON string"""
108
110
  return cls.from_dict(json.loads(json_str))
109
111
 
@@ -128,7 +130,7 @@ class ResultItem(BaseModel):
128
130
  return _dict
129
131
 
130
132
  @classmethod
131
- def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DocumentImageResult, DocumentBinaryInfoResult, RFIDTextDataResult, GraphicsResult, DocumentBinaryInfoResult, RFIDGraphicsInfoResult, ByteArrayResult, LexicalAnalysisResult, DocumentImageResult, TextDataResult, TextDataResult, GraphicsResult, AuthenticityResult, TextDataResult, TextDataResult, ImageQualityResult, GraphicsResult, StatusResult, AuthenticityResult, GraphicsResult, TextResult, ImagesResult, GraphicsResult, AuthenticityResult, EncryptedRCLResult, DocBarCodeInfo, LicenseResult, GraphicsResult, MRZPositionResult, BarcodePositionResult, MRZTestQualityResult, DocumentTypesCandidatesResult, DocumentPositionResult, MRZDetectorResult, ChosenDocumentTypeResult, FaceDetectionResult]]:
133
+ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DocumentImageResult, DocumentBinaryInfoResult, RFIDTextDataResult, GraphicsResult, DocumentBinaryInfoResult, RFIDGraphicsInfoResult, ByteArrayResult, VDSNCDataResult, VDSDataResult, LexicalAnalysisResult, DocumentImageResult, TextDataResult, TextDataResult, GraphicsResult, AuthenticityResult, TextDataResult, TextDataResult, ImageQualityResult, GraphicsResult, StatusResult, AuthenticityResult, GraphicsResult, TextResult, ImagesResult, GraphicsResult, AuthenticityResult, EncryptedRCLResult, DocBarCodeInfo, LicenseResult, GraphicsResult, MRZPositionResult, BarcodePositionResult, MRZTestQualityResult, DocumentTypesCandidatesResult, DocumentPositionResult, MRZDetectorResult, ChosenDocumentTypeResult, FaceDetectionResult]]:
132
134
  """Create an instance of ResultItem from a dict"""
133
135
  # look up the object type based on discriminator mapping
134
136
  object_type = cls.get_discriminator_value(obj)
@@ -146,6 +148,10 @@ class ResultItem(BaseModel):
146
148
  return import_module("regula.documentreader.webclient.gen.models.rfid_graphics_info_result").RFIDGraphicsInfoResult.from_dict(obj)
147
149
  if object_type == 'ByteArrayResult':
148
150
  return import_module("regula.documentreader.webclient.gen.models.byte_array_result").ByteArrayResult.from_dict(obj)
151
+ if object_type == 'VDSNCDataResult':
152
+ return import_module("regula.documentreader.webclient.gen.models.vdsnc_data_result").VDSNCDataResult.from_dict(obj)
153
+ if object_type == 'VDSDataResult':
154
+ return import_module("regula.documentreader.webclient.gen.models.vds_data_result").VDSDataResult.from_dict(obj)
149
155
  if object_type == 'LexicalAnalysisResult':
150
156
  return import_module("regula.documentreader.webclient.gen.models.lexical_analysis_result").LexicalAnalysisResult.from_dict(obj)
151
157
  if object_type == 'DocumentImageResult':
@@ -12,6 +12,7 @@ import json
12
12
  from pydantic import BaseModel, ConfigDict, Field
13
13
  from typing import Any, ClassVar, Dict, List, Optional
14
14
  from regula.documentreader.webclient.gen.models.check_result import CheckResult
15
+ from regula.documentreader.webclient.gen.models.details_age import DetailsAge
15
16
  from regula.documentreader.webclient.gen.models.details_optical import DetailsOptical
16
17
  from regula.documentreader.webclient.gen.models.details_rfid import DetailsRFID
17
18
  from typing import Optional, Set
@@ -29,7 +30,10 @@ class Status(BaseModel):
29
30
  stop_list: SkipValidation[CheckResult] = Field(alias="stopList")
30
31
  details_rfid: SkipValidation[Optional[DetailsRFID]] = Field(alias="detailsRFID", default=None)
31
32
  details_optical: SkipValidation[DetailsOptical] = Field(alias="detailsOptical")
32
- __properties: ClassVar[List[str]] = ["overallStatus", "optical", "portrait", "rfid", "stopList", "detailsRFID", "detailsOptical"]
33
+ age: SkipValidation[CheckResult] = Field(alias="age")
34
+ details_age: SkipValidation[DetailsAge] = Field(alias="detailsAge")
35
+ m_dl: SkipValidation[CheckResult] = Field(alias="mDL")
36
+ __properties: ClassVar[List[str]] = ["overallStatus", "optical", "portrait", "rfid", "stopList", "detailsRFID", "detailsOptical", "age", "detailsAge", "mDL"]
33
37
 
34
38
  model_config = ConfigDict(
35
39
  populate_by_name=True,
@@ -78,6 +82,9 @@ class Status(BaseModel):
78
82
  # override the default output from pydantic by calling `to_dict()` of details_optical
79
83
  if self.details_optical:
80
84
  _dict['detailsOptical'] = self.details_optical.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of details_age
86
+ if self.details_age:
87
+ _dict['detailsAge'] = self.details_age.to_dict()
81
88
  return _dict
82
89
 
83
90
  @classmethod
@@ -96,7 +103,10 @@ class Status(BaseModel):
96
103
  "rfid": obj.get("rfid"),
97
104
  "stopList": obj.get("stopList"),
98
105
  "detailsRFID": DetailsRFID.from_dict(obj["detailsRFID"]) if obj.get("detailsRFID") is not None else None,
99
- "detailsOptical": DetailsOptical.from_dict(obj["detailsOptical"]) if obj.get("detailsOptical") is not None else None
106
+ "detailsOptical": DetailsOptical.from_dict(obj["detailsOptical"]) if obj.get("detailsOptical") is not None else None,
107
+ "age": obj.get("age"),
108
+ "detailsAge": DetailsAge.from_dict(obj["detailsAge"]) if obj.get("detailsAge") is not None else None,
109
+ "mDL": obj.get("mDL")
100
110
  })
101
111
  return _obj
102
112
 
@@ -667,6 +667,9 @@ class TextFieldType(int, Enum):
667
667
  FT_NATIONALITY_CODE_ALPHA2 = 697
668
668
  FT_FIRST_ISSUE_DATE_CHECK_DIGIT = 698
669
669
  FT_FIRST_ISSUE_DATE_CHECKSUM = 699
670
+ FT_COMMERCIAL_INDICATOR = 701
671
+ FT_NON_DOMICILED_INDICATOR = 702
672
+ FT_JURISDICTION_SPECIFIC_DATA = 703
670
673
 
671
674
  @classmethod
672
675
  def from_json(cls, json_str: str) -> Self:
@@ -22,7 +22,7 @@ class TrfFtString(BaseModel):
22
22
  type: SkipValidation[Optional[int]] = Field(alias="Type", default=None)
23
23
  status: SkipValidation[Optional[int]] = Field(alias="Status", default=None, description="Result of logical analysis of compliance of the contents of the field with the requirements of the specification")
24
24
  format: SkipValidation[Optional[str]] = Field(alias="Format", default=None, description="Mask of format of text information (for example, «YYMMDD» for date of birth)")
25
- data: SkipValidation[str] = Field(alias="Data", description="Numeric value.")
25
+ data: SkipValidation[Optional[str]] = Field(alias="Data", default=None, description="Numeric value.")
26
26
  __properties: ClassVar[List[str]] = ["Type", "Status", "Format", "Data"]
27
27
 
28
28
  model_config = ConfigDict(
@@ -0,0 +1,90 @@
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, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional
14
+ from typing import Optional, Set
15
+ from typing_extensions import Self
16
+ from pydantic import SkipValidation, Field
17
+
18
+ class VDItem(BaseModel):
19
+ """
20
+ VDItem
21
+ """ # noqa: E501
22
+ adm: SkipValidation[Optional[str]] = Field(alias="adm", default=None)
23
+ ctr: SkipValidation[Optional[str]] = Field(alias="ctr", default=None)
24
+ dvc: SkipValidation[Optional[str]] = Field(alias="dvc", default=None)
25
+ lot: SkipValidation[Optional[str]] = Field(alias="lot", default=None)
26
+ seq: SkipValidation[Optional[int]] = Field(alias="seq", default=None)
27
+ __properties: ClassVar[List[str]] = ["adm", "ctr", "dvc", "lot", "seq"]
28
+
29
+ model_config = ConfigDict(
30
+ populate_by_name=True,
31
+ validate_assignment=True,
32
+ protected_namespaces=(),
33
+ arbitrary_types_allowed=True,
34
+ use_enum_values=True
35
+ )
36
+
37
+
38
+ def to_str(self) -> str:
39
+ """Returns the string representation of the model using alias"""
40
+ return pprint.pformat(self.model_dump(by_alias=True))
41
+
42
+ def to_json(self) -> str:
43
+ """Returns the JSON representation of the model using alias"""
44
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
45
+ return json.dumps(self.to_dict())
46
+
47
+ @classmethod
48
+ def from_json(cls, json_str: str) -> Optional[Self]:
49
+ """Create an instance of VDItem from a JSON string"""
50
+ return cls.from_dict(json.loads(json_str))
51
+
52
+ def to_dict(self) -> Dict[str, Any]:
53
+ """Return the dictionary representation of the model using alias.
54
+
55
+ This has the following differences from calling pydantic's
56
+ `self.model_dump(by_alias=True)`:
57
+
58
+ * `None` is only added to the output dict for nullable fields that
59
+ were set at model initialization. Other fields with value `None`
60
+ are ignored.
61
+ """
62
+ excluded_fields: Set[str] = set([
63
+ ])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of VDItem from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({
82
+ "adm": obj.get("adm"),
83
+ "ctr": obj.get("ctr"),
84
+ "dvc": obj.get("dvc"),
85
+ "lot": obj.get("lot"),
86
+ "seq": obj.get("seq")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,126 @@
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, Optional
14
+ from regula.documentreader.webclient.gen.models.doc_feature import DocFeature
15
+ from regula.documentreader.webclient.gen.models.rfid_certificate_ex import RfidCertificateEx
16
+ from regula.documentreader.webclient.gen.models.trf_ft_bytes import TrfFtBytes
17
+ from typing import Optional, Set
18
+ from typing_extensions import Self
19
+ from pydantic import SkipValidation, Field
20
+
21
+ class VDSData(BaseModel):
22
+ """
23
+ VDSData
24
+ """ # noqa: E501
25
+ certificate: SkipValidation[Optional[str]] = Field(alias="Certificate", default=None)
26
+ certificate_chain: SkipValidation[Optional[List[RfidCertificateEx]]] = Field(alias="CertificateChain", default=None)
27
+ doc_features: SkipValidation[Optional[List[DocFeature]]] = Field(alias="DocFeatures", default=None)
28
+ doc_issue_date: SkipValidation[Optional[str]] = Field(alias="DocIssueDate", default=None)
29
+ doc_type: SkipValidation[Optional[int]] = Field(alias="DocType", default=None)
30
+ feature_ref: SkipValidation[Optional[int]] = Field(alias="FeatureRef", default=None)
31
+ issuing_country: SkipValidation[Optional[str]] = Field(alias="IssuingCountry", default=None)
32
+ notifications: SkipValidation[Optional[List[int]]] = Field(alias="Notifications", default=None)
33
+ signature: SkipValidation[Optional[TrfFtBytes]] = Field(alias="Signature", default=None)
34
+ signature_date: SkipValidation[Optional[str]] = Field(alias="SignatureDate", default=None)
35
+ signer: SkipValidation[Optional[str]] = Field(alias="Signer", default=None)
36
+ type: SkipValidation[Optional[int]] = Field(alias="Type", default=None)
37
+ version: SkipValidation[Optional[int]] = Field(alias="Version", default=None)
38
+ __properties: ClassVar[List[str]] = ["Certificate", "CertificateChain", "DocFeatures", "DocIssueDate", "DocType", "FeatureRef", "IssuingCountry", "Notifications", "Signature", "SignatureDate", "Signer", "Type", "Version"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ arbitrary_types_allowed=True,
45
+ use_enum_values=True
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of VDSData from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ # override the default output from pydantic by calling `to_dict()` of each item in certificate_chain (list)
82
+ _items = []
83
+ if self.certificate_chain:
84
+ for _item_certificate_chain in self.certificate_chain:
85
+ if _item_certificate_chain:
86
+ _items.append(_item_certificate_chain.to_dict())
87
+ _dict['CertificateChain'] = _items
88
+ # override the default output from pydantic by calling `to_dict()` of each item in doc_features (list)
89
+ _items = []
90
+ if self.doc_features:
91
+ for _item_doc_features in self.doc_features:
92
+ if _item_doc_features:
93
+ _items.append(_item_doc_features.to_dict())
94
+ _dict['DocFeatures'] = _items
95
+ # override the default output from pydantic by calling `to_dict()` of signature
96
+ if self.signature:
97
+ _dict['Signature'] = self.signature.to_dict()
98
+ return _dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
+ """Create an instance of VDSData from a dict"""
103
+ if obj is None:
104
+ return None
105
+
106
+ if not isinstance(obj, dict):
107
+ return cls.model_validate(obj)
108
+
109
+ _obj = cls.model_validate({
110
+ "Certificate": obj.get("Certificate"),
111
+ "CertificateChain": [RfidCertificateEx.from_dict(_item) for _item in obj.get("CertificateChain", []) if RfidCertificateEx.from_dict(_item) is not None],
112
+ "DocFeatures": [DocFeature.from_dict(_item) for _item in obj.get("DocFeatures", []) if DocFeature.from_dict(_item) is not None],
113
+ "DocIssueDate": obj.get("DocIssueDate"),
114
+ "DocType": obj.get("DocType"),
115
+ "FeatureRef": obj.get("FeatureRef"),
116
+ "IssuingCountry": obj.get("IssuingCountry"),
117
+ "Notifications": obj.get("Notifications"),
118
+ "Signature": TrfFtBytes.from_dict(obj["Signature"]) if obj.get("Signature") is not None else None,
119
+ "SignatureDate": obj.get("SignatureDate"),
120
+ "Signer": obj.get("Signer"),
121
+ "Type": obj.get("Type"),
122
+ "Version": obj.get("Version")
123
+ })
124
+ return _obj
125
+
126
+
@@ -0,0 +1,86 @@
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.vds_data import VDSData
15
+ from typing import Optional, Set
16
+ from typing_extensions import Self
17
+ from pydantic import SkipValidation, Field
18
+
19
+ class VDSDataItem(BaseModel):
20
+ """
21
+ VDSDataItem
22
+ """ # noqa: E501
23
+ dft_vds: SkipValidation[VDSData] = Field(alias="dftVDS")
24
+ __properties: ClassVar[List[str]] = ["dftVDS"]
25
+
26
+ model_config = ConfigDict(
27
+ populate_by_name=True,
28
+ validate_assignment=True,
29
+ protected_namespaces=(),
30
+ arbitrary_types_allowed=True,
31
+ use_enum_values=True
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 VDSDataItem 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
+ # override the default output from pydantic by calling `to_dict()` of dft_vds
68
+ if self.dft_vds:
69
+ _dict['dftVDS'] = self.dft_vds.to_dict()
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of VDSDataItem from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({
82
+ "dftVDS": VDSData.from_dict(obj["dftVDS"]) if obj.get("dftVDS") is not None else None
83
+ })
84
+ return _obj
85
+
86
+