Skip to content

Commit 44203be

Browse files
authored
feat(audit_trail): add key manager to resource api (#853)
1 parent 661db26 commit 44203be

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33
from .types import ListEventsRequestOrderBy
44
from .types import ResourceType
5+
from .types import KeyManagerKeyInfo
56
from .types import KubernetesACLInfo
67
from .types import KubernetesClusterInfo
78
from .types import KubernetesNodeInfo
@@ -22,6 +23,7 @@
2223
__all__ = [
2324
"ListEventsRequestOrderBy",
2425
"ResourceType",
26+
"KeyManagerKeyInfo",
2527
"KubernetesACLInfo",
2628
"KubernetesClusterInfo",
2729
"KubernetesNodeInfo",

scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from dateutil import parser
66

77
from .types import (
8+
KeyManagerKeyInfo,
89
KubernetesACLInfo,
910
KubernetesClusterInfo,
1011
KubernetesNodeInfo,
@@ -21,6 +22,17 @@
2122
)
2223

2324

25+
def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
26+
if not isinstance(data, dict):
27+
raise TypeError(
28+
"Unmarshalling the type 'KeyManagerKeyInfo' failed as data isn't a dictionary."
29+
)
30+
31+
args: Dict[str, Any] = {}
32+
33+
return KeyManagerKeyInfo(**args)
34+
35+
2436
def unmarshal_KubernetesACLInfo(data: Any) -> KubernetesACLInfo:
2537
if not isinstance(data, dict):
2638
raise TypeError(
@@ -206,6 +218,12 @@ def unmarshal_Resource(data: Any) -> Resource:
206218
else:
207219
args["kube_acl_info"] = None
208220

221+
field = data.get("keym_key_info", None)
222+
if field is not None:
223+
args["keym_key_info"] = unmarshal_KeyManagerKeyInfo(field)
224+
else:
225+
args["keym_key_info"] = None
226+
209227
return Resource(**args)
210228

211229

scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
3131
KUBE_POOL = "kube_pool"
3232
KUBE_NODE = "kube_node"
3333
KUBE_ACL = "kube_acl"
34+
KEYM_KEY = "keym_key"
3435

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

3839

40+
@dataclass
41+
class KeyManagerKeyInfo:
42+
pass
43+
44+
3945
@dataclass
4046
class KubernetesACLInfo:
4147
pass
@@ -101,6 +107,8 @@ class Resource:
101107

102108
kube_acl_info: Optional[KubernetesACLInfo]
103109

110+
keym_key_info: Optional[KeyManagerKeyInfo]
111+
104112

105113
@dataclass
106114
class ProductService:

scaleway/scaleway/audit_trail/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33
from .types import ListEventsRequestOrderBy
44
from .types import ResourceType
5+
from .types import KeyManagerKeyInfo
56
from .types import KubernetesACLInfo
67
from .types import KubernetesClusterInfo
78
from .types import KubernetesNodeInfo
@@ -22,6 +23,7 @@
2223
__all__ = [
2324
"ListEventsRequestOrderBy",
2425
"ResourceType",
26+
"KeyManagerKeyInfo",
2527
"KubernetesACLInfo",
2628
"KubernetesClusterInfo",
2729
"KubernetesNodeInfo",

scaleway/scaleway/audit_trail/v1alpha1/marshalling.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from dateutil import parser
66

77
from .types import (
8+
KeyManagerKeyInfo,
89
KubernetesACLInfo,
910
KubernetesClusterInfo,
1011
KubernetesNodeInfo,
@@ -21,6 +22,17 @@
2122
)
2223

2324

25+
def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
26+
if not isinstance(data, dict):
27+
raise TypeError(
28+
"Unmarshalling the type 'KeyManagerKeyInfo' failed as data isn't a dictionary."
29+
)
30+
31+
args: Dict[str, Any] = {}
32+
33+
return KeyManagerKeyInfo(**args)
34+
35+
2436
def unmarshal_KubernetesACLInfo(data: Any) -> KubernetesACLInfo:
2537
if not isinstance(data, dict):
2638
raise TypeError(
@@ -206,6 +218,12 @@ def unmarshal_Resource(data: Any) -> Resource:
206218
else:
207219
args["kube_acl_info"] = None
208220

221+
field = data.get("keym_key_info", None)
222+
if field is not None:
223+
args["keym_key_info"] = unmarshal_KeyManagerKeyInfo(field)
224+
else:
225+
args["keym_key_info"] = None
226+
209227
return Resource(**args)
210228

211229

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
3131
KUBE_POOL = "kube_pool"
3232
KUBE_NODE = "kube_node"
3333
KUBE_ACL = "kube_acl"
34+
KEYM_KEY = "keym_key"
3435

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

3839

40+
@dataclass
41+
class KeyManagerKeyInfo:
42+
pass
43+
44+
3945
@dataclass
4046
class KubernetesACLInfo:
4147
pass
@@ -101,6 +107,8 @@ class Resource:
101107

102108
kube_acl_info: Optional[KubernetesACLInfo]
103109

110+
keym_key_info: Optional[KeyManagerKeyInfo]
111+
104112

105113
@dataclass
106114
class ProductService:

0 commit comments

Comments
 (0)