atlassian-python-api 4.0.3__tar.gz → 4.0.4__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 (209) hide show
  1. {atlassian_python_api-4.0.3/atlassian_python_api.egg-info → atlassian_python_api-4.0.4}/PKG-INFO +1 -2
  2. atlassian_python_api-4.0.4/atlassian/VERSION +1 -0
  3. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/__init__.py +7 -1
  4. atlassian_python_api-4.0.4/atlassian/assets.py +626 -0
  5. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bamboo.py +1 -0
  6. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/__init__.py +0 -1
  7. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/__init__.py +5 -1
  8. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py +1 -1
  9. atlassian_python_api-4.0.4/atlassian/cloud_admin.py +117 -0
  10. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/confluence.py +58 -11
  11. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/jira.py +77 -30
  12. atlassian_python_api-4.0.4/atlassian/request_utils.py +14 -0
  13. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/rest_client.py +8 -2
  14. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4/atlassian_python_api.egg-info}/PKG-INFO +1 -2
  15. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian_python_api.egg-info/SOURCES.txt +9 -0
  16. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian_python_api.egg-info/requires.txt +0 -1
  17. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/pyproject.toml +1 -1
  18. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/requirements.txt +0 -1
  19. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/setup.py +1 -1
  20. atlassian_python_api-4.0.4/tests/__pycache__/test_base.cpython-39-pytest-8.3.5.pyc +0 -0
  21. atlassian_python_api-4.0.4/tests/__pycache__/test_bitbucket_cloud_oo.cpython-39-pytest-8.3.5.pyc +0 -0
  22. atlassian_python_api-4.0.4/tests/__pycache__/test_bitbucket_server.cpython-39-pytest-8.3.5.pyc +0 -0
  23. atlassian_python_api-4.0.4/tests/__pycache__/test_bitbucket_server_oo.cpython-39-pytest-8.3.5.pyc +0 -0
  24. atlassian_python_api-4.0.4/tests/__pycache__/test_confluence_advanced_mode.cpython-39-pytest-8.3.5.pyc +0 -0
  25. atlassian_python_api-4.0.4/tests/__pycache__/test_confluence_attach.cpython-39-pytest-8.3.5.pyc +0 -0
  26. atlassian_python_api-4.0.4/tests/__pycache__/test_jira.cpython-39-pytest-8.3.5.pyc +0 -0
  27. atlassian_python_api-4.0.4/tests/__pycache__/test_servicedesk.cpython-39-pytest-8.3.5.pyc +0 -0
  28. atlassian_python_api-4.0.3/atlassian/VERSION +0 -1
  29. atlassian_python_api-4.0.3/atlassian/cloud_admin.py +0 -32
  30. atlassian_python_api-4.0.3/atlassian/request_utils.py +0 -39
  31. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/LICENSE +0 -0
  32. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/MANIFEST.in +0 -0
  33. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/README.rst +0 -0
  34. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/base.py +1 -1
  35. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/base.py +2 -2
  36. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/common/__init__.py +0 -0
  37. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/common/builds.py +0 -0
  38. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/common/comments.py +0 -0
  39. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/common/users.py +0 -0
  40. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/__init__.py +0 -0
  41. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/branchRestrictions.py +0 -0
  42. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/commits.py +0 -0
  43. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/defaultReviewers.py +0 -0
  44. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/diffstat.py +0 -0
  45. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/groupPermissions.py +0 -0
  46. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/hooks.py +0 -0
  47. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/issues.py +0 -0
  48. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/pipelines.py +0 -0
  49. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/pullRequests.py +0 -0
  50. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/refs.py +0 -0
  51. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/repositories/repositoryVariables.py +0 -0
  52. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/workspaces/__init__.py +0 -0
  53. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/workspaces/members.py +0 -0
  54. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/workspaces/permissions.py +0 -0
  55. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/cloud/workspaces/projects.py +0 -0
  56. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/__init__.py +0 -0
  57. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/base.py +0 -0
  58. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/common/__init__.py +0 -0
  59. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/common/permissions.py +0 -0
  60. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/globalPermissions.py +0 -0
  61. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/projects/__init__.py +0 -0
  62. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/bitbucket/server/projects/repos/__init__.py +0 -0
  63. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/crowd.py +0 -0
  64. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/errors.py +0 -0
  65. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/insight.py +0 -0
  66. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/marketplace.py +0 -0
  67. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/portfolio.py +0 -0
  68. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/py.typed +0 -0
  69. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/service_desk.py +0 -0
  70. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/statuspage.py +0 -0
  71. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/typehints.py +0 -0
  72. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/utils.py +0 -0
  73. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian/xray.py +0 -0
  74. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian_python_api.egg-info/dependency_links.txt +0 -0
  75. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian_python_api.egg-info/not-zip-safe +0 -0
  76. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/atlassian_python_api.egg-info/top_level.txt +0 -0
  77. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/setup.cfg +0 -0
  78. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__init__.py +0 -0
  79. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/__init__.cpython-39.pyc +0 -0
  80. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/mockup.cpython-39.pyc +0 -0
  81. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_base.cpython-39-pytest-8.3.4.pyc +0 -0
  82. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_bitbucket_cloud_oo.cpython-39-pytest-8.3.4.pyc +0 -0
  83. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_bitbucket_server.cpython-39-pytest-8.3.4.pyc +0 -0
  84. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_bitbucket_server_oo.cpython-39-pytest-8.3.4.pyc +0 -0
  85. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_confluence_advanced_mode.cpython-39-pytest-8.3.4.pyc +0 -0
  86. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_confluence_attach.cpython-39-pytest-8.3.4.pyc +0 -0
  87. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_jira.cpython-39-pytest-8.3.4.pyc +0 -0
  88. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/__pycache__/test_servicedesk.cpython-39-pytest-8.3.4.pyc +0 -0
  89. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/mockup.py +0 -0
  90. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/GET +0 -0
  91. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/TestRepositoryCreated/POST +0 -0
  92. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/GET +0 -0
  93. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/branch-restrictions/17203842/DELETE +0 -0
  94. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/branch-restrictions/17203842/GET +0 -0
  95. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/branch-restrictions/17203842/PUT +0 -0
  96. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/branch-restrictions/GET +0 -0
  97. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/default-reviewers/DefaultReviewer1Uuid/DELETE +0 -0
  98. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/default-reviewers/DefaultReviewer1Uuid/GET +0 -0
  99. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/default-reviewers/GET +0 -0
  100. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/issues/3/DELETE +0 -0
  101. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/issues/3/GET +0 -0
  102. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/issues/3/PUT +0 -0
  103. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/issues/GET +0 -0
  104. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/issues/POST +0 -0
  105. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/GET +0 -0
  106. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/POST +0 -0
  107. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/GET +0 -0
  108. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/steps/GET +0 -0
  109. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/steps/{PipelineStep1Uuid}/GET +0 -0
  110. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/steps/{PipelineStep2Uuid}/GET +0 -0
  111. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/steps/{PipelineStep2Uuid}/log/GET +0 -0
  112. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pipelines/{PipelineUuid}/stopPipeline/POST +0 -0
  113. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/GET +0 -0
  114. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/approve/DELETE +0 -0
  115. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/approve/POST +0 -0
  116. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/comments/GET +0 -0
  117. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/comments/POST +0 -0
  118. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET +0 -0
  119. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/decline/POST +0 -0
  120. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/merge/POST +0 -0
  121. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/request-changes/DELETE +0 -0
  122. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/request-changes/POST +0 -0
  123. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/statuses/GET +0 -0
  124. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/tasks/123456/DELETE +0 -0
  125. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/tasks/123456/PUT +0 -0
  126. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/tasks/GET +0 -0
  127. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/tasks/POST +0 -0
  128. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/25/GET +0 -0
  129. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/GET +0 -0
  130. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/POST +0 -0
  131. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/workspaces/GET +0 -0
  132. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/workspaces/TestWorkspace1/GET +0 -0
  133. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/workspaces/TestWorkspace2/GET +0 -0
  134. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/cloud/2.0/workspaces/TestWorkspace3/GET +0 -0
  135. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/groups/DELETE +0 -0
  136. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/groups/GET +0 -0
  137. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/groups/none/GET +0 -0
  138. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/users/DELETE +0 -0
  139. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/users/GET +0 -0
  140. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/admin/permissions/users/none/GET +0 -0
  141. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/GET +0 -0
  142. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/GET +0 -0
  143. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/PUT +0 -0
  144. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/groups/DELETE +0 -0
  145. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/groups/GET +0 -0
  146. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/groups/none/GET +0 -0
  147. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/users/DELETE +0 -0
  148. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/users/GET +0 -0
  149. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/permissions/users/none/GET +0 -0
  150. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/GET +0 -0
  151. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/GET +0 -0
  152. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/PUT +0 -0
  153. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/archive/GET +0 -0
  154. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/contributing/GET +0 -0
  155. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/default-branch/GET +0 -0
  156. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/default-branch/PUT +0 -0
  157. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/forks/GET +0 -0
  158. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/license/GET +0 -0
  159. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/groups/DELETE +0 -0
  160. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/groups/GET +0 -0
  161. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/groups/none/GET +0 -0
  162. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/users/DELETE +0 -0
  163. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/users/GET +0 -0
  164. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/permissions/users/none/GET +0 -0
  165. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/readme/GET +0 -0
  166. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/related/GET +0 -0
  167. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/webhooks/3/DELETE +0 -0
  168. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/webhooks/3/GET +0 -0
  169. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/webhooks/3/PUT +0 -0
  170. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/webhooks/GET +0 -0
  171. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/bitbucket/server/rest/api/1.0/projects/PRJ/repos/my-repo1-slug/webhooks/POST +0 -0
  172. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/agile/1.0/epic/BAR-22/issue/GET +0 -0
  173. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/agile/1.0/epic/none/issue/GET +0 -0
  174. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/comment/list/POST +0 -0
  175. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/GET +0 -0
  176. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/comment/10000/GET +0 -0
  177. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/comment/GET +0 -0
  178. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/properties/Bar1/DELETE +0 -0
  179. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/properties/Bar1/GET +0 -0
  180. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/properties/Bar1/PUT +0 -0
  181. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/properties/Bar2New/PUT +0 -0
  182. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/properties/GET +0 -0
  183. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/FOO-123/remotelink/POST +0 -0
  184. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/POST +0 -0
  185. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/jira/rest/api/2/issue/REGEX-123/file.txt +0 -0
  186. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/customer/POST +0 -0
  187. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/GET +0 -0
  188. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/POST +0 -0
  189. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/DELETE +0 -0
  190. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/GET +0 -0
  191. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/property/GET +0 -0
  192. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/user/DELETE +0 -0
  193. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/user/GET +0 -0
  194. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/organization/{organizationId}/user/POST +0 -0
  195. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/customer/DELETE +0 -0
  196. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/customer/GET +0 -0
  197. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/customer/POST +0 -0
  198. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization/DELETE +0 -0
  199. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization/GET +0 -0
  200. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/responses/servicedesk/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization/POST +0 -0
  201. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_base.py +0 -0
  202. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_bitbucket_cloud_oo.py +0 -0
  203. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_bitbucket_server.py +0 -0
  204. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_bitbucket_server_oo.py +0 -0
  205. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_confluence_advanced_mode.py +0 -0
  206. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_confluence_attach.py +0 -0
  207. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_jira.py +0 -0
  208. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tests/test_servicedesk.py +0 -0
  209. {atlassian_python_api-4.0.3 → atlassian_python_api-4.0.4}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atlassian-python-api
