atlassian-python-api 4.0.2__py3-none-any.whl → 4.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
atlassian/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.2
1
+ 4.0.3
atlassian/confluence.py CHANGED
@@ -647,24 +647,80 @@ class Confluence(AtlassianRestAPI):
647
647
  content_type="page",
648
648
  ):
649
649
  """
650
- Get all pages from space
650
+ Retrieve all pages from a Confluence space.
651
651
 
652
- :param space:
653
- :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
654
- :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
655
- fixed system limits. Default: 50
656
- :param status: OPTIONAL: list of statuses the content to be found is in.
657
- Defaults to current is not specified.
658
- If set to 'any', content in 'current' and 'trashed' status will be fetched.
659
- Does not support 'historical' status for now.
660
- :param expand: OPTIONAL: a comma separated list of properties to expand on the content.
661
- Default value: history,space,version.
662
- :param content_type: the content type to return. Default value: page. Valid values: page, blogpost.
663
- :return:
652
+ :param space: The space key to fetch pages from.
653
+ :param start: OPTIONAL: The starting point of the collection. Default: 0.
654
+ :param limit: OPTIONAL: The maximum number of pages per request. Default: 50.
655
+ :param status: OPTIONAL: Filter pages by status ('current', 'trashed', 'any'). Default: None.
656
+ :param expand: OPTIONAL: Comma-separated list of properties to expand. Default: history,space,version.
657
+ :param content_type: OPTIONAL: The content type to return ('page', 'blogpost'). Default: page.
658
+ :return: List containing all pages from the specified space.
664
659
  """
665
- return self.get_all_pages_from_space_raw(
666
- space=space, start=start, limit=limit, status=status, expand=expand, content_type=content_type
667
- ).get("results")
660
+ all_pages = [] # Initialize an empty list to store all pages
661
+ while True:
662
+ # Fetch a single batch of pages
663
+ response = self.get_all_pages_from_space_raw(
664
+ space=space,
665
+ start=start,
666
+ limit=limit,
667
+ status=status,
668
+ expand=expand,
669
+ content_type=content_type,
670
+ )
671
+
672
+ # Extract results from the response
673
+ results = response.get("results", [])
674
+ all_pages.extend(results) # Add the current batch of pages to the list
675
+
676
+ # Break the loop if no more pages are available
677
+ if len(results) < limit:
678
+ break
679
+
680
+ # Increment the start index for the next batch
681
+ start += limit
682
+ return all_pages
683
+
684
+ def get_all_pages_from_space_as_generator(
685
+ self,
686
+ space,
687
+ start=0,
688
+ limit=50,
689
+ status=None,
690
+ expand="history,space,version",
691
+ content_type="page",
692
+ ):
693
+ """
694
+ Retrieve all pages from a Confluence space using pagination.
695
+
696
+ :param space: The space key to fetch pages from.
697
+ :param start: OPTIONAL: The starting point of the collection. Default: 0.
698
+ :param limit: OPTIONAL: The maximum number of pages per request. Default: 50.
699
+ :param status: OPTIONAL: Filter pages by status ('current', 'trashed', 'any'). Default: None.
700
+ :param expand: OPTIONAL: Comma-separated list of properties to expand. Default: history,space,version.
701
+ :param content_type: OPTIONAL: The content type to return ('page', 'blogpost'). Default: page.
702
+ :return: Generator yielding pages one by one.
703
+ """
704
+ while True:
705
+ # Fetch a single batch of pages
706
+ response = self.get_all_pages_from_space_raw(
707
+ space=space,
708
+ start=start,
709
+ limit=limit,
710
+ status=status,
711
+ expand=expand,
712
+ content_type=content_type,
713
+ )
714
+
715
+ # Extract results from the response
716
+ results = response.get("results", [])
717
+ yield from results # Yield each page individually
718
+
719
+ # Break the loop if no more pages are available
720
+ if len(results) < limit:
721
+ break
722
+ start += limit
723
+ pass
668
724
 
669
725
  def get_all_pages_from_space_trash(self, space, start=0, limit=500, status="trashed", content_type="page"):
670
726
  """
@@ -1238,7 +1294,7 @@ class Confluence(AtlassianRestAPI):
1238
1294
  def get_all_spaces(
1239
1295
  self,
1240
1296
  start=0,
1241
- limit=500,
1297
+ limit=50,
1242
1298
  expand=None,
1243
1299
  space_type=None,
1244
1300
  space_status=None,
atlassian/jira.py CHANGED
@@ -470,7 +470,7 @@ class Jira(AtlassianRestAPI):
470
470
  return self.put(url)
471
471
 
472
472
  """
473
- Troubleshooting. (Available for DC) It gives the posibility to download support zips.
473
+ Troubleshooting. (Available for DC) It gives the possibility to download support zips.
474
474
  Reference: https://confluence.atlassian.com/support/create-a-support-zip-using-the-rest-api-in-data-center-applications-952054641.html
475
475
  """
476
476
 
@@ -1571,9 +1571,9 @@ class Jira(AtlassianRestAPI):
1571
1571
  self,
1572
1572
  issue_key: str,
1573
1573
  fields: Union[str, dict],
1574
- update: Optional[dict[Any, Any]] = None,
1575
- history_metadata: Optional[dict[Any, Any]] = None,
1576
- properties: Optional[list[Any]] = None,
1574
+ update: Optional[Dict[Any, Any]] = None,
1575
+ history_metadata: Optional[Dict[Any, Any]] = None,
1576
+ properties: Optional[List[Any]] = None,
1577
1577
  notify_users: bool = True,
1578
1578
  ):
1579
1579
  """
