transferDomainToAnotherAwsAccount method

Future<TransferDomainToAnotherAwsAccountResponse> transferDomainToAnotherAwsAccount({
  1. required String accountId,
  2. required String domainName,
})

Transfers a domain from the current AWS account to another AWS account. Note the following:

Use either ListOperations or GetOperationDetail to determine whether the operation succeeded. GetOperationDetail provides additional information, for example, Domain Transfer from Aws Account 111122223333 has been cancelled.

May throw InvalidInput. May throw OperationLimitExceeded. May throw DuplicateRequest.

Parameter accountId : The account ID of the AWS account that you want to transfer the domain to, for example, 111122223333.

Parameter domainName : The name of the domain that you want to transfer from the current AWS account to another account.

Implementation

Future<TransferDomainToAnotherAwsAccountResponse>
    transferDomainToAnotherAwsAccount({
  required String accountId,
  required String domainName,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    0,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'Route53Domains_v20140515.TransferDomainToAnotherAwsAccount'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccountId': accountId,
      'DomainName': domainName,
    },
  );

  return TransferDomainToAnotherAwsAccountResponse.fromJson(
      jsonResponse.body);
}