3
- Version: 4.0.3
3
+ Version: 4.0.4
4
4
  Summary: Python Atlassian REST API Wrapper
5
5
  Home-page: https://github.com/atlassian-api/atlassian-python-api
6
6
  Download-URL: https://github.com/atlassian-api/atlassian-python-api
@@ -41,7 +41,6 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
41
41
  License-File: LICENSE
42
42
  Requires-Dist: deprecated
43
43
  Requires-Dist: requests
44
- Requires-Dist: six
45
44
  Requires-Dist: oauthlib
46
45
  Requires-Dist: requests_oauthlib
47
46
  Requires-Dist: jmespath
@@ -0,0 +1 @@
1
+ 4.0.4
@@ -1,3 +1,7 @@
1
+ """
2
+ Atlassian Python API
3
+ """
4
+
1
5
  from .bamboo import Bamboo
2
6
  from .bitbucket import Bitbucket
3
7
  from .bitbucket import Bitbucket as Stash
@@ -5,7 +9,8 @@ from .cloud_admin import CloudAdminOrgs, CloudAdminUsers
5
9
  from .confluence import Confluence
6
10
  from .crowd import Crowd
7
11
  from .insight import Insight
8
- from .insight import Insight as Assets
12
+ from .insight import Insight as Assets # used for Insight on-premise
13
+ from .assets import AssetsCloud # used for Insight Cloud
9
14
  from .jira import Jira
