From 7fce46175e5d4790adeac3b5fed78dbe9e558c4e Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 29 Jul 2025 20:42:35 +0000 Subject: [PATCH] feat: update generated APIs --- .../audit_trail/v1alpha1/__init__.py | 2 + .../audit_trail/v1alpha1/api.py | 44 +++++++++- .../audit_trail/v1alpha1/marshalling.py | 88 ++++++++++++++----- .../audit_trail/v1alpha1/types.py | 29 ++++-- .../scaleway/audit_trail/v1alpha1/__init__.py | 2 + scaleway/scaleway/audit_trail/v1alpha1/api.py | 44 +++++++++- .../audit_trail/v1alpha1/marshalling.py | 88 ++++++++++++++----- .../scaleway/audit_trail/v1alpha1/types.py | 29 ++++-- 8 files changed, 264 insertions(+), 62 deletions(-) diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py index 6325b9583..baf6c38b5 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py @@ -17,6 +17,7 @@ from .types import SecretManagerSecretInfo from .types import SecretManagerSecretVersionInfo from .types import EventPrincipal +from .types import EventSystem from .types import Resource from .types import ProductService from .types import Event @@ -45,6 +46,7 @@ "SecretManagerSecretInfo", "SecretManagerSecretVersionInfo", "EventPrincipal", + "EventSystem", "Resource", "ProductService", "Event", diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py index 143a8da7c..0f123155b 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py @@ -2,20 +2,62 @@ # If you have any remark or suggestion do not hesitate to open an issue. from datetime import datetime -from typing import Optional +from typing import Any, Awaitable, Dict, List, Optional, Union from scaleway_core.api import API from scaleway_core.bridge import ( + Money, Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, + marshal_Money, + unmarshal_Money, + marshal_ScwFile, + unmarshal_ScwFile, + unmarshal_ServiceInfo, + marshal_TimeSeries, + unmarshal_TimeSeries, ) from scaleway_core.utils import ( + OneOfPossibility, + WaitForOptions, + project_or_organization_id, + random_name, + resolve_one_of, validate_path_param, + fetch_all_pages_async, + wait_for_resource_async, ) from .types import ( ListEventsRequestOrderBy, ResourceType, + AccountOrganizationInfo, + AccountProjectInfo, + AccountUserInfo, + AppleSiliconServerInfo, + BaremetalServerInfo, + BaremetalSettingInfo, + Event, + EventPrincipal, + EventSystem, + InstanceServerInfo, + KeyManagerKeyInfo, + KubernetesACLInfo, + KubernetesClusterInfo, + KubernetesNodeInfo, + KubernetesPoolInfo, + ListEventsRequest, ListEventsResponse, + ListProductsRequest, ListProductsResponse, + Product, + ProductService, + Resource, + SecretManagerSecretInfo, + SecretManagerSecretVersionInfo, ) from .marshalling import ( unmarshal_ListEventsResponse, diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py index 32ea3154c..1fadd8ad7 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py @@ -1,10 +1,34 @@ # This file was automatically generated. DO NOT EDIT. # If you have any remark or suggestion do not hesitate to open an issue. -from typing import Any, Dict +from decimal import Decimal +from datetime import datetime +from typing import Any, Dict, List, Optional from dateutil import parser +from scaleway_core.profile import ProfileDefaults +from scaleway_core.bridge import ( + Money, + Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, + unmarshal_Money, + marshal_Money, + marshal_ScwFile, + marshal_ServiceInfo, + marshal_TimeSeries, + unmarshal_TimeSeries, +) +from scaleway_core.utils import ( + OneOfPossibility, + resolve_one_of, +) from .types import ( + ListEventsRequestOrderBy, + ResourceType, AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, @@ -20,6 +44,7 @@ SecretManagerSecretInfo, SecretManagerSecretVersionInfo, EventPrincipal, + EventSystem, Resource, Event, ListEventsResponse, @@ -268,6 +293,21 @@ def unmarshal_EventPrincipal(data: Any) -> EventPrincipal: return EventPrincipal(**args) +def unmarshal_EventSystem(data: Any) -> EventSystem: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'EventSystem' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + + return EventSystem(**args) + + def unmarshal_Resource(data: Any) -> Resource: if not isinstance(data, dict): raise TypeError( @@ -445,6 +485,14 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["product_name"] = field + field = data.get("service_name", None) + if field is not None: + args["service_name"] = field + + field = data.get("method_name", None) + if field is not None: + args["method_name"] = field + field = data.get("recorded_at", None) if field is not None: args["recorded_at"] = ( @@ -459,26 +507,6 @@ def unmarshal_Event(data: Any) -> Event: else: args["principal"] = None - field = data.get("project_id", None) - if field is not None: - args["project_id"] = field - else: - args["project_id"] = None - - field = data.get("user_agent", None) - if field is not None: - args["user_agent"] = field - else: - args["user_agent"] = None - - field = data.get("service_name", None) - if field is not None: - args["service_name"] = field - - field = data.get("method_name", None) - if field is not None: - args["method_name"] = field - field = data.get("resources", None) if field is not None: args["resources"] = ( @@ -493,6 +521,24 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["status_code"] = field + field = data.get("system", None) + if field is not None: + args["system"] = unmarshal_EventSystem(field) + else: + args["system"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("user_agent", None) + if field is not None: + args["user_agent"] = field + else: + args["user_agent"] = None + field = data.get("request_body", None) if field is not None: args["request_body"] = field diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py index 16fd831c7..45e8f4523 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py @@ -3,12 +3,19 @@ from __future__ import annotations from dataclasses import dataclass +from decimal import Decimal from datetime import datetime from enum import Enum from typing import Any, Dict, List, Optional from scaleway_core.bridge import ( + Money, Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, ) from scaleway_core.utils import ( StrEnumMeta, @@ -141,6 +148,11 @@ class EventPrincipal: id: str +@dataclass +class EventSystem: + name: str + + @dataclass class Resource: id: str @@ -224,14 +236,14 @@ class Event: Product name of the resource attached to the event. """ - recorded_at: Optional[datetime] + service_name: str """ - Timestamp of the event. + API name called to trigger the event. """ - principal: Optional[EventPrincipal] + recorded_at: Optional[datetime] """ - User or IAM application at the origin of the event. + Timestamp of the event. """ project_id: Optional[str] @@ -244,11 +256,6 @@ class Event: User Agent at the origin of the event. """ - service_name: str - """ - API name called to trigger the event. - """ - method_name: str """ API method called to trigger the event. @@ -274,6 +281,10 @@ class Event: Request at the origin of the event. """ + principal: Optional[EventPrincipal] + + system: Optional[EventSystem] + @dataclass class Product: diff --git a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py index 6325b9583..baf6c38b5 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py @@ -17,6 +17,7 @@ from .types import SecretManagerSecretInfo from .types import SecretManagerSecretVersionInfo from .types import EventPrincipal +from .types import EventSystem from .types import Resource from .types import ProductService from .types import Event @@ -45,6 +46,7 @@ "SecretManagerSecretInfo", "SecretManagerSecretVersionInfo", "EventPrincipal", + "EventSystem", "Resource", "ProductService", "Event", diff --git a/scaleway/scaleway/audit_trail/v1alpha1/api.py b/scaleway/scaleway/audit_trail/v1alpha1/api.py index f2e593c99..a8dd14007 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/api.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/api.py @@ -2,20 +2,62 @@ # If you have any remark or suggestion do not hesitate to open an issue. from datetime import datetime -from typing import Optional +from typing import Any, Awaitable, Dict, List, Optional, Union from scaleway_core.api import API from scaleway_core.bridge import ( + Money, Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, + marshal_Money, + unmarshal_Money, + marshal_ScwFile, + unmarshal_ScwFile, + unmarshal_ServiceInfo, + marshal_TimeSeries, + unmarshal_TimeSeries, ) from scaleway_core.utils import ( + OneOfPossibility, + WaitForOptions, + project_or_organization_id, + random_name, + resolve_one_of, validate_path_param, + fetch_all_pages, + wait_for_resource, ) from .types import ( ListEventsRequestOrderBy, ResourceType, + AccountOrganizationInfo, + AccountProjectInfo, + AccountUserInfo, + AppleSiliconServerInfo, + BaremetalServerInfo, + BaremetalSettingInfo, + Event, + EventPrincipal, + EventSystem, + InstanceServerInfo, + KeyManagerKeyInfo, + KubernetesACLInfo, + KubernetesClusterInfo, + KubernetesNodeInfo, + KubernetesPoolInfo, + ListEventsRequest, ListEventsResponse, + ListProductsRequest, ListProductsResponse, + Product, + ProductService, + Resource, + SecretManagerSecretInfo, + SecretManagerSecretVersionInfo, ) from .marshalling import ( unmarshal_ListEventsResponse, diff --git a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py index 32ea3154c..1fadd8ad7 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py @@ -1,10 +1,34 @@ # This file was automatically generated. DO NOT EDIT. # If you have any remark or suggestion do not hesitate to open an issue. -from typing import Any, Dict +from decimal import Decimal +from datetime import datetime +from typing import Any, Dict, List, Optional from dateutil import parser +from scaleway_core.profile import ProfileDefaults +from scaleway_core.bridge import ( + Money, + Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, + unmarshal_Money, + marshal_Money, + marshal_ScwFile, + marshal_ServiceInfo, + marshal_TimeSeries, + unmarshal_TimeSeries, +) +from scaleway_core.utils import ( + OneOfPossibility, + resolve_one_of, +) from .types import ( + ListEventsRequestOrderBy, + ResourceType, AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, @@ -20,6 +44,7 @@ SecretManagerSecretInfo, SecretManagerSecretVersionInfo, EventPrincipal, + EventSystem, Resource, Event, ListEventsResponse, @@ -268,6 +293,21 @@ def unmarshal_EventPrincipal(data: Any) -> EventPrincipal: return EventPrincipal(**args) +def unmarshal_EventSystem(data: Any) -> EventSystem: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'EventSystem' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + + return EventSystem(**args) + + def unmarshal_Resource(data: Any) -> Resource: if not isinstance(data, dict): raise TypeError( @@ -445,6 +485,14 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["product_name"] = field + field = data.get("service_name", None) + if field is not None: + args["service_name"] = field + + field = data.get("method_name", None) + if field is not None: + args["method_name"] = field + field = data.get("recorded_at", None) if field is not None: args["recorded_at"] = ( @@ -459,26 +507,6 @@ def unmarshal_Event(data: Any) -> Event: else: args["principal"] = None - field = data.get("project_id", None) - if field is not None: - args["project_id"] = field - else: - args["project_id"] = None - - field = data.get("user_agent", None) - if field is not None: - args["user_agent"] = field - else: - args["user_agent"] = None - - field = data.get("service_name", None) - if field is not None: - args["service_name"] = field - - field = data.get("method_name", None) - if field is not None: - args["method_name"] = field - field = data.get("resources", None) if field is not None: args["resources"] = ( @@ -493,6 +521,24 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["status_code"] = field + field = data.get("system", None) + if field is not None: + args["system"] = unmarshal_EventSystem(field) + else: + args["system"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("user_agent", None) + if field is not None: + args["user_agent"] = field + else: + args["user_agent"] = None + field = data.get("request_body", None) if field is not None: args["request_body"] = field diff --git a/scaleway/scaleway/audit_trail/v1alpha1/types.py b/scaleway/scaleway/audit_trail/v1alpha1/types.py index 16fd831c7..45e8f4523 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/types.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/types.py @@ -3,12 +3,19 @@ from __future__ import annotations from dataclasses import dataclass +from decimal import Decimal from datetime import datetime from enum import Enum from typing import Any, Dict, List, Optional from scaleway_core.bridge import ( + Money, Region as ScwRegion, + ScwFile, + ServiceInfo, + TimeSeries, + TimeSeriesPoint, + Zone as ScwZone, ) from scaleway_core.utils import ( StrEnumMeta, @@ -141,6 +148,11 @@ class EventPrincipal: id: str +@dataclass +class EventSystem: + name: str + + @dataclass class Resource: id: str @@ -224,14 +236,14 @@ class Event: Product name of the resource attached to the event. """ - recorded_at: Optional[datetime] + service_name: str """ - Timestamp of the event. + API name called to trigger the event. """ - principal: Optional[EventPrincipal] + recorded_at: Optional[datetime] """ - User or IAM application at the origin of the event. + Timestamp of the event. """ project_id: Optional[str] @@ -244,11 +256,6 @@ class Event: User Agent at the origin of the event. """ - service_name: str - """ - API name called to trigger the event. - """ - method_name: str """ API method called to trigger the event. @@ -274,6 +281,10 @@ class Event: Request at the origin of the event. """ + principal: Optional[EventPrincipal] + + system: Optional[EventSystem] + @dataclass class Product: