transferDomain method

Future<TransferDomainResponse> transferDomain({
  1. required ContactDetail adminContact,
  2. required String domainName,
  3. required ContactDetail registrantContact,
  4. required ContactDetail techContact,
  5. String? authCode,
  6. bool? autoRenew,
  7. ContactDetail? billingContact,
  8. int? durationInYears,
  9. String? idnLangCode,
  10. List<Nameserver>? nameservers,
  11. bool? privacyProtectAdminContact,
  12. bool? privacyProtectBillingContact,
  13. bool? privacyProtectRegistrantContact,
  14. bool? privacyProtectTechContact,
})

Transfers a domain from another registrar to Amazon Route 53.

For more information about transferring domains, see the following topics:

If the registrar for your domain is also the DNS service provider for the domain, we highly recommend that you transfer your DNS service to Route 53 or to another DNS service provider before you transfer your registration. Some registrars provide free DNS service when you purchase a domain registration. When you transfer the registration, the previous registrar will not renew your domain registration and could end your DNS service at any time. If the transfer is successful, this method returns an operation ID that you can use to track the progress and completion of the action. If the transfer doesn't complete successfully, the domain registrant will be notified by email.

May throw DomainLimitExceeded. May throw DuplicateRequest. May throw InvalidInput. May throw OperationLimitExceeded. May throw TLDRulesViolation. May throw UnsupportedTLD.

Parameter adminContact : Provides detailed contact information.

Parameter domainName : The name of the domain that you want to transfer to Route 53. The top-level domain (TLD), such as .com, must be a TLD that Route 53 supports. For a list of supported TLDs, see Domains that You Can Register with Amazon Route 53 in the Amazon Route 53 Developer Guide.

The domain name can contain only the following characters:

  • Letters a through z. Domain names are not case sensitive.
  • Numbers 0 through 9.
  • Hyphen (-). You can't specify a hyphen at the beginning or end of a label.
  • Period (.) to separate the labels in the name, such as the . in example.com.

Parameter registrantContact : Provides detailed contact information.

Parameter techContact : Provides detailed contact information.

Parameter authCode : The authorization code for the domain. You get this value from the current registrar.

Parameter autoRenew : Indicates whether the domain will be automatically renewed (true) or not (false). Auto renewal only takes effect after the account is charged.

Default: true

Parameter billingContact : Provides detailed contact information.

Parameter durationInYears : Reserved for future use.

Currently, the effect of a domain transfer on the registration period varies by TLD. For information about how transferring a domain affects the expiration date, see the Transfer Term column in the pricing information at Amazon Route 53 Pricing.

Default: 1

Parameter idnLangCode : Reserved for future use.

Parameter nameservers : Contains details for the host and glue IP addresses.

Parameter privacyProtectAdminContact : Whether you want to conceal contact information from WHOIS queries. If you specify true, WHOIS ("who is") queries return contact information for the registrar, the phrase "REDACTED FOR PRIVACY", or "On behalf of

Parameter privacyProtectBillingContact : Whether you want to conceal contact information from WHOIS queries. If you specify true, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify false, WHOIS queries return the information that you entered for the billing contact.

Parameter privacyProtectRegistrantContact : Whether you want to conceal contact information from WHOIS queries. If you specify true, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify false, WHOIS queries return the information that you entered for the registrant contact (domain owner). Default: true

Parameter privacyProtectTechContact : Whether you want to conceal contact information from WHOIS queries. If you specify true, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify false, WHOIS queries return the information that you entered for the technical contact. Default: true

Implementation

Future<TransferDomainResponse> transferDomain({
  required ContactDetail adminContact,
  required String domainName,
  required ContactDetail registrantContact,
  required ContactDetail techContact,
  String? authCode,
  bool? autoRenew,
  ContactDetail? billingContact,
  int? durationInYears,
  String? idnLangCode,
  List<Nameserver>? nameservers,
  bool? privacyProtectAdminContact,
  bool? privacyProtectBillingContact,
  bool? privacyProtectRegistrantContact,
  bool? privacyProtectTechContact,
}) async {
  _s.validateNumRange(
    'durationInYears',
    durationInYears,
    1,
    10,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Domains_v20140515.TransferDomain'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AdminContact': adminContact,
      'DomainName': domainName,
      'RegistrantContact': registrantContact,
      'TechContact': techContact,
      if (authCode != null) 'AuthCode': authCode,
      if (autoRenew != null) 'AutoRenew': autoRenew,
      if (billingContact != null) 'BillingContact': billingContact,
      if (durationInYears != null) 'DurationInYears': durationInYears,
      if (idnLangCode != null) 'IdnLangCode': idnLangCode,
      if (nameservers != null) 'Nameservers': nameservers,
      if (privacyProtectAdminContact != null)
        'PrivacyProtectAdminContact': privacyProtectAdminContact,
      if (privacyProtectBillingContact != null)
        'PrivacyProtectBillingContact': privacyProtectBillingContact,
      if (privacyProtectRegistrantContact != null)
        'PrivacyProtectRegistrantContact': privacyProtectRegistrantContact,
      if (privacyProtectTechContact != null)
        'PrivacyProtectTechContact': privacyProtectTechContact,
    },
  );

  return TransferDomainResponse.fromJson(jsonResponse.body);
}