ayon-python-api 1.0.5__tar.gz → 1.0.7__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 (23) hide show
  1. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/PKG-INFO +2 -3
  2. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/README.md +1 -1
  3. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/__init__.py +22 -0
  4. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/_api.py +291 -43
  5. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/entity_hub.py +132 -38
  6. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/graphql.py +5 -8
  7. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/graphql_queries.py +61 -23
  8. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/operations.py +2 -5
  9. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/server_api.py +611 -145
  10. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/utils.py +13 -7
  11. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/version.py +1 -1
  12. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_python_api.egg-info/PKG-INFO +2 -3
  13. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_python_api.egg-info/requires.txt +1 -2
  14. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/pyproject.toml +6 -9
  15. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/setup.py +1 -3
  16. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/LICENSE +0 -0
  17. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/constants.py +0 -0
  18. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/events.py +0 -0
  19. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_api/exceptions.py +0 -0
  20. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_python_api.egg-info/SOURCES.txt +0 -0
  21. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_python_api.egg-info/dependency_links.txt +0 -0
  22. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/ayon_python_api.egg-info/top_level.txt +0 -0
  23. {ayon-python-api-1.0.5 → ayon-python-api-1.0.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ayon-python-api
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -212,13 +212,12 @@ Project-URL: Changelog, https://github.com/ynput/ayon-python-api/releases
212
212
  Keywords: AYON,ynput,OpenPype,vfx
213
213
  Classifier: Development Status :: 5 - Production/Stable
214
214
  Classifier: Programming Language :: Python
215
- Classifier: Programming Language :: Python :: 2
216
215
  Classifier: Programming Language :: Python :: 3
217
216
  Description-Content-Type: text/markdown
218
217
  License-File: LICENSE
219
218
 
220
219
  # AYON server API
221
- Python client for connection server. Client must be (at least for some time) Python 2 compatible because will be used in DCC that are "older".
220
+ Python client for connection server. The client is using REST and GraphQl to communicate with server with `requests` module.
222
221
 
223
222
  AYON Python api should support connection to server with raw REST functions and prepared functionality for work with entities. Must not contain only functionality that can be used with core server functionality.
224
223
 
@@ -1,5 +1,5 @@
1
1
  # AYON server API
2
- Python client for connection server. Client must be (at least for some time) Python 2 compatible because will be used in DCC that are "older".
2
+ Python client for connection server. The client is using REST and GraphQl to communicate with server with `requests` module.
3
3
 
4
4
  AYON Python api should support connection to server with raw REST functions and prepared functionality for work with entities. Must not contain only functionality that can be used with core server functionality.
5
5
 
@@ -5,6 +5,7 @@ from .utils import (
5
5
  create_dependency_package_basename,
6
6
  )
7
7
  from .server_api import (
8
+ RequestTypes,
8
9
  ServerAPI,
9
10
  )
10
11
 
@@ -32,6 +33,7 @@ from ._api import (
32
33
  set_timeout,
33
34
  get_max_retries,
34
35
  set_max_retries,
36
+ is_service_user,
35
37
  get_site_id,
36
38
  set_site_id,
37
39
  get_client_version,
@@ -44,6 +46,7 @@ from ._api import (
44
46
  get_server_version,
45
47
  get_server_version_tuple,
46
48
  get_users,
49
+ get_user_by_name,
47
50
  get_user,
48
51
  raw_post,
49
52
  raw_put,
@@ -60,7 +63,9 @@ from ._api import (
60
63
  update_event,
61
64
  dispatch_event,
62
65
  enroll_event_job,
66
+ download_file_to_stream,
63
67
  download_file,
68
+ upload_file_from_stream,
64
69
  upload_file,
65
70
  trigger_server_restart,
66
71
  query_graphql,
@@ -98,8 +103,12 @@ from ._api import (
98
103
  get_default_anatomy_preset_name,
99
104
  get_project_anatomy_preset,
100
105
  get_build_in_anatomy_preset,
106
+ get_project_root_overrides,
101
107
  get_project_roots_by_site,
108
+ get_project_root_overrides_by_site_id,
102
109
  get_project_roots_for_site,
110
+ get_project_roots_by_site_id,
111
+ get_project_roots_by_platform,
103
112
  get_addon_settings_schema,
104
113
  get_addon_site_settings_schema,
105
114
  get_addon_studio_settings,
@@ -170,6 +179,8 @@ from ._api import (
170
179
  get_representations,
171
180
  get_representation_by_id,
172
181
  get_representation_by_name,
182
+ get_representations_hierarchy,
183
+ get_representation_hierarchy,
173
184
  get_representations_parents,
174
185
  get_representation_parents,
175
186
  get_repre_ids_by_context_filters,
@@ -219,6 +230,7 @@ __all__ = (
219
230
  "slugify_string",
220
231
  "create_dependency_package_basename",
221
232
 
233
+ "RequestTypes",
222
234
  "ServerAPI",
223
235
 
224
236
  "GlobalServerAPI",
@@ -244,6 +256,7 @@ __all__ = (
244
256
  "set_timeout",
245
257
  "get_max_retries",
246
258
  "set_max_retries",
259
+ "is_service_user",
247
260
  "get_site_id",
248
261
  "set_site_id",
249
262
  "get_client_version",
@@ -256,6 +269,7 @@ __all__ = (
256
269
  "get_server_version",
257
270
  "get_server_version_tuple",
258
271
  "get_users",
272
+ "get_user_by_name",
259
273
  "get_user",
260
274
  "raw_post",
261
275
  "raw_put",
@@ -272,7 +286,9 @@ __all__ = (
272
286
  "update_event",
273
287
  "dispatch_event",
274
288
  "enroll_event_job",
289
+ "download_file_to_stream",
275
290
  "download_file",
291
+ "upload_file_from_stream",
276
292
  "upload_file",
277
293
  "trigger_server_restart",
278
294
  "query_graphql",
@@ -310,8 +326,12 @@ __all__ = (
310
326
  "get_default_anatomy_preset_name",
311
327
  "get_project_anatomy_preset",
312
328
  "get_build_in_anatomy_preset",
329
+ "get_project_root_overrides",
313
330
  "get_project_roots_by_site",
331
+ "get_project_root_overrides_by_site_id",
314
332
  "get_project_roots_for_site",
333
+ "get_project_roots_by_site_id",
334
+ "get_project_roots_by_platform",
315
335
  "get_addon_settings_schema",
316
336
  "get_addon_site_settings_schema",
317
337
  "get_addon_studio_settings",
@@ -382,6 +402,8 @@ __all__ = (
382
402
  "get_representations",
383
403
  "get_representation_by_id",
384
404
  "get_representation_by_name",
405
+ "get_representations_hierarchy",
406
+ "get_representation_hierarchy",
385
407
  "get_representations_parents",
386
408
  "get_representation_parents",
387
409
  "get_repre_ids_by_context_filters",
@@ -328,7 +328,9 @@ def get_server_api_connection():
328
328
  """
329
329
  return GlobalContext.get_server_api_connection()
330
330
 
331
-
331
+ # ------------------------------------------------
332
+ # This content is generated automatically.
333
+ # ------------------------------------------------
332
334
  def get_base_url():
333
335
  con = get_server_api_connection()
334
336
  return con.get_base_url()
@@ -428,6 +430,17 @@ def set_max_retries(*args, **kwargs):
428
430
  return con.set_max_retries(*args, **kwargs)
429
431
 
430
432
 
433
+ def is_service_user():
434
+ """Check if connection is using service API key.
435
+
436
+ Returns:
437
+ bool: Used api key belongs to service user.
438
+
439
+ """
440
+ con = get_server_api_connection()
441
+ return con.is_service_user()
442
+
443
+
431
444
  def get_site_id():
432
445
  """Site id used for connection.
433
446
 
@@ -581,9 +594,13 @@ def get_server_version_tuple():
581
594
  def get_users(*args, **kwargs):
582
595
  """Get Users.
583
596
 
597
+ Only administrators and managers can fetch all users. For other users
598
+ it is required to pass in 'project_name' filter.
599
+
584
600
  Args:
601
+ project_name (Optional[str]): Project name.
585
602
  usernames (Optional[Iterable[str]]): Filter by usernames.
586
- fields (Optional[Iterable[str]]): fields to be queried
603
+ fields (Optional[Iterable[str]]): Fields to be queried
587
604
  for users.
588
605
 
589
606
  Returns:
@@ -594,7 +611,38 @@ def get_users(*args, **kwargs):
594
611
  return con.get_users(*args, **kwargs)
595
612
 
596
613
 
614
+ def get_user_by_name(*args, **kwargs):
615
+ """Get user by name using GraphQl.
616
+
617
+ Only administrators and managers can fetch all users. For other users
618
+ it is required to pass in 'project_name' filter.
619
+
620
+ Args:
621
+ username (str): Username.
622
+ project_name (Optional[str]): Define scope of project.
623
+ fields (Optional[Iterable[str]]): Fields to be queried
624
+ for users.
625
+
626
+ Returns:
627
+ Union[dict[str, Any], None]: User info or None if user is not
628
+ found.
629
+
630
+ """
631
+ con = get_server_api_connection()
632
+ return con.get_user_by_name(*args, **kwargs)
633
+
634
+
597
635
  def get_user(*args, **kwargs):
636
+ """Get user info using REST endpoit.
637
+
638
+ Args:
639
+ username (Optional[str]): Username.
640
+
641
+ Returns:
642
+ Union[dict[str, Any], None]: User info or None if user is not
643
+ found.
644
+
645
+ """
598
646
  con = get_server_api_connection()
599
647
  return con.get_user(*args, **kwargs)
600
648
 
@@ -788,6 +836,32 @@ def enroll_event_job(*args, **kwargs):
788
836
  return con.enroll_event_job(*args, **kwargs)
789
837
 
790
838
 
839
+ def download_file_to_stream(*args, **kwargs):
840
+ """Download file from AYON server to IOStream.
841
+
842
+ Endpoint can be full url (must start with 'base_url' of api object).
843
+
844
+ Progress object can be used to track download. Can be used when
845
+ download happens in thread and other thread want to catch changes over
846
+ time.
847
+
848
+ Todos:
849
+ Use retries and timeout.
850
+ Return RestApiResponse.
851
+
852
+ Args:
853
+ endpoint (str): Endpoint or URL to file that should be downloaded.
854
+ stream (Union[io.BytesIO, BinaryIO]): Stream where output will be stored.
855
+ chunk_size (Optional[int]): Size of chunks that are received
856
+ in single loop.
857
+ progress (Optional[TransferProgress]): Object that gives ability
858
+ to track download progress.
859
+
860
+ """
861
+ con = get_server_api_connection()
862
+ return con.download_file_to_stream(*args, **kwargs)
863
+
864
+
791
865
  def download_file(*args, **kwargs):
792
866
  """Download file from AYON server.
793
867
 
@@ -814,6 +888,31 @@ def download_file(*args, **kwargs):
814
888
  return con.download_file(*args, **kwargs)
815
889
 
816
890
 
891
+ def upload_file_from_stream(*args, **kwargs):
892
+ """Upload file to server from bytes.
893
+
894
+ Todos:
895
+ Use retries and timeout.
896
+ Return RestApiResponse.
897
+
898
+ Args:
899
+ endpoint (str): Endpoint or url where file will be uploaded.
900
+ stream (Union[io.BytesIO, BinaryIO]): File content stream.
901
+ progress (Optional[TransferProgress]): Object that gives ability
902
+ to track upload progress.
903
+ request_type (Optional[RequestType]): Type of request that will
904
+ be used to upload file.
905
+ **kwargs (Any): Additional arguments that will be passed
906
+ to request function.
907
+
908
+ Returns:
909
+ requests.Response: Response object
910
+
911
+ """
912
+ con = get_server_api_connection()
913
+ return con.upload_file_from_stream(*args, **kwargs)
914
+
915
+
817
916
  def upload_file(*args, **kwargs):
818
917
  """Upload file to server.
819
918
 
@@ -1475,6 +1574,25 @@ def get_build_in_anatomy_preset():
1475
1574
  return con.get_build_in_anatomy_preset()
1476
1575
 
1477
1576
 
1577
+ def get_project_root_overrides(*args, **kwargs):
1578
+ """Root overrides per site name.
1579
+
1580
+ Method is based on logged user and can't be received for any other
1581
+ user on server.
1582
+
1583
+ Output will contain only roots per site id used by logged user.
1584
+
1585
+ Args:
1586
+ project_name (str): Name of project.
1587
+
1588
+ Returns:
1589
+ dict[str, dict[str, str]]: Root values by root name by site id.
1590
+
1591
+ """
1592
+ con = get_server_api_connection()
1593
+ return con.get_project_root_overrides(*args, **kwargs)
1594
+
1595
+
1478
1596
  def get_project_roots_by_site(*args, **kwargs):
1479
1597
  """Root overrides per site name.
1480
1598
 
@@ -1483,6 +1601,10 @@ def get_project_roots_by_site(*args, **kwargs):
1483
1601
 
1484
1602
  Output will contain only roots per site id used by logged user.
1485
1603
 
1604
+ Deprecated:
1605
+ Use 'get_project_root_overrides' instead. Function
1606
+ deprecated since 1.0.6
1607
+
1486
1608
  Args:
1487
1609
  project_name (str): Name of project.
1488
1610
 
@@ -1494,7 +1616,7 @@ def get_project_roots_by_site(*args, **kwargs):
1494
1616
  return con.get_project_roots_by_site(*args, **kwargs)
1495
1617
 
1496
1618
 
1497
- def get_project_roots_for_site(*args, **kwargs):
1619
+ def get_project_root_overrides_by_site_id(*args, **kwargs):
1498
1620
  """Root overrides for site.
1499
1621
 
1500
1622
  If site id is not passed a site set in current api object is used
@@ -1509,11 +1631,76 @@ def get_project_roots_for_site(*args, **kwargs):
1509
1631
  dict[str, str]: Root values by root name or None if
1510
1632
  site does not have overrides.
1511
1633
 
1634
+ """
1635
+ con = get_server_api_connection()
1636
+ return con.get_project_root_overrides_by_site_id(*args, **kwargs)
1637
+
1638
+
1639
+ def get_project_roots_for_site(*args, **kwargs):
1640
+ """Root overrides for site.
1641
+
1642
+ If site id is not passed a site set in current api object is used
1643
+ instead.
1644
+
1645
+ Deprecated:
1646
+ Use 'get_project_root_overrides_by_site_id' instead. Function
1647
+ deprecated since 1.0.6
1648
+ Args:
1649
+ project_name (str): Name of project.
1650
+ site_id (Optional[str]): Site id for which want to receive
1651
+ site overrides.
1652
+
1653
+ Returns:
1654
+ dict[str, str]: Root values by root name, root name is not
1655
+ available if it does not have overrides.
1656
+
1512
1657
  """
1513
1658
  con = get_server_api_connection()
1514
1659
  return con.get_project_roots_for_site(*args, **kwargs)
1515
1660
 
1516
1661
 
1662
+ def get_project_roots_by_site_id(*args, **kwargs):
1663
+ """Root values for a site.
1664
+
1665
+ If site id is not passed a site set in current api object is used
1666
+ instead. If site id is not available, default roots are returned
1667
+ for current platform.
1668
+
1669
+ Args:
1670
+ project_name (str): Name of project.
1671
+ site_id (Optional[str]): Site id for which want to receive
1672
+ root values.
1673
+
1674
+ Returns:
1675
+ dict[str, str]: Root values.
1676
+
1677
+ """
1678
+ con = get_server_api_connection()
1679
+ return con.get_project_roots_by_site_id(*args, **kwargs)
1680
+
1681
+
1682
+ def get_project_roots_by_platform(*args, **kwargs):
1683
+ """Root values for a site.
1684
+
1685
+ If platform name is not passed current platform name is used instead.
1686
+
1687
+ This function does return root values without site overrides. It is
1688
+ possible to use the function to receive default root values.
1689
+
1690
+ Args:
1691
+ project_name (str): Name of project.
1692
+ platform_name (Optional[Literal["windows", "linux", "darwin"]]):
1693
+ Platform name for which want to receive root values. Current
1694
+ platform name is used if not passed.
1695
+
1696
+ Returns:
1697
+ dict[str, str]: Root values.
1698
+
1699
+ """
1700
+ con = get_server_api_connection()
1701
+ return con.get_project_roots_by_platform(*args, **kwargs)
1702
+
1703
+
1517
1704
  def get_addon_settings_schema(*args, **kwargs):
1518
1705
  """Sudio/Project settings schema of an addon.
1519
1706
 
@@ -2604,8 +2791,8 @@ def get_products(*args, **kwargs):
2604
2791
  fields (Optional[Iterable[str]]): Fields to be queried for
2605
2792
  folder. All possible folder fields are returned
2606
2793
  if 'None' is passed.
2607
- own_attributes (Optional[bool]): Attribute values that are
2608
- not explicitly set on entity will have 'None' value.
2794
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2795
+ products.
2609
2796
 
2610
2797
  Returns:
2611
2798
  Generator[dict[str, Any]]: Queried product entities.
@@ -2624,8 +2811,8 @@ def get_product_by_id(*args, **kwargs):
2624
2811
  product_id (str): Product id.
2625
2812
  fields (Optional[Iterable[str]]): Fields that should be returned.
2626
2813
  All fields are returned if 'None' is passed.
2627
- own_attributes (Optional[bool]): Attribute values that are
2628
- not explicitly set on entity will have 'None' value.
2814
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2815
+ products.
2629
2816
 
2630
2817
  Returns:
2631
2818
  Union[dict, None]: Product entity data or None if was not found.
@@ -2645,8 +2832,8 @@ def get_product_by_name(*args, **kwargs):
2645
2832
  folder_id (str): Folder id (Folder is a parent of products).
2646
2833
  fields (Optional[Iterable[str]]): Fields that should be returned.
2647
2834
  All fields are returned if 'None' is passed.
2648
- own_attributes (Optional[bool]): Attribute values that are
2649
- not explicitly set on entity will have 'None' value.
2835
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2836
+ products.
2650
2837
 
2651
2838
  Returns:
2652
2839
  Union[dict, None]: Product entity data or None if was not found.
@@ -2798,8 +2985,8 @@ def get_versions(*args, **kwargs):
2798
2985
  fields (Optional[Iterable[str]]): Fields to be queried
2799
2986
  for version. All possible folder fields are returned
2800
2987
  if 'None' is passed.
2801
- own_attributes (Optional[bool]): Attribute values that are
2802
- not explicitly set on entity will have 'None' value.
2988
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2989
+ versions.
2803
2990
 
2804
2991
  Returns:
2805
2992
  Generator[dict[str, Any]]: Queried version entities.
@@ -2818,8 +3005,8 @@ def get_version_by_id(*args, **kwargs):
2818
3005
  version_id (str): Version id.
2819
3006
  fields (Optional[Iterable[str]]): Fields that should be returned.
2820
3007
  All fields are returned if 'None' is passed.
2821
- own_attributes (Optional[bool]): Attribute values that are
2822
- not explicitly set on entity will have 'None' value.
3008
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3009
+ versions.
2823
3010
 
2824
3011
  Returns:
2825
3012
  Union[dict, None]: Version entity data or None if was not found.
@@ -2839,8 +3026,8 @@ def get_version_by_name(*args, **kwargs):
2839
3026
  product_id (str): Product id. Product is a parent of version.
2840
3027
  fields (Optional[Iterable[str]]): Fields that should be returned.
2841
3028
  All fields are returned if 'None' is passed.
2842
- own_attributes (Optional[bool]): Attribute values that are
2843
- not explicitly set on entity will have 'None' value.
3029
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3030
+ versions.
2844
3031
 
2845
3032
  Returns:
2846
3033
  Union[dict, None]: Version entity data or None if was not found.
@@ -2859,8 +3046,8 @@ def get_hero_version_by_id(*args, **kwargs):
2859
3046
  version_id (int): Hero version id.
2860
3047
  fields (Optional[Iterable[str]]): Fields that should be returned.
2861
3048
  All fields are returned if 'None' is passed.
2862
- own_attributes (Optional[bool]): Attribute values that are
2863
- not explicitly set on entity will have 'None' value.
3049
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3050
+ versions.
2864
3051
 
2865
3052
  Returns:
2866
3053
  Union[dict, None]: Version entity data or None if was not found.
@@ -2881,8 +3068,8 @@ def get_hero_version_by_product_id(*args, **kwargs):
2881
3068
  product_id (int): Product id.
2882
3069
  fields (Optional[Iterable[str]]): Fields that should be returned.
2883
3070
  All fields are returned if 'None' is passed.
2884
- own_attributes (Optional[bool]): Attribute values that are
2885
- not explicitly set on entity will have 'None' value.
3071
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3072
+ versions.
2886
3073
 
2887
3074
  Returns:
2888
3075
  Union[dict, None]: Version entity data or None if was not found.
@@ -2906,8 +3093,8 @@ def get_hero_versions(*args, **kwargs):
2906
3093
  Both are returned when 'None' is passed.
2907
3094
  fields (Optional[Iterable[str]]): Fields that should be returned.
2908
3095
  All fields are returned if 'None' is passed.
2909
- own_attributes (Optional[bool]): Attribute values that are
2910
- not explicitly set on entity will have 'None' value.
3096
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3097
+ versions.
2911
3098
 
2912
3099
  Returns:
2913
3100
  Union[dict, None]: Version entity data or None if was not found.
@@ -2927,8 +3114,8 @@ def get_last_versions(*args, **kwargs):
2927
3114
  Both are returned when 'None' is passed.
2928
3115
  fields (Optional[Iterable[str]]): fields to be queried
2929
3116
  for representations.
2930
- own_attributes (Optional[bool]): Attribute values that are
2931
- not explicitly set on entity will have 'None' value.
3117
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3118
+ versions.
2932
3119
 
2933
3120
  Returns:
2934
3121
  dict[str, dict[str, Any]]: Last versions by product id.
@@ -2948,8 +3135,8 @@ def get_last_version_by_product_id(*args, **kwargs):
2948
3135
  Both are returned when 'None' is passed.
2949
3136
  fields (Optional[Iterable[str]]): fields to be queried
2950
3137
  for representations.
2951
- own_attributes (Optional[bool]): Attribute values that are
2952
- not explicitly set on entity will have 'None' value.
3138
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3139
+ versions.
2953
3140
 
2954
3141
  Returns:
2955
3142
  Union[dict[str, Any], None]: Queried version entity or None.
@@ -2970,8 +3157,8 @@ def get_last_version_by_product_name(*args, **kwargs):
2970
3157
  Both are returned when 'None' is passed.
2971
3158
  fields (Optional[Iterable[str]]): fields to be queried
2972
3159
  for representations.
2973
- own_attributes (Optional[bool]): Attribute values that are
2974
- not explicitly set on entity will have 'None' value.
3160
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3161
+ representations.
2975
3162
 
2976
3163
  Returns:
2977
3164
  Union[dict[str, Any], None]: Queried version entity or None.
@@ -3094,8 +3281,8 @@ def get_representations(*args, **kwargs):
3094
3281
  fields (Optional[Iterable[str]]): Fields to be queried for
3095
3282
  representation. All possible fields are returned if 'None' is
3096
3283
  passed.
3097
- own_attributes (Optional[bool]): Attribute values that are
3098
- not explicitly set on entity will have 'None' value.
3284
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3285
+ representations.
3099
3286
 
3100
3287
  Returns:
3101
3288
  Generator[dict[str, Any]]: Queried representation entities.
@@ -3113,8 +3300,8 @@ def get_representation_by_id(*args, **kwargs):
3113
3300
  representation_id (str): Id of representation.
3114
3301
  fields (Optional[Iterable[str]]): fields to be queried
3115
3302
  for representations.
3116
- own_attributes (Optional[bool]): Attribute values that are
3117
- not explicitly set on entity will have 'None' value.
3303
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3304
+ representations.
3118
3305
 
3119
3306
  Returns:
3120
3307
  Union[dict[str, Any], None]: Queried representation entity or None.
@@ -3133,8 +3320,8 @@ def get_representation_by_name(*args, **kwargs):
3133
3320
  version_id (str): Version id.
3134
3321
  fields (Optional[Iterable[str]]): fields to be queried
3135
3322
  for representations.
3136
- own_attributes (Optional[bool]): Attribute values that are
3137
- not explicitly set on entity will have 'None' value.
3323
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3324
+ representations.
3138
3325
 
3139
3326
  Returns:
3140
3327
  Union[dict[str, Any], None]: Queried representation entity or None.
@@ -3144,14 +3331,71 @@ def get_representation_by_name(*args, **kwargs):
3144
3331
  return con.get_representation_by_name(*args, **kwargs)
3145
3332
 
3146
3333
 
3334
+ def get_representations_hierarchy(*args, **kwargs):
3335
+ """Find representation with parents by representation id.
3336
+
3337
+ Representation entity with parent entities up to project.
3338
+
3339
+ Default fields are used when any fields are set to `None`. But it is
3340
+ possible to pass in empty iterable (list, set, tuple) to skip
3341
+ entity.
3342
+
3343
+ Args:
3344
+ project_name (str): Project where to look for entities.
3345
+ representation_ids (Iterable[str]): Representation ids.
3346
+ project_fields (Optional[Iterable[str]]): Project fields.
3347
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3348
+ task_fields (Optional[Iterable[str]]): Task fields.
3349
+ product_fields (Optional[Iterable[str]]): Product fields.
3350
+ version_fields (Optional[Iterable[str]]): Version fields.
3351
+ representation_fields (Optional[Iterable[str]]): Representation
3352
+ fields.
3353
+
3354
+ Returns:
3355
+ dict[str, RepresentationHierarchy]: Parent entities by
3356
+ representation id.
3357
+
3358
+ """
3359
+ con = get_server_api_connection()
3360
+ return con.get_representations_hierarchy(*args, **kwargs)
3361
+
3362
+
3363
+ def get_representation_hierarchy(*args, **kwargs):
3364
+ """Find representation parents by representation id.
3365
+
3366
+ Representation parent entities up to project.
3367
+
3368
+ Args:
3369
+ project_name (str): Project where to look for entities.
3370
+ representation_id (str): Representation id.
3371
+ project_fields (Optional[Iterable[str]]): Project fields.
3372
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3373
+ task_fields (Optional[Iterable[str]]): Task fields.
3374
+ product_fields (Optional[Iterable[str]]): Product fields.
3375
+ version_fields (Optional[Iterable[str]]): Version fields.
3376
+ representation_fields (Optional[Iterable[str]]): Representation
3377
+ fields.
3378
+
3379
+ Returns:
3380
+ RepresentationHierarchy: Representation hierarchy entities.
3381
+
3382
+ """
3383
+ con = get_server_api_connection()
3384
+ return con.get_representation_hierarchy(*args, **kwargs)
3385
+
3386
+
3147
3387
  def get_representations_parents(*args, **kwargs):
3148
3388
  """Find representations parents by representation id.
3149
3389
 
3150
3390
  Representation parent entities up to project.
3151
3391
 
3152
3392
  Args:
3153
- project_name (str): Project where to look for entities.
3154
- representation_ids (Iterable[str]): Representation ids.
3393
+ project_name (str): Project where to look for entities.
3394
+ representation_ids (Iterable[str]): Representation ids.
3395
+ project_fields (Optional[Iterable[str]]): Project fields.
3396
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3397
+ product_fields (Optional[Iterable[str]]): Product fields.
3398
+ version_fields (Optional[Iterable[str]]): Version fields.
3155
3399
 
3156
3400
  Returns:
3157
3401
  dict[str, RepresentationParents]: Parent entities by
@@ -3168,8 +3412,12 @@ def get_representation_parents(*args, **kwargs):
3168
3412
  Representation parent entities up to project.
3169
3413
 
3170
3414
  Args:
3171
- project_name (str): Project where to look for entities.
3172
- representation_id (str): Representation id.
3415
+ project_name (str): Project where to look for entities.
3416
+ representation_id (str): Representation id.
3417
+ project_fields (Optional[Iterable[str]]): Project fields.
3418
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3419
+ product_fields (Optional[Iterable[str]]): Product fields.
3420
+ version_fields (Optional[Iterable[str]]): Version fields.
3173
3421
 
3174
3422
  Returns:
3175
3423
  RepresentationParents: Representation parent entities.
@@ -3303,8 +3551,8 @@ def get_workfiles_info(*args, **kwargs):
3303
3551
  fields (Optional[Iterable[str]]): Fields to be queried for
3304
3552
  representation. All possible fields are returned if 'None' is
3305
3553
  passed.
3306
- own_attributes (Optional[bool]): Attribute values that are
3307
- not explicitly set on entity will have 'None' value.
3554
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3555
+ workfiles.
3308
3556
 
3309
3557
  Returns:
3310
3558
  Generator[dict[str, Any]]: Queried workfile info entites.
@@ -3324,8 +3572,8 @@ def get_workfile_info(*args, **kwargs):
3324
3572
  fields (Optional[Iterable[str]]): Fields to be queried for
3325
3573
  representation. All possible fields are returned if 'None' is
3326
3574
  passed.
3327
- own_attributes (Optional[bool]): Attribute values that are
3328
- not explicitly set on entity will have 'None' value.
3575
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3576
+ workfiles.
3329
3577
 
3330
3578
  Returns:
3331
3579
  Union[dict[str, Any], None]: Workfile info entity or None.
@@ -3344,8 +3592,8 @@ def get_workfile_info_by_id(*args, **kwargs):
3344
3592
  fields (Optional[Iterable[str]]): Fields to be queried for
3345
3593
  representation. All possible fields are returned if 'None' is
3346
3594
  passed.
3347
- own_attributes (Optional[bool]): Attribute values that are
3348
- not explicitly set on entity will have 'None' value.
3595
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3596
+ workfiles.
3349
3597
 
3350
3598
  Returns:
3351
3599
  Union[dict[str, Any], None]: Workfile info entity or None.