Skip to content

docs(secret_manager): change documentation for scheduled deletion #885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions scaleway-async/scaleway_async/secret/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ async def delete_secret(
async def list_secrets(
self,
*,
scheduled_for_deletion: bool,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -253,11 +254,11 @@ async def list_secrets(
path: Optional[str] = None,
ephemeral: Optional[bool] = None,
type_: Optional[SecretType] = None,
scheduled_for_deletion: Optional[bool] = None,
) -> ListSecretsResponse:
"""
List secrets.
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: Filter by Organization ID (optional).
:param project_id: Filter by Project ID (optional).
Expand All @@ -269,13 +270,14 @@ async def list_secrets(
:param path: Filter by exact path (optional).
:param ephemeral: Filter by ephemeral / not ephemeral (optional).
:param type_: Filter by secret type (optional).
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
:return: :class:`ListSecretsResponse <ListSecretsResponse>`

Usage:
::

result = await api.list_secrets()
result = await api.list_secrets(
scheduled_for_deletion=False,
)
"""

param_region = validate_path_param(
Expand Down Expand Up @@ -307,6 +309,7 @@ async def list_secrets(
async def list_secrets_all(
self,
*,
scheduled_for_deletion: bool,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -318,11 +321,11 @@ async def list_secrets_all(
path: Optional[str] = None,
ephemeral: Optional[bool] = None,
type_: Optional[SecretType] = None,
scheduled_for_deletion: Optional[bool] = None,
) -> List[Secret]:
"""
List secrets.
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: Filter by Organization ID (optional).
:param project_id: Filter by Project ID (optional).
Expand All @@ -334,20 +337,22 @@ async def list_secrets_all(
:param path: Filter by exact path (optional).
:param ephemeral: Filter by ephemeral / not ephemeral (optional).
:param type_: Filter by secret type (optional).
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
:return: :class:`List[Secret] <List[Secret]>`

Usage:
::

result = await api.list_secrets_all()
result = await api.list_secrets_all(
scheduled_for_deletion=False,
)
"""

return await fetch_all_pages_async(
type=ListSecretsResponse,
key="secrets",
fetcher=self.list_secrets,
args={
"scheduled_for_deletion": scheduled_for_deletion,
"region": region,
"organization_id": organization_id,
"project_id": project_id,
Expand All @@ -359,7 +364,6 @@ async def list_secrets_all(
"path": path,
"ephemeral": ephemeral,
"type_": type_,
"scheduled_for_deletion": scheduled_for_deletion,
},
)

Expand Down
10 changes: 5 additions & 5 deletions scaleway-async/scaleway_async/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,11 @@ class ListSecretVersionsResponse:

@dataclass
class ListSecretsRequest:
scheduled_for_deletion: bool
"""
Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
"""

region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
Expand Down Expand Up @@ -804,11 +809,6 @@ class ListSecretsRequest:
Filter by secret type (optional).
"""

scheduled_for_deletion: Optional[bool]
"""
Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
"""


@dataclass
class ListSecretsResponse:
Expand Down
18 changes: 11 additions & 7 deletions scaleway/scaleway/secret/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def delete_secret(
def list_secrets(
self,
*,
scheduled_for_deletion: bool,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -253,11 +254,11 @@ def list_secrets(
path: Optional[str] = None,
ephemeral: Optional[bool] = None,
type_: Optional[SecretType] = None,
scheduled_for_deletion: Optional[bool] = None,
) -> ListSecretsResponse:
"""
List secrets.
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: Filter by Organization ID (optional).
:param project_id: Filter by Project ID (optional).
Expand All @@ -269,13 +270,14 @@ def list_secrets(
:param path: Filter by exact path (optional).
:param ephemeral: Filter by ephemeral / not ephemeral (optional).
:param type_: Filter by secret type (optional).
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
:return: :class:`ListSecretsResponse <ListSecretsResponse>`

Usage:
::

result = api.list_secrets()
result = api.list_secrets(
scheduled_for_deletion=False,
)
"""

param_region = validate_path_param(
Expand Down Expand Up @@ -307,6 +309,7 @@ def list_secrets(
def list_secrets_all(
self,
*,
scheduled_for_deletion: bool,
region: Optional[ScwRegion] = None,
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
Expand All @@ -318,11 +321,11 @@ def list_secrets_all(
path: Optional[str] = None,
ephemeral: Optional[bool] = None,
type_: Optional[SecretType] = None,
scheduled_for_deletion: Optional[bool] = None,
) -> List[Secret]:
"""
List secrets.
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
:param region: Region to target. If none is passed will use default region from the config.
:param organization_id: Filter by Organization ID (optional).
:param project_id: Filter by Project ID (optional).
Expand All @@ -334,20 +337,22 @@ def list_secrets_all(
:param path: Filter by exact path (optional).
:param ephemeral: Filter by ephemeral / not ephemeral (optional).
:param type_: Filter by secret type (optional).
:param scheduled_for_deletion: Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
:return: :class:`List[Secret] <List[Secret]>`

Usage:
::

result = api.list_secrets_all()
result = api.list_secrets_all(
scheduled_for_deletion=False,
)
"""

return fetch_all_pages(
type=ListSecretsResponse,
key="secrets",
fetcher=self.list_secrets,
args={
"scheduled_for_deletion": scheduled_for_deletion,
"region": region,
"organization_id": organization_id,
"project_id": project_id,
Expand All @@ -359,7 +364,6 @@ def list_secrets_all(
"path": path,
"ephemeral": ephemeral,
"type_": type_,
"scheduled_for_deletion": scheduled_for_deletion,
},
)

Expand Down
10 changes: 5 additions & 5 deletions scaleway/scaleway/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,11 @@ class ListSecretVersionsResponse:

@dataclass
class ListSecretsRequest:
scheduled_for_deletion: bool
"""
Filter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
"""

region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
Expand Down Expand Up @@ -804,11 +809,6 @@ class ListSecretsRequest:
Filter by secret type (optional).
"""

scheduled_for_deletion: Optional[bool]
"""
Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional).
"""


@dataclass
class ListSecretsResponse:
Expand Down