-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathface_api.py
More file actions
371 lines (279 loc) · 11.5 KB
/
face_api.py
File metadata and controls
371 lines (279 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from regula.documentreader.webclient.gen.configuration import Configuration
# this line was added to enable pycharm type hinting
from regula.documentreader.webclient.gen.models import *
"""
"""
class FaceApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'url': 'str',
'mode': 'str',
'search': 'FaceApiSearch',
'threshold': 'int',
'service_timeout': 'int',
'proxy': 'str',
'proxy_userpwd': 'str',
'proxy_type': 'int',
'child_age_threshold': 'int',
'child_doc_validity_years': 'int'
}
attribute_map = {
'url': 'url',
'mode': 'mode',
'search': 'search',
'threshold': 'threshold',
'service_timeout': 'serviceTimeout',
'proxy': 'proxy',
'proxy_userpwd': 'proxy_userpwd',
'proxy_type': 'proxy_type',
'child_age_threshold': 'childAgeThreshold',
'child_doc_validity_years': 'childDocValidityYears'
}
def __init__(self, url=None, mode=None, search=None, threshold=None, service_timeout=None, proxy=None, proxy_userpwd=None, proxy_type=None, child_age_threshold=None, child_doc_validity_years=None, local_vars_configuration=None): # noqa: E501
"""FaceApi - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._url = None
self._mode = None
self._search = None
self._threshold = None
self._service_timeout = None
self._proxy = None
self._proxy_userpwd = None
self._proxy_type = None
self._child_age_threshold = None
self._child_doc_validity_years = None
self.discriminator = None
if url is not None:
self.url = url
if mode is not None:
self.mode = mode
if search is not None:
self.search = search
if threshold is not None:
self.threshold = threshold
if service_timeout is not None:
self.service_timeout = service_timeout
if proxy is not None:
self.proxy = proxy
if proxy_userpwd is not None:
self.proxy_userpwd = proxy_userpwd
if proxy_type is not None:
self.proxy_type = proxy_type
if child_age_threshold is not None:
self.child_age_threshold = child_age_threshold
if child_doc_validity_years is not None:
self.child_doc_validity_years = child_doc_validity_years
@property
def url(self):
"""Gets the url of this FaceApi. # noqa: E501
The URL of the Regula Face Web service to be used. # noqa: E501
:return: The url of this FaceApi. # noqa: E501
:rtype: str
"""
return self._url
@url.setter
def url(self, url):
"""Sets the url of this FaceApi.
The URL of the Regula Face Web service to be used. # noqa: E501
:param url: The url of this FaceApi. # noqa: E501
:type url: str
"""
self._url = url
@property
def mode(self):
"""Gets the mode of this FaceApi. # noqa: E501
The processing mode: \"match\" or \"match+search\". # noqa: E501
:return: The mode of this FaceApi. # noqa: E501
:rtype: str
"""
return self._mode
@mode.setter
def mode(self, mode):
"""Sets the mode of this FaceApi.
The processing mode: \"match\" or \"match+search\". # noqa: E501
:param mode: The mode of this FaceApi. # noqa: E501
:type mode: str
"""
self._mode = mode
@property
def search(self):
"""Gets the search of this FaceApi. # noqa: E501
:return: The search of this FaceApi. # noqa: E501
:rtype: FaceApiSearch
"""
return self._search
@search.setter
def search(self, search):
"""Sets the search of this FaceApi.
:param search: The search of this FaceApi. # noqa: E501
:type search: FaceApiSearch
"""
self._search = search
@property
def threshold(self):
"""Gets the threshold of this FaceApi. # noqa: E501
The similarity threshold, 0-100. Above 75 means that the faces' similarity is verified, below 75 is not. # noqa: E501
:return: The threshold of this FaceApi. # noqa: E501
:rtype: int
"""
return self._threshold
@threshold.setter
def threshold(self, threshold):
"""Sets the threshold of this FaceApi.
The similarity threshold, 0-100. Above 75 means that the faces' similarity is verified, below 75 is not. # noqa: E501
:param threshold: The threshold of this FaceApi. # noqa: E501
:type threshold: int
"""
self._threshold = threshold
@property
def service_timeout(self):
"""Gets the service_timeout of this FaceApi. # noqa: E501
The Regula Face Web service requests timeout, ms. # noqa: E501
:return: The service_timeout of this FaceApi. # noqa: E501
:rtype: int
"""
return self._service_timeout
@service_timeout.setter
def service_timeout(self, service_timeout):
"""Sets the service_timeout of this FaceApi.
The Regula Face Web service requests timeout, ms. # noqa: E501
:param service_timeout: The service_timeout of this FaceApi. # noqa: E501
:type service_timeout: int
"""
self._service_timeout = service_timeout
@property
def proxy(self):
"""Gets the proxy of this FaceApi. # noqa: E501
Proxy to use, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXY.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:return: The proxy of this FaceApi. # noqa: E501
:rtype: str
"""
return self._proxy
@proxy.setter
def proxy(self, proxy):
"""Sets the proxy of this FaceApi.
Proxy to use, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXY.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:param proxy: The proxy of this FaceApi. # noqa: E501
:type proxy: str
"""
self._proxy = proxy
@property
def proxy_userpwd(self):
"""Gets the proxy_userpwd of this FaceApi. # noqa: E501
Username and password to use for proxy authentication, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYUSERPWD.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:return: The proxy_userpwd of this FaceApi. # noqa: E501
:rtype: str
"""
return self._proxy_userpwd
@proxy_userpwd.setter
def proxy_userpwd(self, proxy_userpwd):
"""Sets the proxy_userpwd of this FaceApi.
Username and password to use for proxy authentication, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYUSERPWD.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:param proxy_userpwd: The proxy_userpwd of this FaceApi. # noqa: E501
:type proxy_userpwd: str
"""
self._proxy_userpwd = proxy_userpwd
@property
def proxy_type(self):
"""Gets the proxy_type of this FaceApi. # noqa: E501
Proxy protocol type, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYTYPE.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:return: The proxy_type of this FaceApi. # noqa: E501
:rtype: int
"""
return self._proxy_type
@proxy_type.setter
def proxy_type(self, proxy_type):
"""Sets the proxy_type of this FaceApi.
Proxy protocol type, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYTYPE.html\" target=\"_blank\">cURL standard</a>. # noqa: E501
:param proxy_type: The proxy_type of this FaceApi. # noqa: E501
:type proxy_type: int
"""
self._proxy_type = proxy_type
@property
def child_age_threshold(self):
"""Gets the child_age_threshold of this FaceApi. # noqa: E501
The age threshold for the portrait comparison. Default: 13. # noqa: E501
:return: The child_age_threshold of this FaceApi. # noqa: E501
:rtype: int
"""
return self._child_age_threshold
@child_age_threshold.setter
def child_age_threshold(self, child_age_threshold):
"""Sets the child_age_threshold of this FaceApi.
The age threshold for the portrait comparison. Default: 13. # noqa: E501
:param child_age_threshold: The child_age_threshold of this FaceApi. # noqa: E501
:type child_age_threshold: int
"""
self._child_age_threshold = child_age_threshold
@property
def child_doc_validity_years(self):
"""Gets the child_doc_validity_years of this FaceApi. # noqa: E501
Estimated duration of validity for a child's passport, years. Default: 5. # noqa: E501
:return: The child_doc_validity_years of this FaceApi. # noqa: E501
:rtype: int
"""
return self._child_doc_validity_years
@child_doc_validity_years.setter
def child_doc_validity_years(self, child_doc_validity_years):
"""Sets the child_doc_validity_years of this FaceApi.
Estimated duration of validity for a child's passport, years. Default: 5. # noqa: E501
:param child_doc_validity_years: The child_doc_validity_years of this FaceApi. # noqa: E501
:type child_doc_validity_years: int
"""
self._child_doc_validity_years = child_doc_validity_years
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, FaceApi):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, FaceApi):
return True
return self.to_dict() != other.to_dict()