Skip to content

Commit da759f1

Browse files
authored
feat(audit_trail): add vpc resources info (#1465)
1 parent 29d8e3e commit da759f1

File tree

6 files changed

+268
-0
lines changed

6 files changed

+268
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
from .types import LoadBalancerRouteInfo
4646
from .types import SecretManagerSecretInfo
4747
from .types import SecretManagerSecretVersionInfo
48+
from .types import VpcPrivateNetworkInfo
49+
from .types import VpcRouteInfo
50+
from .types import VpcSubnetInfo
4851
from .types import Resource
4952
from .types import EventPrincipal
5053
from .types import AuthenticationEvent
@@ -116,6 +119,9 @@
116119
"LoadBalancerRouteInfo",
117120
"SecretManagerSecretInfo",
118121
"SecretManagerSecretVersionInfo",
122+
"VpcPrivateNetworkInfo",
123+
"VpcRouteInfo",
124+
"VpcSubnetInfo",
119125
"Resource",
120126
"EventPrincipal",
121127
"AuthenticationEvent",

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

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
LoadBalancerRouteInfo,
5252
SecretManagerSecretInfo,
5353
SecretManagerSecretVersionInfo,
54+
VpcPrivateNetworkInfo,
55+
VpcRouteInfo,
56+
VpcSubnetInfo,
5457
Resource,
5558
AuthenticationEvent,
5659
ListAuthenticationEventsResponse,
@@ -841,6 +844,87 @@ def unmarshal_SecretManagerSecretVersionInfo(
841844
return SecretManagerSecretVersionInfo(**args)
842845

843846

847+
def unmarshal_VpcPrivateNetworkInfo(data: Any) -> VpcPrivateNetworkInfo:
848+
if not isinstance(data, dict):
849+
raise TypeError(
850+
"Unmarshalling the type 'VpcPrivateNetworkInfo' failed as data isn't a dictionary."
851+
)
852+
853+
args: dict[str, Any] = {}
854+
855+
field = data.get("vpc_id", None)
856+
if field is not None:
857+
args["vpc_id"] = field
858+
else:
859+
args["vpc_id"] = None
860+
861+
field = data.get("push_default_route", None)
862+
if field is not None:
863+
args["push_default_route"] = field
864+
else:
865+
args["push_default_route"] = None
866+
867+
return VpcPrivateNetworkInfo(**args)
868+
869+
870+
def unmarshal_VpcRouteInfo(data: Any) -> VpcRouteInfo:
871+
if not isinstance(data, dict):
872+
raise TypeError(
873+
"Unmarshalling the type 'VpcRouteInfo' failed as data isn't a dictionary."
874+
)
875+
876+
args: dict[str, Any] = {}
877+
878+
field = data.get("vpc_id", None)
879+
if field is not None:
880+
args["vpc_id"] = field
881+
else:
882+
args["vpc_id"] = None
883+
884+
field = data.get("destination", None)
885+
if field is not None:
886+
args["destination"] = field
887+
else:
888+
args["destination"] = None
889+
890+
field = data.get("nexthop_resource_key", None)
891+
if field is not None:
892+
args["nexthop_resource_key"] = field
893+
else:
894+
args["nexthop_resource_key"] = None
895+
896+
field = data.get("nexthop_private_network_key", None)
897+
if field is not None:
898+
args["nexthop_private_network_key"] = field
899+
else:
900+
args["nexthop_private_network_key"] = None
901+
902+
return VpcRouteInfo(**args)
903+
904+
905+
def unmarshal_VpcSubnetInfo(data: Any) -> VpcSubnetInfo:
906+
if not isinstance(data, dict):
907+
raise TypeError(
908+
"Unmarshalling the type 'VpcSubnetInfo' failed as data isn't a dictionary."
909+
)
910+
911+
args: dict[str, Any] = {}
912+
913+
field = data.get("subnet_cidr", None)
914+
if field is not None:
915+
args["subnet_cidr"] = field
916+
else:
917+
args["subnet_cidr"] = None
918+
919+
field = data.get("vpc_id", None)
920+
if field is not None:
921+
args["vpc_id"] = field
922+
else:
923+
args["vpc_id"] = None
924+
925+
return VpcSubnetInfo(**args)
926+
927+
844928
def unmarshal_Resource(data: Any) -> Resource:
845929
if not isinstance(data, dict):
846930
raise TypeError(
@@ -1111,6 +1195,24 @@ def unmarshal_Resource(data: Any) -> Resource:
11111195
else:
11121196
args["account_contract_signature_info"] = None
11131197

1198+
field = data.get("vpc_subnet_info", None)
1199+
if field is not None:
1200+
args["vpc_subnet_info"] = unmarshal_VpcSubnetInfo(field)
1201+
else:
1202+
args["vpc_subnet_info"] = None
1203+
1204+
field = data.get("vpc_route_info", None)
1205+
if field is not None:
1206+
args["vpc_route_info"] = unmarshal_VpcRouteInfo(field)
1207+
else:
1208+
args["vpc_route_info"] = None
1209+
1210+
field = data.get("vpc_private_network_info", None)
1211+
if field is not None:
1212+
args["vpc_private_network_info"] = unmarshal_VpcPrivateNetworkInfo(field)
1213+
else:
1214+
args["vpc_private_network_info"] = None
1215+
11141216
return Resource(**args)
11151217

11161218

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,26 @@ class SecretManagerSecretVersionInfo:
372372
revision: int
373373

374374

375+
@dataclass
376+
class VpcPrivateNetworkInfo:
377+
vpc_id: str
378+
push_default_route: bool
379+
380+
381+
@dataclass
382+
class VpcRouteInfo:
383+
vpc_id: str
384+
destination: str
385+
nexthop_resource_key: Optional[str] = None
386+
nexthop_private_network_key: Optional[str] = None
387+
388+
389+
@dataclass
390+
class VpcSubnetInfo:
391+
subnet_cidr: str
392+
vpc_id: str
393+
394+
375395
@dataclass
376396
class Resource:
377397
id: str
@@ -450,6 +470,12 @@ class Resource:
450470

451471
account_contract_signature_info: Optional[AccountContractSignatureInfo] = None
452472

473+
vpc_subnet_info: Optional[VpcSubnetInfo] = None
474+
475+
vpc_route_info: Optional[VpcRouteInfo] = None
476+
477+
vpc_private_network_info: Optional[VpcPrivateNetworkInfo] = None
478+
453479

454480
@dataclass
455481
class EventPrincipal:

scaleway/scaleway/audit_trail/v1alpha1/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
from .types import LoadBalancerRouteInfo
4646
from .types import SecretManagerSecretInfo
4747
from .types import SecretManagerSecretVersionInfo
48+
from .types import VpcPrivateNetworkInfo
49+
from .types import VpcRouteInfo
50+
from .types import VpcSubnetInfo
4851
from .types import Resource
4952
from .types import EventPrincipal
5053
from .types import AuthenticationEvent
@@ -116,6 +119,9 @@
116119
"LoadBalancerRouteInfo",
117120
"SecretManagerSecretInfo",
118121
"SecretManagerSecretVersionInfo",
122+
"VpcPrivateNetworkInfo",
123+
"VpcRouteInfo",
124+
"VpcSubnetInfo",
119125
"Resource",
120126
"EventPrincipal",
121127
"AuthenticationEvent",

scaleway/scaleway/audit_trail/v1alpha1/marshalling.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
LoadBalancerRouteInfo,
5252
SecretManagerSecretInfo,
5353
SecretManagerSecretVersionInfo,
54+
VpcPrivateNetworkInfo,
55+
VpcRouteInfo,
56+
VpcSubnetInfo,
5457
Resource,
5558
AuthenticationEvent,
5659
ListAuthenticationEventsResponse,
@@ -841,6 +844,87 @@ def unmarshal_SecretManagerSecretVersionInfo(
841844
return SecretManagerSecretVersionInfo(**args)
842845

843846

847+
def unmarshal_VpcPrivateNetworkInfo(data: Any) -> VpcPrivateNetworkInfo:
848+
if not isinstance(data, dict):
849+
raise TypeError(
850+
"Unmarshalling the type 'VpcPrivateNetworkInfo' failed as data isn't a dictionary."
851+
)
852+
853+
args: dict[str, Any] = {}
854+
855+
field = data.get("vpc_id", None)
856+
if field is not None:
857+
args["vpc_id"] = field
858+
else:
859+
args["vpc_id"] = None
860+
861+
field = data.get("push_default_route", None)
862+
if field is not None:
863+
args["push_default_route"] = field
864+
else:
865+
args["push_default_route"] = None
866+
867+
return VpcPrivateNetworkInfo(**args)
868+
869+
870+
def unmarshal_VpcRouteInfo(data: Any) -> VpcRouteInfo:
871+
if not isinstance(data, dict):
872+
raise TypeError(
873+
"Unmarshalling the type 'VpcRouteInfo' failed as data isn't a dictionary."
874+
)
875+
876+
args: dict[str, Any] = {}
877+
878+
field = data.get("vpc_id", None)
879+
if field is not None:
880+
args["vpc_id"] = field
881+
else:
882+
args["vpc_id"] = None
883+
884+
field = data.get("destination", None)
885+
if field is not None:
886+
args["destination"] = field
887+
else:
888+
args["destination"] = None
889+
890+
field = data.get("nexthop_resource_key", None)
891+
if field is not None:
892+
args["nexthop_resource_key"] = field
893+
else:
894+
args["nexthop_resource_key"] = None
895+
896+
field = data.get("nexthop_private_network_key", None)
897+
if field is not None:
898+
args["nexthop_private_network_key"] = field
899+
else:
900+
args["nexthop_private_network_key"] = None
901+
902+
return VpcRouteInfo(**args)
903+
904+
905+
def unmarshal_VpcSubnetInfo(data: Any) -> VpcSubnetInfo:
906+
if not isinstance(data, dict):
907+
raise TypeError(
908+
"Unmarshalling the type 'VpcSubnetInfo' failed as data isn't a dictionary."
909+
)
910+
911+
args: dict[str, Any] = {}
912+
913+
field = data.get("subnet_cidr", None)
914+
if field is not None:
915+
args["subnet_cidr"] = field
916+
else:
917+
args["subnet_cidr"] = None
918+
919+
field = data.get("vpc_id", None)
920+
if field is not None:
921+
args["vpc_id"] = field
922+
else:
923+
args["vpc_id"] = None
924+
925+
return VpcSubnetInfo(**args)
926+
927+
844928
def unmarshal_Resource(data: Any) -> Resource:
845929
if not isinstance(data, dict):
846930
raise TypeError(
@@ -1111,6 +1195,24 @@ def unmarshal_Resource(data: Any) -> Resource:
11111195
else:
11121196
args["account_contract_signature_info"] = None
11131197

1198+
field = data.get("vpc_subnet_info", None)
1199+
if field is not None:
1200+
args["vpc_subnet_info"] = unmarshal_VpcSubnetInfo(field)
1201+
else:
1202+
args["vpc_subnet_info"] = None
1203+
1204+
field = data.get("vpc_route_info", None)
1205+
if field is not None:
1206+
args["vpc_route_info"] = unmarshal_VpcRouteInfo(field)
1207+
else:
1208+
args["vpc_route_info"] = None
1209+
1210+
field = data.get("vpc_private_network_info", None)
1211+
if field is not None:
1212+
args["vpc_private_network_info"] = unmarshal_VpcPrivateNetworkInfo(field)
1213+
else:
1214+
args["vpc_private_network_info"] = None
1215+
11141216
return Resource(**args)
11151217

11161218

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,26 @@ class SecretManagerSecretVersionInfo:
372372
revision: int
373373

374374

375+
@dataclass
376+
class VpcPrivateNetworkInfo:
377+
vpc_id: str
378+
push_default_route: bool
379+
380+
381+
@dataclass
382+
class VpcRouteInfo:
383+
vpc_id: str
384+
destination: str
385+
nexthop_resource_key: Optional[str] = None
386+
nexthop_private_network_key: Optional[str] = None
387+
388+
389+
@dataclass
390+
class VpcSubnetInfo:
391+
subnet_cidr: str
392+
vpc_id: str
393+
394+
375395
@dataclass
376396
class Resource:
377397
id: str
@@ -450,6 +470,12 @@ class Resource:
450470

451471
account_contract_signature_info: Optional[AccountContractSignatureInfo] = None
452472

473+
vpc_subnet_info: Optional[VpcSubnetInfo] = None
474+
475+
vpc_route_info: Optional[VpcRouteInfo] = None
476+
477+
vpc_private_network_info: Optional[VpcPrivateNetworkInfo] = None
478+
453479

454480
@dataclass
455481
class EventPrincipal:

0 commit comments

Comments
 (0)