Skip to content

Commit

Permalink
feat(audit_trail): add organization_id field to ListProducts (scalewa…
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Feb 27, 2025
1 parent 99f4096 commit 6e6d3cd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ async def list_products(
self,
*,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
) -> ListProductsResponse:
"""
Retrieve the list of Scaleway resources for which you have Audit Trail events.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: ID of the Organization containing the Audit Trail events.
:return: :class:`ListProductsResponse <ListProductsResponse>`
Usage:
Expand All @@ -116,6 +118,10 @@ async def list_products(
res = self._request(
"GET",
f"/audit-trail/v1alpha1/regions/{param_region}/products",
params={
"organization_id": organization_id
or self.client.default_organization_id,
},
)

self._throw_on_error(res)
Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ class ListProductsRequest:
Region to target. If none is passed will use default region from the config.
"""

organization_id: Optional[str]
"""
ID of the Organization containing the Audit Trail events.
"""


@dataclass
class ListProductsResponse:
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ def list_products(
self,
*,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
) -> ListProductsResponse:
"""
Retrieve the list of Scaleway resources for which you have Audit Trail events.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: ID of the Organization containing the Audit Trail events.
:return: :class:`ListProductsResponse <ListProductsResponse>`
Usage:
Expand All @@ -116,6 +118,10 @@ def list_products(
res = self._request(
"GET",
f"/audit-trail/v1alpha1/regions/{param_region}/products",
params={
"organization_id": organization_id
or self.client.default_organization_id,
},
)

self._throw_on_error(res)
Expand Down
5 changes: 5 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ class ListProductsRequest:
Region to target. If none is passed will use default region from the config.
"""

organization_id: Optional[str]
"""
ID of the Organization containing the Audit Trail events.
"""


@dataclass
class ListProductsResponse:
Expand Down

0 comments on commit 6e6d3cd

Please sign in to comment.