Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generator-templates/lenient/model_generic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
_items = []
if self.{{{name}}}:
for _item_{{{name}}} in self.{{{name}}}:
if _item_{{{name}}}:
if _item_{{{name}}} and hasattr(_item_{{{name}}}, "to_dict"):
_items.append(_item_{{{name}}}.to_dict())
_dict['{{{baseName}}}'] = _items
{{/items.isEnumOrRef}}
Expand Down Expand Up @@ -231,7 +231,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
{{^isPrimitiveType}}
{{^isEnumOrRef}}
# override the default output from pydantic by calling `to_dict()` of {{{name}}}
if self.{{{name}}}:
if self.{{{name}}} and isinstance(self.{{{name}}}, {{{dataType}}}):
_dict['{{{baseName}}}'] = self.{{{name}}}.to_dict()
{{/isEnumOrRef}}
{{/isPrimitiveType}}
Expand Down
4 changes: 2 additions & 2 deletions regula/documentreader/webclient/gen/models/area_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.list:
for _item_list in self.list:
if _item_list:
if _item_list and hasattr(_item_list, "to_dict"):
_items.append(_item_list.to_dict())
_dict['List'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in points (list)
_items = []
if self.points:
for _item_points in self.points:
if _item_points:
if _item_points and hasattr(_item_points, "to_dict"):
_items.append(_item_points.to_dict())
_dict['Points'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.list:
for _item_list in self.list:
if _item_list:
if _item_list and hasattr(_item_list, "to_dict"):
_items.append(_item_list.to_dict())
_dict['List'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in points (list)
_items = []
if self.points:
for _item_points in self.points:
if _item_points:
if _item_points and hasattr(_item_points, "to_dict"):
_items.append(_item_points.to_dict())
_dict['Points'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of liveness_params
if self.liveness_params:
if self.liveness_params and isinstance(self.liveness_params, LivenessParams):
_dict['livenessParams'] = self.liveness_params.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.list:
for _item_list in self.list:
if _item_list:
if _item_list and hasattr(_item_list, "to_dict"):
_items.append(_item_list.to_dict())
_dict['List'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of authenticity_check_list
if self.authenticity_check_list:
if self.authenticity_check_list and isinstance(self.authenticity_check_list, AuthenticityCheckList):
_dict['AuthenticityCheckList'] = self.authenticity_check_list.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.list:
for _item_list in self.list:
if _item_list:
if _item_list and hasattr(_item_list, "to_dict"):
_items.append(_item_list.to_dict())
_dict['List'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of authenticity_check_list
if self.authenticity_check_list:
if self.authenticity_check_list and isinstance(self.authenticity_check_list, AuthenticityCheckList):
_dict['AuthenticityCheckList'] = self.authenticity_check_list.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of barcode_position
if self.barcode_position:
if self.barcode_position and isinstance(self.barcode_position, DocumentPosition):
_dict['BarcodePosition'] = self.barcode_position.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of barcode_position
if self.barcode_position:
if self.barcode_position and isinstance(self.barcode_position, DocumentPosition):
_dict['BarcodePosition'] = self.barcode_position.to_dict()
return _dict

Expand Down
6 changes: 3 additions & 3 deletions regula/documentreader/webclient/gen/models/binary_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of rfid_dg1
if self.rfid_dg1:
if self.rfid_dg1 and isinstance(self.rfid_dg1, RfidDG1):
_dict['RFID_DG1'] = self.rfid_dg1.to_dict()
# override the default output from pydantic by calling `to_dict()` of rfid_session_data
if self.rfid_session_data:
if self.rfid_session_data and isinstance(self.rfid_session_data, RfidSessionData):
_dict['RFID_Session_Data'] = self.rfid_session_data.to_dict()
# override the default output from pydantic by calling `to_dict()` of rfid_session_data_status
if self.rfid_session_data_status:
if self.rfid_session_data_status and isinstance(self.rfid_session_data_status, DetailsRFID):
_dict['RFID_Session_Data_Status'] = self.rfid_session_data_status.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of candidates_list
if self.candidates_list:
if self.candidates_list and isinstance(self.candidates_list, DocumentTypesCandidatesList):
_dict['CandidatesList'] = self.candidates_list.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of fdsid_list
if self.fdsid_list:
if self.fdsid_list and isinstance(self.fdsid_list, FDSIDList):
_dict['FDSIDList'] = self.fdsid_list.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of one_candidate
if self.one_candidate:
if self.one_candidate and isinstance(self.one_candidate, OneCandidate):
_dict['OneCandidate'] = self.one_candidate.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.list:
for _item_list in self.list:
if _item_list:
if _item_list and hasattr(_item_list, "to_dict"):
_items.append(_item_list.to_dict())
_dict['List'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.items:
for _item_items in self.items:
if _item_items:
if _item_items and hasattr(_item_items, "to_dict"):
_items.append(_item_items.to_dict())
_dict['items'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of documents_database
if self.documents_database:
if self.documents_database and isinstance(self.documents_database, DeviceInfoDocumentsDatabase):
_dict['documents-database'] = self.documents_database.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of doc_bar_code_info
if self.doc_bar_code_info:
if self.doc_bar_code_info and isinstance(self.doc_bar_code_info, DocBarCodeInfoFieldsList):
_dict['DocBarCodeInfo'] = self.doc_bar_code_info.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.p_array_fields:
for _item_p_array_fields in self.p_array_fields:
if _item_p_array_fields:
if _item_p_array_fields and hasattr(_item_p_array_fields, "to_dict"):
_items.append(_item_p_array_fields.to_dict())
_dict['pArrayFields'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of doc_bar_code_info
if self.doc_bar_code_info:
if self.doc_bar_code_info and isinstance(self.doc_bar_code_info, DocBarCodeInfoFieldsList):
_dict['DocBarCodeInfo'] = self.doc_bar_code_info.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of data
if self.data:
if self.data and isinstance(self.data, TrfFtBytes):
_dict['Data'] = self.data.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of doc_graphics_info
if self.doc_graphics_info:
if self.doc_graphics_info and isinstance(self.doc_graphics_info, GraphicFieldsList):
_dict['DocGraphicsInfo'] = self.doc_graphics_info.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.strings_result:
for _item_strings_result in self.strings_result:
if _item_strings_result:
if _item_strings_result and hasattr(_item_strings_result, "to_dict"):
_items.append(_item_strings_result.to_dict())
_dict['StringsResult'] = _items
# override the default output from pydantic by calling `to_dict()` of field_rect
if self.field_rect:
if self.field_rect and isinstance(self.field_rect, RectangleCoordinates):
_dict['FieldRect'] = self.field_rect.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of field_rect
if self.field_rect:
if self.field_rect and isinstance(self.field_rect, RectangleCoordinates):
_dict['FieldRect'] = self.field_rect.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.p_array_fields:
for _item_p_array_fields in self.p_array_fields:
if _item_p_array_fields:
if _item_p_array_fields and hasattr(_item_p_array_fields, "to_dict"):
_items.append(_item_p_array_fields.to_dict())
_dict['pArrayFields'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of doc_visual_extended_info
if self.doc_visual_extended_info:
if self.doc_visual_extended_info and isinstance(self.doc_visual_extended_info, DocVisualExtendedInfo):
_dict['DocVisualExtendedInfo'] = self.doc_visual_extended_info.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of t_doc_binary_info
if self.t_doc_binary_info:
if self.t_doc_binary_info and isinstance(self.t_doc_binary_info, TDocBinaryInfo):
_dict['TDocBinaryInfo'] = self.t_doc_binary_info.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of raw_image_container
if self.raw_image_container:
if self.raw_image_container and isinstance(self.raw_image_container, ImageData):
_dict['RawImageContainer'] = self.raw_image_container.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of center
if self.center:
if self.center and isinstance(self.center, Point):
_dict['Center'] = self.center.to_dict()
# override the default output from pydantic by calling `to_dict()` of left_bottom
if self.left_bottom:
if self.left_bottom and isinstance(self.left_bottom, Point):
_dict['LeftBottom'] = self.left_bottom.to_dict()
# override the default output from pydantic by calling `to_dict()` of left_top
if self.left_top:
if self.left_top and isinstance(self.left_top, Point):
_dict['LeftTop'] = self.left_top.to_dict()
# override the default output from pydantic by calling `to_dict()` of right_bottom
if self.right_bottom:
if self.right_bottom and isinstance(self.right_bottom, Point):
_dict['RightBottom'] = self.right_bottom.to_dict()
# override the default output from pydantic by calling `to_dict()` of right_top
if self.right_top:
if self.right_top and isinstance(self.right_top, Point):
_dict['RightTop'] = self.right_top.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of document_position
if self.document_position:
if self.document_position and isinstance(self.document_position, DocumentPosition):
_dict['DocumentPosition'] = self.document_position.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of document_position
if self.document_position:
if self.document_position and isinstance(self.document_position, DocumentPosition):
_dict['DocumentPosition'] = self.document_position.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.candidates:
for _item_candidates in self.candidates:
if _item_candidates:
if _item_candidates and hasattr(_item_candidates, "to_dict"):
_items.append(_item_candidates.to_dict())
_dict['Candidates'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.candidates:
for _item_candidates in self.candidates:
if _item_candidates:
if _item_candidates and hasattr(_item_candidates, "to_dict"):
_items.append(_item_candidates.to_dict())
_dict['Candidates'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of candidates_list
if self.candidates_list:
if self.candidates_list and isinstance(self.candidates_list, DocumentTypesCandidatesList):
_dict['CandidatesList'] = self.candidates_list.to_dict()
return _dict

Expand Down
2 changes: 1 addition & 1 deletion regula/documentreader/webclient/gen/models/face_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of search
if self.search:
if self.search and isinstance(self.search, FaceApiSearch):
_dict['search'] = self.search.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]:
_items = []
if self.res:
for _item_res in self.res:
if _item_res:
if _item_res and hasattr(_item_res, "to_dict"):
_items.append(_item_res.to_dict())
_dict['Res'] = _items
return _dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of face_detection
if self.face_detection:
if self.face_detection and isinstance(self.face_detection, FaceDetection):
_dict['FaceDetection'] = self.face_detection.to_dict()
return _dict

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_dict(self) -> Dict[str, Any]:
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of face_detection
if self.face_detection:
if self.face_detection and isinstance(self.face_detection, FaceDetection):
_dict['FaceDetection'] = self.face_detection.to_dict()
return _dict

Expand Down
Loading