@@ -4050,7 +4050,7 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
4050
4050
  permission_id: str,
4051
4051
  name: str,
4052
4052
  description: Optional[str] = None,
4053
- permissions: Optional[list[dict]] = None,
4053
+ permissions: Optional[List[dict]] = None,
4054
4054
  scope: Optional[str] = None,
4055
4055
  expand: Optional[str] = None,
4056
4056
  ):
@@ -4065,7 +4065,7 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
4065
4065
  :param permission_id: int, REQUIRED: The ID of the permission scheme to update.
4066
4066
  :param name: str, REQUIRED: The name of the permission scheme. Must be unique.
4067
4067
  :param description: str, OPTIONAL: A description for the permission scheme. Defaults to None.
4068
- :param permissions: list[dict], OPTIONAL: A collection of permission grants. Defaults to None.
4068
+ :param permissions: List[dict], OPTIONAL: A collection of permission grants. Defaults to None.
4069
4069
  Example:
4070
4070
  [
4071
4071
  {
@@ -5692,7 +5692,7 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
5692
5692
  """
5693
5693
  Flags or un-flags one or multiple issues in Jira with a flag indicator.
5694
5694
  :param issue_keys: List of issue keys to flag or un-flag.
5695
- :type issue_keys: list[str]
5695
+ :type issue_keys: List[str]
5696
5696
  :param flag: Flag indicating whether to flag or un-flag the issues (default is True for flagging).
5697
5697
  :type flag: bool
5698
5698
  :return: POST request response.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atlassian-python-api
3
- Version: 4.0.2
3
+ Version: 4.0.3
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
@@ -1,12 +1,12 @@
1
- atlassian/VERSION,sha256=X95warY7CEKqtnrNr35kGRZKr9OQgJk0vMthskfwWP0,5
1
+ atlassian/VERSION,sha256=-hKigq1uD-UusmfWTSaUCl1KpmksCOtneKMYfWt8aT4,5
2
2
  atlassian/__init__.py,sha256=F13CZFoWIj9pDkj83soA7hwwHtvDC6EqFATey9p36PM,768
3
3
  atlassian/bamboo.py,sha256=Zmi7o7ETuTvCW37Fq4Vq0e_elfaXC_oDMcMl-9wO-d8,48017
4
4
  atlassian/cloud_admin.py,sha256=avdj1FdrGaxIRnPt4bXxQB65P8nVxNEpEHzlcH-ugac,961
5
- atlassian/confluence.py,sha256=BwtGFXCvIhNT4gQjmWsCUHutr7zT7nrchS2pVI8JX7Y,141150
5
+ atlassian/confluence.py,sha256=mWma3wlEIrpnwyhWz9UxYjMiQHegeq1YnxBuFgIQ564,143045
6
6
  atlassian/crowd.py,sha256=hsLqcmKLm-qWK3xV1pDYCeGcvUIR8k6DJkMlwcDn8QM,9255
7
7
  atlassian/errors.py,sha256=GAKr6W4zPn7ZUMRLHG8-UgAdVnxDzKVZ-jyGXAccALE,398
8
8
  atlassian/insight.py,sha256=fCR9IXmatTp6-l-pOeLFFQGgBeafSzBdkgIHLWkOXEo,23398
9
- atlassian/jira.py,sha256=l8U4yXropYezCEWCdf1sy2uLHUkfMG2XBDGxdr9HgIs,224650
9
+ atlassian/jira.py,sha256=pLxwGdzCQyE59MZ9luX0Qdd8ADU6YFo0maf2WrDsLXE,224651
10
10
  atlassian/marketplace.py,sha256=dLm4I8GROkdhyu3BdGtK_ssq1g44KZFi8S0HS_ZepLs,2540
11
11
  atlassian/portfolio.py,sha256=q38sFFC7DHmHM4vsFzl8sT7HcRRGKH3tT5nRlqltDzc,3696
12
12
  atlassian/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -49,8 +49,8 @@ atlassian/bitbucket/server/common/__init__.py,sha256=woZpR3WXAA3A99hZ1UZI_gLPHaA
49
49
  atlassian/bitbucket/server/common/permissions.py,sha256=ve-hWRIrG0zSMo1hp2uTLHGO1PlXorzZlpt7Sc9KhJw,7300
50
50
  atlassian/bitbucket/server/projects/__init__.py,sha256=6G3MZBOTFpwx5x3chg-M8-BbmOnrdRZiZYp2YKJScbw,7668
51
51
  atlassian/bitbucket/server/projects/repos/__init__.py,sha256=RFnZ5APax9VXASYbHbMjW12L2NR4gWbXzS-c-KyExTI,10776
52
- atlassian_python_api-4.0.2.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
53
- atlassian_python_api-4.0.2.dist-info/METADATA,sha256=hFE8HFuBk4Vppq8zU2Vck-fwrsn2Ds3s_sUxelcwWhM,9519
54
- atlassian_python_api-4.0.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
55
- atlassian_python_api-4.0.2.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
56
- atlassian_python_api-4.0.2.dist-info/RECORD,,
52
+ atlassian_python_api-4.0.3.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
53
+ atlassian_python_api-4.0.3.dist-info/METADATA,sha256=6rYDt5lrS87l3hdh_shFt2GBqpa5euE2OoMqJWEzN6I,9519
54
+ atlassian_python_api-4.0.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
55
+ atlassian_python_api-4.0.3.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
56
+ atlassian_python_api-4.0.3.dist-info/RECORD,,