Skip to content

Commit 3dea806

Browse files
fix(webhosting): add missing post body (#600)
Co-authored-by: Jonathan R. <jremy@scaleway.com>
1 parent bf968a4 commit 3dea806

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
HostingStatus,
1818
ListHostingsRequestOrderBy,
1919
ListOffersRequestOrderBy,
20+
CheckUserOwnsDomainRequest,
2021
CheckUserOwnsDomainResponse,
2122
ControlPanel,
2223
CreateHostingRequest,
@@ -42,6 +43,7 @@
4243
unmarshal_ListOffersResponse,
4344
unmarshal_ResetHostingPasswordResponse,
4445
unmarshal_Session,
46+
marshal_CheckUserOwnsDomainRequest,
4547
marshal_CreateHostingRequest,
4648
marshal_UpdateHostingRequest,
4749
)
@@ -489,9 +491,14 @@ async def check_user_owns_domain(
489491
res = self._request(
490492
"POST",
491493
f"/webhosting/v1/regions/{param_region}/domains/{param_domain}/check-ownership",
492-
params={
493-
"project_id": project_id or self.client.default_project_id,
494-
},
494+
body=marshal_CheckUserOwnsDomainRequest(
495+
CheckUserOwnsDomainRequest(
496+
domain=domain,
497+
region=region,
498+
project_id=project_id,
499+
),
500+
self.client,
501+
),
495502
)
496503

497504
self._throw_on_error(res)

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
ListOffersResponse,
2626
ResetHostingPasswordResponse,
2727
Session,
28+
CheckUserOwnsDomainRequest,
2829
CreateHostingRequestDomainConfiguration,
2930
CreateHostingRequest,
3031
UpdateHostingRequest,
@@ -509,6 +510,18 @@ def unmarshal_Session(data: Any) -> Session:
509510
return Session(**args)
510511

511512

513+
def marshal_CheckUserOwnsDomainRequest(
514+
request: CheckUserOwnsDomainRequest,
515+
defaults: ProfileDefaults,
516+
) -> Dict[str, Any]:
517+
output: Dict[str, Any] = {}
518+
519+
if request.project_id is not None:
520+
output["project_id"] = request.project_id or defaults.default_project_id
521+
522+
return output
523+
524+
512525
def marshal_CreateHostingRequestDomainConfiguration(
513526
request: CreateHostingRequestDomainConfiguration,
514527
defaults: ProfileDefaults,

scaleway/scaleway/webhosting/v1alpha1/api.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
HostingStatus,
1818
ListHostingsRequestOrderBy,
1919
ListOffersRequestOrderBy,
20+
CheckUserOwnsDomainRequest,
2021
CheckUserOwnsDomainResponse,
2122
ControlPanel,
2223
CreateHostingRequest,
@@ -42,6 +43,7 @@
4243
unmarshal_ListOffersResponse,
4344
unmarshal_ResetHostingPasswordResponse,
4445
unmarshal_Session,
46+
marshal_CheckUserOwnsDomainRequest,
4547
marshal_CreateHostingRequest,
4648
marshal_UpdateHostingRequest,
4749
)
@@ -489,9 +491,15 @@ def check_user_owns_domain(
489491
res = self._request(
490492
"POST",
491493
f"/webhosting/v1/regions/{param_region}/domains/{param_domain}/check-ownership",
492-
params={
493-
"project_id": project_id or self.client.default_project_id,
494-
},
494+
body=marshal_CheckUserOwnsDomainRequest(
495+
CheckUserOwnsDomainRequest(
496+
domain=domain,
497+
region=region,
498+
project_id=project_id,
499+
),
500+
self.client,
501+
),
502+
495503
)
496504

497505
self._throw_on_error(res)

scaleway/scaleway/webhosting/v1alpha1/marshalling.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
ListOffersResponse,
2626
ResetHostingPasswordResponse,
2727
Session,
28+
CheckUserOwnsDomainRequest,
2829
CreateHostingRequestDomainConfiguration,
2930
CreateHostingRequest,
3031
UpdateHostingRequest,
@@ -509,6 +510,18 @@ def unmarshal_Session(data: Any) -> Session:
509510
return Session(**args)
510511

511512

513+
def marshal_CheckUserOwnsDomainRequest(
514+
request: CheckUserOwnsDomainRequest,
515+
defaults: ProfileDefaults,
516+
) -> Dict[str, Any]:
517+
output: Dict[str, Any] = {}
518+
519+
if request.project_id is not None:
520+
output["project_id"] = request.project_id or defaults.default_project_id
521+
522+
return output
523+
524+
512525
def marshal_CreateHostingRequestDomainConfiguration(
513526
request: CreateHostingRequestDomainConfiguration,
514527
defaults: ProfileDefaults,

0 commit comments

Comments
 (0)