From 395682b90b5138fe733c59b644a78ad371e5ffad Mon Sep 17 00:00:00 2001 From: Estelle Soulard Date: Wed, 25 Mar 2026 13:51:40 +0100 Subject: [PATCH] chore: formatting --- .../applesilicon/v1alpha1/api.py | 5 +- .../container/v1beta1/marshalling.py | 18 +++---- .../scaleway_async/dedibox/v1/api.py | 4 +- .../domain/v2beta1/marshalling.py | 28 +++++------ .../function/v1beta1/marshalling.py | 12 ++--- .../scaleway_async/interlink/v1beta1/api.py | 4 +- .../scaleway_async/lb/v1/marshalling.py | 12 ++--- scaleway-async/scaleway_async/vpcgw/v1/api.py | 4 +- scaleway-async/scaleway_async/vpcgw/v2/api.py | 4 +- .../webhosting/v1/marshalling.py | 12 ++--- .../scaleway/applesilicon/v1alpha1/api.py | 5 +- .../scaleway/container/v1beta1/marshalling.py | 18 +++---- scaleway/scaleway/dedibox/v1/api.py | 4 +- .../scaleway/domain/v2beta1/marshalling.py | 16 +++---- .../scaleway/function/v1beta1/marshalling.py | 18 +++---- scaleway/scaleway/instance/v1/custom_api.py | 4 +- scaleway/scaleway/interlink/v1beta1/api.py | 4 +- scaleway/scaleway/lb/v1/marshalling.py | 48 +++++++++---------- scaleway/scaleway/vpcgw/v1/api.py | 4 +- scaleway/scaleway/vpcgw/v2/api.py | 4 +- .../scaleway/webhosting/v1/marshalling.py | 12 ++--- 21 files changed, 119 insertions(+), 121 deletions(-) diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py index 8e0879e09..8a49e6f15 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py @@ -1106,9 +1106,8 @@ async def wait_for_server_private_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status - not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES ) return await wait_for_resource_async( diff --git a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py index e444dd2d3..ff8bb1cd5 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py @@ -610,12 +610,6 @@ def unmarshal_Token(data: Any) -> Token: else: args["token"] = None - field = data.get("public_key", None) - if field is not None: - args["public_key"] = field - else: - args["public_key"] = None - field = data.get("status", None) if field is not None: args["status"] = field @@ -634,6 +628,12 @@ def unmarshal_Token(data: Any) -> Token: else: args["namespace_id"] = None + field = data.get("public_key", None) + if field is not None: + args["public_key"] = field + else: + args["public_key"] = None + field = data.get("description", None) if field is not None: args["description"] = field @@ -1208,9 +1208,6 @@ def marshal_CreateNamespaceRequest( ) -> dict[str, Any]: output: dict[str, Any] = {} - if request.activate_vpc_integration is not None: - output["activate_vpc_integration"] = request.activate_vpc_integration - if request.name is not None: output["name"] = request.name @@ -1234,6 +1231,9 @@ def marshal_CreateNamespaceRequest( if request.tags is not None: output["tags"] = request.tags + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + return output diff --git a/scaleway-async/scaleway_async/dedibox/v1/api.py b/scaleway-async/scaleway_async/dedibox/v1/api.py index a6cf8a81a..90f3e71cb 100644 --- a/scaleway-async/scaleway_async/dedibox/v1/api.py +++ b/scaleway-async/scaleway_async/dedibox/v1/api.py @@ -1352,8 +1352,8 @@ async def wait_for_server_install( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in SERVER_INSTALL_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_INSTALL_TRANSIENT_STATUSES ) return await wait_for_resource_async( diff --git a/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py b/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py index 1d0f4d082..b1df52ff7 100644 --- a/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py +++ b/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py @@ -316,6 +316,12 @@ def unmarshal_ContactExtensionIT(data: Any) -> ContactExtensionIT: args: dict[str, Any] = {} + field = data.get("pin", None) + if field is not None: + args["pin"] = field + else: + args["pin"] = None + field = data.get("european_citizenship", None) if field is not None: args["european_citizenship"] = field @@ -328,12 +334,6 @@ def unmarshal_ContactExtensionIT(data: Any) -> ContactExtensionIT: else: args["tax_code"] = None - field = data.get("pin", None) - if field is not None: - args["pin"] = field - else: - args["pin"] = None - return ContactExtensionIT(**args) @@ -3034,15 +3034,15 @@ def marshal_ContactExtensionIT( ) -> dict[str, Any]: output: dict[str, Any] = {} + if request.pin is not None: + output["pin"] = request.pin + if request.european_citizenship is not None: output["european_citizenship"] = request.european_citizenship if request.tax_code is not None: output["tax_code"] = request.tax_code - if request.pin is not None: - output["pin"] = request.pin - return output @@ -3132,11 +3132,6 @@ def marshal_NewContact( if request.whois_opt_in is not None: output["whois_opt_in"] = request.whois_opt_in - if request.questions is not None: - output["questions"] = [ - marshal_ContactQuestion(item, defaults) for item in request.questions - ] - if request.vat_identification_code is not None: output["vat_identification_code"] = request.vat_identification_code @@ -3166,6 +3161,11 @@ def marshal_NewContact( request.extension_it, defaults ) + if request.questions is not None: + output["questions"] = [ + marshal_ContactQuestion(item, defaults) for item in request.questions + ] + return output diff --git a/scaleway-async/scaleway_async/function/v1beta1/marshalling.py b/scaleway-async/scaleway_async/function/v1beta1/marshalling.py index 9df8e13b0..18f25111e 100644 --- a/scaleway-async/scaleway_async/function/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/function/v1beta1/marshalling.py @@ -484,12 +484,6 @@ def unmarshal_Token(data: Any) -> Token: else: args["token"] = None - field = data.get("public_key", None) - if field is not None: - args["public_key"] = field - else: - args["public_key"] = None - field = data.get("status", None) if field is not None: args["status"] = field @@ -508,6 +502,12 @@ def unmarshal_Token(data: Any) -> Token: else: args["namespace_id"] = None + field = data.get("public_key", None) + if field is not None: + args["public_key"] = field + else: + args["public_key"] = None + field = data.get("description", None) if field is not None: args["description"] = field diff --git a/scaleway-async/scaleway_async/interlink/v1beta1/api.py b/scaleway-async/scaleway_async/interlink/v1beta1/api.py index e0ac46b7e..f2140b4ec 100644 --- a/scaleway-async/scaleway_async/interlink/v1beta1/api.py +++ b/scaleway-async/scaleway_async/interlink/v1beta1/api.py @@ -253,8 +253,8 @@ async def wait_for_dedicated_connection( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES ) return await wait_for_resource_async( diff --git a/scaleway-async/scaleway_async/lb/v1/marshalling.py b/scaleway-async/scaleway_async/lb/v1/marshalling.py index 13215d66e..74c013a69 100644 --- a/scaleway-async/scaleway_async/lb/v1/marshalling.py +++ b/scaleway-async/scaleway_async/lb/v1/marshalling.py @@ -167,12 +167,6 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["tags"] = [] - field = data.get("region", None) - if field is not None: - args["region"] = field - else: - args["region"] = None - field = data.get("zone", None) if field is not None: args["zone"] = field @@ -185,6 +179,12 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["lb_id"] = None + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return Ip(**args) diff --git a/scaleway-async/scaleway_async/vpcgw/v1/api.py b/scaleway-async/scaleway_async/vpcgw/v1/api.py index abd53c64f..92d912273 100644 --- a/scaleway-async/scaleway_async/vpcgw/v1/api.py +++ b/scaleway-async/scaleway_async/vpcgw/v1/api.py @@ -696,8 +696,8 @@ async def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return await wait_for_resource_async( diff --git a/scaleway-async/scaleway_async/vpcgw/v2/api.py b/scaleway-async/scaleway_async/vpcgw/v2/api.py index 7d104ab35..14e427605 100644 --- a/scaleway-async/scaleway_async/vpcgw/v2/api.py +++ b/scaleway-async/scaleway_async/vpcgw/v2/api.py @@ -630,8 +630,8 @@ async def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return await wait_for_resource_async( diff --git a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py index f2f8cdb38..44f87579b 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py @@ -1676,18 +1676,18 @@ def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordRes args: dict[str, Any] = {} - field = data.get("one_time_password", None) - if field is not None: - args["one_time_password"] = field - else: - args["one_time_password"] = None - field = data.get("one_time_password_b64", None) if field is not None: args["one_time_password_b64"] = field else: args["one_time_password_b64"] = None + field = data.get("one_time_password", None) + if field is not None: + args["one_time_password"] = field + else: + args["one_time_password"] = None + return ResetHostingPasswordResponse(**args) diff --git a/scaleway/scaleway/applesilicon/v1alpha1/api.py b/scaleway/scaleway/applesilicon/v1alpha1/api.py index 00eca7991..1972f3ef8 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/api.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/api.py @@ -1104,9 +1104,8 @@ def wait_for_server_private_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status - not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/container/v1beta1/marshalling.py b/scaleway/scaleway/container/v1beta1/marshalling.py index e444dd2d3..ff8bb1cd5 100644 --- a/scaleway/scaleway/container/v1beta1/marshalling.py +++ b/scaleway/scaleway/container/v1beta1/marshalling.py @@ -610,12 +610,6 @@ def unmarshal_Token(data: Any) -> Token: else: args["token"] = None - field = data.get("public_key", None) - if field is not None: - args["public_key"] = field - else: - args["public_key"] = None - field = data.get("status", None) if field is not None: args["status"] = field @@ -634,6 +628,12 @@ def unmarshal_Token(data: Any) -> Token: else: args["namespace_id"] = None + field = data.get("public_key", None) + if field is not None: + args["public_key"] = field + else: + args["public_key"] = None + field = data.get("description", None) if field is not None: args["description"] = field @@ -1208,9 +1208,6 @@ def marshal_CreateNamespaceRequest( ) -> dict[str, Any]: output: dict[str, Any] = {} - if request.activate_vpc_integration is not None: - output["activate_vpc_integration"] = request.activate_vpc_integration - if request.name is not None: output["name"] = request.name @@ -1234,6 +1231,9 @@ def marshal_CreateNamespaceRequest( if request.tags is not None: output["tags"] = request.tags + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + return output diff --git a/scaleway/scaleway/dedibox/v1/api.py b/scaleway/scaleway/dedibox/v1/api.py index f11df7de9..88be35b11 100644 --- a/scaleway/scaleway/dedibox/v1/api.py +++ b/scaleway/scaleway/dedibox/v1/api.py @@ -1350,8 +1350,8 @@ def wait_for_server_install( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in SERVER_INSTALL_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in SERVER_INSTALL_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/domain/v2beta1/marshalling.py b/scaleway/scaleway/domain/v2beta1/marshalling.py index 1d0f4d082..c9b811602 100644 --- a/scaleway/scaleway/domain/v2beta1/marshalling.py +++ b/scaleway/scaleway/domain/v2beta1/marshalling.py @@ -3034,15 +3034,15 @@ def marshal_ContactExtensionIT( ) -> dict[str, Any]: output: dict[str, Any] = {} + if request.pin is not None: + output["pin"] = request.pin + if request.european_citizenship is not None: output["european_citizenship"] = request.european_citizenship if request.tax_code is not None: output["tax_code"] = request.tax_code - if request.pin is not None: - output["pin"] = request.pin - return output @@ -3132,11 +3132,6 @@ def marshal_NewContact( if request.whois_opt_in is not None: output["whois_opt_in"] = request.whois_opt_in - if request.questions is not None: - output["questions"] = [ - marshal_ContactQuestion(item, defaults) for item in request.questions - ] - if request.vat_identification_code is not None: output["vat_identification_code"] = request.vat_identification_code @@ -3166,6 +3161,11 @@ def marshal_NewContact( request.extension_it, defaults ) + if request.questions is not None: + output["questions"] = [ + marshal_ContactQuestion(item, defaults) for item in request.questions + ] + return output diff --git a/scaleway/scaleway/function/v1beta1/marshalling.py b/scaleway/scaleway/function/v1beta1/marshalling.py index 9df8e13b0..fac78836f 100644 --- a/scaleway/scaleway/function/v1beta1/marshalling.py +++ b/scaleway/scaleway/function/v1beta1/marshalling.py @@ -484,12 +484,6 @@ def unmarshal_Token(data: Any) -> Token: else: args["token"] = None - field = data.get("public_key", None) - if field is not None: - args["public_key"] = field - else: - args["public_key"] = None - field = data.get("status", None) if field is not None: args["status"] = field @@ -508,6 +502,12 @@ def unmarshal_Token(data: Any) -> Token: else: args["namespace_id"] = None + field = data.get("public_key", None) + if field is not None: + args["public_key"] = field + else: + args["public_key"] = None + field = data.get("description", None) if field is not None: args["description"] = field @@ -1114,9 +1114,6 @@ def marshal_CreateNamespaceRequest( ) -> dict[str, Any]: output: dict[str, Any] = {} - if request.activate_vpc_integration is not None: - output["activate_vpc_integration"] = request.activate_vpc_integration - if request.name is not None: output["name"] = request.name @@ -1140,6 +1137,9 @@ def marshal_CreateNamespaceRequest( if request.tags is not None: output["tags"] = request.tags + if request.activate_vpc_integration is not None: + output["activate_vpc_integration"] = request.activate_vpc_integration + return output diff --git a/scaleway/scaleway/instance/v1/custom_api.py b/scaleway/scaleway/instance/v1/custom_api.py index 853dcc7af..5c85e86f7 100644 --- a/scaleway/scaleway/instance/v1/custom_api.py +++ b/scaleway/scaleway/instance/v1/custom_api.py @@ -111,7 +111,7 @@ def set_all_server_user_data( server_id: str, user_data: Dict[str, bytes], zone: Optional[ScwZone] = None, - ) -> Optional[None]: + ) -> None: param_zone = validate_path_param("zone", zone or self.client.default_zone) param_server_id = validate_path_param("server_id", server_id) @@ -134,7 +134,7 @@ def set_all_server_user_data( content=user_data[key], ) - return None + return def wait_instance_server(self, server_id: str, zone: ScwZone) -> GetServerResponse: wait_interval = interval diff --git a/scaleway/scaleway/interlink/v1beta1/api.py b/scaleway/scaleway/interlink/v1beta1/api.py index cb5ce9d15..225646c9c 100644 --- a/scaleway/scaleway/interlink/v1beta1/api.py +++ b/scaleway/scaleway/interlink/v1beta1/api.py @@ -251,8 +251,8 @@ def wait_for_dedicated_connection( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/lb/v1/marshalling.py b/scaleway/scaleway/lb/v1/marshalling.py index 13215d66e..649132581 100644 --- a/scaleway/scaleway/lb/v1/marshalling.py +++ b/scaleway/scaleway/lb/v1/marshalling.py @@ -167,12 +167,6 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["tags"] = [] - field = data.get("region", None) - if field is not None: - args["region"] = field - else: - args["region"] = None - field = data.get("zone", None) if field is not None: args["zone"] = field @@ -185,6 +179,12 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["lb_id"] = None + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return Ip(**args) @@ -515,12 +515,6 @@ def unmarshal_Instance(data: Any) -> Instance: else: args["ip_address"] = None - field = data.get("region", None) - if field is not None: - args["region"] = field - else: - args["region"] = None - field = data.get("zone", None) if field is not None: args["zone"] = field @@ -539,6 +533,12 @@ def unmarshal_Instance(data: Any) -> Instance: else: args["updated_at"] = None + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return Instance(**args) @@ -644,12 +644,6 @@ def unmarshal_Lb(data: Any) -> Lb: else: args["route_count"] = 0 - field = data.get("region", None) - if field is not None: - args["region"] = field - else: - args["region"] = None - field = data.get("zone", None) if field is not None: args["zone"] = field @@ -674,6 +668,12 @@ def unmarshal_Lb(data: Any) -> Lb: else: args["updated_at"] = None + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return Lb(**args) @@ -1645,18 +1645,18 @@ def unmarshal_LbType(data: Any) -> LbType: else: args["description"] = None - field = data.get("region", None) - if field is not None: - args["region"] = field - else: - args["region"] = None - field = data.get("zone", None) if field is not None: args["zone"] = field else: args["zone"] = None + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return LbType(**args) diff --git a/scaleway/scaleway/vpcgw/v1/api.py b/scaleway/scaleway/vpcgw/v1/api.py index b04c7a0c1..7fa509d97 100644 --- a/scaleway/scaleway/vpcgw/v1/api.py +++ b/scaleway/scaleway/vpcgw/v1/api.py @@ -694,8 +694,8 @@ def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/vpcgw/v2/api.py b/scaleway/scaleway/vpcgw/v2/api.py index 29ee499ca..102253a73 100644 --- a/scaleway/scaleway/vpcgw/v2/api.py +++ b/scaleway/scaleway/vpcgw/v2/api.py @@ -628,8 +628,8 @@ def wait_for_gateway_network( options = WaitForOptions() if not options.stop: - options.stop = ( - lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES + options.stop = lambda res: ( + res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES ) return wait_for_resource( diff --git a/scaleway/scaleway/webhosting/v1/marshalling.py b/scaleway/scaleway/webhosting/v1/marshalling.py index f2f8cdb38..44f87579b 100644 --- a/scaleway/scaleway/webhosting/v1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1/marshalling.py @@ -1676,18 +1676,18 @@ def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordRes args: dict[str, Any] = {} - field = data.get("one_time_password", None) - if field is not None: - args["one_time_password"] = field - else: - args["one_time_password"] = None - field = data.get("one_time_password_b64", None) if field is not None: args["one_time_password_b64"] = field else: args["one_time_password_b64"] = None + field = data.get("one_time_password", None) + if field is not None: + args["one_time_password"] = field + else: + args["one_time_password"] = None + return ResetHostingPasswordResponse(**args)