diff --git a/scaleway-async/scaleway_async/domain/v2beta1/__init__.py b/scaleway-async/scaleway_async/domain/v2beta1/__init__.py index f1082555..f8bbd9db 100644 --- a/scaleway-async/scaleway_async/domain/v2beta1/__init__.py +++ b/scaleway-async/scaleway_async/domain/v2beta1/__init__.py @@ -156,6 +156,7 @@ from .types import RegistrarApiLockDomainTransferRequest from .types import RegistrarApiRegisterExternalDomainRequest from .types import RegistrarApiRenewDomainsRequest +from .types import RegistrarApiRetryInboundTransferRequest from .types import RegistrarApiSearchAvailableDomainsRequest from .types import RegistrarApiTradeDomainRequest from .types import RegistrarApiTransferInDomainRequest @@ -165,6 +166,7 @@ from .types import RegistrarApiUpdateDomainRequest from .types import RestoreDNSZoneVersionRequest from .types import RestoreDNSZoneVersionResponse +from .types import RetryInboundTransferResponse from .types import SearchAvailableDomainsResponse from .types import UpdateDNSZoneNameserversRequest from .types import UpdateDNSZoneNameserversResponse @@ -331,6 +333,7 @@ "RegistrarApiLockDomainTransferRequest", "RegistrarApiRegisterExternalDomainRequest", "RegistrarApiRenewDomainsRequest", + "RegistrarApiRetryInboundTransferRequest", "RegistrarApiSearchAvailableDomainsRequest", "RegistrarApiTradeDomainRequest", "RegistrarApiTransferInDomainRequest", @@ -340,6 +343,7 @@ "RegistrarApiUpdateDomainRequest", "RestoreDNSZoneVersionRequest", "RestoreDNSZoneVersionResponse", + "RetryInboundTransferResponse", "SearchAvailableDomainsResponse", "UpdateDNSZoneNameserversRequest", "UpdateDNSZoneNameserversResponse", diff --git a/scaleway-async/scaleway_async/domain/v2beta1/api.py b/scaleway-async/scaleway_async/domain/v2beta1/api.py index 1ed64a0e..29b79a08 100644 --- a/scaleway-async/scaleway_async/domain/v2beta1/api.py +++ b/scaleway-async/scaleway_async/domain/v2beta1/api.py @@ -86,6 +86,7 @@ RegistrarApiEnableDomainDNSSECRequest, RegistrarApiRegisterExternalDomainRequest, RegistrarApiRenewDomainsRequest, + RegistrarApiRetryInboundTransferRequest, RegistrarApiTradeDomainRequest, RegistrarApiTransferInDomainRequest, RegistrarApiUpdateContactRequest, @@ -93,6 +94,7 @@ RegistrarApiUpdateDomainRequest, RenewableDomain, RestoreDNSZoneVersionResponse, + RetryInboundTransferResponse, SSLCertificate, SearchAvailableDomainsResponse, Task, @@ -142,6 +144,7 @@ unmarshal_RefreshDNSZoneResponse, unmarshal_RegisterExternalDomainResponse, unmarshal_RestoreDNSZoneVersionResponse, + unmarshal_RetryInboundTransferResponse, unmarshal_SearchAvailableDomainsResponse, unmarshal_UpdateDNSZoneNameserversResponse, unmarshal_UpdateDNSZoneRecordsResponse, @@ -157,6 +160,7 @@ marshal_RegistrarApiEnableDomainDNSSECRequest, marshal_RegistrarApiRegisterExternalDomainRequest, marshal_RegistrarApiRenewDomainsRequest, + marshal_RegistrarApiRetryInboundTransferRequest, marshal_RegistrarApiTradeDomainRequest, marshal_RegistrarApiTransferInDomainRequest, marshal_RegistrarApiUpdateContactRequest, @@ -1555,6 +1559,45 @@ async def list_inbound_transfers_all( }, ) + async def retry_inbound_transfer( + self, + *, + domain: str, + project_id: Optional[str] = None, + auth_code: Optional[str] = None, + ) -> RetryInboundTransferResponse: + """ + Retry the inbound transfer of a domain. + Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS. + :param domain: The domain being transfered. + :param project_id: The project ID to associated with the inbound transfer. + :param auth_code: An optional new auth code to replace the previous one for the retry. + :return: :class:`RetryInboundTransferResponse ` + + Usage: + :: + + result = await api.retry_inbound_transfer( + domain="example", + ) + """ + + res = self._request( + "POST", + "/domain/v2beta1/retry-inbound-transfer", + body=marshal_RegistrarApiRetryInboundTransferRequest( + RegistrarApiRetryInboundTransferRequest( + domain=domain, + project_id=project_id, + auth_code=auth_code, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_RetryInboundTransferResponse(res.json()) + async def buy_domains( self, *, diff --git a/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py b/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py index 031a7350..37441a25 100644 --- a/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py +++ b/scaleway-async/scaleway_async/domain/v2beta1/marshalling.py @@ -91,6 +91,7 @@ RefreshDNSZoneResponse, RegisterExternalDomainResponse, RestoreDNSZoneVersionResponse, + RetryInboundTransferResponse, AvailableDomain, SearchAvailableDomainsResponse, UpdateDNSZoneNameserversResponse, @@ -112,6 +113,7 @@ RegistrarApiEnableDomainDNSSECRequest, RegistrarApiRegisterExternalDomainRequest, RegistrarApiRenewDomainsRequest, + RegistrarApiRetryInboundTransferRequest, RegistrarApiTradeDomainRequest, TransferInDomainRequestTransferRequest, RegistrarApiTransferInDomainRequest, @@ -2539,6 +2541,17 @@ def unmarshal_RestoreDNSZoneVersionResponse(data: Any) -> RestoreDNSZoneVersionR return RestoreDNSZoneVersionResponse(**args) +def unmarshal_RetryInboundTransferResponse(data: Any) -> RetryInboundTransferResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'RetryInboundTransferResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return RetryInboundTransferResponse(**args) + + def unmarshal_AvailableDomain(data: Any) -> AvailableDomain: if not isinstance(data, dict): raise TypeError( @@ -3305,6 +3318,26 @@ def marshal_RegistrarApiRenewDomainsRequest( return output +def marshal_RegistrarApiRetryInboundTransferRequest( + request: RegistrarApiRetryInboundTransferRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.domain is not None: + output["domain"] = request.domain + + if request.project_id is not None: + output["project_id"] = request.project_id + else: + output["project_id"] = defaults.default_project_id + + if request.auth_code is not None: + output["auth_code"] = request.auth_code + + return output + + def marshal_RegistrarApiTradeDomainRequest( request: RegistrarApiTradeDomainRequest, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/domain/v2beta1/types.py b/scaleway-async/scaleway_async/domain/v2beta1/types.py index 5e697c29..f8d96983 100644 --- a/scaleway-async/scaleway_async/domain/v2beta1/types.py +++ b/scaleway-async/scaleway_async/domain/v2beta1/types.py @@ -1677,6 +1677,24 @@ class RegistrarApiRenewDomainsRequest: force_late_renewal: Optional[bool] = False +@dataclass +class RegistrarApiRetryInboundTransferRequest: + domain: str + """ + The domain being transfered. + """ + + project_id: Optional[str] = None + """ + The project ID to associated with the inbound transfer. + """ + + auth_code: Optional[str] = None + """ + An optional new auth code to replace the previous one for the retry. + """ + + @dataclass class RegistrarApiSearchAvailableDomainsRequest: domains: list[str] @@ -1785,6 +1803,11 @@ class RestoreDNSZoneVersionResponse: pass +@dataclass +class RetryInboundTransferResponse: + pass + + @dataclass class SearchAvailableDomainsResponse: available_domains: list[AvailableDomain] diff --git a/scaleway/scaleway/domain/v2beta1/__init__.py b/scaleway/scaleway/domain/v2beta1/__init__.py index f1082555..f8bbd9db 100644 --- a/scaleway/scaleway/domain/v2beta1/__init__.py +++ b/scaleway/scaleway/domain/v2beta1/__init__.py @@ -156,6 +156,7 @@ from .types import RegistrarApiLockDomainTransferRequest from .types import RegistrarApiRegisterExternalDomainRequest from .types import RegistrarApiRenewDomainsRequest +from .types import RegistrarApiRetryInboundTransferRequest from .types import RegistrarApiSearchAvailableDomainsRequest from .types import RegistrarApiTradeDomainRequest from .types import RegistrarApiTransferInDomainRequest @@ -165,6 +166,7 @@ from .types import RegistrarApiUpdateDomainRequest from .types import RestoreDNSZoneVersionRequest from .types import RestoreDNSZoneVersionResponse +from .types import RetryInboundTransferResponse from .types import SearchAvailableDomainsResponse from .types import UpdateDNSZoneNameserversRequest from .types import UpdateDNSZoneNameserversResponse @@ -331,6 +333,7 @@ "RegistrarApiLockDomainTransferRequest", "RegistrarApiRegisterExternalDomainRequest", "RegistrarApiRenewDomainsRequest", + "RegistrarApiRetryInboundTransferRequest", "RegistrarApiSearchAvailableDomainsRequest", "RegistrarApiTradeDomainRequest", "RegistrarApiTransferInDomainRequest", @@ -340,6 +343,7 @@ "RegistrarApiUpdateDomainRequest", "RestoreDNSZoneVersionRequest", "RestoreDNSZoneVersionResponse", + "RetryInboundTransferResponse", "SearchAvailableDomainsResponse", "UpdateDNSZoneNameserversRequest", "UpdateDNSZoneNameserversResponse", diff --git a/scaleway/scaleway/domain/v2beta1/api.py b/scaleway/scaleway/domain/v2beta1/api.py index 30edc1f9..13d9d837 100644 --- a/scaleway/scaleway/domain/v2beta1/api.py +++ b/scaleway/scaleway/domain/v2beta1/api.py @@ -86,6 +86,7 @@ RegistrarApiEnableDomainDNSSECRequest, RegistrarApiRegisterExternalDomainRequest, RegistrarApiRenewDomainsRequest, + RegistrarApiRetryInboundTransferRequest, RegistrarApiTradeDomainRequest, RegistrarApiTransferInDomainRequest, RegistrarApiUpdateContactRequest, @@ -93,6 +94,7 @@ RegistrarApiUpdateDomainRequest, RenewableDomain, RestoreDNSZoneVersionResponse, + RetryInboundTransferResponse, SSLCertificate, SearchAvailableDomainsResponse, Task, @@ -142,6 +144,7 @@ unmarshal_RefreshDNSZoneResponse, unmarshal_RegisterExternalDomainResponse, unmarshal_RestoreDNSZoneVersionResponse, + unmarshal_RetryInboundTransferResponse, unmarshal_SearchAvailableDomainsResponse, unmarshal_UpdateDNSZoneNameserversResponse, unmarshal_UpdateDNSZoneRecordsResponse, @@ -157,6 +160,7 @@ marshal_RegistrarApiEnableDomainDNSSECRequest, marshal_RegistrarApiRegisterExternalDomainRequest, marshal_RegistrarApiRenewDomainsRequest, + marshal_RegistrarApiRetryInboundTransferRequest, marshal_RegistrarApiTradeDomainRequest, marshal_RegistrarApiTransferInDomainRequest, marshal_RegistrarApiUpdateContactRequest, @@ -1553,6 +1557,45 @@ def list_inbound_transfers_all( }, ) + def retry_inbound_transfer( + self, + *, + domain: str, + project_id: Optional[str] = None, + auth_code: Optional[str] = None, + ) -> RetryInboundTransferResponse: + """ + Retry the inbound transfer of a domain. + Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS. + :param domain: The domain being transfered. + :param project_id: The project ID to associated with the inbound transfer. + :param auth_code: An optional new auth code to replace the previous one for the retry. + :return: :class:`RetryInboundTransferResponse ` + + Usage: + :: + + result = api.retry_inbound_transfer( + domain="example", + ) + """ + + res = self._request( + "POST", + "/domain/v2beta1/retry-inbound-transfer", + body=marshal_RegistrarApiRetryInboundTransferRequest( + RegistrarApiRetryInboundTransferRequest( + domain=domain, + project_id=project_id, + auth_code=auth_code, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_RetryInboundTransferResponse(res.json()) + def buy_domains( self, *, diff --git a/scaleway/scaleway/domain/v2beta1/marshalling.py b/scaleway/scaleway/domain/v2beta1/marshalling.py index 031a7350..37441a25 100644 --- a/scaleway/scaleway/domain/v2beta1/marshalling.py +++ b/scaleway/scaleway/domain/v2beta1/marshalling.py @@ -91,6 +91,7 @@ RefreshDNSZoneResponse, RegisterExternalDomainResponse, RestoreDNSZoneVersionResponse, + RetryInboundTransferResponse, AvailableDomain, SearchAvailableDomainsResponse, UpdateDNSZoneNameserversResponse, @@ -112,6 +113,7 @@ RegistrarApiEnableDomainDNSSECRequest, RegistrarApiRegisterExternalDomainRequest, RegistrarApiRenewDomainsRequest, + RegistrarApiRetryInboundTransferRequest, RegistrarApiTradeDomainRequest, TransferInDomainRequestTransferRequest, RegistrarApiTransferInDomainRequest, @@ -2539,6 +2541,17 @@ def unmarshal_RestoreDNSZoneVersionResponse(data: Any) -> RestoreDNSZoneVersionR return RestoreDNSZoneVersionResponse(**args) +def unmarshal_RetryInboundTransferResponse(data: Any) -> RetryInboundTransferResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'RetryInboundTransferResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return RetryInboundTransferResponse(**args) + + def unmarshal_AvailableDomain(data: Any) -> AvailableDomain: if not isinstance(data, dict): raise TypeError( @@ -3305,6 +3318,26 @@ def marshal_RegistrarApiRenewDomainsRequest( return output +def marshal_RegistrarApiRetryInboundTransferRequest( + request: RegistrarApiRetryInboundTransferRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.domain is not None: + output["domain"] = request.domain + + if request.project_id is not None: + output["project_id"] = request.project_id + else: + output["project_id"] = defaults.default_project_id + + if request.auth_code is not None: + output["auth_code"] = request.auth_code + + return output + + def marshal_RegistrarApiTradeDomainRequest( request: RegistrarApiTradeDomainRequest, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/domain/v2beta1/types.py b/scaleway/scaleway/domain/v2beta1/types.py index 5e697c29..f8d96983 100644 --- a/scaleway/scaleway/domain/v2beta1/types.py +++ b/scaleway/scaleway/domain/v2beta1/types.py @@ -1677,6 +1677,24 @@ class RegistrarApiRenewDomainsRequest: force_late_renewal: Optional[bool] = False +@dataclass +class RegistrarApiRetryInboundTransferRequest: + domain: str + """ + The domain being transfered. + """ + + project_id: Optional[str] = None + """ + The project ID to associated with the inbound transfer. + """ + + auth_code: Optional[str] = None + """ + An optional new auth code to replace the previous one for the retry. + """ + + @dataclass class RegistrarApiSearchAvailableDomainsRequest: domains: list[str] @@ -1785,6 +1803,11 @@ class RestoreDNSZoneVersionResponse: pass +@dataclass +class RetryInboundTransferResponse: + pass + + @dataclass class SearchAvailableDomainsResponse: available_domains: list[AvailableDomain]