bdpan-cli 0.1.0__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.
Files changed (44) hide show
  1. bdpan_cli/__init__.py +15 -0
  2. bdpan_cli/_vendor/__init__.py +9 -0
  3. bdpan_cli/_vendor/openapi_client/__init__.py +27 -0
  4. bdpan_cli/_vendor/openapi_client/api/__init__.py +6 -0
  5. bdpan_cli/_vendor/openapi_client/api/auth_api.py +649 -0
  6. bdpan_cli/_vendor/openapi_client/api/fileinfo_api.py +737 -0
  7. bdpan_cli/_vendor/openapi_client/api/filemanager_api.py +669 -0
  8. bdpan_cli/_vendor/openapi_client/api/fileupload_api.py +599 -0
  9. bdpan_cli/_vendor/openapi_client/api/multimediafile_api.py +391 -0
  10. bdpan_cli/_vendor/openapi_client/api/userinfo_api.py +315 -0
  11. bdpan_cli/_vendor/openapi_client/api_client.py +864 -0
  12. bdpan_cli/_vendor/openapi_client/configuration.py +454 -0
  13. bdpan_cli/_vendor/openapi_client/exceptions.py +197 -0
  14. bdpan_cli/_vendor/openapi_client/model/__init__.py +5 -0
  15. bdpan_cli/_vendor/openapi_client/model/oauth_token_authorization_code_response.py +276 -0
  16. bdpan_cli/_vendor/openapi_client/model/oauth_token_device_code_response.py +276 -0
  17. bdpan_cli/_vendor/openapi_client/model/oauth_token_device_token_response.py +276 -0
  18. bdpan_cli/_vendor/openapi_client/model/oauth_token_refresh_token_response.py +276 -0
  19. bdpan_cli/_vendor/openapi_client/model/quotaresponse.py +276 -0
  20. bdpan_cli/_vendor/openapi_client/model/uinforesponse.py +284 -0
  21. bdpan_cli/_vendor/openapi_client/model_utils.py +2039 -0
  22. bdpan_cli/_vendor/openapi_client/rest.py +385 -0
  23. bdpan_cli/_version.py +3 -0
  24. bdpan_cli/account.py +78 -0
  25. bdpan_cli/apply_scrape_rename.py +99 -0
  26. bdpan_cli/auth.py +218 -0
  27. bdpan_cli/cli.py +1428 -0
  28. bdpan_cli/config.py +26 -0
  29. bdpan_cli/dedup.py +310 -0
  30. bdpan_cli/downloader.py +178 -0
  31. bdpan_cli/file_manager.py +389 -0
  32. bdpan_cli/foldering.py +181 -0
  33. bdpan_cli/logger.py +101 -0
  34. bdpan_cli/mcp_server.py +547 -0
  35. bdpan_cli/media_info.py +251 -0
  36. bdpan_cli/ops.py +173 -0
  37. bdpan_cli/organize.py +108 -0
  38. bdpan_cli/preview_scrape.py +182 -0
  39. bdpan_cli/scraper.py +505 -0
  40. bdpan_cli/uploader.py +391 -0
  41. bdpan_cli-0.1.0.dist-info/METADATA +167 -0
  42. bdpan_cli-0.1.0.dist-info/RECORD +44 -0
  43. bdpan_cli-0.1.0.dist-info/WHEEL +4 -0
  44. bdpan_cli-0.1.0.dist-info/entry_points.txt +5 -0
