Skip to content

fix(webhosting): add missing post body #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scaleway-async/scaleway_async/webhosting/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
HostingStatus,
ListHostingsRequestOrderBy,
ListOffersRequestOrderBy,
CheckUserOwnsDomainRequest,
CheckUserOwnsDomainResponse,
ControlPanel,
CreateHostingRequest,
Expand All @@ -42,6 +43,7 @@
unmarshal_ListOffersResponse,
unmarshal_ResetHostingPasswordResponse,
unmarshal_Session,
marshal_CheckUserOwnsDomainRequest,
marshal_CreateHostingRequest,
marshal_UpdateHostingRequest,
)
Expand Down Expand Up @@ -489,9 +491,14 @@ async def check_user_owns_domain(
res = self._request(
"POST",
f"/webhosting/v1/regions/{param_region}/domains/{param_domain}/check-ownership",
params={
"project_id": project_id or self.client.default_project_id,
},
body=marshal_CheckUserOwnsDomainRequest(
CheckUserOwnsDomainRequest(
domain=domain,
region=region,
project_id=project_id,
),
self.client,
),
)

self._throw_on_error(res)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ListOffersResponse,
ResetHostingPasswordResponse,
Session,
CheckUserOwnsDomainRequest,
CreateHostingRequestDomainConfiguration,
CreateHostingRequest,
UpdateHostingRequest,
Expand Down Expand Up @@ -509,6 +510,18 @@ def unmarshal_Session(data: Any) -> Session:
return Session(**args)


def marshal_CheckUserOwnsDomainRequest(
request: CheckUserOwnsDomainRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

return output


def marshal_CreateHostingRequestDomainConfiguration(
request: CreateHostingRequestDomainConfiguration,
defaults: ProfileDefaults,
Expand Down
14 changes: 11 additions & 3 deletions scaleway/scaleway/webhosting/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
HostingStatus,
ListHostingsRequestOrderBy,
ListOffersRequestOrderBy,
CheckUserOwnsDomainRequest,
CheckUserOwnsDomainResponse,
ControlPanel,
CreateHostingRequest,
Expand All @@ -42,6 +43,7 @@
unmarshal_ListOffersResponse,
unmarshal_ResetHostingPasswordResponse,
unmarshal_Session,
marshal_CheckUserOwnsDomainRequest,
marshal_CreateHostingRequest,
marshal_UpdateHostingRequest,
)
Expand Down Expand Up @@ -489,9 +491,15 @@ def check_user_owns_domain(
res = self._request(
"POST",
f"/webhosting/v1/regions/{param_region}/domains/{param_domain}/check-ownership",
params={
"project_id": project_id or self.client.default_project_id,
},
body=marshal_CheckUserOwnsDomainRequest(
CheckUserOwnsDomainRequest(
domain=domain,
region=region,
project_id=project_id,
),
self.client,
),

)

self._throw_on_error(res)
Expand Down
13 changes: 13 additions & 0 deletions scaleway/scaleway/webhosting/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ListOffersResponse,
ResetHostingPasswordResponse,
Session,
CheckUserOwnsDomainRequest,
CreateHostingRequestDomainConfiguration,
CreateHostingRequest,
UpdateHostingRequest,
Expand Down Expand Up @@ -509,6 +510,18 @@ def unmarshal_Session(data: Any) -> Session:
return Session(**args)


def marshal_CheckUserOwnsDomainRequest(
request: CheckUserOwnsDomainRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

return output


def marshal_CreateHostingRequestDomainConfiguration(
request: CreateHostingRequestDomainConfiguration,
defaults: ProfileDefaults,
Expand Down