ayon-python-api 1.2.9__tar.gz → 1.2.10__tar.gz

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 (49) hide show
  1. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/PKG-INFO +1 -1
  2. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/links.py +6 -1
  3. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/utils.py +20 -2
  4. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/version.py +1 -1
  5. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_python_api.egg-info/PKG-INFO +1 -1
  6. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/pyproject.toml +1 -1
  7. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/LICENSE +0 -0
  8. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/README.md +0 -0
  9. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/__init__.py +0 -0
  10. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api.py +0 -0
  11. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/__init__.py +0 -0
  12. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/actions.py +0 -0
  13. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/activities.py +0 -0
  14. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/attributes.py +0 -0
  15. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/base.py +0 -0
  16. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/bundles_addons.py +0 -0
  17. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/dependency_packages.py +0 -0
  18. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/events.py +0 -0
  19. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/folders.py +0 -0
  20. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/installers.py +0 -0
  21. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/lists.py +0 -0
  22. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/products.py +0 -0
  23. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/projects.py +0 -0
  24. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/representations.py +0 -0
  25. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/secrets.py +0 -0
  26. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/tasks.py +0 -0
  27. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/thumbnails.py +0 -0
  28. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/versions.py +0 -0
  29. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/_api_helpers/workfiles.py +0 -0
  30. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/constants.py +0 -0
  31. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/entity_hub.py +0 -0
  32. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/events.py +0 -0
  33. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/exceptions.py +0 -0
  34. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/graphql.py +0 -0
  35. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/graphql_queries.py +0 -0
  36. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/operations.py +0 -0
  37. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/server_api.py +0 -0
  38. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_api/typing.py +0 -0
  39. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_python_api.egg-info/SOURCES.txt +0 -0
  40. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_python_api.egg-info/dependency_links.txt +0 -0
  41. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_python_api.egg-info/requires.txt +0 -0
  42. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/ayon_python_api.egg-info/top_level.txt +0 -0
  43. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/setup.cfg +0 -0
  44. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/setup.py +0 -0
  45. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/tests/test_entity_hub.py +0 -0
  46. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/tests/test_folder_hierarchy.py +0 -0
  47. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/tests/test_get_events.py +0 -0
  48. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/tests/test_graphql_queries.py +0 -0
  49. {ayon_python_api-1.2.9 → ayon_python_api-1.2.10}/tests/test_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ayon_python_api
3
- Version: 1.2.9
3
+ Version: 1.2.10
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -203,6 +203,7 @@ class LinksAPI(BaseServerAPI):
203
203
  output_id: str,
204
204
  output_type: str,
205
205
  link_name: Optional[str] = None,
206
+ data: Optional[dict[str, Any]] = None,
206
207
  ) -> CreateLinkData:
207
208
  """Create link between 2 entities.
208
209
 
@@ -222,7 +223,8 @@ class LinksAPI(BaseServerAPI):
222
223
  output_id (str): Output entity id.
223
224
  output_type (str): Entity type of output entity.
224
225
  link_name (Optional[str]): Name of link.
225
- Available from server version '1.0.0-rc.6'.
226
+ data (Optional[dict[str, Any]]): Additional data to be stored
227
+ with the link.
226
228
 
227
229
  Returns:
228
230
  CreateLinkData: Information about link.
@@ -242,6 +244,9 @@ class LinksAPI(BaseServerAPI):
242
244
  if link_name:
243
245
  kwargs["name"] = link_name
244
246
 
247
+ if data:
248
+ kwargs["data"] = data
249
+
245
250
  response = self.post(
246
251
  f"projects/{project_name}/links", **kwargs
247
252
  )
@@ -4,6 +4,8 @@ import os
4
4
  import re
5
5
  import datetime
6
6
  import copy
7
+ import logging
8
+ import json
7
9
  import uuid
8
10
  import string
9
11
  import platform
@@ -101,8 +103,9 @@ def _get_description(response):
101
103
  return HTTPStatus(response.status).description
102
104
 
103
105
 
104
- class RestApiResponse(object):
106
+ class RestApiResponse:
105
107
  """API Response."""
108
+ log = logging.getLogger("RestApiResponse")
106
109
 
107
110
  def __init__(self, response, data=None):
108
111
  if response is None:
@@ -134,7 +137,7 @@ class RestApiResponse(object):
134
137
  if self._data is None:
135
138
  try:
136
139
  self._data = self.orig_response.json()
137
- except RequestsJSONDecodeError:
140
+ except (AttributeError, RequestsJSONDecodeError):
138
141
  self._data = {}
139
142
  return self._data
140
143
 
@@ -178,6 +181,21 @@ class RestApiResponse(object):
178
181
  except requests.exceptions.HTTPError as exc:
179
182
  if message is None:
180
183
  message = str(exc)
184
+
185
+ submsg = ""
186
+ if self.data:
187
+ submsg = json.dumps(self.data, indent=4)
188
+
189
+ self.log.warning(
190
+ "HTTP request error: %s%s%s",
191
+ message,
192
+ "\n" if submsg else "",
193
+ submsg,
194
+ )
195
+
196
+ detail = self.data.get("detail")
197
+ if detail:
198
+ message = f"{message} ({detail})"
181
199
  raise HTTPRequestError(message, exc.response)
182
200
 
183
201
  def __enter__(self, *args, **kwargs):
@@ -1,2 +1,2 @@
1
1
  """Package declaring Python API for AYON server."""
2
- __version__ = "1.2.9"
2
+ __version__ = "1.2.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ayon_python_api
3
- Version: 1.2.9
3
+ Version: 1.2.10
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ayon_python_api"
3
- version = "1.2.9"
3
+ version = "1.2.10"
4
4
  description = "AYON Python API"
5
5
  license = {file = "LICENSE"}
6
6
  readme = {file = "README.md", content-type = "text/markdown"}