regula-facesdk-webclient 6.4.198.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.

Potentially problematic release.


This version of regula-facesdk-webclient might be problematic. Click here for more details.

Files changed (133) hide show
  1. regula/__init__.py +0 -0
  2. regula/facesdk/__init__.py +0 -0
  3. regula/facesdk/webclient/__init__.py +15 -0
  4. regula/facesdk/webclient/ext/__init__.py +5 -0
  5. regula/facesdk/webclient/ext/api/__init__.py +3 -0
  6. regula/facesdk/webclient/ext/api/group_api.py +36 -0
  7. regula/facesdk/webclient/ext/api/match_api.py +46 -0
  8. regula/facesdk/webclient/ext/api/person_api.py +46 -0
  9. regula/facesdk/webclient/ext/api/sdk.py +28 -0
  10. regula/facesdk/webclient/ext/api/search_api.py +17 -0
  11. regula/facesdk/webclient/ext/common.py +7 -0
  12. regula/facesdk/webclient/ext/models/__init__.py +6 -0
  13. regula/facesdk/webclient/ext/models/detect_request.py +32 -0
  14. regula/facesdk/webclient/ext/models/match_image.py +19 -0
  15. regula/facesdk/webclient/ext/models/match_request.py +34 -0
  16. regula/facesdk/webclient/gen/__init__.py +27 -0
  17. regula/facesdk/webclient/gen/api/__init__.py +3 -0
  18. regula/facesdk/webclient/gen/api/diagnostics_api.py +162 -0
  19. regula/facesdk/webclient/gen/api/group_api.py +1040 -0
  20. regula/facesdk/webclient/gen/api/healthcheck_api.py +283 -0
  21. regula/facesdk/webclient/gen/api/liveness_2_0_api.py +168 -0
  22. regula/facesdk/webclient/gen/api/liveness_api.py +424 -0
  23. regula/facesdk/webclient/gen/api/match_api.py +463 -0
  24. regula/facesdk/webclient/gen/api/person_api.py +1345 -0
  25. regula/facesdk/webclient/gen/api/search_api.py +177 -0
  26. regula/facesdk/webclient/gen/api_client.py +695 -0
  27. regula/facesdk/webclient/gen/apis/__init__.py +22 -0
  28. regula/facesdk/webclient/gen/configuration.py +446 -0
  29. regula/facesdk/webclient/gen/exceptions.py +159 -0
  30. regula/facesdk/webclient/gen/model/__init__.py +5 -0
  31. regula/facesdk/webclient/gen/model/add_image_to_person_request.py +205 -0
  32. regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py +204 -0
  33. regula/facesdk/webclient/gen/model/add_image_to_person_response.py +262 -0
  34. regula/facesdk/webclient/gen/model/attribute_config.py +120 -0
  35. regula/facesdk/webclient/gen/model/attribute_config_list.py +92 -0
  36. regula/facesdk/webclient/gen/model/crop.py +208 -0
  37. regula/facesdk/webclient/gen/model/detect_request.py +204 -0
  38. regula/facesdk/webclient/gen/model/detect_request_attributes.py +120 -0
  39. regula/facesdk/webclient/gen/model/detect_response.py +147 -0
  40. regula/facesdk/webclient/gen/model/detect_response_all_of.py +120 -0
  41. regula/facesdk/webclient/gen/model/detect_result.py +231 -0
  42. regula/facesdk/webclient/gen/model/detection.py +258 -0
  43. regula/facesdk/webclient/gen/model/detection_attributes.py +148 -0
  44. regula/facesdk/webclient/gen/model/detection_face.py +260 -0
  45. regula/facesdk/webclient/gen/model/detection_quality.py +234 -0
  46. regula/facesdk/webclient/gen/model/device_info.py +231 -0
  47. regula/facesdk/webclient/gen/model/face_align_type_quality.py +109 -0
  48. regula/facesdk/webclient/gen/model/face_attribute.py +133 -0
  49. regula/facesdk/webclient/gen/model/face_image_quality_align_type.py +109 -0
  50. regula/facesdk/webclient/gen/model/face_image_quality_groups.py +118 -0
  51. regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py +118 -0
  52. regula/facesdk/webclient/gen/model/face_image_quality_status.py +103 -0
  53. regula/facesdk/webclient/gen/model/face_quality_config_name.py +238 -0
  54. regula/facesdk/webclient/gen/model/face_quality_scenarios.py +121 -0
  55. regula/facesdk/webclient/gen/model/face_quality_status.py +103 -0
  56. regula/facesdk/webclient/gen/model/face_rectangular.py +92 -0
  57. regula/facesdk/webclient/gen/model/face_sdk_result.py +121 -0
  58. regula/facesdk/webclient/gen/model/face_sdk_result_code.py +217 -0
  59. regula/facesdk/webclient/gen/model/faces_response.py +286 -0
  60. regula/facesdk/webclient/gen/model/faces_response_all_of.py +148 -0
  61. regula/facesdk/webclient/gen/model/filter_op.py +100 -0
  62. regula/facesdk/webclient/gen/model/filter_search_request.py +176 -0
  63. regula/facesdk/webclient/gen/model/group.py +206 -0
  64. regula/facesdk/webclient/gen/model/group_all_of.py +150 -0
  65. regula/facesdk/webclient/gen/model/group_page.py +178 -0
  66. regula/facesdk/webclient/gen/model/group_page_all_of.py +122 -0
  67. regula/facesdk/webclient/gen/model/group_response.py +150 -0
  68. regula/facesdk/webclient/gen/model/group_to_create.py +180 -0
  69. regula/facesdk/webclient/gen/model/image.py +290 -0
  70. regula/facesdk/webclient/gen/model/image_fields.py +258 -0
  71. regula/facesdk/webclient/gen/model/image_fields_image.py +204 -0
  72. regula/facesdk/webclient/gen/model/image_page.py +176 -0
  73. regula/facesdk/webclient/gen/model/image_page_all_of.py +120 -0
  74. regula/facesdk/webclient/gen/model/image_source.py +115 -0
  75. regula/facesdk/webclient/gen/model/liveness_transaction.py +334 -0
  76. regula/facesdk/webclient/gen/model/liveness_type.py +100 -0
  77. regula/facesdk/webclient/gen/model/match_and_search_request.py +178 -0
  78. regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py +178 -0
  79. regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py +148 -0
  80. regula/facesdk/webclient/gen/model/match_and_search_response.py +233 -0
  81. regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py +206 -0
  82. regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py +176 -0
  83. regula/facesdk/webclient/gen/model/match_image.py +205 -0
  84. regula/facesdk/webclient/gen/model/match_image_detection.py +178 -0
  85. regula/facesdk/webclient/gen/model/match_image_result.py +316 -0
  86. regula/facesdk/webclient/gen/model/match_request.py +204 -0
  87. regula/facesdk/webclient/gen/model/match_request_output_image_params.py +148 -0
  88. regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py +212 -0
  89. regula/facesdk/webclient/gen/model/match_response.py +205 -0
  90. regula/facesdk/webclient/gen/model/match_response_all_of.py +178 -0
  91. regula/facesdk/webclient/gen/model/operation_log.py +206 -0
  92. regula/facesdk/webclient/gen/model/output_image_params.py +146 -0
  93. regula/facesdk/webclient/gen/model/page.py +150 -0
  94. regula/facesdk/webclient/gen/model/person.py +318 -0
  95. regula/facesdk/webclient/gen/model/person_all_of.py +206 -0
  96. regula/facesdk/webclient/gen/model/person_created_response.py +178 -0
  97. regula/facesdk/webclient/gen/model/person_fields.py +234 -0
  98. regula/facesdk/webclient/gen/model/person_to_update_fields.py +206 -0
  99. regula/facesdk/webclient/gen/model/person_with_images.py +346 -0
  100. regula/facesdk/webclient/gen/model/person_with_images_all_of.py +122 -0
  101. regula/facesdk/webclient/gen/model/persons_page.py +176 -0
  102. regula/facesdk/webclient/gen/model/persons_page_all_of.py +120 -0
  103. regula/facesdk/webclient/gen/model/process_param.py +226 -0
  104. regula/facesdk/webclient/gen/model/process_param_attributes.py +120 -0
  105. regula/facesdk/webclient/gen/model/quality_config.py +154 -0
  106. regula/facesdk/webclient/gen/model/quality_config_list.py +92 -0
  107. regula/facesdk/webclient/gen/model/quality_detail.py +234 -0
  108. regula/facesdk/webclient/gen/model/quality_details_groups.py +202 -0
  109. regula/facesdk/webclient/gen/model/quality_request.py +146 -0
  110. regula/facesdk/webclient/gen/model/recognize_image.py +346 -0
  111. regula/facesdk/webclient/gen/model/recognize_image_all_of.py +150 -0
  112. regula/facesdk/webclient/gen/model/resize_options.py +178 -0
  113. regula/facesdk/webclient/gen/model/rgb.py +92 -0
  114. regula/facesdk/webclient/gen/model/search_bad_params.py +172 -0
  115. regula/facesdk/webclient/gen/model/search_detection.py +398 -0
  116. regula/facesdk/webclient/gen/model/search_parameters.py +174 -0
  117. regula/facesdk/webclient/gen/model/search_parameters_create_person.py +177 -0
  118. regula/facesdk/webclient/gen/model/search_person.py +372 -0
  119. regula/facesdk/webclient/gen/model/search_person_all_of.py +148 -0
  120. regula/facesdk/webclient/gen/model/search_request.py +338 -0
  121. regula/facesdk/webclient/gen/model/search_request_all_of.py +178 -0
  122. regula/facesdk/webclient/gen/model/search_result.py +313 -0
  123. regula/facesdk/webclient/gen/model/search_result_all_of.py +122 -0
  124. regula/facesdk/webclient/gen/model/transaction_config.py +92 -0
  125. regula/facesdk/webclient/gen/model/transaction_info.py +344 -0
  126. regula/facesdk/webclient/gen/model/update_group.py +150 -0
  127. regula/facesdk/webclient/gen/model_utils.py +2037 -0
  128. regula/facesdk/webclient/gen/models/__init__.py +96 -0
  129. regula/facesdk/webclient/gen/rest.py +346 -0
  130. regula_facesdk_webclient-6.4.198.dev0.dist-info/METADATA +73 -0
  131. regula_facesdk_webclient-6.4.198.dev0.dist-info/RECORD +133 -0
  132. regula_facesdk_webclient-6.4.198.dev0.dist-info/WHEEL +5 -0
  133. regula_facesdk_webclient-6.4.198.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,463 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Regula Face SDK Web API
