Skip to content
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 @@ -2,6 +2,8 @@
# If you have any remark or suggestion do not hesitate to open an issue.
from .types import ListEventsRequestOrderBy
from .types import ResourceType
from .types import AccountOrganizationInfo
from .types import AccountUserInfo
from .types import KeyManagerKeyInfo
from .types import KubernetesACLInfo
from .types import KubernetesClusterInfo
Expand All @@ -23,6 +25,8 @@
__all__ = [
"ListEventsRequestOrderBy",
"ResourceType",
"AccountOrganizationInfo",
"AccountUserInfo",
"KeyManagerKeyInfo",
"KubernetesACLInfo",
"KubernetesClusterInfo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from dateutil import parser

from .types import (
AccountOrganizationInfo,
AccountUserInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
KubernetesClusterInfo,
Expand All @@ -22,6 +24,32 @@
)


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

args: Dict[str, Any] = {}

return AccountOrganizationInfo(**args)


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

args: Dict[str, Any] = {}

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

return AccountUserInfo(**args)


def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -244,6 +272,18 @@ def unmarshal_Resource(data: Any) -> Resource:
else:
args["key_manager_key_info"] = None

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

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

return Resource(**args)


Expand Down
16 changes: 16 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
SECRET_MANAGER_SECRET = "secret_manager_secret"
SECRET_MANAGER_VERSION = "secret_manager_version"
KEY_MANAGER_KEY = "key_manager_key"
ACCOUNT_USER = "account_user"
ACCOUNT_ORGANIZATION = "account_organization"

def __str__(self) -> str:
return str(self.value)


@dataclass
class AccountOrganizationInfo:
pass


@dataclass
class AccountUserInfo:
email: str


@dataclass
class KeyManagerKeyInfo:
pass
Expand Down Expand Up @@ -125,6 +137,10 @@ class Resource:

key_manager_key_info: Optional[KeyManagerKeyInfo]

account_user_info: Optional[AccountUserInfo]

account_organization_info: Optional[AccountOrganizationInfo]


@dataclass
class ProductService:
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# If you have any remark or suggestion do not hesitate to open an issue.
from .types import ListEventsRequestOrderBy
from .types import ResourceType
from .types import AccountOrganizationInfo
from .types import AccountUserInfo
from .types import KeyManagerKeyInfo
from .types import KubernetesACLInfo
from .types import KubernetesClusterInfo
Expand All @@ -23,6 +25,8 @@
__all__ = [
"ListEventsRequestOrderBy",
"ResourceType",
"AccountOrganizationInfo",
"AccountUserInfo",
"KeyManagerKeyInfo",
"KubernetesACLInfo",
"KubernetesClusterInfo",
Expand Down
40 changes: 40 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from dateutil import parser

from .types import (
AccountOrganizationInfo,
AccountUserInfo,
KeyManagerKeyInfo,
KubernetesACLInfo,
KubernetesClusterInfo,
Expand All @@ -22,6 +24,32 @@
)


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

args: Dict[str, Any] = {}

return AccountOrganizationInfo(**args)


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

args: Dict[str, Any] = {}

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

return AccountUserInfo(**args)


def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -244,6 +272,18 @@ def unmarshal_Resource(data: Any) -> Resource:
else:
args["key_manager_key_info"] = None

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

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

return Resource(**args)


Expand Down
16 changes: 16 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
SECRET_MANAGER_SECRET = "secret_manager_secret"
SECRET_MANAGER_VERSION = "secret_manager_version"
KEY_MANAGER_KEY = "key_manager_key"
ACCOUNT_USER = "account_user"
ACCOUNT_ORGANIZATION = "account_organization"

def __str__(self) -> str:
return str(self.value)


@dataclass
class AccountOrganizationInfo:
pass


@dataclass
class AccountUserInfo:
email: str


@dataclass
class KeyManagerKeyInfo:
pass
Expand Down Expand Up @@ -125,6 +137,10 @@ class Resource:

key_manager_key_info: Optional[KeyManagerKeyInfo]

account_user_info: Optional[AccountUserInfo]

account_organization_info: Optional[AccountOrganizationInfo]


@dataclass
class ProductService:
Expand Down