hiddenlayer-sdk 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. hiddenlayer/__init__.py +109 -0
  2. hiddenlayer/sdk/__init__.py +0 -0
  3. hiddenlayer/sdk/constants.py +14 -0
  4. hiddenlayer/sdk/enterprise/__init__.py +0 -0
  5. hiddenlayer/sdk/enterprise/enterprise_model_scan_api.py +55 -0
  6. hiddenlayer/sdk/exceptions.py +12 -0
  7. hiddenlayer/sdk/models.py +22 -0
  8. hiddenlayer/sdk/rest/__init__.py +49 -0
  9. hiddenlayer/sdk/rest/api/__init__.py +7 -0
  10. hiddenlayer/sdk/rest/api/aidr_predictive_api.py +308 -0
  11. hiddenlayer/sdk/rest/api/model_scan_api.py +591 -0
  12. hiddenlayer/sdk/rest/api/sensor_api.py +1966 -0
  13. hiddenlayer/sdk/rest/api_client.py +770 -0
  14. hiddenlayer/sdk/rest/api_response.py +21 -0
  15. hiddenlayer/sdk/rest/configuration.py +445 -0
  16. hiddenlayer/sdk/rest/exceptions.py +199 -0
  17. hiddenlayer/sdk/rest/models/__init__.py +30 -0
  18. hiddenlayer/sdk/rest/models/create_sensor_request.py +95 -0
  19. hiddenlayer/sdk/rest/models/file_info.py +110 -0
  20. hiddenlayer/sdk/rest/models/get_multipart_upload_response.py +97 -0
  21. hiddenlayer/sdk/rest/models/model.py +100 -0
  22. hiddenlayer/sdk/rest/models/model_query_response.py +101 -0
  23. hiddenlayer/sdk/rest/models/multipart_upload_part.py +93 -0
  24. hiddenlayer/sdk/rest/models/scan_model_request.py +87 -0
  25. hiddenlayer/sdk/rest/models/scan_results_v2.py +108 -0
  26. hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +108 -0
  27. hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +109 -0
  28. hiddenlayer/sdk/rest/models/submission_response.py +95 -0
  29. hiddenlayer/sdk/rest/models/submission_v2.py +109 -0
  30. hiddenlayer/sdk/rest/models/validation_error_model.py +99 -0
  31. hiddenlayer/sdk/rest/models/validation_error_model_loc_inner.py +138 -0
  32. hiddenlayer/sdk/rest/rest.py +257 -0
  33. hiddenlayer/sdk/services/__init__.py +0 -0
  34. hiddenlayer/sdk/services/aidr_predictive.py +76 -0
  35. hiddenlayer/sdk/services/model.py +101 -0
  36. hiddenlayer/sdk/services/model_scan.py +414 -0
  37. hiddenlayer/sdk/utils.py +92 -0
  38. hiddenlayer/sdk/version.py +1 -0
  39. hiddenlayer_sdk-0.1.0.dist-info/LICENSE +201 -0
  40. hiddenlayer_sdk-0.1.0.dist-info/METADATA +320 -0
  41. hiddenlayer_sdk-0.1.0.dist-info/RECORD +43 -0
  42. hiddenlayer_sdk-0.1.0.dist-info/WHEEL +5 -0
  43. hiddenlayer_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+ class ApiResponse(BaseModel, Generic[T]):
