Skip to content

Commit 5566483

Browse files
feat(iam): improve documentation for new quota methods (#64)
Co-authored-by: Nathanael Demacon <[email protected]>
1 parent 786c0df commit 5566483

File tree

4 files changed

+118
-10
lines changed

4 files changed

+118
-10
lines changed

scaleway-async/scaleway_async/iam/v1alpha1/api.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,11 +1738,17 @@ async def list_quota(
17381738
self,
17391739
*,
17401740
order_by: ListQuotaRequestOrderBy = ListQuotaRequestOrderBy.NAME_ASC,
1741-
page: Optional[int] = None,
17421741
page_size: Optional[int] = None,
1742+
page: Optional[int] = None,
17431743
organization_id: Optional[str] = None,
17441744
) -> ListQuotaResponse:
17451745
"""
1746+
List all quota in the organization with the associated limit
1747+
:param order_by: Criteria for sorting results
1748+
:param page_size: Number of results per page. Value must be between 1 and 100
1749+
:param page: Number of page. Value must be greater to 1
1750+
:param organization_id: Filter by organization ID
1751+
:return: :class:`ListQuotaResponse <ListQuotaResponse>`
17461752
17471753
Usage:
17481754
::
@@ -1769,11 +1775,16 @@ async def list_quota_all(
17691775
self,
17701776
*,
17711777
order_by: Optional[ListQuotaRequestOrderBy] = None,
1772-
page: Optional[int] = None,
17731778
page_size: Optional[int] = None,
1779+
page: Optional[int] = None,
17741780
organization_id: Optional[str] = None,
17751781
) -> List[Quotum]:
17761782
"""
1783+
List all quota in the organization with the associated limit
1784+
:param order_by: Criteria for sorting results
1785+
:param page_size: Number of results per page. Value must be between 1 and 100
1786+
:param page: Number of page. Value must be greater to 1
1787+
:param organization_id: Filter by organization ID
17771788
:return: :class:`List[ListQuotaResponse] <List[ListQuotaResponse]>`
17781789
17791790
Usage:
@@ -1788,8 +1799,8 @@ async def list_quota_all(
17881799
fetcher=self.list_quota,
17891800
args={
17901801
"order_by": order_by,
1791-
"page": page,
17921802
"page_size": page_size,
1803+
"page": page,
17931804
"organization_id": organization_id,
17941805
},
17951806
)
@@ -1801,6 +1812,10 @@ async def get_quotum(
18011812
organization_id: Optional[str] = None,
18021813
) -> Quotum:
18031814
"""
1815+
Get a quotum in the organization with the associated limit
1816+
:param quotum_name: Name of the quotum to get
1817+
:param organization_id: ID of the organization
1818+
:return: :class:`Quotum <Quotum>`
18041819
18051820
Usage:
18061821
::

scaleway-async/scaleway_async/iam/v1alpha1/types.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,19 @@ class ListPoliciesResponse:
384384

385385
@dataclass
386386
class ListQuotaResponse:
387+
"""
388+
List quota response
389+
"""
390+
387391
quota: List[Quotum]
392+
"""
393+
List of quota
394+
"""
388395

389396
total_count: int
397+
"""
398+
Total count of quota
399+
"""
390400

391401

392402
@dataclass
@@ -559,15 +569,26 @@ class Policy:
559569

560570
@dataclass
561571
class Quotum:
572+
"""
573+
Quotum
574+
"""
575+
562576
name: str
577+
"""
578+
Name of the quotum
579+
"""
563580

564581
limit: Optional[int]
565582
"""
583+
Max limit of the quotum.
584+
566585
One-of ('value'): at most one of 'limit', 'unlimited' could be set.
567586
"""
568587

569588
unlimited: Optional[bool]
570589
"""
590+
Whether the quotum is unlimited or not.
591+
571592
One-of ('value'): at most one of 'limit', 'unlimited' could be set.
572593
"""
573594

@@ -1491,16 +1512,34 @@ class DeleteAPIKeyRequest:
14911512
@dataclass
14921513
class ListQuotaRequest:
14931514
order_by: Optional[ListQuotaRequestOrderBy]
1494-
1495-
page: Optional[int]
1515+
"""
1516+
Criteria for sorting results
1517+
"""
14961518

14971519
page_size: Optional[int]
1520+
"""
1521+
Number of results per page. Value must be between 1 and 100
1522+
"""
1523+
1524+
page: Optional[int]
1525+
"""
1526+
Number of page. Value must be greater to 1
1527+
"""
14981528

14991529
organization_id: Optional[str]
1530+
"""
1531+
Filter by organization ID
1532+
"""
15001533

15011534

15021535
@dataclass
15031536
class GetQuotumRequest:
15041537
quotum_name: str
1538+
"""
1539+
Name of the quotum to get
1540+
"""
15051541

15061542
organization_id: Optional[str]
1543+
"""
1544+
ID of the organization
1545+
"""

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,11 +1738,17 @@ def list_quota(
17381738
self,
17391739
*,
17401740
order_by: ListQuotaRequestOrderBy = ListQuotaRequestOrderBy.NAME_ASC,
1741-
page: Optional[int] = None,
17421741
page_size: Optional[int] = None,
1742+
page: Optional[int] = None,
17431743
organization_id: Optional[str] = None,
17441744
) -> ListQuotaResponse:
17451745
"""
1746+
List all quota in the organization with the associated limit
1747+
:param order_by: Criteria for sorting results
1748+
:param page_size: Number of results per page. Value must be between 1 and 100
1749+
:param page: Number of page. Value must be greater to 1
1750+
:param organization_id: Filter by organization ID
1751+
:return: :class:`ListQuotaResponse <ListQuotaResponse>`
17461752
17471753
Usage:
17481754
::
@@ -1769,11 +1775,16 @@ def list_quota_all(
17691775
self,
17701776
*,
17711777
order_by: Optional[ListQuotaRequestOrderBy] = None,
1772-
page: Optional[int] = None,
17731778
page_size: Optional[int] = None,
1779+
page: Optional[int] = None,
17741780
organization_id: Optional[str] = None,
17751781
) -> List[Quotum]:
17761782
"""
1783+
List all quota in the organization with the associated limit
1784+
:param order_by: Criteria for sorting results
1785+
:param page_size: Number of results per page. Value must be between 1 and 100
1786+
:param page: Number of page. Value must be greater to 1
1787+
:param organization_id: Filter by organization ID
17771788
:return: :class:`List[ListQuotaResponse] <List[ListQuotaResponse]>`
17781789
17791790
Usage:
@@ -1788,8 +1799,8 @@ def list_quota_all(
17881799
fetcher=self.list_quota,
17891800
args={
17901801
"order_by": order_by,
1791-
"page": page,
17921802
"page_size": page_size,
1803+
"page": page,
17931804
"organization_id": organization_id,
17941805
},
17951806
)
@@ -1801,6 +1812,10 @@ def get_quotum(
18011812
organization_id: Optional[str] = None,
18021813
) -> Quotum:
18031814
"""
1815+
Get a quotum in the organization with the associated limit
1816+
:param quotum_name: Name of the quotum to get
1817+
:param organization_id: ID of the organization
1818+
:return: :class:`Quotum <Quotum>`
18041819
18051820
Usage:
18061821
::

scaleway/scaleway/iam/v1alpha1/types.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,19 @@ class ListPoliciesResponse:
384384

385385
@dataclass
386386
class ListQuotaResponse:
387+
"""
388+
List quota response
389+
"""
390+
387391
quota: List[Quotum]
392+
"""
393+
List of quota
394+
"""
388395

389396
total_count: int
397+
"""
398+
Total count of quota
399+
"""
390400

391401

392402
@dataclass
@@ -559,15 +569,26 @@ class Policy:
559569

560570
@dataclass
561571
class Quotum:
572+
"""
573+
Quotum
574+
"""
575+
562576
name: str
577+
"""
578+
Name of the quotum
579+
"""
563580

564581
limit: Optional[int]
565582
"""
583+
Max limit of the quotum.
584+
566585
One-of ('value'): at most one of 'limit', 'unlimited' could be set.
567586
"""
568587

569588
unlimited: Optional[bool]
570589
"""
590+
Whether the quotum is unlimited or not.
591+
571592
One-of ('value'): at most one of 'limit', 'unlimited' could be set.
572593
"""
573594

@@ -1491,16 +1512,34 @@ class DeleteAPIKeyRequest:
14911512
@dataclass
14921513
class ListQuotaRequest:
14931514
order_by: Optional[ListQuotaRequestOrderBy]
1494-
1495-
page: Optional[int]
1515+
"""
1516+
Criteria for sorting results
1517+
"""
14961518

14971519
page_size: Optional[int]
1520+
"""
1521+
Number of results per page. Value must be between 1 and 100
1522+
"""
1523+
1524+
page: Optional[int]
1525+
"""
1526+
Number of page. Value must be greater to 1
1527+
"""
14981528

14991529
organization_id: Optional[str]
1530+
"""
1531+
Filter by organization ID
1532+
"""
15001533

15011534

15021535
@dataclass
15031536
class GetQuotumRequest:
15041537
quotum_name: str
1538+
"""
1539+
Name of the quotum to get
1540+
"""
15051541

15061542
organization_id: Optional[str]
1543+
"""
1544+
ID of the organization
1545+
"""

0 commit comments

Comments
 (0)