regula-facesdk-webclient 7.2.388.dev0__py3-none-any.whl → 8.1.433.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 (227) hide show
  1. regula/facesdk/webclient/__init__.py +5 -5
  2. regula/facesdk/webclient/ext/api/group_api.py +2 -27
  3. regula/facesdk/webclient/ext/api/match_api.py +3 -29
  4. regula/facesdk/webclient/ext/api/person_api.py +8 -34
  5. regula/facesdk/webclient/ext/api/sdk.py +5 -3
  6. regula/facesdk/webclient/ext/api/search_api.py +2 -6
  7. regula/facesdk/webclient/ext/models/detect_request.py +6 -5
  8. regula/facesdk/webclient/ext/models/match_image.py +3 -3
  9. regula/facesdk/webclient/ext/models/match_request.py +7 -5
  10. regula/facesdk/webclient/gen/__init__.py +349 -18
  11. regula/facesdk/webclient/gen/api/__init__.py +30 -3
  12. regula/facesdk/webclient/gen/api/group_api.py +1854 -799
  13. regula/facesdk/webclient/gen/api/healthcheck_api.py +475 -215
  14. regula/facesdk/webclient/gen/api/liveness20_api.py +565 -0
  15. regula/facesdk/webclient/gen/api/match_api.py +801 -355
  16. regula/facesdk/webclient/gen/api/person_api.py +2399 -1039
  17. regula/facesdk/webclient/gen/api/search_api.py +286 -130
  18. regula/facesdk/webclient/gen/api_client.py +577 -476
  19. regula/facesdk/webclient/gen/api_response.py +21 -0
  20. regula/facesdk/webclient/gen/configuration.py +231 -105
  21. regula/facesdk/webclient/gen/exceptions.py +82 -33
  22. regula/facesdk/webclient/gen/models/__init__.py +202 -95
  23. regula/facesdk/webclient/gen/models/add_image_to_person_request.py +96 -0
  24. regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py +92 -0
  25. regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py +92 -0
  26. regula/facesdk/webclient/gen/models/add_image_to_person_response.py +92 -0
  27. regula/facesdk/webclient/gen/models/attribute_config.py +83 -0
  28. regula/facesdk/webclient/gen/models/attributes_data.py +82 -0
  29. regula/facesdk/webclient/gen/models/crop.py +88 -0
  30. regula/facesdk/webclient/gen/models/detail_item.py +136 -0
  31. regula/facesdk/webclient/gen/models/detect_attributes_details.py +84 -0
  32. regula/facesdk/webclient/gen/models/detect_details_meta.py +86 -0
  33. regula/facesdk/webclient/gen/models/detect_meta_data.py +84 -0
  34. regula/facesdk/webclient/gen/models/detect_request.py +94 -0
  35. regula/facesdk/webclient/gen/models/detect_request_data.py +90 -0
  36. regula/facesdk/webclient/gen/models/detect_response.py +89 -0
  37. regula/facesdk/webclient/gen/models/detect_response_results.py +86 -0
  38. regula/facesdk/webclient/gen/models/detect_result.py +98 -0
  39. regula/facesdk/webclient/gen/models/detection.py +98 -0
  40. regula/facesdk/webclient/gen/models/detection_attributes.py +92 -0
  41. regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py +132 -0
  42. regula/facesdk/webclient/gen/models/detection_face.py +90 -0
  43. regula/facesdk/webclient/gen/models/detection_quality.py +107 -0
  44. regula/facesdk/webclient/gen/models/device_info.py +111 -0
  45. regula/facesdk/webclient/gen/models/face_attribute.py +40 -0
  46. regula/facesdk/webclient/gen/models/face_image_quality_align_type.py +32 -0
  47. regula/facesdk/webclient/gen/models/face_image_quality_groups.py +35 -0
  48. regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py +35 -0
  49. regula/facesdk/webclient/gen/models/face_image_quality_status.py +30 -0
  50. regula/facesdk/webclient/gen/models/face_quality_config_name.py +75 -0
  51. regula/facesdk/webclient/gen/models/face_quality_scenarios.py +37 -0
  52. regula/facesdk/webclient/gen/models/face_sdk_result.py +83 -0
  53. regula/facesdk/webclient/gen/models/face_sdk_result_code.py +68 -0
  54. regula/facesdk/webclient/gen/models/faces_response.py +100 -0
  55. regula/facesdk/webclient/gen/models/faces_response_data.py +90 -0
  56. regula/facesdk/webclient/gen/models/filter_op.py +29 -0
  57. regula/facesdk/webclient/gen/models/filter_search_request.py +87 -0
  58. regula/facesdk/webclient/gen/models/group.py +89 -0
  59. regula/facesdk/webclient/gen/models/group_data.py +85 -0
  60. regula/facesdk/webclient/gen/models/group_page.py +94 -0
  61. regula/facesdk/webclient/gen/models/group_page_items.py +90 -0
  62. regula/facesdk/webclient/gen/models/group_response.py +84 -0
  63. regula/facesdk/webclient/gen/models/group_to_create.py +86 -0
  64. regula/facesdk/webclient/gen/models/image.py +96 -0
  65. regula/facesdk/webclient/gen/models/image_fields.py +100 -0
  66. regula/facesdk/webclient/gen/models/image_fields_image.py +92 -0
  67. regula/facesdk/webclient/gen/models/image_page.py +94 -0
  68. regula/facesdk/webclient/gen/models/image_page_items.py +90 -0
  69. regula/facesdk/webclient/gen/models/image_source.py +34 -0
  70. regula/facesdk/webclient/gen/models/liveness_type.py +29 -0
  71. regula/facesdk/webclient/gen/models/match_and_search_request.py +103 -0
  72. regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py +87 -0
  73. regula/facesdk/webclient/gen/models/match_and_search_response.py +107 -0
  74. regula/facesdk/webclient/gen/models/match_and_search_response_data.py +104 -0
  75. regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py +95 -0
  76. regula/facesdk/webclient/gen/models/match_image.py +89 -0
  77. regula/facesdk/webclient/gen/models/match_image_detection.py +95 -0
  78. regula/facesdk/webclient/gen/models/match_image_result.py +97 -0
  79. regula/facesdk/webclient/gen/models/match_request.py +102 -0
  80. regula/facesdk/webclient/gen/models/match_request_data.py +98 -0
  81. regula/facesdk/webclient/gen/models/match_response.py +105 -0
  82. regula/facesdk/webclient/gen/models/match_response_data.py +102 -0
  83. regula/facesdk/webclient/gen/models/operation_log.py +88 -0
  84. regula/facesdk/webclient/gen/models/output_image_params.py +89 -0
  85. regula/facesdk/webclient/gen/models/page.py +84 -0
  86. regula/facesdk/webclient/gen/models/person.py +97 -0
  87. regula/facesdk/webclient/gen/models/person_data.py +87 -0
  88. regula/facesdk/webclient/gen/models/person_fields.py +91 -0
  89. regula/facesdk/webclient/gen/models/person_items.py +90 -0
  90. regula/facesdk/webclient/gen/models/person_to_update_fields.py +89 -0
  91. regula/facesdk/webclient/gen/models/person_with_images.py +107 -0
  92. regula/facesdk/webclient/gen/models/person_with_images_data.py +90 -0
  93. regula/facesdk/webclient/gen/models/persons_page.py +94 -0
  94. regula/facesdk/webclient/gen/models/process_param.py +103 -0
  95. regula/facesdk/webclient/gen/models/process_param_attributes.py +90 -0
  96. regula/facesdk/webclient/gen/models/quality_config.py +86 -0
  97. regula/facesdk/webclient/gen/models/quality_detail.py +94 -0
  98. regula/facesdk/webclient/gen/models/quality_details_groups.py +90 -0
  99. regula/facesdk/webclient/gen/models/quality_request.py +93 -0
  100. regula/facesdk/webclient/gen/models/recognize_image.py +100 -0
  101. regula/facesdk/webclient/gen/models/recognize_image_data.py +84 -0
  102. regula/facesdk/webclient/gen/models/resize_options.py +86 -0
  103. regula/facesdk/webclient/gen/models/search_bad_params.py +86 -0
  104. regula/facesdk/webclient/gen/models/search_detection.py +102 -0
  105. regula/facesdk/webclient/gen/models/search_parameters.py +95 -0
  106. regula/facesdk/webclient/gen/models/search_parameters_create_person.py +86 -0
  107. regula/facesdk/webclient/gen/models/search_person.py +113 -0
  108. regula/facesdk/webclient/gen/models/search_person_data.py +96 -0
  109. regula/facesdk/webclient/gen/models/search_request.py +119 -0
  110. regula/facesdk/webclient/gen/models/search_result.py +92 -0
  111. regula/facesdk/webclient/gen/models/transaction_info.py +99 -0
  112. regula/facesdk/webclient/gen/models/transaction_labels.py +84 -0
  113. regula/facesdk/webclient/gen/models/update_group.py +85 -0
  114. regula/facesdk/webclient/gen/py.typed +0 -0
  115. regula/facesdk/webclient/gen/rest.py +136 -232
  116. {regula_facesdk_webclient-7.2.388.dev0.dist-info → regula_facesdk_webclient-8.1.433.dev0.dist-info}/METADATA +7 -4
  117. regula_facesdk_webclient-8.1.433.dev0.dist-info/RECORD +125 -0
  118. {regula_facesdk_webclient-7.2.388.dev0.dist-info → regula_facesdk_webclient-8.1.433.dev0.dist-info}/WHEEL +1 -1
  119. regula/facesdk/webclient/gen/api/diagnostics_api.py +0 -162
  120. regula/facesdk/webclient/gen/api/liveness_2_0_api.py +0 -306
  121. regula/facesdk/webclient/gen/api/liveness_api.py +0 -424
  122. regula/facesdk/webclient/gen/apis/__init__.py +0 -22
  123. regula/facesdk/webclient/gen/model/__init__.py +0 -5
  124. regula/facesdk/webclient/gen/model/add_image_to_person_request.py +0 -261
  125. regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py +0 -204
  126. regula/facesdk/webclient/gen/model/add_image_to_person_response.py +0 -262
  127. regula/facesdk/webclient/gen/model/attribute_config.py +0 -120
  128. regula/facesdk/webclient/gen/model/attribute_config_list.py +0 -92
  129. regula/facesdk/webclient/gen/model/crop.py +0 -180
  130. regula/facesdk/webclient/gen/model/detect_attributes_details.py +0 -150
  131. regula/facesdk/webclient/gen/model/detect_details_meta.py +0 -178
  132. regula/facesdk/webclient/gen/model/detect_request.py +0 -232
  133. regula/facesdk/webclient/gen/model/detect_request_attributes.py +0 -120
  134. regula/facesdk/webclient/gen/model/detect_response.py +0 -147
  135. regula/facesdk/webclient/gen/model/detect_response_all_of.py +0 -120
  136. regula/facesdk/webclient/gen/model/detect_result.py +0 -235
  137. regula/facesdk/webclient/gen/model/detection.py +0 -230
  138. regula/facesdk/webclient/gen/model/detection_attributes.py +0 -150
  139. regula/facesdk/webclient/gen/model/detection_face.py +0 -232
  140. regula/facesdk/webclient/gen/model/detection_quality.py +0 -234
  141. regula/facesdk/webclient/gen/model/device_info.py +0 -231
  142. regula/facesdk/webclient/gen/model/face_align_type_quality.py +0 -109
  143. regula/facesdk/webclient/gen/model/face_attribute.py +0 -133
  144. regula/facesdk/webclient/gen/model/face_image_quality_align_type.py +0 -109
  145. regula/facesdk/webclient/gen/model/face_image_quality_groups.py +0 -118
  146. regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py +0 -118
  147. regula/facesdk/webclient/gen/model/face_image_quality_status.py +0 -103
  148. regula/facesdk/webclient/gen/model/face_quality_config_name.py +0 -238
  149. regula/facesdk/webclient/gen/model/face_quality_scenarios.py +0 -124
  150. regula/facesdk/webclient/gen/model/face_quality_status.py +0 -103
  151. regula/facesdk/webclient/gen/model/face_rectangular.py +0 -92
  152. regula/facesdk/webclient/gen/model/face_sdk_result.py +0 -121
  153. regula/facesdk/webclient/gen/model/face_sdk_result_code.py +0 -217
  154. regula/facesdk/webclient/gen/model/faces_response.py +0 -258
  155. regula/facesdk/webclient/gen/model/faces_response_all_of.py +0 -148
  156. regula/facesdk/webclient/gen/model/filter_op.py +0 -100
  157. regula/facesdk/webclient/gen/model/filter_search_request.py +0 -176
  158. regula/facesdk/webclient/gen/model/group.py +0 -206
  159. regula/facesdk/webclient/gen/model/group_all_of.py +0 -150
  160. regula/facesdk/webclient/gen/model/group_page.py +0 -178
  161. regula/facesdk/webclient/gen/model/group_page_all_of.py +0 -122
  162. regula/facesdk/webclient/gen/model/group_response.py +0 -150
  163. regula/facesdk/webclient/gen/model/group_to_create.py +0 -180
  164. regula/facesdk/webclient/gen/model/image.py +0 -318
  165. regula/facesdk/webclient/gen/model/image_fields.py +0 -258
  166. regula/facesdk/webclient/gen/model/image_fields_image.py +0 -204
  167. regula/facesdk/webclient/gen/model/image_page.py +0 -176
  168. regula/facesdk/webclient/gen/model/image_page_all_of.py +0 -120
  169. regula/facesdk/webclient/gen/model/image_source.py +0 -115
  170. regula/facesdk/webclient/gen/model/liveness_transaction.py +0 -334
  171. regula/facesdk/webclient/gen/model/liveness_type.py +0 -100
  172. regula/facesdk/webclient/gen/model/match_and_search_request.py +0 -290
  173. regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py +0 -234
  174. regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py +0 -148
  175. regula/facesdk/webclient/gen/model/match_and_search_request_images.py +0 -176
  176. regula/facesdk/webclient/gen/model/match_and_search_response.py +0 -233
  177. regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py +0 -206
  178. regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py +0 -176
  179. regula/facesdk/webclient/gen/model/match_image.py +0 -205
  180. regula/facesdk/webclient/gen/model/match_image_detection.py +0 -178
  181. regula/facesdk/webclient/gen/model/match_image_result.py +0 -316
  182. regula/facesdk/webclient/gen/model/match_request.py +0 -233
  183. regula/facesdk/webclient/gen/model/match_request_output_image_params.py +0 -148
  184. regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py +0 -212
  185. regula/facesdk/webclient/gen/model/match_response.py +0 -205
  186. regula/facesdk/webclient/gen/model/match_response_all_of.py +0 -178
  187. regula/facesdk/webclient/gen/model/operation_log.py +0 -206
  188. regula/facesdk/webclient/gen/model/output_image_params.py +0 -146
  189. regula/facesdk/webclient/gen/model/page.py +0 -150
  190. regula/facesdk/webclient/gen/model/person.py +0 -319
  191. regula/facesdk/webclient/gen/model/person_all_of.py +0 -206
  192. regula/facesdk/webclient/gen/model/person_created_response.py +0 -178
  193. regula/facesdk/webclient/gen/model/person_fields.py +0 -235
  194. regula/facesdk/webclient/gen/model/person_to_update_fields.py +0 -206
  195. regula/facesdk/webclient/gen/model/person_with_images.py +0 -347
  196. regula/facesdk/webclient/gen/model/person_with_images_all_of.py +0 -122
  197. regula/facesdk/webclient/gen/model/persons_page.py +0 -176
  198. regula/facesdk/webclient/gen/model/persons_page_all_of.py +0 -120
  199. regula/facesdk/webclient/gen/model/persons_request.py +0 -291
  200. regula/facesdk/webclient/gen/model/persons_request_all_of.py +0 -150
  201. regula/facesdk/webclient/gen/model/process_param.py +0 -226
  202. regula/facesdk/webclient/gen/model/process_param_attributes.py +0 -120
  203. regula/facesdk/webclient/gen/model/quality_config.py +0 -154
  204. regula/facesdk/webclient/gen/model/quality_config_list.py +0 -92
  205. regula/facesdk/webclient/gen/model/quality_detail.py +0 -234
  206. regula/facesdk/webclient/gen/model/quality_details_groups.py +0 -202
  207. regula/facesdk/webclient/gen/model/quality_request.py +0 -146
  208. regula/facesdk/webclient/gen/model/recognize_image.py +0 -374
  209. regula/facesdk/webclient/gen/model/recognize_image_all_of.py +0 -150
  210. regula/facesdk/webclient/gen/model/resize_options.py +0 -178
  211. regula/facesdk/webclient/gen/model/rgb.py +0 -92
  212. regula/facesdk/webclient/gen/model/search_bad_params.py +0 -172
  213. regula/facesdk/webclient/gen/model/search_detection.py +0 -398
  214. regula/facesdk/webclient/gen/model/search_parameters.py +0 -174
  215. regula/facesdk/webclient/gen/model/search_parameters_create_person.py +0 -177
  216. regula/facesdk/webclient/gen/model/search_person.py +0 -373
  217. regula/facesdk/webclient/gen/model/search_person_all_of.py +0 -148
  218. regula/facesdk/webclient/gen/model/search_request.py +0 -394
  219. regula/facesdk/webclient/gen/model/search_request_all_of.py +0 -150
  220. regula/facesdk/webclient/gen/model/search_result.py +0 -150
  221. regula/facesdk/webclient/gen/model/search_result_all_of.py +0 -122
  222. regula/facesdk/webclient/gen/model/transaction_config.py +0 -92
  223. regula/facesdk/webclient/gen/model/transaction_info.py +0 -344
  224. regula/facesdk/webclient/gen/model/update_group.py +0 -150
  225. regula/facesdk/webclient/gen/model_utils.py +0 -2037
  226. regula_facesdk_webclient-7.2.388.dev0.dist-info/RECORD +0 -138
  227. {regula_facesdk_webclient-7.2.388.dev0.dist-info → regula_facesdk_webclient-8.1.433.dev0.dist-info}/top_level.txt +0 -0