@@ -0,0 +1,454 @@
1
+ """
2
+ xpan
3
+
4
+ xpanapi # noqa: E501
5
+
6
+ The version of the OpenAPI document: 0.1
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 bdpan_cli._vendor.openapi_client.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 = "https://d.pcs.baidu.com" 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("bdpan_cli._vendor.openapi_client")
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: 0.1\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': "https://d.pcs.baidu.com",
394
+ 'description': "No description provided",
395
+ },
396
+ {
397
+ 'url': "https://pan.baidu.com",
398
+ 'description': "No description provided",
399
+ },
400
+ {
401
+ 'url': "https://openapi.baidu.com",
402
+ 'description': "No description provided",
403
+ }
404
+ ]
405
+
406
+ def get_host_from_settings(self, index, variables=None, servers=None):
407
+ """Gets host URL based on the index and variables
408
+ :param index: array index of the host settings
409
+ :param variables: hash of variable and the corresponding value
410
+ :param servers: an array of host settings or None
411
+ :return: URL based on host settings
412
+ """
413
+ if index is None:
414
+ return self._base_path
415
+
416
+ variables = {} if variables is None else variables
417
+ servers = self.get_host_settings() if servers is None else servers
418
+
419
+ try:
420
+ server = servers[index]
421
+ except IndexError:
422
+ raise ValueError(
423
+ "Invalid index {0} when selecting the host settings. "
424
+ "Must be less than {1}".format(index, len(servers)))
425
+
426
+ url = server['url']
427
+
428
+ # go through variables and replace placeholders
429
+ for variable_name, variable in server.get('variables', {}).items():
430
+ used_value = variables.get(
431
+ variable_name, variable['default_value'])
432
+
433
+ if 'enum_values' in variable \
434
+ and used_value not in variable['enum_values']:
435
+ raise ValueError(
436
+ "The variable `{0}` in the host URL has invalid value "
437
+ "{1}. Must be {2}.".format(
438
+ variable_name, variables[variable_name],
439
+ variable['enum_values']))
440
+
441
+ url = url.replace("{" + variable_name + "}", used_value)
442
+
443
+ return url
444
+
445
+ @property
446
+ def host(self):
447
+ """Return generated host."""
448
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
449
+
450
+ @host.setter
451
+ def host(self, value):
452
+ """Fix base path."""
453
+ self._base_path = value
454
+ self.server_index = None
@@ -0,0 +1,197 @@
1
+ """
2
+ xpan
3
+
4
+ xpanapi # noqa: E501
5
+
6
+ The version of the OpenAPI document: 0.1
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
+ """
18
+ class ApiTypeError
19
+ """
20
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
21
+ key_type=None):
22
+ """ Raises an exception for TypeErrors
23
+
24
+ Args:
25
+ msg (str): the exception message
26
+
27
+ Keyword Args:
28
+ path_to_item (list): a list of keys an indices to get to the
29
+ current_item
30
+ None if unset
31
+ valid_classes (tuple): the primitive classes that current item
32
+ should be an instance of
33
+ None if unset
34
+ key_type (bool): False if our value is a value in a dict
35
+ True if it is a key in a dict
36
+ False if our item is an item in a list
37
+ None if unset
38
+ """
39
+ self.path_to_item = path_to_item
40
+ self.valid_classes = valid_classes
41
+ self.key_type = key_type
42
+ full_msg = msg
43
+ if path_to_item:
44
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
45
+ super(ApiTypeError, self).__init__(full_msg)
46
+
47
+
48
+ class ApiValueError(OpenApiException, ValueError):
49
+ """
50
+ class ApiValueError
51
+ """
52
+ def __init__(self, msg, path_to_item=None):
53
+ """
54
+ Args:
55
+ msg (str): the exception message
56
+
57
+ Keyword Args:
58
+ path_to_item (list) the path to the exception in the
59
+ received_data dict. None if unset
60
+ """
61
+
62
+ self.path_to_item = path_to_item
63
+ full_msg = msg
64
+ if path_to_item:
65
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
66
+ super(ApiValueError, self).__init__(full_msg)
67
+
68
+
69
+ class ApiAttributeError(OpenApiException, AttributeError):
70
+ """
71
+ class ApiAttributeError
72
+ """
73
+ def __init__(self, msg, path_to_item=None):
74
+ """
75
+ Raised when an attribute reference or assignment fails.
76
+
77
+ Args:
78
+ msg (str): the exception message
79
+
80
+ Keyword Args:
81
+ path_to_item (None/list) the path to the exception in the
82
+ received_data dict
83
+ """
84
+ self.path_to_item = path_to_item
85
+ full_msg = msg
86
+ if path_to_item:
87
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
88
+ super(ApiAttributeError, self).__init__(full_msg)
89
+
90
+
91
+ class ApiKeyError(OpenApiException, KeyError):
92
+ """
93
+ class ApiKeyError
94
+ """
95
+ def __init__(self, msg, path_to_item=None):
96
+ """
97
+ Args:
98
+ msg (str): the exception message
99
+
100
+ Keyword Args:
101
+ path_to_item (None/list) the path to the exception in the
102
+ received_data dict
103
+ """
104
+ self.path_to_item = path_to_item
105
+ full_msg = msg
106
+ if path_to_item:
107
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
108
+ super(ApiKeyError, self).__init__(full_msg)
109
+
110
+
111
+ class ApiException(OpenApiException):
112
+ """
113
+ class ApiException
114
+ """
115
+ def __init__(self, status=None, reason=None, http_resp=None):
116
+ """
117
+ __init__
118
+ """
119
+ if http_resp:
120
+ self.status = http_resp.status
121
+ self.reason = http_resp.reason
122
+ self.body = http_resp.data
123
+ self.headers = http_resp.getheaders()
124
+ else:
125
+ self.status = status
126
+ self.reason = reason
127
+ self.body = None
128
+ self.headers = None
129
+
130
+ def __str__(self):
131
+ """Custom error messages for exception"""
132
+ error_message = "({0})\n"\
133
+ "Reason: {1}\n".format(self.status, self.reason)
134
+ if self.headers:
135
+ error_message += "HTTP response headers: {0}\n".format(
136
+ self.headers)
137
+
138
+ if self.body:
139
+ error_message += "HTTP response body: {0}\n".format(self.body)
140
+
141
+ return error_message
142
+
143
+
144
+ class NotFoundException(ApiException):
145
+ """
146
+ class NotFoundException
147
+ """
148
+
149
+ def __init__(self, status=None, reason=None, http_resp=None):
150
+ """
151
+ __init__
152
+ """
153
+ super(NotFoundException, self).__init__(status, reason, http_resp)
154
+
155
+
156
+ class UnauthorizedException(ApiException):
157
+ """
158
+ class UnauthorizedException
159
+ """
160
+ def __init__(self, status=None, reason=None, http_resp=None):
161
+ """
162
+ __init__
163
+ """
164
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
165
+
166
+
167
+ class ForbiddenException(ApiException):
168
+ """
169
+ class ForbiddenException
170
+ """
171
+ def __init__(self, status=None, reason=None, http_resp=None):
172
+ """
173
+ __init__
174
+ """
175
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
176
+
177
+
178
+ class ServiceException(ApiException):
179
+ """
180
+ class ServiceException
181
+ """
182
+ def __init__(self, status=None, reason=None, http_resp=None):
183
+ """
184
+ __init__
185
+ """
186
+ super(ServiceException, self).__init__(status, reason, http_resp)
187
+
188
+
189
+ def render_path(path_to_item):
190
+ """Returns a string representation of a path"""
191
+ result = ""
192
+ for pth in path_to_item:
193
+ if isinstance(pth, int):
194
+ result += "[{0}]".format(pth)
195
+ else:
196
+ result += "['{0}']".format(pth)
197
+ 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