10
+ """
11
+ API response object
12
+ """
13
+
14
+ status_code: StrictInt = Field(description="HTTP status code")
15
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16
+ data: T = Field(description="Deserialized data given the data type")
17
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
+
19
+ model_config = {
20
+ "arbitrary_types_allowed": True
21
+ }
@@ -0,0 +1,445 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HiddenLayer ModelScan
5
+
6
+ HiddenLayer ModelScan API for scanning of models
7
+
8
+ The version of the OpenAPI document: 1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import copy
16
+ import logging
17
+ from logging import FileHandler
18
+ import multiprocessing
19
+ import sys
20
+ from typing import Optional
21
+ import urllib3
22
+
23
+ import http.client as httplib
24
+
25
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
26
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
27
+ 'minimum', 'exclusiveMinimum', 'maxLength',
28
+ 'minLength', 'pattern', 'maxItems', 'minItems'
29
+ }
30
+
31
+ class Configuration:
32
+ """This class contains various settings of the API client.
33
+
34
+ :param host: Base url.
35
+ :param api_key: Dict to store API key(s).
36
+ Each entry in the dict specifies an API key.
37
+ The dict key is the name of the security scheme in the OAS specification.
38
+ The dict value is the API key secret.
39
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
40
+ The dict key is the name of the security scheme in the OAS specification.
41
+ The dict value is an API key prefix when generating the auth data.
42
+ :param username: Username for HTTP basic authentication.
43
+ :param password: Password for HTTP basic authentication.
44
+ :param access_token: Access token.
45
+ :param server_index: Index to servers configuration.
46
+ :param server_variables: Mapping with string values to replace variables in
47
+ templated server configuration. The validation of enums is performed for
48
+ variables with defined enum values before.
49
+ :param server_operation_index: Mapping from operation ID to an index to server
50
+ configuration.
51
+ :param server_operation_variables: Mapping from operation ID to a mapping with
52
+ string values to replace variables in templated server configuration.
53
+ The validation of enums is performed for variables with defined enum
54
+ values before.
55
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
56
+ in PEM format.
57
+
58
+ :Example:
59
+ """
60
+
61
+ _default = None
62
+
63
+ def __init__(self, host=None,
64
+ api_key=None, api_key_prefix=None,
65
+ username=None, password=None,
66
+ access_token=None,
67
+ server_index=None, server_variables=None,
68
+ server_operation_index=None, server_operation_variables=None,
69
+ ssl_ca_cert=None,
70
+ ) -> None:
71
+ """Constructor
72
+ """
73
+ self._base_path = "http://localhost" if host is None else host
74
+ """Default Base url
75
+ """
76
+ self.server_index = 0 if server_index is None and host is None else server_index
77
+ self.server_operation_index = server_operation_index or {}
78
+ """Default server index
79
+ """
80
+ self.server_variables = server_variables or {}
81
+ self.server_operation_variables = server_operation_variables or {}
82
+ """Default server variables
83
+ """
84
+ self.temp_folder_path = None
85
+ """Temp file folder for downloading files
86
+ """
87
+ # Authentication Settings
88
+ self.api_key = {}
89
+ if api_key:
90
+ self.api_key = api_key
91
+ """dict to store API key(s)
92
+ """
93
+ self.api_key_prefix = {}
94
+ if api_key_prefix:
95
+ self.api_key_prefix = api_key_prefix
96
+ """dict to store API prefix (e.g. Bearer)
97
+ """
98
+ self.refresh_api_key_hook = None
99
+ """function hook to refresh API key if expired
100
+ """
101
+ self.username = username
102
+ """Username for HTTP basic authentication
103
+ """
104
+ self.password = password
105
+ """Password for HTTP basic authentication
106
+ """
107
+ self.access_token = access_token
108
+ """Access token
109
+ """
110
+ self.logger = {}
111
+ """Logging Settings
112
+ """
113
+ self.logger["package_logger"] = logging.getLogger("hiddenlayer.sdk.rest")
114
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
115
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
116
+ """Log format
117
+ """
118
+ self.logger_stream_handler = None
119
+ """Log stream handler
120
+ """
121
+ self.logger_file_handler: Optional[FileHandler] = None
122
+ """Log file handler
123
+ """
124
+ self.logger_file = None
125
+ """Debug file location
126
+ """
127
+ self.debug = False
128
+ """Debug switch
129
+ """
130
+
131
+ self.verify_ssl = True
132
+ """SSL/TLS verification
133
+ Set this to false to skip verifying SSL certificate when calling API
134
+ from https server.
135
+ """
136
+ self.ssl_ca_cert = ssl_ca_cert
137
+ """Set this to customize the certificate file to verify the peer.
138
+ """
139
+ self.cert_file = None
140
+ """client certificate file
141
+ """
142
+ self.key_file = None
143
+ """client key file
144
+ """
145
+ self.assert_hostname = None
146
+ """Set this to True/False to enable/disable SSL hostname verification.
147
+ """
148
+ self.tls_server_name = None
149
+ """SSL/TLS Server Name Indication (SNI)
150
+ Set this to the SNI value expected by the server.
151
+ """
152
+
153
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
154
+ """urllib3 connection pool's maximum number of connections saved
155
+ per pool. urllib3 uses 1 connection as default value, but this is
156
+ not the best value when you are making a lot of possibly parallel
157
+ requests to the same host, which is often the case here.
158
+ cpu_count * 5 is used as default value to increase performance.
159
+ """
160
+
161
+ self.proxy: Optional[str] = None
162
+ """Proxy URL
163
+ """
164
+ self.proxy_headers = None
165
+ """Proxy headers
166
+ """
167
+ self.safe_chars_for_path_param = ''
168
+ """Safe chars for path_param
169
+ """
170
+ self.retries = None
171
+ """Adding retries to override urllib3 default value 3
172
+ """
173
+ # Enable client side validation
174
+ self.client_side_validation = True
175
+
176
+ self.socket_options = None
177
+ """Options to pass down to the underlying urllib3 socket
178
+ """
179
+
180
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
181
+ """datetime format
182
+ """
183
+
184
+ self.date_format = "%Y-%m-%d"
185
+ """date format
186
+ """
187
+
188
+ def __deepcopy__(self, memo):
189
+ cls = self.__class__
190
+ result = cls.__new__(cls)
191
+ memo[id(self)] = result
192
+ for k, v in self.__dict__.items():
193
+ if k not in ('logger', 'logger_file_handler'):
194
+ setattr(result, k, copy.deepcopy(v, memo))
195
+ # shallow copy of loggers
196
+ result.logger = copy.copy(self.logger)
197
+ # use setters to configure loggers
198
+ result.logger_file = self.logger_file
199
+ result.debug = self.debug
200
+ return result
201
+
202
+ def __setattr__(self, name, value):
203
+ object.__setattr__(self, name, value)
204
+
205
+ @classmethod
206
+ def set_default(cls, default):
207
+ """Set default instance of configuration.
208
+
209
+ It stores default configuration, which can be
210
+ returned by get_default_copy method.
211
+
212
+ :param default: object of Configuration
213
+ """
214
+ cls._default = default
215
+
216
+ @classmethod
217
+ def get_default_copy(cls):
218
+ """Deprecated. Please use `get_default` instead.
219
+
220
+ Deprecated. Please use `get_default` instead.
221
+
222
+ :return: The configuration object.
223
+ """
224
+ return cls.get_default()
225
+
226
+ @classmethod
227
+ def get_default(cls):
228
+ """Return the default configuration.
229
+
230
+ This method returns newly created, based on default constructor,
231
+ object of Configuration class or returns a copy of default
232
+ configuration.
233
+
234
+ :return: The configuration object.
235
+ """
236
+ if cls._default is None:
237
+ cls._default = Configuration()
238
+ return cls._default
239
+
240
+ @property
241
+ def logger_file(self):
242
+ """The logger file.
243
+
244
+ If the logger_file is None, then add stream handler and remove file
245
+ handler. Otherwise, add file handler and remove stream handler.
246
+
247
+ :param value: The logger_file path.
248
+ :type: str
249
+ """
250
+ return self.__logger_file
251
+
252
+ @logger_file.setter
253
+ def logger_file(self, value):
254
+ """The logger file.
255
+
256
+ If the logger_file is None, then add stream handler and remove file
257
+ handler. Otherwise, add file handler and remove stream handler.
258
+
259
+ :param value: The logger_file path.
260
+ :type: str
261
+ """
262
+ self.__logger_file = value
263
+ if self.__logger_file:
264
+ # If set logging file,
265
+ # then add file handler and remove stream handler.
266
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
267
+ self.logger_file_handler.setFormatter(self.logger_formatter)
268
+ for _, logger in self.logger.items():
269
+ logger.addHandler(self.logger_file_handler)
270
+
271
+ @property
272
+ def debug(self):
273
+ """Debug status
274
+
275
+ :param value: The debug status, True or False.
276
+ :type: bool
277
+ """
278
+ return self.__debug
279
+
280
+ @debug.setter
281
+ def debug(self, value):
282
+ """Debug status
283
+
284
+ :param value: The debug status, True or False.
285
+ :type: bool
286
+ """
287
+ self.__debug = value
288
+ if self.__debug:
289
+ # if debug status is True, turn on debug logging
290
+ for _, logger in self.logger.items():
291
+ logger.setLevel(logging.DEBUG)
292
+ # turn on httplib debug
293
+ httplib.HTTPConnection.debuglevel = 1
294
+ else:
295
+ # if debug status is False, turn off debug logging,
296
+ # setting log level to default `logging.WARNING`
297
+ for _, logger in self.logger.items():
298
+ logger.setLevel(logging.WARNING)
299
+ # turn off httplib debug
300
+ httplib.HTTPConnection.debuglevel = 0
301
+
302
+ @property
303
+ def logger_format(self):
304
+ """The logger format.
305
+
306
+ The logger_formatter will be updated when sets logger_format.
307
+
308
+ :param value: The format string.
309
+ :type: str
310
+ """
311
+ return self.__logger_format
312
+
313
+ @logger_format.setter
314
+ def logger_format(self, value):
315
+ """The logger format.
316
+
317
+ The logger_formatter will be updated when sets logger_format.
318
+
319
+ :param value: The format string.
320
+ :type: str
321
+ """
322
+ self.__logger_format = value
323
+ self.logger_formatter = logging.Formatter(self.__logger_format)
324
+
325
+ def get_api_key_with_prefix(self, identifier, alias=None):
326
+ """Gets API key (with prefix if set).
327
+
328
+ :param identifier: The identifier of apiKey.
329
+ :param alias: The alternative identifier of apiKey.
330
+ :return: The token for api key authentication.
331
+ """
332
+ if self.refresh_api_key_hook is not None:
333
+ self.refresh_api_key_hook(self)
334
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
335
+ if key:
336
+ prefix = self.api_key_prefix.get(identifier)
337
+ if prefix:
338
+ return "%s %s" % (prefix, key)
339
+ else:
340
+ return key
341
+
342
+ def get_basic_auth_token(self):
343
+ """Gets HTTP basic authentication header (string).
344
+
345
+ :return: The token for basic HTTP authentication.
346
+ """
347
+ username = ""
348
+ if self.username is not None:
349
+ username = self.username
350
+ password = ""
351
+ if self.password is not None:
352
+ password = self.password
353
+ return urllib3.util.make_headers(
354
+ basic_auth=username + ':' + password
355
+ ).get('authorization')
356
+
357
+ def auth_settings(self):
358
+ """Gets Auth Settings dict for api client.
359
+
360
+ :return: The Auth Settings information dict.
361
+ """
362
+ auth = {}
363
+ if self.access_token is not None:
364
+ auth['BearerAuth'] = {
365
+ 'type': 'bearer',
366
+ 'in': 'header',
367
+ 'format': 'JWT',
368
+ 'key': 'Authorization',
369
+ 'value': 'Bearer ' + self.access_token
370
+ }
371
+ return auth
372
+
373
+ def to_debug_report(self):
374
+ """Gets the essential information for debugging.
375
+
376
+ :return: The report for debugging.
377
+ """
378
+ return "Python SDK Debug Report:\n"\
379
+ "OS: {env}\n"\
380
+ "Python Version: {pyversion}\n"\
381
+ "Version of the API: 1\n"\
382
+ "SDK Package Version: 1.0.0".\
383
+ format(env=sys.platform, pyversion=sys.version)
384
+
385
+ def get_host_settings(self):
386
+ """Gets an array of host settings
387
+
388
+ :return: An array of host settings
389
+ """
390
+ return [
391
+ {
392
+ 'url': "",
393
+ 'description': "No description provided",
394
+ }
395
+ ]
396
+
397
+ def get_host_from_settings(self, index, variables=None, servers=None):
398
+ """Gets host URL based on the index and variables
399
+ :param index: array index of the host settings
400
+ :param variables: hash of variable and the corresponding value
401
+ :param servers: an array of host settings or None
402
+ :return: URL based on host settings
403
+ """
404
+ if index is None:
405
+ return self._base_path
406
+
407
+ variables = {} if variables is None else variables
408
+ servers = self.get_host_settings() if servers is None else servers
409
+
410
+ try:
411
+ server = servers[index]
412
+ except IndexError:
413
+ raise ValueError(
414
+ "Invalid index {0} when selecting the host settings. "
415
+ "Must be less than {1}".format(index, len(servers)))
416
+
417
+ url = server['url']
418
+
419
+ # go through variables and replace placeholders
420
+ for variable_name, variable in server.get('variables', {}).items():
421
+ used_value = variables.get(
422
+ variable_name, variable['default_value'])
423
+
424
+ if 'enum_values' in variable \
425
+ and used_value not in variable['enum_values']:
426
+ raise ValueError(
427
+ "The variable `{0}` in the host URL has invalid value "
428
+ "{1}. Must be {2}.".format(
429
+ variable_name, variables[variable_name],
430
+ variable['enum_values']))
431
+
432
+ url = url.replace("{" + variable_name + "}", used_value)
433
+
434
+ return url
435
+
436
+ @property
437
+ def host(self):
438
+ """Return generated host."""
439
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
440
+
441
+ @host.setter
442
+ def host(self, value):
443
+ """Fix base path."""
444
+ self._base_path = value
445
+ self.server_index = None
@@ -0,0 +1,199 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HiddenLayer ModelScan
5
+
6
+ HiddenLayer ModelScan API for scanning of models
7
+
8
+ The version of the OpenAPI document: 1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.getheaders()
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ if 500 <= http_resp.status <= 599:
154
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
155
+ raise ApiException(http_resp=http_resp, body=body, data=data)
156
+
157
+ def __str__(self):
158
+ """Custom error messages for exception"""
159
+ error_message = "({0})\n"\
160
+ "Reason: {1}\n".format(self.status, self.reason)
161
+ if self.headers:
162
+ error_message += "HTTP response headers: {0}\n".format(
163
+ self.headers)
164
+
165
+ if self.data or self.body:
166
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
167
+
168
+ return error_message
169
+
170
+
171
+ class BadRequestException(ApiException):
172
+ pass
173
+
174
+
175
+ class NotFoundException(ApiException):
176
+ pass
177
+
178
+
179
+ class UnauthorizedException(ApiException):
180
+ pass
181
+
182
+
183
+ class ForbiddenException(ApiException):
184
+ pass
185
+
186
+
187
+ class ServiceException(ApiException):
188
+ pass
189
+
190
+
191
+ def render_path(path_to_item):
192
+ """Returns a string representation of a path"""
193
+ result = ""
194
+ for pth in path_to_item:
195
+ if isinstance(pth, int):
196
+ result += "[{0}]".format(pth)
197
+ else:
198
+ result += "['{0}']".format(pth)
199
+ return result
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ HiddenLayer ModelScan
6
+
7
+ HiddenLayer ModelScan API for scanning of models
8
+
9
+ The version of the OpenAPI document: 1
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ # import models into model package
17
+ from hiddenlayer.sdk.rest.models.create_sensor_request import CreateSensorRequest
18
+ from hiddenlayer.sdk.rest.models.file_info import FileInfo
19
+ from hiddenlayer.sdk.rest.models.get_multipart_upload_response import GetMultipartUploadResponse
20
+ from hiddenlayer.sdk.rest.models.model import Model
21
+ from hiddenlayer.sdk.rest.models.model_query_response import ModelQueryResponse
22
+ from hiddenlayer.sdk.rest.models.multipart_upload_part import MultipartUploadPart
23
+ from hiddenlayer.sdk.rest.models.scan_model_request import ScanModelRequest
24
+ from hiddenlayer.sdk.rest.models.scan_results_v2 import ScanResultsV2
25
+ from hiddenlayer.sdk.rest.models.sensor_sor_query_filter import SensorSORQueryFilter
26
+ from hiddenlayer.sdk.rest.models.sensor_sor_query_request import SensorSORQueryRequest
27
+ from hiddenlayer.sdk.rest.models.submission_response import SubmissionResponse
28
+ from hiddenlayer.sdk.rest.models.submission_v2 import SubmissionV2
29
+ from hiddenlayer.sdk.rest.models.validation_error_model import ValidationErrorModel
30
+ from hiddenlayer.sdk.rest.models.validation_error_model_loc_inner import ValidationErrorModelLocInner