@@ -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, Field, StrictFloat, StrictInt, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional, Union
14
+ from regula.facesdk.webclient.gen.models.detection import Detection
15
+ from typing import Optional, Set
16
+ from typing_extensions import Self
17
+ from pydantic import SkipValidation, Field
18
+
19
+ class DetectResult(BaseModel):
20
+ """
21
+ The detection results.
22
+ """ # noqa: E501
23
+ detections: SkipValidation[List[Detection]] = Field(alias="detections", description="The array of performed checks.")
24
+ detector_type: SkipValidation[Optional[int]] = Field(alias="detectorType", default=None, description="Internal.")
25
+ landmarks_type: SkipValidation[Optional[int]] = Field(alias="landmarksType", default=None, description="Internal.")
26
+ scenario: SkipValidation[Optional[str]] = Field(alias="scenario", default=None, description="The face detection scenario that was set in the `processParam.scenario` field of the request.")
27
+ elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time, ms. Does not include the time taken to receive the request or deliver the response.")
28
+ __properties: ClassVar[List[str]] = ["detections", "detectorType", "landmarksType", "scenario", "elapsedTime"]
29
+
30
+ model_config = ConfigDict(
31
+ populate_by_name=True,
32
+ validate_assignment=True,
33
+ protected_namespaces=(),
34
+ arbitrary_types_allowed=True,
35
+ use_enum_values=True
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of DetectResult from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ # override the default output from pydantic by calling `to_dict()` of each item in detections (list)
72
+ _items = []
73
+ if self.detections:
74
+ for _item_detections in self.detections:
75
+ if _item_detections:
76
+ _items.append(_item_detections.to_dict())
77
+ _dict['detections'] = _items
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of DetectResult from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "detections": [Detection.from_dict(_item) for _item in obj.get("detections", []) if Detection.from_dict(_item) is not None],
91
+ "detectorType": obj.get("detectorType"),
92
+ "landmarksType": obj.get("landmarksType"),
93
+ "scenario": obj.get("scenario"),
94
+ "elapsedTime": obj.get("elapsedTime")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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, Field, StrictBytes, StrictFloat, StrictInt, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional, Union
14
+ from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes
15
+ from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality
16
+ from typing import Optional, Set
17
+ from typing_extensions import Self
18
+ from pydantic import SkipValidation, Field
19
+
20
+ class Detection(BaseModel):
21
+ """
22
+ Detection
23
+ """ # noqa: E501
24
+ crop: SkipValidation[Optional[bytearray]] = Field(alias="crop", default=None, description="Base64-encoded image.")
25
+ attributes: SkipValidation[Optional[DetectionAttributes]] = Field(alias="attributes", default=None)
26
+ landmarks: SkipValidation[List[List[int]]] = Field(alias="landmarks", description="Absolute coordinates (X,Y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.")
27
+ quality: SkipValidation[Optional[DetectionQuality]] = Field(alias="quality", default=None)
28
+ roi: SkipValidation[List[float]] = Field(alias="roi", description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.")
29
+ __properties: ClassVar[List[str]] = ["crop", "attributes", "landmarks", "quality", "roi"]
30
+
31
+ model_config = ConfigDict(
32
+ populate_by_name=True,
33
+ validate_assignment=True,
34
+ protected_namespaces=(),
35
+ arbitrary_types_allowed=True,
36
+ use_enum_values=True
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Detection from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of attributes
73
+ if self.attributes:
74
+ _dict['attributes'] = self.attributes.to_dict()
75
+ # override the default output from pydantic by calling `to_dict()` of quality
76
+ if self.quality:
77
+ _dict['quality'] = self.quality.to_dict()
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of Detection from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "crop": obj.get("crop"),
91
+ "attributes": DetectionAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None,
92
+ "landmarks": obj.get("landmarks"),
93
+ "quality": DetectionQuality.from_dict(obj["quality"]) if obj.get("quality") is not None else None,
94
+ "roi": obj.get("roi")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,92 @@
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 regula.facesdk.webclient.gen.models.detail_item import DetailItem
15
+ from typing import Optional, Set
16
+ from typing_extensions import Self
17
+ from pydantic import SkipValidation, Field
18
+
19
+ class DetectionAttributes(BaseModel):
20
+ """
21
+ The evaluated attributes, see the [Attributes List](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/) for details.
22
+ """ # noqa: E501
23
+ details: SkipValidation[Optional[List[DetailItem]]] = Field(alias="details", default=None, description="Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`.")
24
+ elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time for attribute detection, ms.")
25
+ __properties: ClassVar[List[str]] = ["details", "elapsedTime"]
26
+
27
+ model_config = ConfigDict(
28
+ populate_by_name=True,
29
+ validate_assignment=True,
30
+ protected_namespaces=(),
31
+ arbitrary_types_allowed=True,
32
+ use_enum_values=True
33
+ )
34
+
35
+
36
+ def to_str(self) -> str:
37
+ """Returns the string representation of the model using alias"""
38
+ return pprint.pformat(self.model_dump(by_alias=True))
39
+
40
+ def to_json(self) -> str:
41
+ """Returns the JSON representation of the model using alias"""
42
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
43
+ return json.dumps(self.to_dict())
44
+
45
+ @classmethod
46
+ def from_json(cls, json_str: str) -> Optional[Self]:
47
+ """Create an instance of DetectionAttributes from a JSON string"""
48
+ return cls.from_dict(json.loads(json_str))
49
+
50
+ def to_dict(self) -> Dict[str, Any]:
51
+ """Return the dictionary representation of the model using alias.
52
+
53
+ This has the following differences from calling pydantic's
54
+ `self.model_dump(by_alias=True)`:
55
+
56
+ * `None` is only added to the output dict for nullable fields that
57
+ were set at model initialization. Other fields with value `None`
58
+ are ignored.
59
+ """
60
+ excluded_fields: Set[str] = set([
61
+ ])
62
+
63
+ _dict = self.model_dump(
64
+ by_alias=True,
65
+ exclude=excluded_fields,
66
+ exclude_none=True,
67
+ )
68
+ # override the default output from pydantic by calling `to_dict()` of each item in details (list)
69
+ _items = []
70
+ if self.details:
71
+ for _item_details in self.details:
72
+ if _item_details:
73
+ _items.append(_item_details.to_dict())
74
+ _dict['details'] = _items
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of DetectionAttributes from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "details": [DetailItem.from_dict(_item) for _item in obj.get("details", []) if DetailItem.from_dict(_item) is not None],
88
+ "elapsedTime": obj.get("elapsedTime")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,132 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Generated by: https://openapi-generator.tech
5
+ """
6
+
7
+ from __future__ import annotations
8
+ import json
9
+ import pprint
10
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
11
+ from typing import Any, List, Optional
12
+ from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails
13
+ from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta
14
+ from pydantic import StrictStr, Field
15
+ from typing import Union, List, Set, Optional, Dict
16
+ from typing_extensions import Literal, Self
17
+
18
+ DETECTIONATTRIBUTESDETAILSINNER_ONE_OF_SCHEMAS = ["DetectAttributesDetails", "DetectDetailsMeta"]
19
+
20
+ class DetectionAttributesDetailsInner(BaseModel):
21
+ """
22
+ DetectionAttributesDetailsInner
23
+ """
24
+ # data type: DetectAttributesDetails
25
+ oneof_schema_1_validator: Optional[DetectAttributesDetails] = None
26
+ # data type: DetectDetailsMeta
27
+ oneof_schema_2_validator: Optional[DetectDetailsMeta] = None
28
+ actual_instance: Optional[Union[DetectAttributesDetails, DetectDetailsMeta]] = None
29
+ one_of_schemas: Set[str] = { "DetectAttributesDetails", "DetectDetailsMeta" }
30
+
31
+ model_config = ConfigDict(
32
+ validate_assignment=True,
33
+ protected_namespaces=(),
34
+ )
35
+
36
+
37
+ discriminator_value_class_map: Dict[str, str] = {
38
+ }
39
+
40
+ def __init__(self, *args, **kwargs) -> None:
41
+ if args:
42
+ if len(args) > 1:
43
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
44
+ if kwargs:
45
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
46
+ super().__init__(actual_instance=args[0])
47
+ else:
48
+ super().__init__(**kwargs)
49
+
50
+ @field_validator('actual_instance')
51
+ def actual_instance_must_validate_oneof(cls, v):
52
+ instance = DetectionAttributesDetailsInner.model_construct()
53
+ error_messages = []
54
+ match = 0
55
+ # validate data type: DetectAttributesDetails
56
+ if not isinstance(v, DetectAttributesDetails):
57
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DetectAttributesDetails`")
58
+ else:
59
+ match += 1
60
+ # validate data type: DetectDetailsMeta
61
+ if not isinstance(v, DetectDetailsMeta):
62
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DetectDetailsMeta`")
63
+ else:
64
+ match += 1
65
+ if match > 1:
66
+ # more than 1 match
67
+ raise ValueError("Multiple matches found when setting `actual_instance` in DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages))
68
+ elif match == 0:
69
+ # no match
70
+ raise ValueError("No match found when setting `actual_instance` in DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages))
71
+ else:
72
+ return v
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
76
+ return cls.from_json(json.dumps(obj))
77
+
78
+ @classmethod
79
+ def from_json(cls, json_str: str) -> Self:
80
+ """Returns the object represented by the json string"""
81
+ instance = cls.model_construct()
82
+ error_messages = []
83
+ match = 0
84
+
85
+ # deserialize data into DetectAttributesDetails
86
+ try:
87
+ instance.actual_instance = DetectAttributesDetails.from_json(json_str)
88
+ match += 1
89
+ except (ValidationError, ValueError) as e:
90
+ error_messages.append(str(e))
91
+ # deserialize data into DetectDetailsMeta
92
+ try:
93
+ instance.actual_instance = DetectDetailsMeta.from_json(json_str)
94
+ match += 1
95
+ except (ValidationError, ValueError) as e:
96
+ error_messages.append(str(e))
97
+
98
+ if match > 1:
99
+ # more than 1 match
100
+ raise ValueError("Multiple matches found when deserializing the JSON string into DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages))
101
+ elif match == 0:
102
+ # no match
103
+ raise ValueError("No match found when deserializing the JSON string into DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages))
104
+ else:
105
+ return instance
106
+
107
+ def to_json(self) -> str:
108
+ """Returns the JSON representation of the actual instance"""
109
+ if self.actual_instance is None:
110
+ return "null"
111
+
112
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
113
+ return self.actual_instance.to_json()
114
+ else:
115
+ return json.dumps(self.actual_instance)
116
+
117
+ def to_dict(self) -> Optional[Union[Dict[str, Any], DetectAttributesDetails, DetectDetailsMeta]]:
118
+ """Returns the dict representation of the actual instance"""
119
+ if self.actual_instance is None:
120
+ return None
121
+
122
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
123
+ return self.actual_instance.to_dict()
124
+ else:
125
+ # primitive type
126
+ return self.actual_instance
127
+
128
+ def to_str(self) -> str:
129
+ """Returns the string representation of the actual instance"""
130
+ return pprint.pformat(self.model_dump())
131
+
132
+
@@ -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, Field, StrictBytes, StrictFloat, StrictInt, StrictStr
13
+ from typing import Any, ClassVar, Dict, List, Optional, Union
14
+ from typing import Optional, Set
15
+ from typing_extensions import Self
16
+ from pydantic import SkipValidation, Field
17
+
18
+ class DetectionFace(BaseModel):
19
+ """
20
+ DetectionFace
21
+ """ # noqa: E501
22
+ face_index: SkipValidation[Optional[float]] = Field(alias="faceIndex", default=None, description="The detected face index number.")
23
+ landmarks: SkipValidation[Optional[List[List[float]]]] = Field(alias="landmarks", default=None, description="Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.")
24
+ rotation_angle: SkipValidation[Optional[float]] = Field(alias="rotationAngle", default=None, description="Angle of rotation of the face from the vertical axis, degrees.")
25
+ roi: SkipValidation[Optional[List[float]]] = Field(alias="roi", default=None, description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.")
26
+ crop: SkipValidation[Optional[bytearray]] = Field(alias="crop", default=None, description="Base64-encoded aligned and cropped portrait.")
27
+ __properties: ClassVar[List[str]] = ["faceIndex", "landmarks", "rotationAngle", "roi", "crop"]
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 DetectionFace 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 DetectionFace 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
+ "faceIndex": obj.get("faceIndex"),
83
+ "landmarks": obj.get("landmarks"),
84
+ "rotationAngle": obj.get("rotationAngle"),
85
+ "roi": obj.get("roi"),
86
+ "crop": obj.get("crop")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,107 @@
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 regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName
15
+ from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail
16
+ from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups
17
+ from typing import Optional, Set
18
+ from typing_extensions import Self
19
+ from pydantic import SkipValidation, Field
20
+
21
+ class DetectionQuality(BaseModel):
22
+ """
23
+ The portrait quality assessment results, see [Face Image Quality Characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). If not set in request, no quality check is performed.
24
+ """ # noqa: E501
25
+ non_compliant: SkipValidation[Optional[List[FaceQualityConfigName]]] = Field(alias="nonCompliant", default=None, description="Non-compliant assessment characteristics.")
26
+ details_groups: SkipValidation[Optional[List[QualityDetailsGroups]]] = Field(alias="detailsGroups", default=None, description="Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/).")
27
+ details: SkipValidation[Optional[List[QualityDetail]]] = Field(alias="details", default=None, description="Assessment characteristics that were set in the request.")
28
+ score: SkipValidation[Optional[float]] = Field(alias="score", default=None, description="Returns the estimated portrait quality assessment result, a number from `0` to `1`, where `1` is for absolute compliance.")
29
+ elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time for quality assessment, ms.")
30
+ __properties: ClassVar[List[str]] = ["nonCompliant", "detailsGroups", "details", "score", "elapsedTime"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ arbitrary_types_allowed=True,
37
+ use_enum_values=True
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of DetectionQuality from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in details_groups (list)
74
+ _items = []
75
+ if self.details_groups:
76
+ for _item_details_groups in self.details_groups:
77
+ if _item_details_groups:
78
+ _items.append(_item_details_groups.to_dict())
79
+ _dict['detailsGroups'] = _items
80
+ # override the default output from pydantic by calling `to_dict()` of each item in details (list)
81
+ _items = []
82
+ if self.details:
83
+ for _item_details in self.details:
84
+ if _item_details:
85
+ _items.append(_item_details.to_dict())
86
+ _dict['details'] = _items
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of DetectionQuality from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "nonCompliant": obj.get("nonCompliant"),
100
+ "detailsGroups": [QualityDetailsGroups.from_dict(_item) for _item in obj.get("detailsGroups", []) if QualityDetailsGroups.from_dict(_item) is not None],
101
+ "details": [QualityDetail.from_dict(_item) for _item in obj.get("details", []) if QualityDetail.from_dict(_item) is not None],
102
+ "score": obj.get("score"),
103
+ "elapsedTime": obj.get("elapsedTime")
104
+ })
105
+ return _obj
106
+
107
+