ayon-python-api 1.0.5__tar.gz → 1.0.6__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.6}/PKG-INFO +2 -3
  2. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/README.md +1 -1
  3. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/__init__.py +20 -0
  4. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/_api.py +253 -42
  5. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/entity_hub.py +132 -38
  6. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/graphql.py +5 -8
  7. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/graphql_queries.py +53 -23
  8. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/operations.py +2 -5
  9. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/server_api.py +548 -143
  10. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/utils.py +6 -7
  11. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/version.py +1 -1
  12. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_python_api.egg-info/PKG-INFO +2 -3
  13. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_python_api.egg-info/requires.txt +1 -2
  14. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/pyproject.toml +6 -9
  15. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/setup.py +1 -3
  16. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/LICENSE +0 -0
  17. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/constants.py +0 -0
  18. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/events.py +0 -0
  19. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_api/exceptions.py +0 -0
  20. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_python_api.egg-info/SOURCES.txt +0 -0
  21. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_python_api.egg-info/dependency_links.txt +0 -0
  22. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/ayon_python_api.egg-info/top_level.txt +0 -0
  23. {ayon-python-api-1.0.5 → ayon-python-api-1.0.6}/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.6
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,
@@ -60,7 +62,9 @@ from ._api import (
60
62
  update_event,
61
63
  dispatch_event,
62
64
  enroll_event_job,
65
+ download_file_to_stream,
63
66
  download_file,
67
+ upload_file_from_stream,
64
68
  upload_file,
65
69
  trigger_server_restart,
66
70
  query_graphql,
@@ -98,8 +102,12 @@ from ._api import (
98
102
  get_default_anatomy_preset_name,
99
103
  get_project_anatomy_preset,
100
104
  get_build_in_anatomy_preset,
105
+ get_project_root_overrides,
101
106
  get_project_roots_by_site,
107
+ get_project_root_overrides_by_site_id,
102
108
  get_project_roots_for_site,
109
+ get_project_roots_by_site_id,
110
+ get_project_roots_by_platform,
103
111
  get_addon_settings_schema,
104
112
  get_addon_site_settings_schema,
105
113
  get_addon_studio_settings,
@@ -170,6 +178,8 @@ from ._api import (
170
178
  get_representations,
171
179
  get_representation_by_id,
172
180
  get_representation_by_name,
181
+ get_representations_hierarchy,
182
+ get_representation_hierarchy,
173
183
  get_representations_parents,
174
184
  get_representation_parents,
175
185
  get_repre_ids_by_context_filters,
@@ -219,6 +229,7 @@ __all__ = (
219
229
  "slugify_string",
220
230
  "create_dependency_package_basename",
221
231
 
232
+ "RequestTypes",
222
233
  "ServerAPI",
223
234
 
224
235
  "GlobalServerAPI",
@@ -244,6 +255,7 @@ __all__ = (
244
255
  "set_timeout",
245
256
  "get_max_retries",
246
257
  "set_max_retries",
258
+ "is_service_user",
247
259
  "get_site_id",
248
260
  "set_site_id",
249
261
  "get_client_version",
@@ -272,7 +284,9 @@ __all__ = (
272
284
  "update_event",
273
285
  "dispatch_event",
274
286
  "enroll_event_job",
287
+ "download_file_to_stream",
275
288
  "download_file",
289
+ "upload_file_from_stream",
276
290
  "upload_file",
277
291
  "trigger_server_restart",
278
292
  "query_graphql",
@@ -310,8 +324,12 @@ __all__ = (
310
324
  "get_default_anatomy_preset_name",
311
325
  "get_project_anatomy_preset",
312
326
  "get_build_in_anatomy_preset",
327
+ "get_project_root_overrides",
313
328
  "get_project_roots_by_site",
329
+ "get_project_root_overrides_by_site_id",
314
330
  "get_project_roots_for_site",
331
+ "get_project_roots_by_site_id",
332
+ "get_project_roots_by_platform",
315
333
  "get_addon_settings_schema",
316
334
  "get_addon_site_settings_schema",
317
335
  "get_addon_studio_settings",
@@ -382,6 +400,8 @@ __all__ = (
382
400
  "get_representations",
383
401
  "get_representation_by_id",
384
402
  "get_representation_by_name",
403
+ "get_representations_hierarchy",
404
+ "get_representation_hierarchy",
385
405
  "get_representations_parents",
386
406
  "get_representation_parents",
387
407
  "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
 
@@ -788,6 +801,32 @@ def enroll_event_job(*args, **kwargs):
788
801
  return con.enroll_event_job(*args, **kwargs)
789
802
 
790
803
 
804
+ def download_file_to_stream(*args, **kwargs):
805
+ """Download file from AYON server to IOStream.
806
+
807
+ Endpoint can be full url (must start with 'base_url' of api object).
808
+
809
+ Progress object can be used to track download. Can be used when
810
+ download happens in thread and other thread want to catch changes over
811
+ time.
812
+
813
+ Todos:
814
+ Use retries and timeout.
815
+ Return RestApiResponse.
816
+
817
+ Args:
818
+ endpoint (str): Endpoint or URL to file that should be downloaded.
819
+ stream (Union[io.BytesIO, BinaryIO]): Stream where output will be stored.
820
+ chunk_size (Optional[int]): Size of chunks that are received
821
+ in single loop.
822
+ progress (Optional[TransferProgress]): Object that gives ability
823
+ to track download progress.
824
+
825
+ """
826
+ con = get_server_api_connection()
827
+ return con.download_file_to_stream(*args, **kwargs)
828
+
829
+
791
830
  def download_file(*args, **kwargs):
792
831
  """Download file from AYON server.
793
832
 
@@ -814,6 +853,31 @@ def download_file(*args, **kwargs):
814
853
  return con.download_file(*args, **kwargs)
815
854
 
816
855
 
856
+ def upload_file_from_stream(*args, **kwargs):
857
+ """Upload file to server from bytes.
858
+
859
+ Todos:
860
+ Use retries and timeout.
861
+ Return RestApiResponse.
862
+
863
+ Args:
864
+ endpoint (str): Endpoint or url where file will be uploaded.
865
+ stream (Union[io.BytesIO, BinaryIO]): File content stream.
866
+ progress (Optional[TransferProgress]): Object that gives ability
867
+ to track upload progress.
868
+ request_type (Optional[RequestType]): Type of request that will
869
+ be used to upload file.
870
+ **kwargs (Any): Additional arguments that will be passed
871
+ to request function.
872
+
873
+ Returns:
874
+ requests.Response: Response object
875
+
876
+ """
877
+ con = get_server_api_connection()
878
+ return con.upload_file_from_stream(*args, **kwargs)
879
+
880
+
817
881
  def upload_file(*args, **kwargs):
818
882
  """Upload file to server.
819
883
 
@@ -1475,6 +1539,25 @@ def get_build_in_anatomy_preset():
1475
1539
  return con.get_build_in_anatomy_preset()
1476
1540
 
1477
1541
 
1542
+ def get_project_root_overrides(*args, **kwargs):
1543
+ """Root overrides per site name.
1544
+
1545
+ Method is based on logged user and can't be received for any other
1546
+ user on server.
1547
+
1548
+ Output will contain only roots per site id used by logged user.
1549
+
1550
+ Args:
1551
+ project_name (str): Name of project.
1552
+
1553
+ Returns:
1554
+ dict[str, dict[str, str]]: Root values by root name by site id.
1555
+
1556
+ """
1557
+ con = get_server_api_connection()
1558
+ return con.get_project_root_overrides(*args, **kwargs)
1559
+
1560
+
1478
1561
  def get_project_roots_by_site(*args, **kwargs):
1479
1562
  """Root overrides per site name.
1480
1563
 
@@ -1483,6 +1566,10 @@ def get_project_roots_by_site(*args, **kwargs):
1483
1566
 
1484
1567
  Output will contain only roots per site id used by logged user.
1485
1568
 
1569
+ Deprecated:
1570
+ Use 'get_project_root_overrides' instead. Function
1571
+ deprecated since 1.0.6
1572
+
1486
1573
  Args:
1487
1574
  project_name (str): Name of project.
1488
1575
 
@@ -1494,7 +1581,7 @@ def get_project_roots_by_site(*args, **kwargs):
1494
1581
  return con.get_project_roots_by_site(*args, **kwargs)
1495
1582
 
1496
1583
 
1497
- def get_project_roots_for_site(*args, **kwargs):
1584
+ def get_project_root_overrides_by_site_id(*args, **kwargs):
1498
1585
  """Root overrides for site.
1499
1586
 
1500
1587
  If site id is not passed a site set in current api object is used
@@ -1509,11 +1596,76 @@ def get_project_roots_for_site(*args, **kwargs):
1509
1596
  dict[str, str]: Root values by root name or None if
1510
1597
  site does not have overrides.
1511
1598
 
1599
+ """
1600
+ con = get_server_api_connection()
1601
+ return con.get_project_root_overrides_by_site_id(*args, **kwargs)
1602
+
1603
+
1604
+ def get_project_roots_for_site(*args, **kwargs):
1605
+ """Root overrides for site.
1606
+
1607
+ If site id is not passed a site set in current api object is used
1608
+ instead.
1609
+
1610
+ Deprecated:
1611
+ Use 'get_project_root_overrides_by_site_id' instead. Function
1612
+ deprecated since 1.0.6
1613
+ Args:
1614
+ project_name (str): Name of project.
1615
+ site_id (Optional[str]): Site id for which want to receive
1616
+ site overrides.
1617
+
1618
+ Returns:
1619
+ dict[str, str]: Root values by root name, root name is not
1620
+ available if it does not have overrides.
1621
+
1512
1622
  """
1513
1623
  con = get_server_api_connection()
1514
1624
  return con.get_project_roots_for_site(*args, **kwargs)
1515
1625
 
1516
1626
 
1627
+ def get_project_roots_by_site_id(*args, **kwargs):
1628
+ """Root values for a site.
1629
+
1630
+ If site id is not passed a site set in current api object is used
1631
+ instead. If site id is not available, default roots are returned
1632
+ for current platform.
1633
+
1634
+ Args:
1635
+ project_name (str): Name of project.
1636
+ site_id (Optional[str]): Site id for which want to receive
1637
+ root values.
1638
+
1639
+ Returns:
1640
+ dict[str, str]: Root values.
1641
+
1642
+ """
1643
+ con = get_server_api_connection()
1644
+ return con.get_project_roots_by_site_id(*args, **kwargs)
1645
+
1646
+
1647
+ def get_project_roots_by_platform(*args, **kwargs):
1648
+ """Root values for a site.
1649
+
1650
+ If platform name is not passed current platform name is used instead.
1651
+
1652
+ This function does return root values without site overrides. It is
1653
+ possible to use the function to receive default root values.
1654
+
1655
+ Args:
1656
+ project_name (str): Name of project.
1657
+ platform_name (Optional[Literal["windows", "linux", "darwin"]]):
1658
+ Platform name for which want to receive root values. Current
1659
+ platform name is used if not passed.
1660
+
1661
+ Returns:
1662
+ dict[str, str]: Root values.
1663
+
1664
+ """
1665
+ con = get_server_api_connection()
1666
+ return con.get_project_roots_by_platform(*args, **kwargs)
1667
+
1668
+
1517
1669
  def get_addon_settings_schema(*args, **kwargs):
1518
1670
  """Sudio/Project settings schema of an addon.
1519
1671
 
@@ -2604,8 +2756,8 @@ def get_products(*args, **kwargs):
2604
2756
  fields (Optional[Iterable[str]]): Fields to be queried for
2605
2757
  folder. All possible folder fields are returned
2606
2758
  if 'None' is passed.
2607
- own_attributes (Optional[bool]): Attribute values that are
2608
- not explicitly set on entity will have 'None' value.
2759
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2760
+ products.
2609
2761
 
2610
2762
  Returns:
2611
2763
  Generator[dict[str, Any]]: Queried product entities.
@@ -2624,8 +2776,8 @@ def get_product_by_id(*args, **kwargs):
2624
2776
  product_id (str): Product id.
2625
2777
  fields (Optional[Iterable[str]]): Fields that should be returned.
2626
2778
  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.
2779
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2780
+ products.
2629
2781
 
2630
2782
  Returns:
2631
2783
  Union[dict, None]: Product entity data or None if was not found.
@@ -2645,8 +2797,8 @@ def get_product_by_name(*args, **kwargs):
2645
2797
  folder_id (str): Folder id (Folder is a parent of products).
2646
2798
  fields (Optional[Iterable[str]]): Fields that should be returned.
2647
2799
  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.
2800
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2801
+ products.
2650
2802
 
2651
2803
  Returns:
2652
2804
  Union[dict, None]: Product entity data or None if was not found.
@@ -2798,8 +2950,8 @@ def get_versions(*args, **kwargs):
2798
2950
  fields (Optional[Iterable[str]]): Fields to be queried
2799
2951
  for version. All possible folder fields are returned
2800
2952
  if 'None' is passed.
2801
- own_attributes (Optional[bool]): Attribute values that are
2802
- not explicitly set on entity will have 'None' value.
2953
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2954
+ versions.
2803
2955
 
2804
2956
  Returns:
2805
2957
  Generator[dict[str, Any]]: Queried version entities.
@@ -2818,8 +2970,8 @@ def get_version_by_id(*args, **kwargs):
2818
2970
  version_id (str): Version id.
2819
2971
  fields (Optional[Iterable[str]]): Fields that should be returned.
2820
2972
  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.
2973
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2974
+ versions.
2823
2975
 
2824
2976
  Returns:
2825
2977
  Union[dict, None]: Version entity data or None if was not found.
@@ -2839,8 +2991,8 @@ def get_version_by_name(*args, **kwargs):
2839
2991
  product_id (str): Product id. Product is a parent of version.
2840
2992
  fields (Optional[Iterable[str]]): Fields that should be returned.
2841
2993
  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.
2994
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
2995
+ versions.
2844
2996
 
2845
2997
  Returns:
2846
2998
  Union[dict, None]: Version entity data or None if was not found.
@@ -2859,8 +3011,8 @@ def get_hero_version_by_id(*args, **kwargs):
2859
3011
  version_id (int): Hero version id.
2860
3012
  fields (Optional[Iterable[str]]): Fields that should be returned.
2861
3013
  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.
3014
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3015
+ versions.
2864
3016
 
2865
3017
  Returns:
2866
3018
  Union[dict, None]: Version entity data or None if was not found.
@@ -2881,8 +3033,8 @@ def get_hero_version_by_product_id(*args, **kwargs):
2881
3033
  product_id (int): Product id.
2882
3034
  fields (Optional[Iterable[str]]): Fields that should be returned.
2883
3035
  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.
3036
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3037
+ versions.
2886
3038
 
2887
3039
  Returns:
2888
3040
  Union[dict, None]: Version entity data or None if was not found.
@@ -2906,8 +3058,8 @@ def get_hero_versions(*args, **kwargs):
2906
3058
  Both are returned when 'None' is passed.
2907
3059
  fields (Optional[Iterable[str]]): Fields that should be returned.
2908
3060
  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.
3061
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3062
+ versions.
2911
3063
 
2912
3064
  Returns:
2913
3065
  Union[dict, None]: Version entity data or None if was not found.
@@ -2927,8 +3079,8 @@ def get_last_versions(*args, **kwargs):
2927
3079
  Both are returned when 'None' is passed.
2928
3080
  fields (Optional[Iterable[str]]): fields to be queried
2929
3081
  for representations.
2930
- own_attributes (Optional[bool]): Attribute values that are
2931
- not explicitly set on entity will have 'None' value.
3082
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3083
+ versions.
2932
3084
 
2933
3085
  Returns:
2934
3086
  dict[str, dict[str, Any]]: Last versions by product id.
@@ -2948,8 +3100,8 @@ def get_last_version_by_product_id(*args, **kwargs):
2948
3100
  Both are returned when 'None' is passed.
2949
3101
  fields (Optional[Iterable[str]]): fields to be queried
2950
3102
  for representations.
2951
- own_attributes (Optional[bool]): Attribute values that are
2952
- not explicitly set on entity will have 'None' value.
3103
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3104
+ versions.
2953
3105
 
2954
3106
  Returns:
2955
3107
  Union[dict[str, Any], None]: Queried version entity or None.
@@ -2970,8 +3122,8 @@ def get_last_version_by_product_name(*args, **kwargs):
2970
3122
  Both are returned when 'None' is passed.
2971
3123
  fields (Optional[Iterable[str]]): fields to be queried
2972
3124
  for representations.
2973
- own_attributes (Optional[bool]): Attribute values that are
2974
- not explicitly set on entity will have 'None' value.
3125
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3126
+ representations.
2975
3127
 
2976
3128
  Returns:
2977
3129
  Union[dict[str, Any], None]: Queried version entity or None.
@@ -3094,8 +3246,8 @@ def get_representations(*args, **kwargs):
3094
3246
  fields (Optional[Iterable[str]]): Fields to be queried for
3095
3247
  representation. All possible fields are returned if 'None' is
3096
3248
  passed.
3097
- own_attributes (Optional[bool]): Attribute values that are
3098
- not explicitly set on entity will have 'None' value.
3249
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3250
+ representations.
3099
3251
 
3100
3252
  Returns:
3101
3253
  Generator[dict[str, Any]]: Queried representation entities.
@@ -3113,8 +3265,8 @@ def get_representation_by_id(*args, **kwargs):
3113
3265
  representation_id (str): Id of representation.
3114
3266
  fields (Optional[Iterable[str]]): fields to be queried
3115
3267
  for representations.
3116
- own_attributes (Optional[bool]): Attribute values that are
3117
- not explicitly set on entity will have 'None' value.
3268
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3269
+ representations.
3118
3270
 
3119
3271
  Returns:
3120
3272
  Union[dict[str, Any], None]: Queried representation entity or None.
@@ -3133,8 +3285,8 @@ def get_representation_by_name(*args, **kwargs):
3133
3285
  version_id (str): Version id.
3134
3286
  fields (Optional[Iterable[str]]): fields to be queried
3135
3287
  for representations.
3136
- own_attributes (Optional[bool]): Attribute values that are
3137
- not explicitly set on entity will have 'None' value.
3288
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3289
+ representations.
3138
3290
 
3139
3291
  Returns:
3140
3292
  Union[dict[str, Any], None]: Queried representation entity or None.
@@ -3144,14 +3296,69 @@ def get_representation_by_name(*args, **kwargs):
3144
3296
  return con.get_representation_by_name(*args, **kwargs)
3145
3297
 
3146
3298
 
3299
+ def get_representations_hierarchy(*args, **kwargs):
3300
+ """Find representation with parents by representation id.
3301
+
3302
+ Representation entity with parent entities up to project.
3303
+
3304
+ Default fields are used when any fields are set to `None`. But it is
3305
+ possible to pass in empty iterable (list, set, tuple) to skip
3306
+ entity.
3307
+
3308
+ Args:
3309
+ project_name (str): Project where to look for entities.
3310
+ representation_ids (Iterable[str]): Representation ids.
3311
+ project_fields (Optional[Iterable[str]]): Project fields.
3312
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3313
+ product_fields (Optional[Iterable[str]]): Product fields.
3314
+ version_fields (Optional[Iterable[str]]): Version fields.
3315
+ representation_fields (Optional[Iterable[str]]): Representation
3316
+ fields.
3317
+
3318
+ Returns:
3319
+ dict[str, RepresentationHierarchy]: Parent entities by
3320
+ representation id.
3321
+
3322
+ """
3323
+ con = get_server_api_connection()
3324
+ return con.get_representations_hierarchy(*args, **kwargs)
3325
+
3326
+
3327
+ def get_representation_hierarchy(*args, **kwargs):
3328
+ """Find representation parents by representation id.
3329
+
3330
+ Representation parent entities up to project.
3331
+
3332
+ Args:
3333
+ project_name (str): Project where to look for entities.
3334
+ representation_id (str): Representation id.
3335
+ project_fields (Optional[Iterable[str]]): Project fields.
3336
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3337
+ product_fields (Optional[Iterable[str]]): Product fields.
3338
+ version_fields (Optional[Iterable[str]]): Version fields.
3339
+ representation_fields (Optional[Iterable[str]]): Representation
3340
+ fields.
3341
+
3342
+ Returns:
3343
+ RepresentationHierarchy: Representation hierarchy entities.
3344
+
3345
+ """
3346
+ con = get_server_api_connection()
3347
+ return con.get_representation_hierarchy(*args, **kwargs)
3348
+
3349
+
3147
3350
  def get_representations_parents(*args, **kwargs):
3148
3351
  """Find representations parents by representation id.
3149
3352
 
3150
3353
  Representation parent entities up to project.
3151
3354
 
3152
3355
  Args:
3153
- project_name (str): Project where to look for entities.
3154
- representation_ids (Iterable[str]): Representation ids.
3356
+ project_name (str): Project where to look for entities.
3357
+ representation_ids (Iterable[str]): Representation ids.
3358
+ project_fields (Optional[Iterable[str]]): Project fields.
3359
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3360
+ product_fields (Optional[Iterable[str]]): Product fields.
3361
+ version_fields (Optional[Iterable[str]]): Version fields.
3155
3362
 
3156
3363
  Returns:
3157
3364
  dict[str, RepresentationParents]: Parent entities by
@@ -3168,8 +3375,12 @@ def get_representation_parents(*args, **kwargs):
3168
3375
  Representation parent entities up to project.
3169
3376
 
3170
3377
  Args:
3171
- project_name (str): Project where to look for entities.
3172
- representation_id (str): Representation id.
3378
+ project_name (str): Project where to look for entities.
3379
+ representation_id (str): Representation id.
3380
+ project_fields (Optional[Iterable[str]]): Project fields.
3381
+ folder_fields (Optional[Iterable[str]]): Folder fields.
3382
+ product_fields (Optional[Iterable[str]]): Product fields.
3383
+ version_fields (Optional[Iterable[str]]): Version fields.
3173
3384
 
3174
3385
  Returns:
3175
3386
  RepresentationParents: Representation parent entities.
@@ -3303,8 +3514,8 @@ def get_workfiles_info(*args, **kwargs):
3303
3514
  fields (Optional[Iterable[str]]): Fields to be queried for
3304
3515
  representation. All possible fields are returned if 'None' is
3305
3516
  passed.
3306
- own_attributes (Optional[bool]): Attribute values that are
3307
- not explicitly set on entity will have 'None' value.
3517
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3518
+ workfiles.
3308
3519
 
3309
3520
  Returns:
3310
3521
  Generator[dict[str, Any]]: Queried workfile info entites.
@@ -3324,8 +3535,8 @@ def get_workfile_info(*args, **kwargs):
3324
3535
  fields (Optional[Iterable[str]]): Fields to be queried for
3325
3536
  representation. All possible fields are returned if 'None' is
3326
3537
  passed.
3327
- own_attributes (Optional[bool]): Attribute values that are
3328
- not explicitly set on entity will have 'None' value.
3538
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3539
+ workfiles.
3329
3540
 
3330
3541
  Returns:
3331
3542
  Union[dict[str, Any], None]: Workfile info entity or None.
@@ -3344,8 +3555,8 @@ def get_workfile_info_by_id(*args, **kwargs):
3344
3555
  fields (Optional[Iterable[str]]): Fields to be queried for
3345
3556
  representation. All possible fields are returned if 'None' is
3346
3557
  passed.
3347
- own_attributes (Optional[bool]): Attribute values that are
3348
- not explicitly set on entity will have 'None' value.
3558
+ own_attributes (Optional[bool]): DEPRECATED: Not supported for
3559
+ workfiles.
3349
3560
 
3350
3561
  Returns:
3351
3562
  Union[dict[str, Any], None]: Workfile info entity or None.