diff --git a/scaleway-async/scaleway_async/autoscaling/v1alpha2/api.py b/scaleway-async/scaleway_async/autoscaling/v1alpha2/api.py index 0ab4656df..4dcdd7ec8 100644 --- a/scaleway-async/scaleway_async/autoscaling/v1alpha2/api.py +++ b/scaleway-async/scaleway_async/autoscaling/v1alpha2/api.py @@ -42,9 +42,7 @@ class AutoscalingV1Alpha2API(API): - """ - Instances Autoscaling Groups management API. - """ + """ """ async def list_groups( self, @@ -101,7 +99,8 @@ async def get_group( ) -> Group: """ Get an autoscaling group. - Get details of a specified autoscaling group including its configuration, current size, and status. + Get details of a specified autoscaling group including its + configuration, current size, and status. :param group_id: ID of the group to get. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -134,7 +133,8 @@ async def wait_for_group( ) -> Group: """ Get an autoscaling group. - Get details of a specified autoscaling group including its configuration, current size, and status. + Get details of a specified autoscaling group including its + configuration, current size, and status. :param group_id: ID of the group to get. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -177,7 +177,9 @@ async def create_group( ) -> Group: """ Create an autoscaling group. - Create a new autoscaling group with the specified configuration including template, scaling policy, and optional load balancer settings. + Create a new autoscaling group with the specified configuration + including template, scaling policy, and optional load balancer + settings. :param name: Name of the autoscaling group. :param template_id: Template ID for instances in this group. :param zone: Zone to target. If none is passed will use default zone from the config. @@ -233,7 +235,8 @@ async def update_group( ) -> Group: """ Update an autoscaling group. - Update the configuration of a specified autoscaling group including name, tags, template, scaling policy, and load balancer settings. + Update the configuration of a specified autoscaling group including + name, tags, template, scaling policy, and load balancer settings. :param group_id: ID of the group to update. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: New name for the group. @@ -282,7 +285,8 @@ async def delete_group( ) -> Group: """ Delete an autoscaling group. - Delete a specified autoscaling group and all its associated resources. + Delete a specified autoscaling group and all its associated + resources. :param group_id: ID of the group to delete. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -317,8 +321,9 @@ async def list_logs( end_time: Optional[datetime] = None, ) -> ListLogsResponse: """ - List group logs. - List logs for a specified autoscaling group to view scaling events and activities. + List autoscaling group logs. + List logs for a specified autoscaling group to view scaling events + and activities. :param group_id: :param zone: Zone to target. If none is passed will use default zone from the config. :param page_token: @@ -361,7 +366,7 @@ async def list_servers( page_size: Optional[int] = None, ) -> ListServersResponse: """ - List group servers. + List autoscaling group servers. List all Instances belonging to a specified autoscaling group. :param group_id: :param zone: Zone to target. If none is passed will use default zone from the config. @@ -402,7 +407,7 @@ async def list_alerts( project_id: Optional[str] = None, ) -> ListAlertsResponse: """ - List group alerts. + List autoscaling group alerts. List active and historical alerts for a specified autoscaling group. :param zone: Zone to target. If none is passed will use default zone from the config. :param group_id: diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/__init__.py b/scaleway-async/scaleway_async/instance/v2alpha1/__init__.py index 3d05b58cd..4eda878e9 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/__init__.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/__init__.py @@ -43,7 +43,7 @@ from .types import CreateServerRequestPublicNetworkInterface from .types import CreateServerRequestServerVolume from .types import PlacementGroup -from .types import PrivateNetworkInterface +from .types import PrivateNetworkInterfaceSummary from .types import SecurityGroupSummary from .types import ServerType from .types import ServerSummary @@ -108,6 +108,7 @@ from .types import ListUserDataKeysRequest from .types import ListUserDataKeysResponse from .types import PauseServerRequest +from .types import PrivateNetworkInterface from .types import RebootServerRequest from .types import ResourceCounts from .types import Server @@ -174,7 +175,7 @@ "CreateServerRequestPublicNetworkInterface", "CreateServerRequestServerVolume", "PlacementGroup", - "PrivateNetworkInterface", + "PrivateNetworkInterfaceSummary", "SecurityGroupSummary", "ServerType", "ServerSummary", @@ -239,6 +240,7 @@ "ListUserDataKeysRequest", "ListUserDataKeysResponse", "PauseServerRequest", + "PrivateNetworkInterface", "RebootServerRequest", "ResourceCounts", "Server", diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/api.py b/scaleway-async/scaleway_async/instance/v2alpha1/api.py index 7d3ca29c5..dee4f16b4 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/api.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/api.py @@ -88,7 +88,6 @@ from .marshalling import ( unmarshal_SecurityGroup, unmarshal_PlacementGroup, - unmarshal_PrivateNetworkInterface, unmarshal_AddSecurityGroupRulesResponse, unmarshal_ListPlacementGroupsResponse, unmarshal_ListPrivateNetworkInterfacesResponse, @@ -98,6 +97,7 @@ unmarshal_ListTemplateUserDataKeysResponse, unmarshal_ListTemplatesResponse, unmarshal_ListUserDataKeysResponse, + unmarshal_PrivateNetworkInterface, unmarshal_ResourceCounts, unmarshal_Server, unmarshal_Template, diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py b/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py index bdbc79859..062eb9bb2 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py @@ -14,9 +14,9 @@ SecurityGroupRule, SecurityGroup, PlacementGroup, - PrivateNetworkInterface, AddSecurityGroupRulesResponse, ListPlacementGroupsResponse, + PrivateNetworkInterfaceSummary, ListPrivateNetworkInterfacesResponse, SecurityGroupSummary, ListSecurityGroupsResponse, @@ -30,6 +30,7 @@ TemplateSummary, ListTemplatesResponse, ListUserDataKeysResponse, + PrivateNetworkInterface, ResourceCounts, ServerIP, ServerFilesystem, @@ -339,10 +340,70 @@ def unmarshal_PlacementGroup(data: Any) -> PlacementGroup: return PlacementGroup(**args) -def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: +def unmarshal_AddSecurityGroupRulesResponse(data: Any) -> AddSecurityGroupRulesResponse: if not isinstance(data, dict): raise TypeError( - "Unmarshalling the type 'PrivateNetworkInterface' failed as data isn't a dictionary." + "Unmarshalling the type 'AddSecurityGroupRulesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("added_rules", None) + if field is not None: + args["added_rules"] = ( + [unmarshal_SecurityGroupRule(v) for v in field] + if field is not None + else None + ) + else: + args["added_rules"] = None + + field = data.get("security_group", None) + if field is not None: + args["security_group"] = unmarshal_SecurityGroup(field) + else: + args["security_group"] = None + + return AddSecurityGroupRulesResponse(**args) + + +def unmarshal_ListPlacementGroupsResponse(data: Any) -> ListPlacementGroupsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("placement_groups", None) + if field is not None: + args["placement_groups"] = ( + [unmarshal_PlacementGroup(v) for v in field] if field is not None else None + ) + else: + args["placement_groups"] = None + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + else: + args["total_count"] = None + + field = data.get("next_page_token", None) + if field is not None: + args["next_page_token"] = field + else: + args["next_page_token"] = None + + return ListPlacementGroupsResponse(**args) + + +def unmarshal_PrivateNetworkInterfaceSummary( + data: Any, +) -> PrivateNetworkInterfaceSummary: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PrivateNetworkInterfaceSummary' failed as data isn't a dictionary." ) args: dict[str, Any] = {} @@ -413,65 +474,7 @@ def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: else: args["updated_at"] = None - return PrivateNetworkInterface(**args) - - -def unmarshal_AddSecurityGroupRulesResponse(data: Any) -> AddSecurityGroupRulesResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'AddSecurityGroupRulesResponse' failed as data isn't a dictionary." - ) - - args: dict[str, Any] = {} - - field = data.get("added_rules", None) - if field is not None: - args["added_rules"] = ( - [unmarshal_SecurityGroupRule(v) for v in field] - if field is not None - else None - ) - else: - args["added_rules"] = None - - field = data.get("security_group", None) - if field is not None: - args["security_group"] = unmarshal_SecurityGroup(field) - else: - args["security_group"] = None - - return AddSecurityGroupRulesResponse(**args) - - -def unmarshal_ListPlacementGroupsResponse(data: Any) -> ListPlacementGroupsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary." - ) - - args: dict[str, Any] = {} - - field = data.get("placement_groups", None) - if field is not None: - args["placement_groups"] = ( - [unmarshal_PlacementGroup(v) for v in field] if field is not None else None - ) - else: - args["placement_groups"] = None - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - else: - args["total_count"] = None - - field = data.get("next_page_token", None) - if field is not None: - args["next_page_token"] = field - else: - args["next_page_token"] = None - - return ListPlacementGroupsResponse(**args) + return PrivateNetworkInterfaceSummary(**args) def unmarshal_ListPrivateNetworkInterfacesResponse( @@ -487,7 +490,7 @@ def unmarshal_ListPrivateNetworkInterfacesResponse( field = data.get("private_network_interfaces", None) if field is not None: args["private_network_interfaces"] = ( - [unmarshal_PrivateNetworkInterface(v) for v in field] + [unmarshal_PrivateNetworkInterfaceSummary(v) for v in field] if field is not None else None ) @@ -1115,6 +1118,83 @@ def unmarshal_ListUserDataKeysResponse(data: Any) -> ListUserDataKeysResponse: return ListUserDataKeysResponse(**args) +def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PrivateNetworkInterface' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("private_network_id", None) + if field is not None: + args["private_network_id"] = field + else: + args["private_network_id"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("server_id", None) + if field is not None: + args["server_id"] = field + else: + args["server_id"] = None + + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + + field = data.get("mac_address", None) + if field is not None: + args["mac_address"] = field + else: + args["mac_address"] = None + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = None + + field = data.get("ip_ids", None) + if field is not None: + args["ip_ids"] = field + else: + args["ip_ids"] = None + + field = data.get("tags", None) + if field is not None: + args["tags"] = field + else: + args["tags"] = None + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + return PrivateNetworkInterface(**args) + + def unmarshal_ResourceCounts(data: Any) -> ResourceCounts: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/types.py b/scaleway-async/scaleway_async/instance/v2alpha1/types.py index 7fe1f5cbf..63351339f 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/types.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/types.py @@ -392,7 +392,7 @@ class PlacementGroup: @dataclass -class PrivateNetworkInterface: +class PrivateNetworkInterfaceSummary: id: str private_network_id: str project_id: str @@ -962,7 +962,7 @@ class ListPrivateNetworkInterfacesRequest: @dataclass class ListPrivateNetworkInterfacesResponse: - private_network_interfaces: list[PrivateNetworkInterface] + private_network_interfaces: list[PrivateNetworkInterfaceSummary] total_count: int next_page_token: Optional[str] = None @@ -1109,6 +1109,21 @@ class PauseServerRequest: """ +@dataclass +class PrivateNetworkInterface: + id: str + private_network_id: str + project_id: str + server_id: str + security_group_id: str + mac_address: str + status: PrivateNetworkInterfaceStatus + ip_ids: list[str] + tags: list[str] + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + + @dataclass class RebootServerRequest: server_id: str diff --git a/scaleway/scaleway/autoscaling/v1alpha2/api.py b/scaleway/scaleway/autoscaling/v1alpha2/api.py index 6b5e19d73..86f814cad 100644 --- a/scaleway/scaleway/autoscaling/v1alpha2/api.py +++ b/scaleway/scaleway/autoscaling/v1alpha2/api.py @@ -42,9 +42,7 @@ class AutoscalingV1Alpha2API(API): - """ - Instances Autoscaling Groups management API. - """ + """ """ def list_groups( self, @@ -101,7 +99,8 @@ def get_group( ) -> Group: """ Get an autoscaling group. - Get details of a specified autoscaling group including its configuration, current size, and status. + Get details of a specified autoscaling group including its + configuration, current size, and status. :param group_id: ID of the group to get. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -134,7 +133,8 @@ def wait_for_group( ) -> Group: """ Get an autoscaling group. - Get details of a specified autoscaling group including its configuration, current size, and status. + Get details of a specified autoscaling group including its + configuration, current size, and status. :param group_id: ID of the group to get. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -177,7 +177,9 @@ def create_group( ) -> Group: """ Create an autoscaling group. - Create a new autoscaling group with the specified configuration including template, scaling policy, and optional load balancer settings. + Create a new autoscaling group with the specified configuration + including template, scaling policy, and optional load balancer + settings. :param name: Name of the autoscaling group. :param template_id: Template ID for instances in this group. :param zone: Zone to target. If none is passed will use default zone from the config. @@ -233,7 +235,8 @@ def update_group( ) -> Group: """ Update an autoscaling group. - Update the configuration of a specified autoscaling group including name, tags, template, scaling policy, and load balancer settings. + Update the configuration of a specified autoscaling group including + name, tags, template, scaling policy, and load balancer settings. :param group_id: ID of the group to update. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: New name for the group. @@ -282,7 +285,8 @@ def delete_group( ) -> Group: """ Delete an autoscaling group. - Delete a specified autoscaling group and all its associated resources. + Delete a specified autoscaling group and all its associated + resources. :param group_id: ID of the group to delete. :param zone: Zone to target. If none is passed will use default zone from the config. :return: :class:`Group ` @@ -317,8 +321,9 @@ def list_logs( end_time: Optional[datetime] = None, ) -> ListLogsResponse: """ - List group logs. - List logs for a specified autoscaling group to view scaling events and activities. + List autoscaling group logs. + List logs for a specified autoscaling group to view scaling events + and activities. :param group_id: :param zone: Zone to target. If none is passed will use default zone from the config. :param page_token: @@ -361,7 +366,7 @@ def list_servers( page_size: Optional[int] = None, ) -> ListServersResponse: """ - List group servers. + List autoscaling group servers. List all Instances belonging to a specified autoscaling group. :param group_id: :param zone: Zone to target. If none is passed will use default zone from the config. @@ -402,7 +407,7 @@ def list_alerts( project_id: Optional[str] = None, ) -> ListAlertsResponse: """ - List group alerts. + List autoscaling group alerts. List active and historical alerts for a specified autoscaling group. :param zone: Zone to target. If none is passed will use default zone from the config. :param group_id: diff --git a/scaleway/scaleway/instance/v2alpha1/__init__.py b/scaleway/scaleway/instance/v2alpha1/__init__.py index 3d05b58cd..4eda878e9 100644 --- a/scaleway/scaleway/instance/v2alpha1/__init__.py +++ b/scaleway/scaleway/instance/v2alpha1/__init__.py @@ -43,7 +43,7 @@ from .types import CreateServerRequestPublicNetworkInterface from .types import CreateServerRequestServerVolume from .types import PlacementGroup -from .types import PrivateNetworkInterface +from .types import PrivateNetworkInterfaceSummary from .types import SecurityGroupSummary from .types import ServerType from .types import ServerSummary @@ -108,6 +108,7 @@ from .types import ListUserDataKeysRequest from .types import ListUserDataKeysResponse from .types import PauseServerRequest +from .types import PrivateNetworkInterface from .types import RebootServerRequest from .types import ResourceCounts from .types import Server @@ -174,7 +175,7 @@ "CreateServerRequestPublicNetworkInterface", "CreateServerRequestServerVolume", "PlacementGroup", - "PrivateNetworkInterface", + "PrivateNetworkInterfaceSummary", "SecurityGroupSummary", "ServerType", "ServerSummary", @@ -239,6 +240,7 @@ "ListUserDataKeysRequest", "ListUserDataKeysResponse", "PauseServerRequest", + "PrivateNetworkInterface", "RebootServerRequest", "ResourceCounts", "Server", diff --git a/scaleway/scaleway/instance/v2alpha1/api.py b/scaleway/scaleway/instance/v2alpha1/api.py index a6ad0c3a7..e01889ba8 100644 --- a/scaleway/scaleway/instance/v2alpha1/api.py +++ b/scaleway/scaleway/instance/v2alpha1/api.py @@ -88,7 +88,6 @@ from .marshalling import ( unmarshal_SecurityGroup, unmarshal_PlacementGroup, - unmarshal_PrivateNetworkInterface, unmarshal_AddSecurityGroupRulesResponse, unmarshal_ListPlacementGroupsResponse, unmarshal_ListPrivateNetworkInterfacesResponse, @@ -98,6 +97,7 @@ unmarshal_ListTemplateUserDataKeysResponse, unmarshal_ListTemplatesResponse, unmarshal_ListUserDataKeysResponse, + unmarshal_PrivateNetworkInterface, unmarshal_ResourceCounts, unmarshal_Server, unmarshal_Template, diff --git a/scaleway/scaleway/instance/v2alpha1/marshalling.py b/scaleway/scaleway/instance/v2alpha1/marshalling.py index bdbc79859..062eb9bb2 100644 --- a/scaleway/scaleway/instance/v2alpha1/marshalling.py +++ b/scaleway/scaleway/instance/v2alpha1/marshalling.py @@ -14,9 +14,9 @@ SecurityGroupRule, SecurityGroup, PlacementGroup, - PrivateNetworkInterface, AddSecurityGroupRulesResponse, ListPlacementGroupsResponse, + PrivateNetworkInterfaceSummary, ListPrivateNetworkInterfacesResponse, SecurityGroupSummary, ListSecurityGroupsResponse, @@ -30,6 +30,7 @@ TemplateSummary, ListTemplatesResponse, ListUserDataKeysResponse, + PrivateNetworkInterface, ResourceCounts, ServerIP, ServerFilesystem, @@ -339,10 +340,70 @@ def unmarshal_PlacementGroup(data: Any) -> PlacementGroup: return PlacementGroup(**args) -def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: +def unmarshal_AddSecurityGroupRulesResponse(data: Any) -> AddSecurityGroupRulesResponse: if not isinstance(data, dict): raise TypeError( - "Unmarshalling the type 'PrivateNetworkInterface' failed as data isn't a dictionary." + "Unmarshalling the type 'AddSecurityGroupRulesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("added_rules", None) + if field is not None: + args["added_rules"] = ( + [unmarshal_SecurityGroupRule(v) for v in field] + if field is not None + else None + ) + else: + args["added_rules"] = None + + field = data.get("security_group", None) + if field is not None: + args["security_group"] = unmarshal_SecurityGroup(field) + else: + args["security_group"] = None + + return AddSecurityGroupRulesResponse(**args) + + +def unmarshal_ListPlacementGroupsResponse(data: Any) -> ListPlacementGroupsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("placement_groups", None) + if field is not None: + args["placement_groups"] = ( + [unmarshal_PlacementGroup(v) for v in field] if field is not None else None + ) + else: + args["placement_groups"] = None + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + else: + args["total_count"] = None + + field = data.get("next_page_token", None) + if field is not None: + args["next_page_token"] = field + else: + args["next_page_token"] = None + + return ListPlacementGroupsResponse(**args) + + +def unmarshal_PrivateNetworkInterfaceSummary( + data: Any, +) -> PrivateNetworkInterfaceSummary: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PrivateNetworkInterfaceSummary' failed as data isn't a dictionary." ) args: dict[str, Any] = {} @@ -413,65 +474,7 @@ def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: else: args["updated_at"] = None - return PrivateNetworkInterface(**args) - - -def unmarshal_AddSecurityGroupRulesResponse(data: Any) -> AddSecurityGroupRulesResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'AddSecurityGroupRulesResponse' failed as data isn't a dictionary." - ) - - args: dict[str, Any] = {} - - field = data.get("added_rules", None) - if field is not None: - args["added_rules"] = ( - [unmarshal_SecurityGroupRule(v) for v in field] - if field is not None - else None - ) - else: - args["added_rules"] = None - - field = data.get("security_group", None) - if field is not None: - args["security_group"] = unmarshal_SecurityGroup(field) - else: - args["security_group"] = None - - return AddSecurityGroupRulesResponse(**args) - - -def unmarshal_ListPlacementGroupsResponse(data: Any) -> ListPlacementGroupsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary." - ) - - args: dict[str, Any] = {} - - field = data.get("placement_groups", None) - if field is not None: - args["placement_groups"] = ( - [unmarshal_PlacementGroup(v) for v in field] if field is not None else None - ) - else: - args["placement_groups"] = None - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - else: - args["total_count"] = None - - field = data.get("next_page_token", None) - if field is not None: - args["next_page_token"] = field - else: - args["next_page_token"] = None - - return ListPlacementGroupsResponse(**args) + return PrivateNetworkInterfaceSummary(**args) def unmarshal_ListPrivateNetworkInterfacesResponse( @@ -487,7 +490,7 @@ def unmarshal_ListPrivateNetworkInterfacesResponse( field = data.get("private_network_interfaces", None) if field is not None: args["private_network_interfaces"] = ( - [unmarshal_PrivateNetworkInterface(v) for v in field] + [unmarshal_PrivateNetworkInterfaceSummary(v) for v in field] if field is not None else None ) @@ -1115,6 +1118,83 @@ def unmarshal_ListUserDataKeysResponse(data: Any) -> ListUserDataKeysResponse: return ListUserDataKeysResponse(**args) +def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PrivateNetworkInterface' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("private_network_id", None) + if field is not None: + args["private_network_id"] = field + else: + args["private_network_id"] = None + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("server_id", None) + if field is not None: + args["server_id"] = field + else: + args["server_id"] = None + + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + + field = data.get("mac_address", None) + if field is not None: + args["mac_address"] = field + else: + args["mac_address"] = None + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = None + + field = data.get("ip_ids", None) + if field is not None: + args["ip_ids"] = field + else: + args["ip_ids"] = None + + field = data.get("tags", None) + if field is not None: + args["tags"] = field + else: + args["tags"] = None + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + return PrivateNetworkInterface(**args) + + def unmarshal_ResourceCounts(data: Any) -> ResourceCounts: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway/scaleway/instance/v2alpha1/types.py b/scaleway/scaleway/instance/v2alpha1/types.py index 7fe1f5cbf..63351339f 100644 --- a/scaleway/scaleway/instance/v2alpha1/types.py +++ b/scaleway/scaleway/instance/v2alpha1/types.py @@ -392,7 +392,7 @@ class PlacementGroup: @dataclass -class PrivateNetworkInterface: +class PrivateNetworkInterfaceSummary: id: str private_network_id: str project_id: str @@ -962,7 +962,7 @@ class ListPrivateNetworkInterfacesRequest: @dataclass class ListPrivateNetworkInterfacesResponse: - private_network_interfaces: list[PrivateNetworkInterface] + private_network_interfaces: list[PrivateNetworkInterfaceSummary] total_count: int next_page_token: Optional[str] = None @@ -1109,6 +1109,21 @@ class PauseServerRequest: """ +@dataclass +class PrivateNetworkInterface: + id: str + private_network_id: str + project_id: str + server_id: str + security_group_id: str + mac_address: str + status: PrivateNetworkInterfaceStatus + ip_ids: list[str] + tags: list[str] + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + + @dataclass class RebootServerRequest: server_id: str