Skip to content

Commit 6e6d3cd

Browse files
authored
feat(audit_trail): add organization_id field to ListProducts (#871)
1 parent 99f4096 commit 6e6d3cd

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ async def list_products(
9797
self,
9898
*,
9999
region: Optional[ScwRegion] = None,
100+
organization_id: Optional[str] = None,
100101
) -> ListProductsResponse:
101102
"""
102103
Retrieve the list of Scaleway resources for which you have Audit Trail events.
103104
:param region: Region to target. If none is passed will use default region from the config.
105+
:param organization_id: ID of the Organization containing the Audit Trail events.
104106
:return: :class:`ListProductsResponse <ListProductsResponse>`
105107
106108
Usage:
@@ -116,6 +118,10 @@ async def list_products(
116118
res = self._request(
117119
"GET",
118120
f"/audit-trail/v1alpha1/regions/{param_region}/products",
121+
params={
122+
"organization_id": organization_id
123+
or self.client.default_organization_id,
124+
},
119125
)
120126

121127
self._throw_on_error(res)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ class ListProductsRequest:
298298
Region to target. If none is passed will use default region from the config.
299299
"""
300300

301+
organization_id: Optional[str]
302+
"""
303+
ID of the Organization containing the Audit Trail events.
304+
"""
305+
301306

302307
@dataclass
303308
class ListProductsResponse:

scaleway/scaleway/audit_trail/v1alpha1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ def list_products(
9797
self,
9898
*,
9999
region: Optional[ScwRegion] = None,
100+
organization_id: Optional[str] = None,
100101
) -> ListProductsResponse:
101102
"""
102103
Retrieve the list of Scaleway resources for which you have Audit Trail events.
103104
:param region: Region to target. If none is passed will use default region from the config.
105+
:param organization_id: ID of the Organization containing the Audit Trail events.
104106
:return: :class:`ListProductsResponse <ListProductsResponse>`
105107
106108
Usage:
@@ -116,6 +118,10 @@ def list_products(
116118
res = self._request(
117119
"GET",
118120
f"/audit-trail/v1alpha1/regions/{param_region}/products",
121+
params={
122+
"organization_id": organization_id
123+
or self.client.default_organization_id,
124+
},
119125
)
120126

121127
self._throw_on_error(res)

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ class ListProductsRequest:
298298
Region to target. If none is passed will use default region from the config.
299299
"""
300300

301+
organization_id: Optional[str]
302+
"""
303+
ID of the Organization containing the Audit Trail events.
304+
"""
305+
301306

302307
@dataclass
303308
class ListProductsResponse:

0 commit comments

Comments
 (0)