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,22 @@
1
+
2
+ # flake8: noqa
3
+
4
+ # Import all APIs into this package.
5
+ # If you have many APIs here with many many models used in each API this may
6
+ # raise a `RecursionError`.
7
+ # In order to avoid this, import only the API that you directly need like:
8
+ #
9
+ # from .api.group_api import GroupApi
10
+ #
11
+ # or import this package, but before doing it, use:
12
+ #
13
+ # import sys
14
+ # sys.setrecursionlimit(n)
15
+
16
+ # Import APIs into API package:
17
+ from regula.facesdk.webclient.gen.api.group_api import GroupApi
18
+ from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi
19
+ from regula.facesdk.webclient.gen.api.liveness_2_0_api import Liveness20Api
20
+ from regula.facesdk.webclient.gen.api.match_api import MatchApi
21
+ from regula.facesdk.webclient.gen.api.person_api import PersonApi
22
+ from regula.facesdk.webclient.gen.api.search_api import SearchApi
@@ -0,0 +1,446 @@
1
+ """
2
+ Regula Face SDK Web API
3
+
4
+ <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
5
+
6
+ The version of the OpenAPI document: 6.2.0
7
+ Generated by: https://openapi-generator.tech
8
+ """
9
+
10
+
11
+ import copy
12
+ import logging
13
+ import multiprocessing
14
+ import sys
15
+ import urllib3
16
+
17
+ from http import client as http_client
18
+ from regula.facesdk.webclient.gen.exceptions import ApiValueError
19
+
20
+
21
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
22
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
23
+ 'minimum', 'exclusiveMinimum', 'maxLength',
24
+ 'minLength', 'pattern', 'maxItems', 'minItems'
25
+ }
26
+
27
+ class Configuration(object):
28
+ """NOTE: This class is auto generated by OpenAPI Generator
29
+
30
+ Ref: https://openapi-generator.tech
31
+ Do not edit the class manually.
32
+
33
+ :param host: Base url
34
+ :param api_key: Dict to store API key(s).
35
+ Each entry in the dict specifies an API key.
36
+ The dict key is the name of the security scheme in the OAS specification.
37
+ The dict value is the API key secret.
38
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer)
39
+ The dict key is the name of the security scheme in the OAS specification.
40
+ The dict value is an API key prefix when generating the auth data.
41
+ :param username: Username for HTTP basic authentication
42
+ :param password: Password for HTTP basic authentication
43
+ :param discard_unknown_keys: Boolean value indicating whether to discard
44
+ unknown properties. A server may send a response that includes additional
45
+ properties that are not known by the client in the following scenarios:
46
+ 1. The OpenAPI document is incomplete, i.e. it does not match the server
47
+ implementation.
48
+ 2. The client was generated using an older version of the OpenAPI document
49
+ and the server has been upgraded since then.
50
+ If a schema in the OpenAPI document defines the additionalProperties attribute,
51
+ then all undeclared properties received by the server are injected into the
52
+ additional properties map. In that case, there are undeclared properties, and
53
+ nothing to discard.
54
+ :param disabled_client_side_validations (string): Comma-separated list of
55
+ JSON schema validation keywords to disable JSON schema structural validation
56
+ rules. The following keywords may be specified: multipleOf, maximum,
57
+ exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
58
+ maxItems, minItems.
59
+ By default, the validation is performed for data generated locally by the client
60
+ and data received from the server, independent of any validation performed by
61
+ the server side. If the input data does not satisfy the JSON schema validation
62
+ rules specified in the OpenAPI document, an exception is raised.
63
+ If disabled_client_side_validations is set, structural validation is
64
+ disabled. This can be useful to troubleshoot data validation problem, such as
65
+ when the OpenAPI document validation rules do not match the actual API data
66
+ received by the server.
67
+ :param server_index: Index to servers configuration.
68
+ :param server_variables: Mapping with string values to replace variables in
69
+ templated server configuration. The validation of enums is performed for
70
+ variables with defined enum values before.
71
+ :param server_operation_index: Mapping from operation ID to an index to server
72
+ configuration.
73
+ :param server_operation_variables: Mapping from operation ID to a mapping with
74
+ string values to replace variables in templated server configuration.
75
+ The validation of enums is performed for variables with defined enum values before.
76
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
77
+ in PEM format
78
+
79
+ """
80
+
81
+ _default = None
82
+
83
+ def __init__(self, host=None,
84
+ api_key=None, api_key_prefix=None,
85
+ access_token=None,
86
+ username=None, password=None,
87
+ discard_unknown_keys=False,
88
+ disabled_client_side_validations="",
89
+ server_index=None, server_variables=None,
90
+ server_operation_index=None, server_operation_variables=None,
91
+ ssl_ca_cert=None,
92
+ ):
93
+ """Constructor
94
+ """
95
+ self._base_path = "http://localhost:41101" if host is None else host
96
+ """Default Base url
97
+ """
98
+ self.server_index = 0 if server_index is None and host is None else server_index
99
+ self.server_operation_index = server_operation_index or {}
100
+ """Default server index
101
+ """
102
+ self.server_variables = server_variables or {}
103
+ self.server_operation_variables = server_operation_variables or {}
104
+ """Default server variables
105
+ """
106
+ self.temp_folder_path = None
107
+ """Temp file folder for downloading files
108
+ """
109
+ # Authentication Settings
110
+ self.access_token = access_token
111
+ self.api_key = {}
112
+ if api_key:
113
+ self.api_key = api_key
114
+ """dict to store API key(s)
115
+ """
116
+ self.api_key_prefix = {}
117
+ if api_key_prefix:
118
+ self.api_key_prefix = api_key_prefix
119
+ """dict to store API prefix (e.g. Bearer)
120
+ """
121
+ self.refresh_api_key_hook = None
122
+ """function hook to refresh API key if expired
123
+ """
124
+ self.username = username
125
+ """Username for HTTP basic authentication
126
+ """
127
+ self.password = password
128
+ """Password for HTTP basic authentication
129
+ """
130
+ self.discard_unknown_keys = discard_unknown_keys
131
+ self.disabled_client_side_validations = disabled_client_side_validations
132
+ self.logger = {}
133
+ """Logging Settings
134
+ """
135
+ self.logger["package_logger"] = logging.getLogger("regula.facesdk.webclient.gen")
136
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
137
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
138
+ """Log format
139
+ """
140
+ self.logger_stream_handler = None
141
+ """Log stream handler
142
+ """
143
+ self.logger_file_handler = None
144
+ """Log file handler
145
+ """
146
+ self.logger_file = None
147
+ """Debug file location
148
+ """
149
+ self.debug = False
150
+ """Debug switch
151
+ """
152
+
153
+ self.verify_ssl = True
154
+ """SSL/TLS verification
155
+ Set this to false to skip verifying SSL certificate when calling API
156
+ from https server.
157
+ """
158
+ self.ssl_ca_cert = ssl_ca_cert
159
+ """Set this to customize the certificate file to verify the peer.
160
+ """
161
+ self.cert_file = None
162
+ """client certificate file
163
+ """
164
+ self.key_file = None
165
+ """client key file
166
+ """
167
+ self.assert_hostname = None
168
+ """Set this to True/False to enable/disable SSL hostname verification.
169
+ """
170
+
171
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
172
+ """urllib3 connection pool's maximum number of connections saved
173
+ per pool. urllib3 uses 1 connection as default value, but this is
174
+ not the best value when you are making a lot of possibly parallel
175
+ requests to the same host, which is often the case here.
176
+ cpu_count * 5 is used as default value to increase performance.
177
+ """
178
+
179
+ self.proxy = None
180
+ """Proxy URL
181
+ """
182
+ self.no_proxy = None
183
+ """bypass proxy for host in the no_proxy list.
184
+ """
185
+ self.proxy_headers = None
186
+ """Proxy headers
187
+ """
188
+ self.safe_chars_for_path_param = ''
189
+ """Safe chars for path_param
190
+ """
191
+ self.retries = None
192
+ """Adding retries to override urllib3 default value 3
193
+ """
194
+ # Enable client side validation
195
+ self.client_side_validation = True
196
+
197
+ # Options to pass down to the underlying urllib3 socket
198
+ self.socket_options = None
199
+
200
+ def __deepcopy__(self, memo):
201
+ cls = self.__class__
202
+ result = cls.__new__(cls)
203
+ memo[id(self)] = result
204
+ for k, v in self.__dict__.items():
205
+ if k not in ('logger', 'logger_file_handler'):
206
+ setattr(result, k, copy.deepcopy(v, memo))
207
+ # shallow copy of loggers
208
+ result.logger = copy.copy(self.logger)
209
+ # use setters to configure loggers
210
+ result.logger_file = self.logger_file
211
+ result.debug = self.debug
212
+ return result
213
+
214
+ def __setattr__(self, name, value):
215
+ object.__setattr__(self, name, value)
216
+ if name == 'disabled_client_side_validations':
217
+ s = set(filter(None, value.split(',')))
218
+ for v in s:
219
+ if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
220
+ raise ApiValueError(
221
+ "Invalid keyword: '{0}''".format(v))
222
+ self._disabled_client_side_validations = s
223
+
224
+ @classmethod
225
+ def set_default(cls, default):
226
+ """Set default instance of configuration.
227
+
228
+ It stores default configuration, which can be
229
+ returned by get_default_copy method.
230
+
231
+ :param default: object of Configuration
232
+ """
233
+ cls._default = copy.deepcopy(default)
234
+
235
+ @classmethod
236
+ def get_default_copy(cls):
237
+ """Return new instance of configuration.
238
+
239
+ This method returns newly created, based on default constructor,
240
+ object of Configuration class or returns a copy of default
241
+ configuration passed by the set_default method.
242
+
243
+ :return: The configuration object.
244
+ """
245
+ if cls._default is not None:
246
+ return copy.deepcopy(cls._default)
247
+ return Configuration()
248
+
249
+ @property
250
+ def logger_file(self):
251
+ """The logger file.
252
+
253
+ If the logger_file is None, then add stream handler and remove file
254
+ handler. Otherwise, add file handler and remove stream handler.
255
+
256
+ :param value: The logger_file path.
257
+ :type: str
258
+ """
259
+ return self.__logger_file
260
+
261
+ @logger_file.setter
262
+ def logger_file(self, value):
263
+ """The logger file.
264
+
265
+ If the logger_file is None, then add stream handler and remove file
266
+ handler. Otherwise, add file handler and remove stream handler.
267
+
268
+ :param value: The logger_file path.
269
+ :type: str
270
+ """
271
+ self.__logger_file = value
272
+ if self.__logger_file:
273
+ # If set logging file,
274
+ # then add file handler and remove stream handler.
275
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
276
+ self.logger_file_handler.setFormatter(self.logger_formatter)
277
+ for _, logger in self.logger.items():
278
+ logger.addHandler(self.logger_file_handler)
279
+
280
+ @property
281
+ def debug(self):
282
+ """Debug status
283
+
284
+ :param value: The debug status, True or False.
285
+ :type: bool
286
+ """
287
+ return self.__debug
288
+
289
+ @debug.setter
290
+ def debug(self, value):
291
+ """Debug status
292
+
293
+ :param value: The debug status, True or False.
294
+ :type: bool
295
+ """
296
+ self.__debug = value
297
+ if self.__debug:
298
+ # if debug status is True, turn on debug logging
299
+ for _, logger in self.logger.items():
300
+ logger.setLevel(logging.DEBUG)
301
+ # turn on http_client debug
302
+ http_client.HTTPConnection.debuglevel = 1
303
+ else:
304
+ # if debug status is False, turn off debug logging,
305
+ # setting log level to default `logging.WARNING`
306
+ for _, logger in self.logger.items():
307
+ logger.setLevel(logging.WARNING)
308
+ # turn off http_client debug
309
+ http_client.HTTPConnection.debuglevel = 0
310
+
311
+ @property
312
+ def logger_format(self):
313
+ """The logger format.
314
+
315
+ The logger_formatter will be updated when sets logger_format.
316
+
317
+ :param value: The format string.
318
+ :type: str
319
+ """
320
+ return self.__logger_format
321
+
322
+ @logger_format.setter
323
+ def logger_format(self, value):
324
+ """The logger format.
325
+
326
+ The logger_formatter will be updated when sets logger_format.
327
+
328
+ :param value: The format string.
329
+ :type: str
330
+ """
331
+ self.__logger_format = value
332
+ self.logger_formatter = logging.Formatter(self.__logger_format)
333
+
334
+ def get_api_key_with_prefix(self, identifier, alias=None):
335
+ """Gets API key (with prefix if set).
336
+
337
+ :param identifier: The identifier of apiKey.
338
+ :param alias: The alternative identifier of apiKey.
339
+ :return: The token for api key authentication.
340
+ """
341
+ if self.refresh_api_key_hook is not None:
342
+ self.refresh_api_key_hook(self)
343
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
344
+ if key:
345
+ prefix = self.api_key_prefix.get(identifier)
346
+ if prefix:
347
+ return "%s %s" % (prefix, key)
348
+ else:
349
+ return key
350
+
351
+ def get_basic_auth_token(self):
352
+ """Gets HTTP basic authentication header (string).
353
+
354
+ :return: The token for basic HTTP authentication.
355
+ """
356
+ username = ""
357
+ if self.username is not None:
358
+ username = self.username
359
+ password = ""
360
+ if self.password is not None:
361
+ password = self.password
362
+ return urllib3.util.make_headers(
363
+ basic_auth=username + ':' + password
364
+ ).get('authorization')
365
+
366
+ def auth_settings(self):
367
+ """Gets Auth Settings dict for api client.
368
+
369
+ :return: The Auth Settings information dict.
370
+ """
371
+ auth = {}
372
+ return auth
373
+
374
+ def to_debug_report(self):
375
+ """Gets the essential information for debugging.
376
+
377
+ :return: The report for debugging.
378
+ """
379
+ return "Python SDK Debug Report:\n"\
380
+ "OS: {env}\n"\
381
+ "Python Version: {pyversion}\n"\
382
+ "Version of the API: 6.2.0\n"\
383
+ "SDK Package Version: 1.0.0".\
384
+ format(env=sys.platform, pyversion=sys.version)
385
+
386
+ def get_host_settings(self):
387
+ """Gets an array of host settings
388
+
389
+ :return: An array of host settings
390
+ """
391
+ return [
392
+ {
393
+ 'url': "http://localhost:41101",
394
+ 'description': "Local on-premise installation",
395
+ }
396
+ ]
397
+
398
+ def get_host_from_settings(self, index, variables=None, servers=None):
399
+ """Gets host URL based on the index and variables
400
+ :param index: array index of the host settings
401
+ :param variables: hash of variable and the corresponding value
402
+ :param servers: an array of host settings or None
403
+ :return: URL based on host settings
404
+ """
405
+ if index is None:
406
+ return self._base_path
407
+
408
+ variables = {} if variables is None else variables
409
+ servers = self.get_host_settings() if servers is None else servers
410
+
411
+ try:
412
+ server = servers[index]
413
+ except IndexError:
414
+ raise ValueError(
415
+ "Invalid index {0} when selecting the host settings. "
416
+ "Must be less than {1}".format(index, len(servers)))
417
+
418
+ url = server['url']
419
+
420
+ # go through variables and replace placeholders
421
+ for variable_name, variable in server.get('variables', {}).items():
422
+ used_value = variables.get(
423
+ variable_name, variable['default_value'])
424
+
425
+ if 'enum_values' in variable \
426
+ and used_value not in variable['enum_values']:
427
+ raise ValueError(
428
+ "The variable `{0}` in the host URL has invalid value "
429
+ "{1}. Must be {2}.".format(
430
+ variable_name, variables[variable_name],
431
+ variable['enum_values']))
432
+
433
+ url = url.replace("{" + variable_name + "}", used_value)
434
+
435
+ return url
436
+
437
+ @property
438
+ def host(self):
439
+ """Return generated host."""
440
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
441
+
442
+ @host.setter
443
+ def host(self, value):
444
+ """Fix base path."""
445
+ self._base_path = value
446
+ self.server_index = None
@@ -0,0 +1,159 @@
1
+ """
2
+ Regula Face SDK Web API
3
+
4
+ <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
5
+
6
+ The version of the OpenAPI document: 6.2.0
7
+ Generated by: https://openapi-generator.tech
8
+ """
9
+
10
+
11
+
12
+ class OpenApiException(Exception):
13
+ """The base exception class for all OpenAPIExceptions"""
14
+
15
+
16
+ class ApiTypeError(OpenApiException, TypeError):
17
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
18
+ key_type=None):
19
+ """ Raises an exception for TypeErrors
20
+
21
+ Args:
22
+ msg (str): the exception message
23
+
24
+ Keyword Args:
25
+ path_to_item (list): a list of keys an indices to get to the
26
+ current_item
27
+ None if unset
28
+ valid_classes (tuple): the primitive classes that current item
29
+ should be an instance of
30
+ None if unset
31
+ key_type (bool): False if our value is a value in a dict
32
+ True if it is a key in a dict
33
+ False if our item is an item in a list
34
+ None if unset
35
+ """
36
+ self.path_to_item = path_to_item
37
+ self.valid_classes = valid_classes
38
+ self.key_type = key_type
39
+ full_msg = msg
40
+ if path_to_item:
41
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
42
+ super(ApiTypeError, self).__init__(full_msg)
43
+
44
+
45
+ class ApiValueError(OpenApiException, ValueError):
46
+ def __init__(self, msg, path_to_item=None):
47
+ """
48
+ Args:
49
+ msg (str): the exception message
50
+
51
+ Keyword Args:
52
+ path_to_item (list) the path to the exception in the
53
+ received_data dict. None if unset
54
+ """
55
+
56
+ self.path_to_item = path_to_item
57
+ full_msg = msg
58
+ if path_to_item:
59
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
60
+ super(ApiValueError, self).__init__(full_msg)
61
+
62
+
63
+ class ApiAttributeError(OpenApiException, AttributeError):
64
+ def __init__(self, msg, path_to_item=None):
65
+ """
66
+ Raised when an attribute reference or assignment fails.
67
+
68
+ Args:
69
+ msg (str): the exception message
70
+
71
+ Keyword Args:
72
+ path_to_item (None/list) the path to the exception in the
73
+ received_data dict
74
+ """
75
+ self.path_to_item = path_to_item
76
+ full_msg = msg
77
+ if path_to_item:
78
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
79
+ super(ApiAttributeError, self).__init__(full_msg)
80
+
81
+
82
+ class ApiKeyError(OpenApiException, KeyError):
83
+ def __init__(self, msg, path_to_item=None):
84
+ """
85
+ Args:
86
+ msg (str): the exception message
87
+
88
+ Keyword Args:
89
+ path_to_item (None/list) the path to the exception in the
90
+ received_data dict
91
+ """
92
+ self.path_to_item = path_to_item
93
+ full_msg = msg
94
+ if path_to_item:
95
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
96
+ super(ApiKeyError, self).__init__(full_msg)
97
+
98
+
99
+ class ApiException(OpenApiException):
100
+
101
+ def __init__(self, status=None, reason=None, http_resp=None):
102
+ if http_resp:
103
+ self.status = http_resp.status
104
+ self.reason = http_resp.reason
105
+ self.body = http_resp.data
106
+ self.headers = http_resp.getheaders()
107
+ else:
108
+ self.status = status
109
+ self.reason = reason
110
+ self.body = None
111
+ self.headers = None
112
+
113
+ def __str__(self):
114
+ """Custom error messages for exception"""
115
+ error_message = "({0})\n"\
116
+ "Reason: {1}\n".format(self.status, self.reason)
117
+ if self.headers:
118
+ error_message += "HTTP response headers: {0}\n".format(
119
+ self.headers)
120
+
121
+ if self.body:
122
+ error_message += "HTTP response body: {0}\n".format(self.body)
123
+
124
+ return error_message
125
+
126
+
127
+ class NotFoundException(ApiException):
128
+
129
+ def __init__(self, status=None, reason=None, http_resp=None):
130
+ super(NotFoundException, self).__init__(status, reason, http_resp)
131
+
132
+
133
+ class UnauthorizedException(ApiException):
134
+
135
+ def __init__(self, status=None, reason=None, http_resp=None):
136
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
137
+
138
+
139
+ class ForbiddenException(ApiException):
140
+
141
+ def __init__(self, status=None, reason=None, http_resp=None):
142
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
143
+
144
+
145
+ class ServiceException(ApiException):
146
+
147
+ def __init__(self, status=None, reason=None, http_resp=None):
148
+ super(ServiceException, self).__init__(status, reason, http_resp)
149
+
150
+
151
+ def render_path(path_to_item):
152
+ """Returns a string representation of a path"""
153
+ result = ""
154
+ for pth in path_to_item:
155
+ if isinstance(pth, int):
156
+ result += "[{0}]".format(pth)
157
+ else:
158
+ result += "['{0}']".format(pth)
159
+ return result
@@ -0,0 +1,5 @@
1
+ # we can not import model classes here because that would create a circular
2
+ # reference which would not work in python2
3
+ # do not import all models into this module because that uses a lot of memory and stack frames
4
+ # if you need the ability to import all models from one package, import them with
5
+ # from {{packageName}.models import ModelA, ModelB