5
+
6
+ <a href=\"https://regulaforensics.com/products/face-recognition-sdk/ \" target=\"_blank\">Regula Face SDK</a> is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * <a href=\"https://docs.regulaforensics.com/develop/face-sdk/overview/introduction/#face-detection\" target=\"_blank\">Face detection and image quality assessment</a> * <a href=\"https://docs.regulaforensics.com/develop/face-sdk/overview/introduction/#face-comparison-11\" target=\"_blank\">Face match (1:1)</a> * <a href=\"https://docs.regulaforensics.com/develop/face-sdk/overview/introduction/#face-identification-1n\" target=\"_blank\">Face search (1:N)</a> * <a href=\"https://docs.regulaforensics.com/develop/face-sdk/overview/introduction/#liveness-assessment\" target=\"_blank\">Liveness detection</a> Here is the <a href=\"https://github.com/regulaforensics/FaceSDK-web-openapi \" target=\"_blank\">OpenAPI specification on GitHub</a>. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501
7
+
8
+ The version of the OpenAPI document: 6.2.0
9
+ Generated by: https://openapi-generator.tech
10
+ """
11
+
12
+
13
+ from __future__ import absolute_import
14
+
15
+ import re # noqa: F401
16
+
17
+ # python 2 and python 3 compatibility library
18
+ import six
19
+
20
+ from regula.facesdk.webclient.gen.api_client import ApiClient
21
+ from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401
22
+ ApiTypeError,
23
+ ApiValueError
24
+ )
25
+
26
+
27
+ class MatchApi(object):
28
+ """NOTE: This class is auto generated by OpenAPI Generator
29
+ Ref: https://openapi-generator.tech
30
+
31
+ Do not edit the class manually.
32
+ """
33
+
34
+ def __init__(self, api_client=None):
35
+ if api_client is None:
36
+ api_client = ApiClient()
37
+ self.api_client = api_client
38
+
39
+ def detect(self, detect_request, **kwargs): # noqa: E501
40
+ """detect and check quality # noqa: E501
41
+
42
+ Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. # noqa: E501
43
+ This method makes a synchronous HTTP request by default. To make an
44
+ asynchronous HTTP request, please pass async_req=True
45
+
46
+ >>> thread = api.detect(detect_request, async_req=True)
47
+ >>> result = thread.get()
48
+
49
+ :param detect_request: (required)
50
+ :type detect_request: DetectRequest
51
+ :param x_request_id: Request header label.
52
+ :type x_request_id: str
53
+ :param async_req: Whether to execute the request asynchronously.
54
+ :type async_req: bool, optional
55
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
56
+ be returned without reading/decoding response
57
+ data. Default is True.
58
+ :type _preload_content: bool, optional
59
+ :param _request_timeout: timeout setting for this request. If one
60
+ number provided, it will be total request
61
+ timeout. It can also be a pair (tuple) of
62
+ (connection, read) timeouts.
63
+ :return: Returns the result object.
64
+ If the method is called asynchronously,
65
+ returns the request thread.
66
+ :rtype: DetectResponse
67
+ """
68
+ kwargs['_return_http_data_only'] = True
69
+ return self.detect_with_http_info(detect_request, **kwargs) # noqa: E501
70
+
71
+ def detect_with_http_info(self, detect_request, **kwargs): # noqa: E501
72
+ """detect and check quality # noqa: E501
73
+
74
+ Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. # noqa: E501
75
+ This method makes a synchronous HTTP request by default. To make an
76
+ asynchronous HTTP request, please pass async_req=True
77
+
78
+ >>> thread = api.detect_with_http_info(detect_request, async_req=True)
79
+ >>> result = thread.get()
80
+
81
+ :param detect_request: (required)
82
+ :type detect_request: DetectRequest
83
+ :param x_request_id: Request header label.
84
+ :type x_request_id: str
85
+ :param async_req: Whether to execute the request asynchronously.
86
+ :type async_req: bool, optional
87
+ :param _return_http_data_only: response data without head status code
88
+ and headers
89
+ :type _return_http_data_only: bool, optional
90
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
91
+ be returned without reading/decoding response
92
+ data. Default is True.
93
+ :type _preload_content: bool, optional
94
+ :param _request_timeout: timeout setting for this request. If one
95
+ number provided, it will be total request
96
+ timeout. It can also be a pair (tuple) of
97
+ (connection, read) timeouts.
98
+ :param _request_auth: set to override the auth_settings for an a single
99
+ request; this effectively ignores the authentication
100
+ in the spec for a single request.
101
+ :type _request_auth: dict, optional
102
+ :return: Returns the result object.
103
+ If the method is called asynchronously,
104
+ returns the request thread.
105
+ :rtype: tuple(DetectResponse, status_code(int), headers(HTTPHeaderDict))
106
+ """
107
+
108
+ local_var_params = locals()
109
+
110
+ all_params = [
111
+ 'detect_request',
112
+ 'x_request_id',
113
+ ]
114
+ all_params.extend(
115
+ [
116
+ 'async_req',
117
+ '_return_http_data_only',
118
+ '_preload_content',
119
+ '_request_timeout',
120
+ '_request_auth'
121
+ ]
122
+ )
123
+
124
+ for key, val in six.iteritems(local_var_params['kwargs']):
125
+ if key not in all_params:
126
+ raise ApiTypeError(
127
+ "Got an unexpected keyword argument '%s'"
128
+ " to method detect" % key
129
+ )
130
+ local_var_params[key] = val
131
+ del local_var_params['kwargs']
132
+ # verify the required parameter 'detect_request' is set
133
+ if self.api_client.client_side_validation and ('detect_request' not in local_var_params or # noqa: E501
134
+ local_var_params['detect_request'] is None): # noqa: E501
135
+ raise ApiValueError("Missing the required parameter `detect_request` when calling `detect`") # noqa: E501
136
+
137
+ collection_formats = {}
138
+
139
+ path_params = {}
140
+
141
+ query_params = []
142
+
143
+ header_params = {}
144
+ if 'x_request_id' in local_var_params:
145
+ header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501
146
+
147
+ form_params = []
148
+ local_var_files = {}
149
+
150
+ body_params = None
151
+ if 'detect_request' in local_var_params:
152
+ body_params = local_var_params['detect_request']
153
+ # HTTP header `Accept`
154
+ header_params['Accept'] = self.api_client.select_header_accept(
155
+ ['application/json']) # noqa: E501
156
+
157
+ # HTTP header `Content-Type`
158
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
159
+ ['application/json']) # noqa: E501
160
+
161
+ # Authentication setting
162
+ auth_settings = [] # noqa: E501
163
+
164
+ return self.api_client.call_api(
165
+ '/api/detect', 'POST',
166
+ path_params,
167
+ query_params,
168
+ header_params,
169
+ body=body_params,
170
+ post_params=form_params,
171
+ files=local_var_files,
172
+ response_type='DetectResponse', # noqa: E501
173
+ auth_settings=auth_settings,
174
+ async_req=local_var_params.get('async_req'),
175
+ _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
176
+ _preload_content=local_var_params.get('_preload_content', True),
177
+ _request_timeout=local_var_params.get('_request_timeout'),
178
+ collection_formats=collection_formats,
179
+ _request_auth=local_var_params.get('_request_auth'))
180
+
181
+ def match(self, match_request, **kwargs): # noqa: E501
182
+ """compare faces (1:1) # noqa: E501
183
+
184
+ To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` # noqa: E501
185
+ This method makes a synchronous HTTP request by default. To make an
186
+ asynchronous HTTP request, please pass async_req=True
187
+
188
+ >>> thread = api.match(match_request, async_req=True)
189
+ >>> result = thread.get()
190
+
191
+ :param match_request: (required)
192
+ :type match_request: MatchRequest
193
+ :param x_request_id: Request header label.
194
+ :type x_request_id: str
195
+ :param async_req: Whether to execute the request asynchronously.
196
+ :type async_req: bool, optional
197
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
198
+ be returned without reading/decoding response
199
+ data. Default is True.
200
+ :type _preload_content: bool, optional
201
+ :param _request_timeout: timeout setting for this request. If one
202
+ number provided, it will be total request
203
+ timeout. It can also be a pair (tuple) of
204
+ (connection, read) timeouts.
205
+ :return: Returns the result object.
206
+ If the method is called asynchronously,
207
+ returns the request thread.
208
+ :rtype: MatchResponse
209
+ """
210
+ kwargs['_return_http_data_only'] = True
211
+ return self.match_with_http_info(match_request, **kwargs) # noqa: E501
212
+
213
+ def match_with_http_info(self, match_request, **kwargs): # noqa: E501
214
+ """compare faces (1:1) # noqa: E501
215
+
216
+ To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` # noqa: E501
217
+ This method makes a synchronous HTTP request by default. To make an
218
+ asynchronous HTTP request, please pass async_req=True
219
+
220
+ >>> thread = api.match_with_http_info(match_request, async_req=True)
221
+ >>> result = thread.get()
222
+
223
+ :param match_request: (required)
224
+ :type match_request: MatchRequest
225
+ :param x_request_id: Request header label.
226
+ :type x_request_id: str
227
+ :param async_req: Whether to execute the request asynchronously.
228
+ :type async_req: bool, optional
229
+ :param _return_http_data_only: response data without head status code
230
+ and headers
231
+ :type _return_http_data_only: bool, optional
232
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
233
+ be returned without reading/decoding response
234
+ data. Default is True.
235
+ :type _preload_content: bool, optional
236
+ :param _request_timeout: timeout setting for this request. If one
237
+ number provided, it will be total request
238
+ timeout. It can also be a pair (tuple) of
239
+ (connection, read) timeouts.
240
+ :param _request_auth: set to override the auth_settings for an a single
241
+ request; this effectively ignores the authentication
242
+ in the spec for a single request.
243
+ :type _request_auth: dict, optional
244
+ :return: Returns the result object.
245
+ If the method is called asynchronously,
246
+ returns the request thread.
247
+ :rtype: tuple(MatchResponse, status_code(int), headers(HTTPHeaderDict))
248
+ """
249
+
250
+ local_var_params = locals()
251
+
252
+ all_params = [
253
+ 'match_request',
254
+ 'x_request_id',
255
+ ]
256
+ all_params.extend(
257
+ [
258
+ 'async_req',
259
+ '_return_http_data_only',
260
+ '_preload_content',
261
+ '_request_timeout',
262
+ '_request_auth'
263
+ ]
264
+ )
265
+
266
+ for key, val in six.iteritems(local_var_params['kwargs']):
267
+ if key not in all_params:
268
+ raise ApiTypeError(
269
+ "Got an unexpected keyword argument '%s'"
270
+ " to method match" % key
271
+ )
272
+ local_var_params[key] = val
273
+ del local_var_params['kwargs']
274
+ # verify the required parameter 'match_request' is set
275
+ if self.api_client.client_side_validation and ('match_request' not in local_var_params or # noqa: E501
276
+ local_var_params['match_request'] is None): # noqa: E501
277
+ raise ApiValueError("Missing the required parameter `match_request` when calling `match`") # noqa: E501
278
+
279
+ collection_formats = {}
280
+
281
+ path_params = {}
282
+
283
+ query_params = []
284
+
285
+ header_params = {}
286
+ if 'x_request_id' in local_var_params:
287
+ header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501
288
+
289
+ form_params = []
290
+ local_var_files = {}
291
+
292
+ body_params = None
293
+ if 'match_request' in local_var_params:
294
+ body_params = local_var_params['match_request']
295
+ # HTTP header `Accept`
296
+ header_params['Accept'] = self.api_client.select_header_accept(
297
+ ['application/json']) # noqa: E501
298
+
299
+ # HTTP header `Content-Type`
300
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
301
+ ['application/json']) # noqa: E501
302
+
303
+ # Authentication setting
304
+ auth_settings = [] # noqa: E501
305
+
306
+ return self.api_client.call_api(
307
+ '/api/match', 'POST',
308
+ path_params,
309
+ query_params,
310
+ header_params,
311
+ body=body_params,
312
+ post_params=form_params,
313
+ files=local_var_files,
314
+ response_type='MatchResponse', # noqa: E501
315
+ auth_settings=auth_settings,
316
+ async_req=local_var_params.get('async_req'),
317
+ _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
318
+ _preload_content=local_var_params.get('_preload_content', True),
319
+ _request_timeout=local_var_params.get('_request_timeout'),
320
+ collection_formats=collection_formats,
321
+ _request_auth=local_var_params.get('_request_auth'))
322
+
323
+ def match_and_search(self, match_and_search_request, **kwargs): # noqa: E501
324
+ """match and search (1:1 + 1:N) # noqa: E501
325
+
326
+ To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out. # noqa: E501
327
+ This method makes a synchronous HTTP request by default. To make an
328
+ asynchronous HTTP request, please pass async_req=True
329
+
330
+ >>> thread = api.match_and_search(match_and_search_request, async_req=True)
331
+ >>> result = thread.get()
332
+
333
+ :param match_and_search_request: (required)
334
+ :type match_and_search_request: MatchAndSearchRequest
335
+ :param x_request_id: Request header label.
336
+ :type x_request_id: str
337
+ :param async_req: Whether to execute the request asynchronously.
338
+ :type async_req: bool, optional
339
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
340
+ be returned without reading/decoding response
341
+ data. Default is True.
342
+ :type _preload_content: bool, optional
343
+ :param _request_timeout: timeout setting for this request. If one
344
+ number provided, it will be total request
345
+ timeout. It can also be a pair (tuple) of
346
+ (connection, read) timeouts.
347
+ :return: Returns the result object.
348
+ If the method is called asynchronously,
349
+ returns the request thread.
350
+ :rtype: MatchAndSearchResponse
351
+ """
352
+ kwargs['_return_http_data_only'] = True
353
+ return self.match_and_search_with_http_info(match_and_search_request, **kwargs) # noqa: E501
354
+
355
+ def match_and_search_with_http_info(self, match_and_search_request, **kwargs): # noqa: E501
356
+ """match and search (1:1 + 1:N) # noqa: E501
357
+
358
+ To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out. # noqa: E501
359
+ This method makes a synchronous HTTP request by default. To make an
360
+ asynchronous HTTP request, please pass async_req=True
361
+
362
+ >>> thread = api.match_and_search_with_http_info(match_and_search_request, async_req=True)
363
+ >>> result = thread.get()
364
+
365
+ :param match_and_search_request: (required)
366
+ :type match_and_search_request: MatchAndSearchRequest
367
+ :param x_request_id: Request header label.
368
+ :type x_request_id: str
369
+ :param async_req: Whether to execute the request asynchronously.
370
+ :type async_req: bool, optional
371
+ :param _return_http_data_only: response data without head status code
372
+ and headers
373
+ :type _return_http_data_only: bool, optional
374
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
375
+ be returned without reading/decoding response
376
+ data. Default is True.
377
+ :type _preload_content: bool, optional
378
+ :param _request_timeout: timeout setting for this request. If one
379
+ number provided, it will be total request
380
+ timeout. It can also be a pair (tuple) of
381
+ (connection, read) timeouts.
382
+ :param _request_auth: set to override the auth_settings for an a single
383
+ request; this effectively ignores the authentication
384
+ in the spec for a single request.
385
+ :type _request_auth: dict, optional
386
+ :return: Returns the result object.
387
+ If the method is called asynchronously,
388
+ returns the request thread.
389
+ :rtype: tuple(MatchAndSearchResponse, status_code(int), headers(HTTPHeaderDict))
390
+ """
391
+
392
+ local_var_params = locals()
393
+
394
+ all_params = [
395
+ 'match_and_search_request',
396
+ 'x_request_id',
397
+ ]
398
+ all_params.extend(
399
+ [
400
+ 'async_req',
401
+ '_return_http_data_only',
402
+ '_preload_content',
403
+ '_request_timeout',
404
+ '_request_auth'
405
+ ]
406
+ )
407
+
408
+ for key, val in six.iteritems(local_var_params['kwargs']):
409
+ if key not in all_params:
410
+ raise ApiTypeError(
411
+ "Got an unexpected keyword argument '%s'"
412
+ " to method match_and_search" % key
413
+ )
414
+ local_var_params[key] = val
415
+ del local_var_params['kwargs']
416
+ # verify the required parameter 'match_and_search_request' is set
417
+ if self.api_client.client_side_validation and ('match_and_search_request' not in local_var_params or # noqa: E501
418
+ local_var_params['match_and_search_request'] is None): # noqa: E501
419
+ raise ApiValueError("Missing the required parameter `match_and_search_request` when calling `match_and_search`") # noqa: E501
420
+
421
+ collection_formats = {}
422
+
423
+ path_params = {}
424
+
425
+ query_params = []
426
+
427
+ header_params = {}
428
+ if 'x_request_id' in local_var_params:
429
+ header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501
430
+
431
+ form_params = []
432
+ local_var_files = {}
433
+
434
+ body_params = None
435
+ if 'match_and_search_request' in local_var_params:
436
+ body_params = local_var_params['match_and_search_request']
437
+ # HTTP header `Accept`
438
+ header_params['Accept'] = self.api_client.select_header_accept(
439
+ ['application/json']) # noqa: E501
440
+
441
+ # HTTP header `Content-Type`
442
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
443
+ ['application/json']) # noqa: E501
444
+
445
+ # Authentication setting
446
+ auth_settings = [] # noqa: E501
447
+
448
+ return self.api_client.call_api(
449
+ '/api/match_and_search', 'POST',
450
+ path_params,
451
+ query_params,
452
+ header_params,
453
+ body=body_params,
454
+ post_params=form_params,
455
+ files=local_var_files,
456
+ response_type='MatchAndSearchResponse', # noqa: E501
457
+ auth_settings=auth_settings,
458
+ async_req=local_var_params.get('async_req'),
459
+ _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
460
+ _preload_content=local_var_params.get('_preload_content', True),
461
+ _request_timeout=local_var_params.get('_request_timeout'),
462
+ collection_formats=collection_formats,
463
+ _request_auth=local_var_params.get('_request_auth'))