Skip to content

feat(secret_manager): add used_by field to Secret #627

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
Aug 9, 2024
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
29 changes: 17 additions & 12 deletions scaleway-async/scaleway_async/secret/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.profile import ProfileDefaults
from .types import (
Product,
SecretType,
EphemeralProperties,
SecretVersion,
Expand Down Expand Up @@ -157,18 +158,6 @@ def unmarshal_Secret(data: Any) -> Secret:
if field is not None:
args["status"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("tags", None)
if field is not None:
args["tags"] = field
Expand All @@ -193,10 +182,26 @@ def unmarshal_Secret(data: Any) -> Secret:
if field is not None:
args["path"] = field

field = data.get("used_by", None)
if field is not None:
args["used_by"] = [Product(v) for v in field] if field is not None else None

field = data.get("region", None)
if field is not None:
args["region"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("description", None)
if field is not None:
args["description"] = field
Expand Down
25 changes: 15 additions & 10 deletions scaleway-async/scaleway_async/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,6 @@ class Secret:
* `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
"""

created_at: Optional[datetime]
"""
Date and time of the secret's creation.
"""

updated_at: Optional[datetime]
"""
Last update of the secret.
"""

tags: List[str]
"""
List of the secret's tags.
Expand Down Expand Up @@ -266,11 +256,26 @@ class Secret:
Location of the secret in the directory structure.
"""

used_by: List[Product]
"""
List of Scaleway resources that can access and manage the secret.
"""

region: Region
"""
Region of the secret.
"""

created_at: Optional[datetime]
"""
Date and time of the secret's creation.
"""

updated_at: Optional[datetime]
"""
Last update of the secret.
"""

description: Optional[str]
"""
Updated description of the secret.
Expand Down
29 changes: 17 additions & 12 deletions scaleway/scaleway/secret/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from scaleway_core.profile import ProfileDefaults
from .types import (
Product,
SecretType,
EphemeralProperties,
SecretVersion,
Expand Down Expand Up @@ -157,18 +158,6 @@ def unmarshal_Secret(data: Any) -> Secret:
if field is not None:
args["status"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("tags", None)
if field is not None:
args["tags"] = field
Expand All @@ -193,10 +182,26 @@ def unmarshal_Secret(data: Any) -> Secret:
if field is not None:
args["path"] = field

field = data.get("used_by", None)
if field is not None:
args["used_by"] = [Product(v) for v in field] if field is not None else None

field = data.get("region", None)
if field is not None:
args["region"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("description", None)
if field is not None:
args["description"] = field
Expand Down
25 changes: 15 additions & 10 deletions scaleway/scaleway/secret/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,6 @@ class Secret:
* `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway.
"""

created_at: Optional[datetime]
"""
Date and time of the secret's creation.
"""

updated_at: Optional[datetime]
"""
Last update of the secret.
"""

tags: List[str]
"""
List of the secret's tags.
Expand Down Expand Up @@ -266,11 +256,26 @@ class Secret:
Location of the secret in the directory structure.
"""

used_by: List[Product]
"""
List of Scaleway resources that can access and manage the secret.
"""

region: Region
"""
Region of the secret.
"""

created_at: Optional[datetime]
"""
Date and time of the secret's creation.
"""

updated_at: Optional[datetime]
"""
Last update of the secret.
"""

description: Optional[str]
"""
Updated description of the secret.
Expand Down
Loading