diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py index 56f35d976..74b110dcb 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py @@ -4,6 +4,7 @@ from .types import ResourceType from .types import AccountOrganizationInfo from .types import AccountUserInfo +from .types import AppleSiliconServerInfo from .types import InstanceServerInfo from .types import KeyManagerKeyInfo from .types import KubernetesACLInfo @@ -28,6 +29,7 @@ "ResourceType", "AccountOrganizationInfo", "AccountUserInfo", + "AppleSiliconServerInfo", "InstanceServerInfo", "KeyManagerKeyInfo", "KubernetesACLInfo", diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py index 615537865..d558104bf 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py @@ -7,6 +7,7 @@ from .types import ( AccountOrganizationInfo, AccountUserInfo, + AppleSiliconServerInfo, InstanceServerInfo, KeyManagerKeyInfo, KubernetesACLInfo, @@ -57,6 +58,25 @@ def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo: return AccountUserInfo(**args) +def unmarshal_AppleSiliconServerInfo(data: Any) -> AppleSiliconServerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'AppleSiliconServerInfo' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + return AppleSiliconServerInfo(**args) + + def unmarshal_InstanceServerInfo(data: Any) -> InstanceServerInfo: if not isinstance(data, dict): raise TypeError( @@ -318,6 +338,12 @@ def unmarshal_Resource(data: Any) -> Resource: else: args["instance_server_info"] = None + field = data.get("apple_silicon_server_info", None) + if field is not None: + args["apple_silicon_server_info"] = unmarshal_AppleSiliconServerInfo(field) + else: + args["apple_silicon_server_info"] = None + return Resource(**args) @@ -345,6 +371,10 @@ 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"] = ( @@ -371,10 +401,6 @@ 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 @@ -397,12 +423,6 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["status_code"] = field - field = data.get("resource", None) - if field is not None: - args["resource"] = unmarshal_Resource(field) - else: - args["resource"] = 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 aa1ccf764..d17db9ad2 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py @@ -45,6 +45,7 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta): ACCOUNT_USER = "account_user" ACCOUNT_ORGANIZATION = "account_organization" INSTANCE_SERVER = "instance_server" + APPLE_SILICON_SERVER = "apple_silicon_server" def __str__(self) -> str: return str(self.value) @@ -62,6 +63,13 @@ class AccountUserInfo: phone_number: Optional[str] +@dataclass +class AppleSiliconServerInfo: + id: str + + name: str + + @dataclass class InstanceServerInfo: name: str @@ -153,6 +161,8 @@ class Resource: instance_server_info: Optional[InstanceServerInfo] + apple_silicon_server_info: Optional[AppleSiliconServerInfo] + @dataclass class ProductService: @@ -183,6 +193,11 @@ 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. @@ -203,11 +218,6 @@ 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. @@ -233,11 +243,6 @@ class Event: HTTP status code resulting of the API call. """ - resource: Optional[Resource] - """ - Resource attached to the event. - """ - request_body: Optional[Dict[str, Any]] """ Request at the origin of the event. diff --git a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py index 56f35d976..74b110dcb 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py @@ -4,6 +4,7 @@ from .types import ResourceType from .types import AccountOrganizationInfo from .types import AccountUserInfo +from .types import AppleSiliconServerInfo from .types import InstanceServerInfo from .types import KeyManagerKeyInfo from .types import KubernetesACLInfo @@ -28,6 +29,7 @@ "ResourceType", "AccountOrganizationInfo", "AccountUserInfo", + "AppleSiliconServerInfo", "InstanceServerInfo", "KeyManagerKeyInfo", "KubernetesACLInfo", diff --git a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py index 615537865..d558104bf 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py @@ -7,6 +7,7 @@ from .types import ( AccountOrganizationInfo, AccountUserInfo, + AppleSiliconServerInfo, InstanceServerInfo, KeyManagerKeyInfo, KubernetesACLInfo, @@ -57,6 +58,25 @@ def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo: return AccountUserInfo(**args) +def unmarshal_AppleSiliconServerInfo(data: Any) -> AppleSiliconServerInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'AppleSiliconServerInfo' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + return AppleSiliconServerInfo(**args) + + def unmarshal_InstanceServerInfo(data: Any) -> InstanceServerInfo: if not isinstance(data, dict): raise TypeError( @@ -318,6 +338,12 @@ def unmarshal_Resource(data: Any) -> Resource: else: args["instance_server_info"] = None + field = data.get("apple_silicon_server_info", None) + if field is not None: + args["apple_silicon_server_info"] = unmarshal_AppleSiliconServerInfo(field) + else: + args["apple_silicon_server_info"] = None + return Resource(**args) @@ -345,6 +371,10 @@ 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"] = ( @@ -371,10 +401,6 @@ 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 @@ -397,12 +423,6 @@ def unmarshal_Event(data: Any) -> Event: if field is not None: args["status_code"] = field - field = data.get("resource", None) - if field is not None: - args["resource"] = unmarshal_Resource(field) - else: - args["resource"] = 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 aa1ccf764..d17db9ad2 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/types.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/types.py @@ -45,6 +45,7 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta): ACCOUNT_USER = "account_user" ACCOUNT_ORGANIZATION = "account_organization" INSTANCE_SERVER = "instance_server" + APPLE_SILICON_SERVER = "apple_silicon_server" def __str__(self) -> str: return str(self.value) @@ -62,6 +63,13 @@ class AccountUserInfo: phone_number: Optional[str] +@dataclass +class AppleSiliconServerInfo: + id: str + + name: str + + @dataclass class InstanceServerInfo: name: str @@ -153,6 +161,8 @@ class Resource: instance_server_info: Optional[InstanceServerInfo] + apple_silicon_server_info: Optional[AppleSiliconServerInfo] + @dataclass class ProductService: @@ -183,6 +193,11 @@ 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. @@ -203,11 +218,6 @@ 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. @@ -233,11 +243,6 @@ class Event: HTTP status code resulting of the API call. """ - resource: Optional[Resource] - """ - Resource attached to the event. - """ - request_body: Optional[Dict[str, Any]] """ Request at the origin of the event.