Skip to content
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

feat(audit_trail): add support for Resources #870

Merged
merged 1 commit into from
Feb 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["source_ip"] = field

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

field = data.get("recorded_at", None)
if field is not None:
args["recorded_at"] = (
Expand All @@ -281,6 +277,10 @@ def unmarshal_Event(data: Any) -> Event:
else:
args["user_agent"] = None

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

field = data.get("service_name", None)
if field is not None:
args["service_name"] = field
Expand All @@ -289,6 +289,12 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["method_name"] = field

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

field = data.get("request_id", None)
if field is not None:
args["request_id"] = field
Expand Down
15 changes: 10 additions & 5 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ class Event:
IP address at the origin of the event.
"""

product_name: str
"""
Product name of the resource attached to the event.
"""

recorded_at: Optional[datetime]
"""
Timestamp of the event.
Expand All @@ -170,6 +165,11 @@ class Event:
User Agent at the origin of the event.
"""

product_name: str
"""
Product name of the resource attached to the event.
"""

service_name: str
"""
API name called to trigger the event.
Expand All @@ -180,6 +180,11 @@ class Event:
API method called to trigger the event.
"""

resources: List[Resource]
"""
Resources attached to the event.
"""

request_id: str
"""
Unique identifier of the request at the origin of the event.
Expand Down
14 changes: 10 additions & 4 deletions scaleway/scaleway/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["source_ip"] = field

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

field = data.get("recorded_at", None)
if field is not None:
args["recorded_at"] = (
Expand All @@ -281,6 +277,10 @@ def unmarshal_Event(data: Any) -> Event:
else:
args["user_agent"] = None

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

field = data.get("service_name", None)
if field is not None:
args["service_name"] = field
Expand All @@ -289,6 +289,12 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["method_name"] = field

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

field = data.get("request_id", None)
if field is not None:
args["request_id"] = field
Expand Down
15 changes: 10 additions & 5 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ class Event:
IP address at the origin of the event.
"""

product_name: str
"""
Product name of the resource attached to the event.
"""

recorded_at: Optional[datetime]
"""
Timestamp of the event.
Expand All @@ -170,6 +165,11 @@ class Event:
User Agent at the origin of the event.
"""

product_name: str
"""
Product name of the resource attached to the event.
"""

service_name: str
"""
API name called to trigger the event.
Expand All @@ -180,6 +180,11 @@ class Event:
API method called to trigger the event.
"""

resources: List[Resource]
"""
Resources attached to the event.
"""

request_id: str
"""
Unique identifier of the request at the origin of the event.
Expand Down