|
17 | 17 | HostingStatus, |
18 | 18 | ListHostingsRequestOrderBy, |
19 | 19 | ListOffersRequestOrderBy, |
| 20 | + CheckUserOwnsDomainResponse, |
20 | 21 | ControlPanel, |
21 | 22 | CreateHostingRequest, |
22 | 23 | CreateHostingRequestDomainConfiguration, |
|
34 | 35 | ) |
35 | 36 | from .marshalling import ( |
36 | 37 | unmarshal_Hosting, |
| 38 | + unmarshal_CheckUserOwnsDomainResponse, |
37 | 39 | unmarshal_DnsRecords, |
38 | 40 | unmarshal_ListControlPanelsResponse, |
39 | 41 | unmarshal_ListHostingsResponse, |
@@ -457,6 +459,44 @@ async def get_domain_dns_records( |
457 | 459 | self._throw_on_error(res) |
458 | 460 | return unmarshal_DnsRecords(res.json()) |
459 | 461 |
|
| 462 | + async def check_user_owns_domain( |
| 463 | + self, |
| 464 | + *, |
| 465 | + domain: str, |
| 466 | + region: Optional[Region] = None, |
| 467 | + project_id: Optional[str] = None, |
| 468 | + ) -> CheckUserOwnsDomainResponse: |
| 469 | + """ |
| 470 | + "Check whether you own this domain or not.". |
| 471 | + :param domain: Domain for which ownership is to be verified. |
| 472 | + :param region: Region to target. If none is passed will use default region from the config. |
| 473 | + :param project_id: ID of the project currently in use. |
| 474 | + :return: :class:`CheckUserOwnsDomainResponse <CheckUserOwnsDomainResponse>` |
| 475 | +
|
| 476 | + Usage: |
| 477 | + :: |
| 478 | +
|
| 479 | + result = await api.check_user_owns_domain( |
| 480 | + domain="example", |
| 481 | + ) |
| 482 | + """ |
| 483 | + |
| 484 | + param_region = validate_path_param( |
| 485 | + "region", region or self.client.default_region |
| 486 | + ) |
| 487 | + param_domain = validate_path_param("domain", domain) |
| 488 | + |
| 489 | + res = self._request( |
| 490 | + "POST", |
| 491 | + 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 | + }, |
| 495 | + ) |
| 496 | + |
| 497 | + self._throw_on_error(res) |
| 498 | + return unmarshal_CheckUserOwnsDomainResponse(res.json()) |
| 499 | + |
460 | 500 | async def list_offers( |
461 | 501 | self, |
462 | 502 | *, |
|
0 commit comments