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.
- regula/facesdk/webclient/__init__.py +5 -5
- regula/facesdk/webclient/ext/api/group_api.py +2 -27
- regula/facesdk/webclient/ext/api/match_api.py +3 -29
- regula/facesdk/webclient/ext/api/person_api.py +8 -34
- regula/facesdk/webclient/ext/api/sdk.py +5 -3
- regula/facesdk/webclient/ext/api/search_api.py +2 -6
- regula/facesdk/webclient/ext/models/detect_request.py +6 -5
- regula/facesdk/webclient/ext/models/match_image.py +3 -3
- regula/facesdk/webclient/ext/models/match_request.py +7 -5
- regula/facesdk/webclient/gen/__init__.py +349 -18
- regula/facesdk/webclient/gen/api/__init__.py +30 -3
- regula/facesdk/webclient/gen/api/group_api.py +1854 -799
- regula/facesdk/webclient/gen/api/healthcheck_api.py +475 -215
- regula/facesdk/webclient/gen/api/liveness20_api.py +565 -0
- regula/facesdk/webclient/gen/api/match_api.py +801 -355
- regula/facesdk/webclient/gen/api/person_api.py +2399 -1039
- regula/facesdk/webclient/gen/api/search_api.py +286 -130
- regula/facesdk/webclient/gen/api_client.py +577 -476
- regula/facesdk/webclient/gen/api_response.py +21 -0
- regula/facesdk/webclient/gen/configuration.py +231 -105
- regula/facesdk/webclient/gen/exceptions.py +82 -33
- regula/facesdk/webclient/gen/models/__init__.py +202 -95
- regula/facesdk/webclient/gen/models/add_image_to_person_request.py +96 -0
- regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py +92 -0
- regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py +92 -0
- regula/facesdk/webclient/gen/models/add_image_to_person_response.py +92 -0
- regula/facesdk/webclient/gen/models/attribute_config.py +83 -0
- regula/facesdk/webclient/gen/models/attributes_data.py +82 -0
- regula/facesdk/webclient/gen/models/crop.py +88 -0
- regula/facesdk/webclient/gen/models/detail_item.py +136 -0
- regula/facesdk/webclient/gen/models/detect_attributes_details.py +84 -0
- regula/facesdk/webclient/gen/models/detect_details_meta.py +86 -0
- regula/facesdk/webclient/gen/models/detect_meta_data.py +84 -0
- regula/facesdk/webclient/gen/models/detect_request.py +94 -0
- regula/facesdk/webclient/gen/models/detect_request_data.py +90 -0
- regula/facesdk/webclient/gen/models/detect_response.py +89 -0
- regula/facesdk/webclient/gen/models/detect_response_results.py +86 -0
- regula/facesdk/webclient/gen/models/detect_result.py +98 -0
- regula/facesdk/webclient/gen/models/detection.py +98 -0
- regula/facesdk/webclient/gen/models/detection_attributes.py +92 -0
- regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py +132 -0
- regula/facesdk/webclient/gen/models/detection_face.py +90 -0
- regula/facesdk/webclient/gen/models/detection_quality.py +107 -0
- regula/facesdk/webclient/gen/models/device_info.py +111 -0
- regula/facesdk/webclient/gen/models/face_attribute.py +40 -0
- regula/facesdk/webclient/gen/models/face_image_quality_align_type.py +32 -0
- regula/facesdk/webclient/gen/models/face_image_quality_groups.py +35 -0
- regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py +35 -0
- regula/facesdk/webclient/gen/models/face_image_quality_status.py +30 -0
- regula/facesdk/webclient/gen/models/face_quality_config_name.py +75 -0
- regula/facesdk/webclient/gen/models/face_quality_scenarios.py +37 -0
- regula/facesdk/webclient/gen/models/face_sdk_result.py +83 -0
- regula/facesdk/webclient/gen/models/face_sdk_result_code.py +68 -0
- regula/facesdk/webclient/gen/models/faces_response.py +100 -0
- regula/facesdk/webclient/gen/models/faces_response_data.py +90 -0
- regula/facesdk/webclient/gen/models/filter_op.py +29 -0
- regula/facesdk/webclient/gen/models/filter_search_request.py +87 -0
- regula/facesdk/webclient/gen/models/group.py +89 -0
- regula/facesdk/webclient/gen/models/group_data.py +85 -0
- regula/facesdk/webclient/gen/models/group_page.py +94 -0
- regula/facesdk/webclient/gen/models/group_page_items.py +90 -0
- regula/facesdk/webclient/gen/models/group_response.py +84 -0
- regula/facesdk/webclient/gen/models/group_to_create.py +86 -0
- regula/facesdk/webclient/gen/models/image.py +96 -0
- regula/facesdk/webclient/gen/models/image_fields.py +100 -0
- regula/facesdk/webclient/gen/models/image_fields_image.py +92 -0
- regula/facesdk/webclient/gen/models/image_page.py +94 -0
- regula/facesdk/webclient/gen/models/image_page_items.py +90 -0
- regula/facesdk/webclient/gen/models/image_source.py +34 -0
- regula/facesdk/webclient/gen/models/liveness_type.py +29 -0
- regula/facesdk/webclient/gen/models/match_and_search_request.py +103 -0
- regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py +87 -0
- regula/facesdk/webclient/gen/models/match_and_search_response.py +107 -0
- regula/facesdk/webclient/gen/models/match_and_search_response_data.py +104 -0
- regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py +95 -0
- regula/facesdk/webclient/gen/models/match_image.py +89 -0
- regula/facesdk/webclient/gen/models/match_image_detection.py +95 -0
- regula/facesdk/webclient/gen/models/match_image_result.py +97 -0
- regula/facesdk/webclient/gen/models/match_request.py +102 -0
- regula/facesdk/webclient/gen/models/match_request_data.py +98 -0
- regula/facesdk/webclient/gen/models/match_response.py +105 -0
- regula/facesdk/webclient/gen/models/match_response_data.py +102 -0
- regula/facesdk/webclient/gen/models/operation_log.py +88 -0
- regula/facesdk/webclient/gen/models/output_image_params.py +89 -0
- regula/facesdk/webclient/gen/models/page.py +84 -0
- regula/facesdk/webclient/gen/models/person.py +97 -0
- regula/facesdk/webclient/gen/models/person_data.py +87 -0
- regula/facesdk/webclient/gen/models/person_fields.py +91 -0
- regula/facesdk/webclient/gen/models/person_items.py +90 -0
- regula/facesdk/webclient/gen/models/person_to_update_fields.py +89 -0
- regula/facesdk/webclient/gen/models/person_with_images.py +107 -0
- regula/facesdk/webclient/gen/models/person_with_images_data.py +90 -0
- regula/facesdk/webclient/gen/models/persons_page.py +94 -0
- regula/facesdk/webclient/gen/models/process_param.py +103 -0
- regula/facesdk/webclient/gen/models/process_param_attributes.py +90 -0
- regula/facesdk/webclient/gen/models/quality_config.py +86 -0
- regula/facesdk/webclient/gen/models/quality_detail.py +94 -0
- regula/facesdk/webclient/gen/models/quality_details_groups.py +90 -0
- regula/facesdk/webclient/gen/models/quality_request.py +93 -0
- regula/facesdk/webclient/gen/models/recognize_image.py +100 -0
- regula/facesdk/webclient/gen/models/recognize_image_data.py +84 -0
- regula/facesdk/webclient/gen/models/resize_options.py +86 -0
- regula/facesdk/webclient/gen/models/search_bad_params.py +86 -0
- regula/facesdk/webclient/gen/models/search_detection.py +102 -0
- regula/facesdk/webclient/gen/models/search_parameters.py +95 -0
- regula/facesdk/webclient/gen/models/search_parameters_create_person.py +86 -0
- regula/facesdk/webclient/gen/models/search_person.py +113 -0
- regula/facesdk/webclient/gen/models/search_person_data.py +96 -0
- regula/facesdk/webclient/gen/models/search_request.py +119 -0
- regula/facesdk/webclient/gen/models/search_result.py +92 -0
- regula/facesdk/webclient/gen/models/transaction_info.py +99 -0
- regula/facesdk/webclient/gen/models/transaction_labels.py +84 -0
- regula/facesdk/webclient/gen/models/update_group.py +85 -0
- regula/facesdk/webclient/gen/py.typed +0 -0
- regula/facesdk/webclient/gen/rest.py +136 -232
- {regula_facesdk_webclient-7.2.388.dev0.dist-info → regula_facesdk_webclient-8.1.433.dev0.dist-info}/METADATA +7 -4
- regula_facesdk_webclient-8.1.433.dev0.dist-info/RECORD +125 -0
- {regula_facesdk_webclient-7.2.388.dev0.dist-info → regula_facesdk_webclient-8.1.433.dev0.dist-info}/WHEEL +1 -1
- regula/facesdk/webclient/gen/api/diagnostics_api.py +0 -162
- regula/facesdk/webclient/gen/api/liveness_2_0_api.py +0 -306
- regula/facesdk/webclient/gen/api/liveness_api.py +0 -424
- regula/facesdk/webclient/gen/apis/__init__.py +0 -22
- regula/facesdk/webclient/gen/model/__init__.py +0 -5
- regula/facesdk/webclient/gen/model/add_image_to_person_request.py +0 -261
- regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py +0 -204
- regula/facesdk/webclient/gen/model/add_image_to_person_response.py +0 -262
- regula/facesdk/webclient/gen/model/attribute_config.py +0 -120
- regula/facesdk/webclient/gen/model/attribute_config_list.py +0 -92
- regula/facesdk/webclient/gen/model/crop.py +0 -180
- regula/facesdk/webclient/gen/model/detect_attributes_details.py +0 -150
- regula/facesdk/webclient/gen/model/detect_details_meta.py +0 -178
- regula/facesdk/webclient/gen/model/detect_request.py +0 -232
- regula/facesdk/webclient/gen/model/detect_request_attributes.py +0 -120
- regula/facesdk/webclient/gen/model/detect_response.py +0 -147
- regula/facesdk/webclient/gen/model/detect_response_all_of.py +0 -120
- regula/facesdk/webclient/gen/model/detect_result.py +0 -235
- regula/facesdk/webclient/gen/model/detection.py +0 -230
- regula/facesdk/webclient/gen/model/detection_attributes.py +0 -150
- regula/facesdk/webclient/gen/model/detection_face.py +0 -232
- regula/facesdk/webclient/gen/model/detection_quality.py +0 -234
- regula/facesdk/webclient/gen/model/device_info.py +0 -231
- regula/facesdk/webclient/gen/model/face_align_type_quality.py +0 -109
- regula/facesdk/webclient/gen/model/face_attribute.py +0 -133
- regula/facesdk/webclient/gen/model/face_image_quality_align_type.py +0 -109
- regula/facesdk/webclient/gen/model/face_image_quality_groups.py +0 -118
- regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py +0 -118
- regula/facesdk/webclient/gen/model/face_image_quality_status.py +0 -103
- regula/facesdk/webclient/gen/model/face_quality_config_name.py +0 -238
- regula/facesdk/webclient/gen/model/face_quality_scenarios.py +0 -124
- regula/facesdk/webclient/gen/model/face_quality_status.py +0 -103
- regula/facesdk/webclient/gen/model/face_rectangular.py +0 -92
- regula/facesdk/webclient/gen/model/face_sdk_result.py +0 -121
- regula/facesdk/webclient/gen/model/face_sdk_result_code.py +0 -217
- regula/facesdk/webclient/gen/model/faces_response.py +0 -258
- regula/facesdk/webclient/gen/model/faces_response_all_of.py +0 -148
- regula/facesdk/webclient/gen/model/filter_op.py +0 -100
- regula/facesdk/webclient/gen/model/filter_search_request.py +0 -176
- regula/facesdk/webclient/gen/model/group.py +0 -206
- regula/facesdk/webclient/gen/model/group_all_of.py +0 -150
- regula/facesdk/webclient/gen/model/group_page.py +0 -178
- regula/facesdk/webclient/gen/model/group_page_all_of.py +0 -122
- regula/facesdk/webclient/gen/model/group_response.py +0 -150
- regula/facesdk/webclient/gen/model/group_to_create.py +0 -180
- regula/facesdk/webclient/gen/model/image.py +0 -318
- regula/facesdk/webclient/gen/model/image_fields.py +0 -258
- regula/facesdk/webclient/gen/model/image_fields_image.py +0 -204
- regula/facesdk/webclient/gen/model/image_page.py +0 -176
- regula/facesdk/webclient/gen/model/image_page_all_of.py +0 -120
- regula/facesdk/webclient/gen/model/image_source.py +0 -115
- regula/facesdk/webclient/gen/model/liveness_transaction.py +0 -334
- regula/facesdk/webclient/gen/model/liveness_type.py +0 -100
- regula/facesdk/webclient/gen/model/match_and_search_request.py +0 -290
- regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py +0 -234
- regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py +0 -148
- regula/facesdk/webclient/gen/model/match_and_search_request_images.py +0 -176
- regula/facesdk/webclient/gen/model/match_and_search_response.py +0 -233
- regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py +0 -206
- regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py +0 -176
- regula/facesdk/webclient/gen/model/match_image.py +0 -205
- regula/facesdk/webclient/gen/model/match_image_detection.py +0 -178
- regula/facesdk/webclient/gen/model/match_image_result.py +0 -316
- regula/facesdk/webclient/gen/model/match_request.py +0 -233
- regula/facesdk/webclient/gen/model/match_request_output_image_params.py +0 -148
- regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py +0 -212
- regula/facesdk/webclient/gen/model/match_response.py +0 -205
- regula/facesdk/webclient/gen/model/match_response_all_of.py +0 -178
- regula/facesdk/webclient/gen/model/operation_log.py +0 -206
- regula/facesdk/webclient/gen/model/output_image_params.py +0 -146
- regula/facesdk/webclient/gen/model/page.py +0 -150
- regula/facesdk/webclient/gen/model/person.py +0 -319
- regula/facesdk/webclient/gen/model/person_all_of.py +0 -206
- regula/facesdk/webclient/gen/model/person_created_response.py +0 -178
- regula/facesdk/webclient/gen/model/person_fields.py +0 -235
- regula/facesdk/webclient/gen/model/person_to_update_fields.py +0 -206
- regula/facesdk/webclient/gen/model/person_with_images.py +0 -347
- regula/facesdk/webclient/gen/model/person_with_images_all_of.py +0 -122
- regula/facesdk/webclient/gen/model/persons_page.py +0 -176
- regula/facesdk/webclient/gen/model/persons_page_all_of.py +0 -120
- regula/facesdk/webclient/gen/model/persons_request.py +0 -291
- regula/facesdk/webclient/gen/model/persons_request_all_of.py +0 -150
- regula/facesdk/webclient/gen/model/process_param.py +0 -226
- regula/facesdk/webclient/gen/model/process_param_attributes.py +0 -120
- regula/facesdk/webclient/gen/model/quality_config.py +0 -154
- regula/facesdk/webclient/gen/model/quality_config_list.py +0 -92
- regula/facesdk/webclient/gen/model/quality_detail.py +0 -234
- regula/facesdk/webclient/gen/model/quality_details_groups.py +0 -202
- regula/facesdk/webclient/gen/model/quality_request.py +0 -146
- regula/facesdk/webclient/gen/model/recognize_image.py +0 -374
- regula/facesdk/webclient/gen/model/recognize_image_all_of.py +0 -150
- regula/facesdk/webclient/gen/model/resize_options.py +0 -178
- regula/facesdk/webclient/gen/model/rgb.py +0 -92
- regula/facesdk/webclient/gen/model/search_bad_params.py +0 -172
- regula/facesdk/webclient/gen/model/search_detection.py +0 -398
- regula/facesdk/webclient/gen/model/search_parameters.py +0 -174
- regula/facesdk/webclient/gen/model/search_parameters_create_person.py +0 -177
- regula/facesdk/webclient/gen/model/search_person.py +0 -373
- regula/facesdk/webclient/gen/model/search_person_all_of.py +0 -148
- regula/facesdk/webclient/gen/model/search_request.py +0 -394
- regula/facesdk/webclient/gen/model/search_request_all_of.py +0 -150
- regula/facesdk/webclient/gen/model/search_result.py +0 -150
- regula/facesdk/webclient/gen/model/search_result_all_of.py +0 -122
- regula/facesdk/webclient/gen/model/transaction_config.py +0 -92
- regula/facesdk/webclient/gen/model/transaction_info.py +0 -344
- regula/facesdk/webclient/gen/model/update_group.py +0 -150
- regula/facesdk/webclient/gen/model_utils.py +0 -2037
- regula_facesdk_webclient-7.2.388.dev0.dist-info/RECORD +0 -138
- {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,97 @@
|
|
|
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.image_source import ImageSource
|
|
15
|
+
from typing import Optional, Set
|
|
16
|
+
from typing_extensions import Self
|
|
17
|
+
from pydantic import SkipValidation, Field
|
|
18
|
+
|
|
19
|
+
class MatchImageResult(BaseModel):
|
|
20
|
+
"""
|
|
21
|
+
MatchImageResult
|
|
22
|
+
""" # noqa: E501
|
|
23
|
+
first_index: SkipValidation[int] = Field(alias="firstIndex", description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.")
|
|
24
|
+
first_face_index: SkipValidation[Optional[float]] = Field(alias="firstFaceIndex", default=None, description="The detected face index number.")
|
|
25
|
+
first: SkipValidation[Optional[ImageSource]] = Field(alias="first", default=None)
|
|
26
|
+
second_index: SkipValidation[int] = Field(alias="secondIndex", description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.")
|
|
27
|
+
second_face_index: SkipValidation[Optional[float]] = Field(alias="secondFaceIndex", default=None, description="The detected face index number.")
|
|
28
|
+
second: SkipValidation[Optional[ImageSource]] = Field(alias="second", default=None)
|
|
29
|
+
score: SkipValidation[Optional[float]] = Field(alias="score", default=None, description="A dimensionless number that shows how similar the compared faces are. 0—absolutely identical faces.")
|
|
30
|
+
similarity: SkipValidation[Optional[float]] = Field(alias="similarity", default=None, description="The detected faces similarity, %. 100%—absolutely identical faces, 0%—absolutely not identical.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["firstIndex", "firstFaceIndex", "first", "secondIndex", "secondFaceIndex", "second", "score", "similarity"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
arbitrary_types_allowed=True,
|
|
38
|
+
use_enum_values=True
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of MatchImageResult from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of MatchImageResult from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"firstIndex": obj.get("firstIndex"),
|
|
87
|
+
"firstFaceIndex": obj.get("firstFaceIndex"),
|
|
88
|
+
"first": obj.get("first"),
|
|
89
|
+
"secondIndex": obj.get("secondIndex"),
|
|
90
|
+
"secondFaceIndex": obj.get("secondFaceIndex"),
|
|
91
|
+
"second": obj.get("second"),
|
|
92
|
+
"score": obj.get("score"),
|
|
93
|
+
"similarity": obj.get("similarity")
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Generated by: https://openapi-generator.tech
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
import pprint
|
|
9
|
+
import re # noqa: F401
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
13
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
14
|
+
from regula.facesdk.webclient.gen.models.match_image import MatchImage
|
|
15
|
+
from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams
|
|
16
|
+
from typing import Optional, Set
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
from pydantic import SkipValidation, Field
|
|
19
|
+
|
|
20
|
+
class MatchRequest(BaseModel):
|
|
21
|
+
"""
|
|
22
|
+
MatchRequest
|
|
23
|
+
""" # noqa: E501
|
|
24
|
+
tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.")
|
|
25
|
+
env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.")
|
|
26
|
+
tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.")
|
|
27
|
+
images: SkipValidation[List[MatchImage]] = Field(alias="images", description="An array of images to be processed. At least two images must be provided.")
|
|
28
|
+
output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None)
|
|
29
|
+
__properties: ClassVar[List[str]] = ["tenant", "env", "tag", "images", "outputImageParams"]
|
|
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 MatchRequest 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 each item in images (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.images:
|
|
75
|
+
for _item_images in self.images:
|
|
76
|
+
if _item_images:
|
|
77
|
+
_items.append(_item_images.to_dict())
|
|
78
|
+
_dict['images'] = _items
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of output_image_params
|
|
80
|
+
if self.output_image_params:
|
|
81
|
+
_dict['outputImageParams'] = self.output_image_params.to_dict()
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of MatchRequest from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"tenant": obj.get("tenant"),
|
|
95
|
+
"env": obj.get("env"),
|
|
96
|
+
"tag": obj.get("tag"),
|
|
97
|
+
"images": [MatchImage.from_dict(_item) for _item in obj.get("images", []) if MatchImage.from_dict(_item) is not None],
|
|
98
|
+
"outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -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, StrictStr
|
|
13
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
14
|
+
from regula.facesdk.webclient.gen.models.match_image import MatchImage
|
|
15
|
+
from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams
|
|
16
|
+
from typing import Optional, Set
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
from pydantic import SkipValidation, Field
|
|
19
|
+
|
|
20
|
+
class MatchRequestData(BaseModel):
|
|
21
|
+
"""
|
|
22
|
+
MatchRequestData
|
|
23
|
+
""" # noqa: E501
|
|
24
|
+
tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.")
|
|
25
|
+
images: SkipValidation[List[MatchImage]] = Field(alias="images", description="An array of images to be processed. At least two images must be provided.")
|
|
26
|
+
output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None)
|
|
27
|
+
__properties: ClassVar[List[str]] = ["tag", "images", "outputImageParams"]
|
|
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 MatchRequestData 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 each item in images (list)
|
|
71
|
+
_items = []
|
|
72
|
+
if self.images:
|
|
73
|
+
for _item_images in self.images:
|
|
74
|
+
if _item_images:
|
|
75
|
+
_items.append(_item_images.to_dict())
|
|
76
|
+
_dict['images'] = _items
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of output_image_params
|
|
78
|
+
if self.output_image_params:
|
|
79
|
+
_dict['outputImageParams'] = self.output_image_params.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of MatchRequestData 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
|
+
"tag": obj.get("tag"),
|
|
93
|
+
"images": [MatchImage.from_dict(_item) for _item in obj.get("images", []) if MatchImage.from_dict(_item) is not None],
|
|
94
|
+
"outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Generated by: https://openapi-generator.tech
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
import pprint
|
|
9
|
+
import re # noqa: F401
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
13
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
14
|
+
from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode
|
|
15
|
+
from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection
|
|
16
|
+
from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult
|
|
17
|
+
from typing import Optional, Set
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
from pydantic import SkipValidation, Field
|
|
20
|
+
|
|
21
|
+
class MatchResponse(BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
MatchResponse
|
|
24
|
+
""" # noqa: E501
|
|
25
|
+
code: SkipValidation[FaceSDKResultCode] = Field(alias="code")
|
|
26
|
+
detections: SkipValidation[Optional[List[MatchImageDetection]]] = Field(alias="detections", default=None, description="The detection results.")
|
|
27
|
+
results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The comparison results.")
|
|
28
|
+
metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.")
|
|
29
|
+
__properties: ClassVar[List[str]] = ["code", "detections", "results", "metadata"]
|
|
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 MatchResponse 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 each item in detections (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.detections:
|
|
75
|
+
for _item_detections in self.detections:
|
|
76
|
+
if _item_detections:
|
|
77
|
+
_items.append(_item_detections.to_dict())
|
|
78
|
+
_dict['detections'] = _items
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
80
|
+
_items = []
|
|
81
|
+
if self.results:
|
|
82
|
+
for _item_results in self.results:
|
|
83
|
+
if _item_results:
|
|
84
|
+
_items.append(_item_results.to_dict())
|
|
85
|
+
_dict['results'] = _items
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of MatchResponse from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"code": obj.get("code"),
|
|
99
|
+
"detections": [MatchImageDetection.from_dict(_item) for _item in obj.get("detections", []) if MatchImageDetection.from_dict(_item) is not None],
|
|
100
|
+
"results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None],
|
|
101
|
+
"metadata": obj.get("metadata")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Generated by: https://openapi-generator.tech
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
import pprint
|
|
9
|
+
import re # noqa: F401
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
13
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
14
|
+
from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection
|
|
15
|
+
from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult
|
|
16
|
+
from typing import Optional, Set
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
from pydantic import SkipValidation, Field
|
|
19
|
+
|
|
20
|
+
class MatchResponseData(BaseModel):
|
|
21
|
+
"""
|
|
22
|
+
MatchResponseData
|
|
23
|
+
""" # noqa: E501
|
|
24
|
+
detections: SkipValidation[Optional[List[MatchImageDetection]]] = Field(alias="detections", default=None, description="The detection results.")
|
|
25
|
+
results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The comparison results.")
|
|
26
|
+
metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.")
|
|
27
|
+
__properties: ClassVar[List[str]] = ["detections", "results", "metadata"]
|
|
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 MatchResponseData 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 each item in detections (list)
|
|
71
|
+
_items = []
|
|
72
|
+
if self.detections:
|
|
73
|
+
for _item_detections in self.detections:
|
|
74
|
+
if _item_detections:
|
|
75
|
+
_items.append(_item_detections.to_dict())
|
|
76
|
+
_dict['detections'] = _items
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
78
|
+
_items = []
|
|
79
|
+
if self.results:
|
|
80
|
+
for _item_results in self.results:
|
|
81
|
+
if _item_results:
|
|
82
|
+
_items.append(_item_results.to_dict())
|
|
83
|
+
_dict['results'] = _items
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of MatchResponseData from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"detections": [MatchImageDetection.from_dict(_item) for _item in obj.get("detections", []) if MatchImageDetection.from_dict(_item) is not None],
|
|
97
|
+
"results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None],
|
|
98
|
+
"metadata": obj.get("metadata")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -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, Field, 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 OperationLog(BaseModel):
|
|
19
|
+
"""
|
|
20
|
+
OperationLog
|
|
21
|
+
""" # noqa: E501
|
|
22
|
+
status_code: SkipValidation[Optional[int]] = Field(alias="statusCode", default=None, description="Status code.")
|
|
23
|
+
type: SkipValidation[Optional[str]] = Field(alias="type", default=None, description="Error type.")
|
|
24
|
+
msg: SkipValidation[Optional[str]] = Field(alias="msg", default=None, description="Error message.")
|
|
25
|
+
metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing group's extended attributes.")
|
|
26
|
+
__properties: ClassVar[List[str]] = ["statusCode", "type", "msg", "metadata"]
|
|
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 OperationLog 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 OperationLog 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
|
+
"statusCode": obj.get("statusCode"),
|
|
82
|
+
"type": obj.get("type"),
|
|
83
|
+
"msg": obj.get("msg"),
|
|
84
|
+
"metadata": obj.get("metadata")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Generated by: https://openapi-generator.tech
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
import pprint
|
|
9
|
+
import re # noqa: F401
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
13
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
14
|
+
from typing_extensions import Annotated
|
|
15
|
+
from regula.facesdk.webclient.gen.models.crop import Crop
|
|
16
|
+
from typing import Optional, Set
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
from pydantic import SkipValidation, Field
|
|
19
|
+
|
|
20
|
+
class OutputImageParams(BaseModel):
|
|
21
|
+
"""
|
|
22
|
+
Allows to process the uploaded image according to the indicated settings.
|
|
23
|
+
""" # noqa: E501
|
|
24
|
+
background_color: SkipValidation[Optional[List[int]]] = Field(alias="backgroundColor", default=None, description="The RGB value of a color for filling background behind a person's silhouette and for aligning the image.")
|
|
25
|
+
crop: SkipValidation[Optional[Crop]] = Field(alias="crop", default=None)
|
|
26
|
+
__properties: ClassVar[List[str]] = ["backgroundColor", "crop"]
|
|
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 OutputImageParams 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
|
+
# override the default output from pydantic by calling `to_dict()` of crop
|
|
70
|
+
if self.crop:
|
|
71
|
+
_dict['crop'] = self.crop.to_dict()
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of OutputImageParams from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"backgroundColor": obj.get("backgroundColor"),
|
|
85
|
+
"crop": Crop.from_dict(obj["crop"]) if obj.get("crop") is not None else None
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|