10
15
  from .marketplace import MarketPlace
11
16
  from .portfolio import Portfolio
@@ -29,4 +34,5 @@ __all__ = [
29
34
  "Xray",
30
35
  "Insight",
31
36
  "Assets",
37
+ "AssetsCloud",
32
38
  ]
@@ -0,0 +1,626 @@
1
+ # coding=utf-8
2
+ import logging
3
+
4
+ from .rest_client import AtlassianRestAPI
5
+
6
+ # from deprecated import deprecated
7
+
8
+ log = logging.getLogger(__name__)
9
+
10
+
11
+ class AssetsCloud(AtlassianRestAPI):
12
+ """Assets for Jira API wrapper."""
13
+
14
+ # https://developer.atlassian.com/cloud/assets/rest
15
+
16
+ def __init__(self, *args, **kwargs):
17
+ """
18
+ Initialize Assets()
19
+
20
+ :param args:
21
+ :param kwargs:
22
+ :return: Assets()
23
+ """
24
+ kwargs["api_root"] = "rest/assets/1.0"
25
+ # If cloud is set to true, trigger private __cloud__init method
26
+ if kwargs.get("cloud"):
27
+ args, kwargs = self.__cloud_init(*args, **kwargs)
28
+ super(AssetsCloud, self).__init__(*args, **kwargs)
29
+
30
+ def __cloud_init(self, *args, **kwargs):
31
+ """
32
+ Creates a Cloud specific version of Assets()
33
+
34
+ Returns:
35
+ Assets(AtlassianRestAPI)
36
+ """
37
+ # trigger a normal init and avoid looping
38
+ del kwargs["cloud"]
39
+ temp = AssetsCloud(*args, **kwargs)
40
+ # retrieve cloud workspace id and generate the api_root
41
+ kwargs["api_root"] = f"/jsm/assets/workspace/{temp.__get_workspace_id()}/v1/"
42
+ # Assets cloud uses the atlassian base url, not custom instance urls
43
+ kwargs["url"] = "https://api.atlassian.com"
44
+ # set cloud back to true and return
45
+ kwargs["cloud"] = True
46
+ # Assets cloud is particular about its headers.
47
+ self.default_headers = {"Accept": "application/json", "Content-Type": "application/json"}
48
+ return args, kwargs
49
+
50
+ def __get_workspace_id(self):
51
+ result = self.get(
52
+ "rest/servicedeskapi/assets/workspace",
53
+ headers=self.default_headers,
54
+ )
55
+ return result["values"][0]["workspaceId"]
56
+
57
+ def _get_assets_workspace_ids(self):
58
+ """
59
+ Returns all Assets workspace Ids.
60
+ :return: List
61
+ """
62
+ result = self.get(
63
+ "rest/servicedeskapi/assets/workspace",
64
+ headers=self.experimental_headers,
65
+ )
66
+ return [i["workspaceId"] for i in result["values"]]
67
+
68
+ def _get_assets_workspace_id(self):
69
+ """
70
+ Returns the first Assets workspace ID.
71
+ :return: str
72
+ """
73
+ return next(iter(self._get_assets_workspace_ids()))
74
+
75
+ # Attachments
76
+ def get_attachments_of_objects(self, object_id):
77
+ """
78
+ Get Attachment info
79
+ Example output:
80
+ [
81
+ {
82
+ "id": 1,
83
+ "author": "admin",
84
+ "mimeType": "image/png",
85
+ "filename": "astronaut.png",
86
+ "filesize": "490 B",
87
+ "created": "2019-11-27T11:42:22.283Z",
88
+ "comment": "",
89
+ "commentOutput": "",
90
+ "url": "http://jira/rest/assets/1.0/attachments/1"
91
+ }
92
+ ]
93
+
94
+ :param object_id Object ID
95
+ :return list of object
96
+ id: required(string)
97
+ author: (string)
98
+ mimeType: (string)
99
+ filename: required(string)
100
+ filesize: (string)
101
+ created: required(datetime)
102
+ comment: (string)
103
+ commentOutput: (string)
104
+ url: required(string)
105
+ """
106
+ if self.cloud:
107
+ raise NotImplementedError
108
+ url = self.url_joiner(
109
+ self.api_root,
110
+ f"attachments/object/{object_id}",
111
+ )
112
+ return self.get(url)
113
+
114
+ def upload_attachment_to_object(self, object_id, filename):
115
+ """
116
+ Add attachment to Object
117
+ :param object_id: int
118
+ :param filename: str, name, if file in current directory or full path to file
119
+ """
120
+ if self.cloud:
121
+ raise NotImplementedError
122
+ log.info("Adding attachment...")
123
+ url = f"rest/assets/1.0/attachments/object/{object_id}"
124
+ with open(filename, "rb") as attachment:
125
+ files = {"file": attachment}
126
+ return self.post(url, headers=self.no_check_headers, files=files)
127
+
128
+ def delete_attachment(self, attachment_id):
129
+ """
130
+ Add attachment to Object
131
+ :param attachment_id: int
132
+ """
133
+ if self.cloud:
134
+ raise NotImplementedError
135
+ log.info("Deleting attachment...")
136
+ url = f"rest/assets/1.0/attachments/{attachment_id}"
137
+ return self.delete(url)
138
+
139
+ # Comments
140
+ # Handle comments on objets
141
+ def add_comment_to_object(self, comment, object_id, role):
142
+ """
143
+ Add comment to Object
144
+
145
+ :param comment: str
146
+ :param object_id: int - Object ID
147
+ :param role: int - Role ID
148
+ 0 Assets Users
149
+ 1 Assets Managers
150
+ 2 Assets Administrators
151
+ 3 Assets Developers
152
+ :return:
153
+ {
154
+ "created": "2019-11-27T12:37:41.492Z",
155
+ "updated": "2019-11-27T12:37:41.492Z",
156
+ "id": 1,
157
+ "actor": {
158
+ "avatarUrl": "https://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028?d=mm&s=48",
159
+ "displayName": "admin",
160
+ "name": "admin",
161
+ "key": "admin",
162
+ "renderedLink": "<a href=\"/jira/secure/ViewProfile.jspa?name=admin\">admin</a>",
163
+ "isDeleted": false
164
+ },
165
+ "role": 0,
166
+ "comment": "A comment to be added",
167
+ "commentOutput": "A comment to be added",
168
+ "objectId": 1,
169
+ "canEdit": true,
170
+ "canDelete": true
171
+ }
172
+ """
173
+ if self.cloud:
174
+ raise NotImplementedError
175
+ params = {"comment": comment, "objectId": object_id, "role": role}
176
+ url = "rest/assets/1.0/comment/create"
177
+ return self.post(url, params=params)
178
+
179
+ def get_comment_of_object(self, object_id):
180
+ """
181
+ The object id to fetch comments from
182
+
183
+ :param object_id:
184
+ :return:
185
+ """
186
+ if self.cloud:
187
+ raise NotImplementedError
188
+ url = f"rest/assets/1.0/comment/object/{object_id}"
189
+ return self.get(url)
190
+
191
+ # Icon
192
+ # Resources dedicated to load and find icons
193
+ def get_icon_by_id(self, icon_id):
194
+ """
195
+ Load a single icon by id
196
+
197
+ :param icon_id:
198
+ :return:
199
+ {
200
+ "id": 1,
201
+ "name": "Delete",
202
+ "url16": "http://jira/rest/assets/1.0/icon/1/icon.png?size=16",
203
+ "url48": "http://jira/rest/assets/1.0/icon/1/icon.png?size=48"
204
+ }
205
+ """
206
+ url = self.url_joiner(self.api_root, f"icon/{icon_id}")
207
+ return self.get(url)
208
+
209
+ def get_all_global_icons(self):
210
+ """
211
+ All existing global icons
212
+
213
+ :return:
214
+ """
215
+ url = self.url_joiner(self.api_root, "icon/global")
216
+ return self.get(url)
217
+
218
+ # Import
219
+ # Start configured imports. To see an ongoing import see the Progress resource
220
+ def start_import_configuration(self, import_id):
221
+ """
222
+ The id of the import configuration that should be started
223
+
224
+ :param import_id:
225
+ :return:
226
+ """
227
+ url = self.url_joiner(
228
+ self.api_root,
229
+ f"import/start/{import_id}",
230
+ )
231
+ return self.post(url)
232
+
233
+ # Index
234
+ # Handle the indexing of Assets
235
+ def reindex_assets(self):
236
+ """
237
+ Should the reindex clean the index before doing the reindex
238
+
239
+ :return:
240
+ """
241
+ if self.cloud:
242
+ raise NotImplementedError
243
+ url = self.url_joiner(self.api_root, "index/reindex/start")
244
+ return self.post(url)
245
+
246
+ def reindex_current_node_assets(self):
247
+ """
248
+ Should the reindex clean the index before doing the reindex
249
+
250
+ :return:
251
+ """
252
+ if self.cloud:
253
+ raise NotImplementedError
254
+ url = self.url_joiner(self.api_root, "index/reindex/currentnode")
255
+ return self.post(url)
256
+
257
+ # AQL
258
+ # Fetch Objects by AQL
259
+ # Cloud-only. Server use navlist_aql()
260
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post
261
+ def aql(self, query, start=0, max_results=25, include_attributes=True):
262
+ """
263
+ Resource dedicated to finding objects based on the Assets Query Language (AQL)
264
+
265
+ :param query:
266
+ :param start:
267
+ :param max_results:
268
+ :param include_attributes:
269
+ :return:
270
+ """
271
+ if not self.cloud:
272
+ raise NotImplementedError
273
+ params = {"startAt": start, "maxResults": max_results, "includeAttributes": include_attributes}
274
+ data = {"qlQuery": query}
275
+ url = self.url_joiner(self.api_root, "object/aql")
276
+ return self.post(url, params=params, data=data)
277
+
278
+ # Navlist AQL
279
+ # Retrieve a list of objects based on an AQL query
280
+ # Server-only. Cloud use aql()
281
+ # https://developer.atlassian.com/server/jira-servicedesk/rest/v1006/api-group-assets---object/#api-assets-1-0-object-navlist-aql-post
282
+ def navlist_aql(
283
+ self,
284
+ query,
285
+ object_schema_id,
286
+ page=1,
287
+ order_by_attribute_id=None,
288
+ order_asc=True,
289
+ result_per_page=25,
290
+ include_attributes=True,
291
+ include_attributes_deep=1,
292
+ include_type_attributes=False,
293
+ include_extended_info=False,
294
+ extended=None,
295
+ ):
296
+ """
297
+ Resource dedicated to finding objects based on the Insight Query Language (IQL)
298
+
299
+ :param query:
300
+ :param object_schema_id:
301
+ :param page:
302
+ :param order_by_attribute_id:
303
+ :param order_asc:
304
+ :param result_per_page:
305
+ :param include_attributes:
306
+ :param include_attributes_deep:
307
+ :param include_type_attributes:
308
+ :param include_extended_info:
309
+ :param extended:
310
+ :return:
311
+ """
312
+ if self.cloud:
313
+ raise NotImplementedError
314
+ data = {
315
+ "qlQuery": query,
316
+ "objectSchemaId": object_schema_id,
317
+ "page": page,
318
+ "orderAsc": order_asc,
319
+ "resultPerPage": result_per_page,
320
+ "includeAttributes": include_attributes,
321
+ "includeAttributesDeep": include_attributes_deep,
322
+ "includeTypeAttributes": include_type_attributes,
323
+ "includeExtendedInfo": include_extended_info,
324
+ }
325
+ if order_by_attribute_id:
326
+ data["orderByAttributeId"] = order_by_attribute_id
327
+ if extended:
328
+ data["extended"] = extended
329
+ url = self.url_joiner(self.api_root, "object/navlist/aql")
330
+ return self.get(url, data=data)
331
+
332
+ # Object
333
+ def get_object(self, object_id):
334
+ """
335
+ Load one object
336
+
337
+ :param object_id:
338
+ :return:
339
+ """
340
+ url = self.url_joiner(self.api_root, f"object/{object_id}")
341
+ return self.get(url)
342
+
343
+ def update_object(
344
+ self,
345
+ object_id,
346
+ object_type_id,
347
+ attributes,
348
+ has_avatar=False,
349
+ avatar_uuid="",
350
+ ):
351
+ """
352
+ Update an existing object in Assets
353
+
354
+ :param object_id:
355
+ :param object_type_id:
356
+ :param attributes:
357
+ :param has_avatar:
358
+ :param avatar_uuid:
359
+ :return:
360
+ """
361
+ body = {
362
+ "attributes": attributes,
363
+ "objectTypeId": object_type_id,
364
+ "avatarUUID": avatar_uuid,
365
+ "hasAvatar": has_avatar,
366
+ }
367
+ url = self.url_joiner(self.api_root, f"object/{object_id}")
368
+ return self.put(url, data=body)
369
+
370
+ def delete_object(self, object_id):
371
+ """
372
+ Delete the referenced object
373
+
374
+ :param object_id:
375
+ :return:
376
+ """
377
+ url = self.url_joiner(self.api_root, f"object/{object_id}")
378
+ return self.delete(url)
379
+
380
+ def get_object_attributes(self, object_id):
381
+ """
382
+ List all attributes for the given object
383
+
384
+ :param object_id:
385
+ :return:
386
+ """
387
+ url = self.url_joiner(self.api_root, f"object/{object_id}/attributes")
388
+ return self.get(url)
389
+
390
+ def get_object_history(self, object_id, asc=False, abbreviate=True):
391
+ """
392
+ Retrieve the history entries for this object
393
+
394
+ :param object_id:
395
+ :param asc:
396
+ :param abbreviate:
397
+ :return:
398
+ """
399
+ params = {"asc": asc, "abbreviate": abbreviate}
400
+ url = self.url_joiner(self.api_root, f"object/{object_id}/history")
401
+ return self.get(url, params=params)
402
+
403
+ def get_object_reference_info(self, object_id):
404
+ """
405
+ Find all references for an object
406
+
407
+ :param object_id:
408
+ :return:
409
+ """
410
+ url = self.url_joiner(self.api_root, f"object/{object_id}/referenceinfo")
411
+ return self.get(url)
412
+
413
+ def create_object(self, object_type_id, attributes, has_avatar=False, avatar_uuid=""):
414
+ """
415
+ Create a new object in Assets
416
+
417
+ :param object_type_id:
418
+ :param attributes:
419
+ :param has_avatar:
420
+ :param avatar_uuid:
421
+ :return:
422
+ :return:
423
+ """
424
+ data = {
425
+ "attributes": attributes,
426
+ "objectTypeId": object_type_id,
427
+ "avatarUUID": avatar_uuid,
428
+ "hasAvatar": has_avatar,
429
+ }
430
+ url = self.url_joiner(self.api_root, "object/create")
431
+ return self.post(url, data=data)
432
+
433
+ # Objectconnectedtickets
434
+ def get_object_connected_tickets(self, object_id):
435
+ """
436
+ Relation between Jira issues and Assets objects
437
+
438
+ :param object_id:
439
+ :return:
440
+ """
441
+ url = self.url_joiner(
442
+ self.api_root,
443
+ f"objectconnectedtickets/{object_id}/tickets",
444
+ )
445
+ return self.get(url)
446
+
447
+ def list_object_schema(self):
448
+ """
449
+ Resource to find object schemas in Assets
450
+ :return:
451
+ {
452
+ "objectschemas": [
453
+ {
454
+ "id": 1,
455
+ "name": "Test",
456
+ "objectSchemaKey": "TEST",
457
+ "status": "Ok",
458
+ "created": "2019-11-26T08:05:46.894Z",
459
+ "updated": "2019-11-26T08:05:46.894Z",
460
+ "objectCount": 2,
461
+ "objectTypeCount": 3
462
+ }
463
+ ]
464
+ }
465
+ """
466
+ url = self.url_joiner(self.api_root, "objectschema/list")
467
+ return self.get(url)
468
+
469
+ def create_object_schema(self, object_schema_key, description):
470
+ raise NotImplementedError
471
+
472
+ def get_object_schema(self, schema_id):
473
+ """
474
+ Find a schema by id
475
+ :param schema_id:
476
+ """
477
+ url = self.url_joiner(self.api_root, f"objectschema/{schema_id}")
478
+ return self.get(url)
479
+
480
+ def update_object_schema(self, schema_id):
481
+ """
482
+ Update an object schema
483
+ """
484
+ raise NotImplementedError
485
+
486
+ def delete_object_schema(self, schema_id):
487
+ """
488
+ Delete a schema
489
+ """
490
+ raise NotImplementedError
491
+
492
+ def get_object_schema_attributes(self, schema_id):
493
+ """
494
+ Find all object type attributes for this object schema
495
+ """
496
+ raise NotImplementedError
497
+
498
+ def get_object_schema_object_types_flat(self, schema_id, query=None, exclude=None, includeObjectCounts=None):
499
+ """
500
+ Find all object types for this object schema
501
+ https://developer.atlassian.com/cloud/assets/rest/api-group-objectschema/#api-objectschema-id-objecttypes-flat-get
502
+ Args:
503
+ schema_id (str): id of the object schema
504
+ query (bool, optional): Object Type Names to search for, defaults to None (Use API default)
505
+ exclude (str, optional): Exclude objects with this name, defaults to None (Use API default)
506
+ includeObjectCounts (bool, optional): Populate objectCount attribute for each object type, defaults to None (Use API default)
507
+ """
508
+ kwargs = list(locals().items())
509
+ params = dict()
510
+ params.update({k: v for k, v in kwargs if v is not None and k not in ["self", "schema_id"]})
511
+ return self.get(
512
+ f"{self.api_root}/objectschema/{schema_id}/objecttypes/flat",
513
+ params=params,
514
+ )
515
+
516
+ def get_object_type_attributes(
517
+ self,
518
+ type_id,
519
+ only_value_editable=None,
520
+ order_by_name=None,
521
+ query=None,
522
+ include_values_exist=None,
523
+ exclude_parent_attributes=None,
524
+ include_children=None,
525
+ order_by_required=None,
526
+ ):
527
+ """
528
+ Find all attributes for this object type
529
+ https://developer.atlassian.com/cloud/assets/rest/api-group-objecttype/#api-objecttype-id-attributes-get
530
+ Args:
531
+ type_id (str): id of the object type
532
+ only_value_editable (bool, optional): only return editable values, defaults to None (Use API default)
533
+ order_by_name (bool, optional): values, defaults to None (Use API default)
534
+ query (str, optional): Not documented in API, defaults to None (Use API default)
535
+ include_values_exist (bool, optional): Include only where values exist, defaults to None (Use API default)
536
+ exclude_parent_attributes (bool, optional): Exclude parent attributes, defaults to None (Use API default)
537
+ include_children (bool, optional): include attributes from children, defaults to None (Use API default)
538
+ order_by_required (bool, optional): Order by required fields, defaults to None (Use API default)
539
+ """
540
+
541
+ kwargs = list(locals().items())
542
+ params = dict()
543
+ params.update({k: v for k, v in kwargs if v is not None and k not in ["self", "type_id"]})
544
+
545
+ return self.get(
546
+ f"{self.api_root}/objecttype/{type_id}/attributes",
547
+ headers=self.experimental_headers,
548
+ params=params,
549
+ )
550
+
551
+ # Objecttype
552
+ # TODO: Post objecttype {id} position:
553
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-objecttype/#api-objecttype-id-position-post
554
+ # TODO: Post objecttype create:
555
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-objecttype/#api-objecttype-create-post
556
+
557
+ # Assets ObjectTypeAttribute API
558
+ # TODO: Post objecttypeattribute {objectTypeId}:
559
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-objecttypeattribute/#api-objecttypeattribute-objecttypeid-post
560
+ # TODO: Put objecttypeattribute {objectTypeId} {id}:
561
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-objecttypeattribute/#api-objecttypeattribute-objecttypeid-id-put
562
+ # TODO: Delete objecttypeattribute {id}:
563
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-objecttypeattribute/#api-objecttypeattribute-id-delete
564
+
565
+ # Assets Progress API
566
+ # TODO: Get progress category imports {id}:
567
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-progress/#api-progress-category-imports-id-get
568
+ def get_progress_of_reindex(self):
569
+ """
570
+ Show ongoing assets processes
571
+ :return:
572
+ """
573
+ if self.cloud:
574
+ raise NotImplementedError
575
+ # Yes, the Assets Server API still uses "insight-reindex" as a category (as of April 2025)
576
+ # https://developer.atlassian.com/server/jira-servicedesk/rest/v1006/api-group-assets---progress/#api-assets-1-0-progress-category-category-resourceid-get
577
+ url = self.url_joiner(self.api_root, "progress/category/insight-reindex/reindex")
578
+ return self.get(url)
579
+
580
+ def get_progress_of_import(self, import_id):
581
+ """
582
+ Show ongoing assets processes
583
+ :type import_id: int: The id of the import source configuration
584
+ that the progress should be fetched for
585
+ :return:
586
+ """
587
+ if self.cloud:
588
+ raise NotImplementedError
589
+ url = self.url_joiner(self.api_root, f"progress/category/imports/{import_id}")
590
+ return self.get(url)
591
+
592
+ # Assets Config API
593
+ # TODO: Get config statustype:
594
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-config/#api-config-statustype-get
595
+ # TODO: Post config statustype:
596
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-config/#api-config-statustype-post
597
+ # TODO: Get config statustype {id}:
598
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-config/#api-config-statustype-id-get
599
+ # TODO: Put config statustype {id}:
600
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-config/#api-config-statustype-id-put
601
+ # TODO: Delete config statustype {id}:
602
+ # https://developer.atlassian.com/cloud/assets/rest/api-group-config/#api-config-statustype-id-delete
603
+
604
+ # Update Issue with Assets Field
605
+ def update_issue_assets_field(self, key, field_id, assets_keys, add=False):
606
+ """
607
+ Set the value of an Assets field.
608
+ Args:
609
+ key (str): Jira issue key, eg. SFT-446
610
+ field_id (str): The internal Jira name of the Assets field, e.g. customfield_10200
611
+ assets_keys (list): List of Assets objects to associate with the field. Limited
612
+ to 20 objects. If the field only takes a single object pass a single value list.
613
+ add (bool, optional): Add to the existing field rather than setting the field value.
614
+ Defaults to False.
615
+ Returns:
616
+ [type]: The assets object updated.
617
+ """
618
+ base_url = self.resource_url("issue")
619
+ action = "add" if add else "set"
620
+ data = {
621
+ "update": {
622
+ field_id: [{action: [{"key": i} for i in assets_keys]}],
623
+ }
624
+ }
625
+ data = {"fields": {field_id: [{"key": i} for i in assets_keys]}}
626
+ return self.put(f"{base_url}/{key}", data=data)
@@ -2,6 +2,7 @@
2
2
  import logging
3
3
 
4
4
  from requests.exceptions import HTTPError
5
+
5
6
  from .rest_client import AtlassianRestAPI
6
7
 
7
8
  log = logging.getLogger(__name__)
@@ -162,7 +162,6 @@ class Bitbucket(BitbucketBase):
162
162
  params["filter"] = user_filter
163
163
  return self._get_paged(url, params=params)
164
164
 
165
- @property
166
165
  def get_current_license(self):
167
166
  """
168
167
  Retrieves details about the current license, as well as the current status of the system with