checkDomainTransferability method

Future<CheckDomainTransferabilityResponse> checkDomainTransferability({
  1. required String domainName,
  2. String? authCode,
})

Checks whether a domain name can be transferred to Amazon Route 53.

May throw InvalidInput. May throw UnsupportedTLD.

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 authCode : If the registrar for the top-level domain (TLD) requires an authorization code to transfer the domain, the code that you got from the current registrar for the domain.

Implementation

Future<CheckDomainTransferabilityResponse> checkDomainTransferability({
  required String domainName,
  String? authCode,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    0,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'authCode',
    authCode,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Domains_v20140515.CheckDomainTransferability'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainName': domainName,
      if (authCode != null) 'AuthCode': authCode,
    },
  );

  return CheckDomainTransferabilityResponse.fromJson(jsonResponse.body);
}