Skip to content

Commit 419bdcb

Browse files
authored
feat(mnq): allow filtering nats credentials listing by project id (scaleway#779)
1 parent 0f21d3e commit 419bdcb

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

scaleway-async/scaleway_async/mnq/v1beta1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ async def list_nats_credentials(
420420
self,
421421
*,
422422
region: Optional[Region] = None,
423+
project_id: Optional[str] = None,
423424
nats_account_id: Optional[str] = None,
424425
page: Optional[int] = None,
425426
page_size: Optional[int] = None,
@@ -429,6 +430,7 @@ async def list_nats_credentials(
429430
List NATS credentials.
430431
List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
431432
:param region: Region to target. If none is passed will use default region from the config.
433+
:param project_id: Include only NATS accounts in this Project.
432434
:param nats_account_id: Include only credentials for this NATS account.
433435
:param page: Page number to return.
434436
:param page_size: Maximum number of credentials to return per page.
@@ -453,6 +455,7 @@ async def list_nats_credentials(
453455
"order_by": order_by,
454456
"page": page,
455457
"page_size": page_size or self.client.default_page_size,
458+
"project_id": project_id or self.client.default_project_id,
456459
},
457460
)
458461

@@ -463,6 +466,7 @@ async def list_nats_credentials_all(
463466
self,
464467
*,
465468
region: Optional[Region] = None,
469+
project_id: Optional[str] = None,
466470
nats_account_id: Optional[str] = None,
467471
page: Optional[int] = None,
468472
page_size: Optional[int] = None,
@@ -472,6 +476,7 @@ async def list_nats_credentials_all(
472476
List NATS credentials.
473477
List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
474478
:param region: Region to target. If none is passed will use default region from the config.
479+
:param project_id: Include only NATS accounts in this Project.
475480
:param nats_account_id: Include only credentials for this NATS account.
476481
:param page: Page number to return.
477482
:param page_size: Maximum number of credentials to return per page.
@@ -490,6 +495,7 @@ async def list_nats_credentials_all(
490495
fetcher=self.list_nats_credentials,
491496
args={
492497
"region": region,
498+
"project_id": project_id,
493499
"nats_account_id": nats_account_id,
494500
"page": page,
495501
"page_size": page_size,

scaleway-async/scaleway_async/mnq/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ class NatsApiListNatsCredentialsRequest:
487487
Region to target. If none is passed will use default region from the config.
488488
"""
489489

490+
project_id: Optional[str]
491+
"""
492+
Include only NATS accounts in this Project.
493+
"""
494+
490495
nats_account_id: Optional[str]
491496
"""
492497
Include only credentials for this NATS account.

scaleway/scaleway/mnq/v1beta1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ def list_nats_credentials(
420420
self,
421421
*,
422422
region: Optional[Region] = None,
423+
project_id: Optional[str] = None,
423424
nats_account_id: Optional[str] = None,
424425
page: Optional[int] = None,
425426
page_size: Optional[int] = None,
@@ -429,6 +430,7 @@ def list_nats_credentials(
429430
List NATS credentials.
430431
List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
431432
:param region: Region to target. If none is passed will use default region from the config.
433+
:param project_id: Include only NATS accounts in this Project.
432434
:param nats_account_id: Include only credentials for this NATS account.
433435
:param page: Page number to return.
434436
:param page_size: Maximum number of credentials to return per page.
@@ -453,6 +455,7 @@ def list_nats_credentials(
453455
"order_by": order_by,
454456
"page": page,
455457
"page_size": page_size or self.client.default_page_size,
458+
"project_id": project_id or self.client.default_project_id,
456459
},
457460
)
458461

@@ -463,6 +466,7 @@ def list_nats_credentials_all(
463466
self,
464467
*,
465468
region: Optional[Region] = None,
469+
project_id: Optional[str] = None,
466470
nats_account_id: Optional[str] = None,
467471
page: Optional[int] = None,
468472
page_size: Optional[int] = None,
@@ -472,6 +476,7 @@ def list_nats_credentials_all(
472476
List NATS credentials.
473477
List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
474478
:param region: Region to target. If none is passed will use default region from the config.
479+
:param project_id: Include only NATS accounts in this Project.
475480
:param nats_account_id: Include only credentials for this NATS account.
476481
:param page: Page number to return.
477482
:param page_size: Maximum number of credentials to return per page.
@@ -490,6 +495,7 @@ def list_nats_credentials_all(
490495
fetcher=self.list_nats_credentials,
491496
args={
492497
"region": region,
498+
"project_id": project_id,
493499
"nats_account_id": nats_account_id,
494500
"page": page,
495501
"page_size": page_size,

scaleway/scaleway/mnq/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ class NatsApiListNatsCredentialsRequest:
487487
Region to target. If none is passed will use default region from the config.
488488
"""
489489

490+
project_id: Optional[str]
491+
"""
492+
Include only NATS accounts in this Project.
493+
"""
494+
490495
nats_account_id: Optional[str]
491496
"""
492497
Include only credentials for this NATS account.

0 commit comments

Comments
 (0)