Skip to content

Commit cff9b2d

Browse files
chore: formatting (scaleway#1669)
1 parent 0c12257 commit cff9b2d

21 files changed

Lines changed: 119 additions & 121 deletions

File tree

scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,8 @@ async def wait_for_server_private_network(
11061106
options = WaitForOptions()
11071107

11081108
if not options.stop:
1109-
options.stop = (
1110-
lambda res: res.status
1111-
not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES
1109+
options.stop = lambda res: (
1110+
res.status not in SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES
11121111
)
11131112

11141113
return await wait_for_resource_async(

scaleway-async/scaleway_async/container/v1beta1/marshalling.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,6 @@ def unmarshal_Token(data: Any) -> Token:
610610
else:
611611
args["token"] = None
612612

613-
field = data.get("public_key", None)
614-
if field is not None:
615-
args["public_key"] = field
616-
else:
617-
args["public_key"] = None
618-
619613
field = data.get("status", None)
620614
if field is not None:
621615
args["status"] = field
@@ -634,6 +628,12 @@ def unmarshal_Token(data: Any) -> Token:
634628
else:
635629
args["namespace_id"] = None
636630

631+
field = data.get("public_key", None)
632+
if field is not None:
633+
args["public_key"] = field
634+
else:
635+
args["public_key"] = None
636+
637637
field = data.get("description", None)
638638
if field is not None:
639639
args["description"] = field
@@ -1208,9 +1208,6 @@ def marshal_CreateNamespaceRequest(
12081208
) -> dict[str, Any]:
12091209
output: dict[str, Any] = {}
12101210

1211-
if request.activate_vpc_integration is not None:
1212-
output["activate_vpc_integration"] = request.activate_vpc_integration
1213-
12141211
if request.name is not None:
12151212
output["name"] = request.name
12161213

@@ -1234,6 +1231,9 @@ def marshal_CreateNamespaceRequest(
12341231
if request.tags is not None:
12351232
output["tags"] = request.tags
12361233

1234+
if request.activate_vpc_integration is not None:
1235+
output["activate_vpc_integration"] = request.activate_vpc_integration
1236+
12371237
return output
12381238

12391239

scaleway-async/scaleway_async/dedibox/v1/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,8 @@ async def wait_for_server_install(
13521352
options = WaitForOptions()
13531353

13541354
if not options.stop:
1355-
options.stop = (
1356-
lambda res: res.status not in SERVER_INSTALL_TRANSIENT_STATUSES
1355+
options.stop = lambda res: (
1356+
res.status not in SERVER_INSTALL_TRANSIENT_STATUSES
13571357
)
13581358

13591359
return await wait_for_resource_async(

scaleway-async/scaleway_async/domain/v2beta1/marshalling.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ def unmarshal_ContactExtensionIT(data: Any) -> ContactExtensionIT:
316316

317317
args: dict[str, Any] = {}
318318

319+
field = data.get("pin", None)
320+
if field is not None:
321+
args["pin"] = field
322+
else:
323+
args["pin"] = None
324+
319325
field = data.get("european_citizenship", None)
320326
if field is not None:
321327
args["european_citizenship"] = field
@@ -328,12 +334,6 @@ def unmarshal_ContactExtensionIT(data: Any) -> ContactExtensionIT:
328334
else:
329335
args["tax_code"] = None
330336

331-
field = data.get("pin", None)
332-
if field is not None:
333-
args["pin"] = field
334-
else:
335-
args["pin"] = None
336-
337337
return ContactExtensionIT(**args)
338338

339339

@@ -3034,15 +3034,15 @@ def marshal_ContactExtensionIT(
30343034
) -> dict[str, Any]:
30353035
output: dict[str, Any] = {}
30363036

3037+
if request.pin is not None:
3038+
output["pin"] = request.pin
3039+
30373040
if request.european_citizenship is not None:
30383041
output["european_citizenship"] = request.european_citizenship
30393042

30403043
if request.tax_code is not None:
30413044
output["tax_code"] = request.tax_code
30423045

3043-
if request.pin is not None:
3044-
output["pin"] = request.pin
3045-
30463046
return output
30473047

30483048

@@ -3132,11 +3132,6 @@ def marshal_NewContact(
31323132
if request.whois_opt_in is not None:
31333133
output["whois_opt_in"] = request.whois_opt_in
31343134

3135-
if request.questions is not None:
3136-
output["questions"] = [
3137-
marshal_ContactQuestion(item, defaults) for item in request.questions
3138-
]
3139-
31403135
if request.vat_identification_code is not None:
31413136
output["vat_identification_code"] = request.vat_identification_code
31423137

@@ -3166,6 +3161,11 @@ def marshal_NewContact(
31663161
request.extension_it, defaults
31673162
)
31683163

3164+
if request.questions is not None:
3165+
output["questions"] = [
3166+
marshal_ContactQuestion(item, defaults) for item in request.questions
3167+
]
3168+
31693169
return output
31703170

31713171

scaleway-async/scaleway_async/function/v1beta1/marshalling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,6 @@ def unmarshal_Token(data: Any) -> Token:
484484
else:
485485
args["token"] = None
486486

487-
field = data.get("public_key", None)
488-
if field is not None:
489-
args["public_key"] = field
490-
else:
491-
args["public_key"] = None
492-
493487
field = data.get("status", None)
494488
if field is not None:
495489
args["status"] = field
@@ -508,6 +502,12 @@ def unmarshal_Token(data: Any) -> Token:
508502
else:
509503
args["namespace_id"] = None
510504

505+
field = data.get("public_key", None)
506+
if field is not None:
507+
args["public_key"] = field
508+
else:
509+
args["public_key"] = None
510+
511511
field = data.get("description", None)
512512
if field is not None:
513513
args["description"] = field

scaleway-async/scaleway_async/interlink/v1beta1/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ async def wait_for_dedicated_connection(
253253
options = WaitForOptions()
254254

255255
if not options.stop:
256-
options.stop = (
257-
lambda res: res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES
256+
options.stop = lambda res: (
257+
res.status not in DEDICATED_CONNECTION_TRANSIENT_STATUSES
258258
)
259259

260260
return await wait_for_resource_async(

scaleway-async/scaleway_async/lb/v1/marshalling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ def unmarshal_Ip(data: Any) -> Ip:
167167
else:
168168
args["tags"] = []
169169

170-
field = data.get("region", None)
171-
if field is not None:
172-
args["region"] = field
173-
else:
174-
args["region"] = None
175-
176170
field = data.get("zone", None)
177171
if field is not None:
178172
args["zone"] = field
@@ -185,6 +179,12 @@ def unmarshal_Ip(data: Any) -> Ip:
185179
else:
186180
args["lb_id"] = None
187181

182+
field = data.get("region", None)
183+
if field is not None:
184+
args["region"] = field
185+
else:
186+
args["region"] = None
187+
188188
return Ip(**args)
189189

190190

scaleway-async/scaleway_async/vpcgw/v1/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ async def wait_for_gateway_network(
696696
options = WaitForOptions()
697697

698698
if not options.stop:
699-
options.stop = (
700-
lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES
699+
options.stop = lambda res: (
700+
res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES
701701
)
702702

703703
return await wait_for_resource_async(

scaleway-async/scaleway_async/vpcgw/v2/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,8 @@ async def wait_for_gateway_network(
630630
options = WaitForOptions()
631631

632632
if not options.stop:
633-
options.stop = (
634-
lambda res: res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES
633+
options.stop = lambda res: (
634+
res.status not in GATEWAY_NETWORK_TRANSIENT_STATUSES
635635
)
636636

637637
return await wait_for_resource_async(

scaleway-async/scaleway_async/webhosting/v1/marshalling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,18 +1676,18 @@ def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordRes
16761676

16771677
args: dict[str, Any] = {}
16781678

1679-
field = data.get("one_time_password", None)
1680-
if field is not None:
1681-
args["one_time_password"] = field
1682-
else:
1683-
args["one_time_password"] = None
1684-
16851679
field = data.get("one_time_password_b64", None)
16861680
if field is not None:
16871681
args["one_time_password_b64"] = field
16881682
else:
16891683
args["one_time_password_b64"] = None
16901684

1685+
field = data.get("one_time_password", None)
1686+
if field is not None:
1687+
args["one_time_password"] = field
1688+
else:
1689+
args["one_time_password"] = None
1690+
16911691
return ResetHostingPasswordResponse(**args)
16921692

16931693

0 commit comments

Comments
 (0)