From 7fdf6eeda53d866567827d793f3144387b001e73 Mon Sep 17 00:00:00 2001 From: Estelle Soulard Date: Fri, 27 Mar 2026 10:37:29 +0100 Subject: [PATCH] chore(instance): handle deprecated_optional fields --- .../scaleway_async/instance/v1/marshalling.py | 36 +++++++++---------- .../scaleway_async/instance/v1/types.py | 20 +++++------ scaleway/scaleway/instance/v1/marshalling.py | 36 +++++++++---------- scaleway/scaleway/instance/v1/types.py | 20 +++++------ 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/scaleway-async/scaleway_async/instance/v1/marshalling.py b/scaleway-async/scaleway_async/instance/v1/marshalling.py index 2e72fdb36..8aabb07a6 100644 --- a/scaleway-async/scaleway_async/instance/v1/marshalling.py +++ b/scaleway-async/scaleway_async/instance/v1/marshalling.py @@ -1108,13 +1108,13 @@ def unmarshal_Server(data: Any) -> Server: if field is not None: args["routed_ip_enabled"] = field else: - args["routed_ip_enabled"] = False + args["routed_ip_enabled"] = None field = data.get("enable_ipv6", None) if field is not None: args["enable_ipv6"] = field else: - args["enable_ipv6"] = False + args["enable_ipv6"] = None field = data.get("image", None) if field is not None: @@ -1472,7 +1472,7 @@ def unmarshal_SecurityGroup(data: Any) -> SecurityGroup: if field is not None: args["organization_default"] = field else: - args["organization_default"] = False + args["organization_default"] = None field = data.get("creation_date", None) if field is not None: @@ -1905,85 +1905,85 @@ def unmarshal_Dashboard(data: Any) -> Dashboard: if field is not None: args["volumes_count"] = field else: - args["volumes_count"] = None + args["volumes_count"] = 0 field = data.get("running_servers_count", None) if field is not None: args["running_servers_count"] = field else: - args["running_servers_count"] = None + args["running_servers_count"] = 0 field = data.get("servers_by_types", None) if field is not None: args["servers_by_types"] = field else: - args["servers_by_types"] = None + args["servers_by_types"] = {} field = data.get("images_count", None) if field is not None: args["images_count"] = field else: - args["images_count"] = None + args["images_count"] = 0 field = data.get("snapshots_count", None) if field is not None: args["snapshots_count"] = field else: - args["snapshots_count"] = None + args["snapshots_count"] = 0 field = data.get("servers_count", None) if field is not None: args["servers_count"] = field else: - args["servers_count"] = None + args["servers_count"] = 0 field = data.get("ips_count", None) if field is not None: args["ips_count"] = field else: - args["ips_count"] = None + args["ips_count"] = 0 field = data.get("security_groups_count", None) if field is not None: args["security_groups_count"] = field else: - args["security_groups_count"] = None + args["security_groups_count"] = 0 field = data.get("ips_unused", None) if field is not None: args["ips_unused"] = field else: - args["ips_unused"] = None + args["ips_unused"] = 0 field = data.get("volumes_l_ssd_count", None) if field is not None: args["volumes_l_ssd_count"] = field else: - args["volumes_l_ssd_count"] = None + args["volumes_l_ssd_count"] = 0 field = data.get("volumes_l_ssd_total_size", None) if field is not None: args["volumes_l_ssd_total_size"] = field else: - args["volumes_l_ssd_total_size"] = None + args["volumes_l_ssd_total_size"] = 0 field = data.get("private_nics_count", None) if field is not None: args["private_nics_count"] = field else: - args["private_nics_count"] = None + args["private_nics_count"] = 0 field = data.get("placement_groups_count", None) if field is not None: args["placement_groups_count"] = field else: - args["placement_groups_count"] = None + args["placement_groups_count"] = 0 field = data.get("volumes_scratch_count", None) if field is not None: args["volumes_scratch_count"] = field else: - args["volumes_scratch_count"] = None + args["volumes_scratch_count"] = 0 field = data.get("volumes_b_ssd_count", None) if field is not None: @@ -2662,7 +2662,7 @@ def unmarshal_ServerType(data: Any) -> ServerType: if field is not None: args["monthly_price"] = field else: - args["monthly_price"] = 0.0 + args["monthly_price"] = None field = data.get("hourly_price", None) if field is not None: diff --git a/scaleway-async/scaleway_async/instance/v1/types.py b/scaleway-async/scaleway_async/instance/v1/types.py index 4470ba522..a21f0f80b 100644 --- a/scaleway-async/scaleway_async/instance/v1/types.py +++ b/scaleway-async/scaleway_async/instance/v1/types.py @@ -879,12 +879,12 @@ class Server: Instance creation date. """ - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None """ True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`). """ @@ -1064,7 +1064,7 @@ class SecurityGroup: Zone in which the security group is located. """ - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None """ True if it is your default security group for this Organization ID. """ @@ -1329,7 +1329,7 @@ class ServerType: True if this Instance type has reached end of service. """ - monthly_price: Optional[float] = 0.0 + monthly_price: Optional[float] = None """ Estimated monthly price, for a 30 days month, in Euro. """ @@ -1724,7 +1724,7 @@ class CreateSecurityGroupRequest: organization: Optional[str] = None - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None project_default: Optional[bool] = False @@ -1803,7 +1803,7 @@ class CreateServerRequest: By default, `dynamic_ip_required` is true, a dynamic ip is attached to the instance (if no flexible ip is already attached). """ - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ If true, configure the Instance so it uses the new routed IP mode. """ @@ -1818,7 +1818,7 @@ class CreateServerRequest: Volumes attached to the server. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None """ True if IPv6 is enabled on the server (deprecated and always `False` when `routed_ip_enabled` is `True`). """ @@ -3354,7 +3354,7 @@ class UpdateSecurityGroupRequest: Tags of the security group. """ - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None """ Please use project_default instead. """ @@ -3469,7 +3469,7 @@ class UpdateServerRequest: volumes: Optional[dict[str, VolumeServerTemplate]] = field(default_factory=dict) dynamic_ip_required: Optional[bool] = False - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False). """ @@ -3479,7 +3479,7 @@ class UpdateServerRequest: A list of reserved IP IDs to attach to the Instance. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None protected: Optional[bool] = False """ True to activate server protection option. diff --git a/scaleway/scaleway/instance/v1/marshalling.py b/scaleway/scaleway/instance/v1/marshalling.py index 2e72fdb36..8aabb07a6 100644 --- a/scaleway/scaleway/instance/v1/marshalling.py +++ b/scaleway/scaleway/instance/v1/marshalling.py @@ -1108,13 +1108,13 @@ def unmarshal_Server(data: Any) -> Server: if field is not None: args["routed_ip_enabled"] = field else: - args["routed_ip_enabled"] = False + args["routed_ip_enabled"] = None field = data.get("enable_ipv6", None) if field is not None: args["enable_ipv6"] = field else: - args["enable_ipv6"] = False + args["enable_ipv6"] = None field = data.get("image", None) if field is not None: @@ -1472,7 +1472,7 @@ def unmarshal_SecurityGroup(data: Any) -> SecurityGroup: if field is not None: args["organization_default"] = field else: - args["organization_default"] = False + args["organization_default"] = None field = data.get("creation_date", None) if field is not None: @@ -1905,85 +1905,85 @@ def unmarshal_Dashboard(data: Any) -> Dashboard: if field is not None: args["volumes_count"] = field else: - args["volumes_count"] = None + args["volumes_count"] = 0 field = data.get("running_servers_count", None) if field is not None: args["running_servers_count"] = field else: - args["running_servers_count"] = None + args["running_servers_count"] = 0 field = data.get("servers_by_types", None) if field is not None: args["servers_by_types"] = field else: - args["servers_by_types"] = None + args["servers_by_types"] = {} field = data.get("images_count", None) if field is not None: args["images_count"] = field else: - args["images_count"] = None + args["images_count"] = 0 field = data.get("snapshots_count", None) if field is not None: args["snapshots_count"] = field else: - args["snapshots_count"] = None + args["snapshots_count"] = 0 field = data.get("servers_count", None) if field is not None: args["servers_count"] = field else: - args["servers_count"] = None + args["servers_count"] = 0 field = data.get("ips_count", None) if field is not None: args["ips_count"] = field else: - args["ips_count"] = None + args["ips_count"] = 0 field = data.get("security_groups_count", None) if field is not None: args["security_groups_count"] = field else: - args["security_groups_count"] = None + args["security_groups_count"] = 0 field = data.get("ips_unused", None) if field is not None: args["ips_unused"] = field else: - args["ips_unused"] = None + args["ips_unused"] = 0 field = data.get("volumes_l_ssd_count", None) if field is not None: args["volumes_l_ssd_count"] = field else: - args["volumes_l_ssd_count"] = None + args["volumes_l_ssd_count"] = 0 field = data.get("volumes_l_ssd_total_size", None) if field is not None: args["volumes_l_ssd_total_size"] = field else: - args["volumes_l_ssd_total_size"] = None + args["volumes_l_ssd_total_size"] = 0 field = data.get("private_nics_count", None) if field is not None: args["private_nics_count"] = field else: - args["private_nics_count"] = None + args["private_nics_count"] = 0 field = data.get("placement_groups_count", None) if field is not None: args["placement_groups_count"] = field else: - args["placement_groups_count"] = None + args["placement_groups_count"] = 0 field = data.get("volumes_scratch_count", None) if field is not None: args["volumes_scratch_count"] = field else: - args["volumes_scratch_count"] = None + args["volumes_scratch_count"] = 0 field = data.get("volumes_b_ssd_count", None) if field is not None: @@ -2662,7 +2662,7 @@ def unmarshal_ServerType(data: Any) -> ServerType: if field is not None: args["monthly_price"] = field else: - args["monthly_price"] = 0.0 + args["monthly_price"] = None field = data.get("hourly_price", None) if field is not None: diff --git a/scaleway/scaleway/instance/v1/types.py b/scaleway/scaleway/instance/v1/types.py index 4470ba522..a21f0f80b 100644 --- a/scaleway/scaleway/instance/v1/types.py +++ b/scaleway/scaleway/instance/v1/types.py @@ -879,12 +879,12 @@ class Server: Instance creation date. """ - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None """ True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`). """ @@ -1064,7 +1064,7 @@ class SecurityGroup: Zone in which the security group is located. """ - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None """ True if it is your default security group for this Organization ID. """ @@ -1329,7 +1329,7 @@ class ServerType: True if this Instance type has reached end of service. """ - monthly_price: Optional[float] = 0.0 + monthly_price: Optional[float] = None """ Estimated monthly price, for a 30 days month, in Euro. """ @@ -1724,7 +1724,7 @@ class CreateSecurityGroupRequest: organization: Optional[str] = None - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None project_default: Optional[bool] = False @@ -1803,7 +1803,7 @@ class CreateServerRequest: By default, `dynamic_ip_required` is true, a dynamic ip is attached to the instance (if no flexible ip is already attached). """ - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ If true, configure the Instance so it uses the new routed IP mode. """ @@ -1818,7 +1818,7 @@ class CreateServerRequest: Volumes attached to the server. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None """ True if IPv6 is enabled on the server (deprecated and always `False` when `routed_ip_enabled` is `True`). """ @@ -3354,7 +3354,7 @@ class UpdateSecurityGroupRequest: Tags of the security group. """ - organization_default: Optional[bool] = False + organization_default: Optional[bool] = None """ Please use project_default instead. """ @@ -3469,7 +3469,7 @@ class UpdateServerRequest: volumes: Optional[dict[str, VolumeServerTemplate]] = field(default_factory=dict) dynamic_ip_required: Optional[bool] = False - routed_ip_enabled: Optional[bool] = False + routed_ip_enabled: Optional[bool] = None """ True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False). """ @@ -3479,7 +3479,7 @@ class UpdateServerRequest: A list of reserved IP IDs to attach to the Instance. """ - enable_ipv6: Optional[bool] = False + enable_ipv6: Optional[bool] = None protected: Optional[bool] = False """ True to activate server protection option.