Skip to content

feat(audit_trail): add baremetal resources #1113

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
Jul 25, 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 @@ -3,8 +3,11 @@
from .types import ListEventsRequestOrderBy
from .types import ResourceType
from .types import AccountOrganizationInfo
from .types import AccountProjectInfo
from .types import AccountUserInfo
from .types import AppleSiliconServerInfo
from .types import BaremetalServerInfo
from .types import BaremetalSettingInfo
from .types import InstanceServerInfo
from .types import KeyManagerKeyInfo
from .types import KubernetesACLInfo
Expand All @@ -28,8 +31,11 @@
"ListEventsRequestOrderBy",
"ResourceType",
"AccountOrganizationInfo",
"AccountProjectInfo",
"AccountUserInfo",
"AppleSiliconServerInfo",
"BaremetalServerInfo",
"BaremetalSettingInfo",
"InstanceServerInfo",
"KeyManagerKeyInfo",
"KubernetesACLInfo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

from .types import (
AccountOrganizationInfo,
AccountProjectInfo,
AccountUserInfo,
AppleSiliconServerInfo,
BaremetalServerInfo,
BaremetalSettingInfo,
InstanceServerInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
Expand Down Expand Up @@ -37,6 +40,21 @@ def unmarshal_AccountOrganizationInfo(data: Any) -> AccountOrganizationInfo:
return AccountOrganizationInfo(**args)


def unmarshal_AccountProjectInfo(data: Any) -> AccountProjectInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'AccountProjectInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

return AccountProjectInfo(**args)


def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -77,6 +95,40 @@ def unmarshal_AppleSiliconServerInfo(data: Any) -> AppleSiliconServerInfo:
return AppleSiliconServerInfo(**args)


def unmarshal_BaremetalServerInfo(data: Any) -> BaremetalServerInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'BaremetalServerInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

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

return BaremetalServerInfo(**args)


def unmarshal_BaremetalSettingInfo(data: Any) -> BaremetalSettingInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'BaremetalSettingInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

return BaremetalSettingInfo(**args)


def unmarshal_InstanceServerInfo(data: Any) -> InstanceServerInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -344,6 +396,24 @@ def unmarshal_Resource(data: Any) -> Resource:
else:
args["apple_silicon_server_info"] = None

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

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

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

return Resource(**args)


Expand Down
26 changes: 26 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
KEY_MANAGER_KEY = "key_manager_key"
ACCOUNT_USER = "account_user"
ACCOUNT_ORGANIZATION = "account_organization"
ACCOUNT_PROJECT = "account_project"
INSTANCE_SERVER = "instance_server"
APPLE_SILICON_SERVER = "apple_silicon_server"
BAREMETAL_SERVER = "baremetal_server"
BAREMETAL_SETTING = "baremetal_setting"

def __str__(self) -> str:
return str(self.value)
Expand All @@ -56,6 +59,11 @@ class AccountOrganizationInfo:
pass


@dataclass
class AccountProjectInfo:
description: str


@dataclass
class AccountUserInfo:
email: str
Expand All @@ -70,6 +78,18 @@ class AppleSiliconServerInfo:
name: str


@dataclass
class BaremetalServerInfo:
description: str

tags: List[str]


@dataclass
class BaremetalSettingInfo:
type_: str


@dataclass
class InstanceServerInfo:
name: str
Expand Down Expand Up @@ -163,6 +183,12 @@ class Resource:

apple_silicon_server_info: Optional[AppleSiliconServerInfo]

account_project_info: Optional[AccountProjectInfo]

baremetal_server_info: Optional[BaremetalServerInfo]

baremetal_setting_info: Optional[BaremetalSettingInfo]


@dataclass
class ProductService:
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
from .types import ListEventsRequestOrderBy
from .types import ResourceType
from .types import AccountOrganizationInfo
from .types import AccountProjectInfo
from .types import AccountUserInfo
from .types import AppleSiliconServerInfo
from .types import BaremetalServerInfo
from .types import BaremetalSettingInfo
from .types import InstanceServerInfo
from .types import KeyManagerKeyInfo
from .types import KubernetesACLInfo
Expand All @@ -28,8 +31,11 @@
"ListEventsRequestOrderBy",
"ResourceType",
"AccountOrganizationInfo",
"AccountProjectInfo",
"AccountUserInfo",
"AppleSiliconServerInfo",
"BaremetalServerInfo",
"BaremetalSettingInfo",
"InstanceServerInfo",
"KeyManagerKeyInfo",
"KubernetesACLInfo",
Expand Down
70 changes: 70 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

from .types import (
AccountOrganizationInfo,
AccountProjectInfo,
AccountUserInfo,
AppleSiliconServerInfo,
BaremetalServerInfo,
BaremetalSettingInfo,
InstanceServerInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
Expand Down Expand Up @@ -37,6 +40,21 @@ def unmarshal_AccountOrganizationInfo(data: Any) -> AccountOrganizationInfo:
return AccountOrganizationInfo(**args)


def unmarshal_AccountProjectInfo(data: Any) -> AccountProjectInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'AccountProjectInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

return AccountProjectInfo(**args)


def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -77,6 +95,40 @@ def unmarshal_AppleSiliconServerInfo(data: Any) -> AppleSiliconServerInfo:
return AppleSiliconServerInfo(**args)


def unmarshal_BaremetalServerInfo(data: Any) -> BaremetalServerInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'BaremetalServerInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

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

return BaremetalServerInfo(**args)


def unmarshal_BaremetalSettingInfo(data: Any) -> BaremetalSettingInfo:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'BaremetalSettingInfo' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

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

return BaremetalSettingInfo(**args)


def unmarshal_InstanceServerInfo(data: Any) -> InstanceServerInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -344,6 +396,24 @@ def unmarshal_Resource(data: Any) -> Resource:
else:
args["apple_silicon_server_info"] = None

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

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

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

return Resource(**args)


Expand Down
26 changes: 26 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
KEY_MANAGER_KEY = "key_manager_key"
ACCOUNT_USER = "account_user"
ACCOUNT_ORGANIZATION = "account_organization"
ACCOUNT_PROJECT = "account_project"
INSTANCE_SERVER = "instance_server"
APPLE_SILICON_SERVER = "apple_silicon_server"
BAREMETAL_SERVER = "baremetal_server"
BAREMETAL_SETTING = "baremetal_setting"

def __str__(self) -> str:
return str(self.value)
Expand All @@ -56,6 +59,11 @@ class AccountOrganizationInfo:
pass


@dataclass
class AccountProjectInfo:
description: str


@dataclass
class AccountUserInfo:
email: str
Expand All @@ -70,6 +78,18 @@ class AppleSiliconServerInfo:
name: str


@dataclass
class BaremetalServerInfo:
description: str

tags: List[str]


@dataclass
class BaremetalSettingInfo:
type_: str


@dataclass
class InstanceServerInfo:
name: str
Expand Down Expand Up @@ -163,6 +183,12 @@ class Resource:

apple_silicon_server_info: Optional[AppleSiliconServerInfo]

account_project_info: Optional[AccountProjectInfo]

baremetal_server_info: Optional[BaremetalServerInfo]

baremetal_setting_info: Optional[BaremetalSettingInfo]


@dataclass
class ProductService:
Expand Down
Loading