updateDomainNameservers method

Future<UpdateDomainNameserversResponse> updateDomainNameservers({
  1. required String domainName,
  2. required List<Nameserver> nameservers,
  3. String? fIAuthKey,
})

This operation replaces the current set of name servers for the domain with the specified set of name servers. If you use Amazon Route 53 as your DNS service, specify the four name servers in the delegation set for the hosted zone for the domain.

If successful, this operation returns an operation ID that you can use to track the progress and completion of the action. If the request is not completed successfully, the domain registrant will be notified by email.

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

Parameter domainName : The name of the domain that you want to change name servers for.

Parameter nameservers : A list of new name servers for the domain.

Parameter fIAuthKey : The authorization key for .fi domains

Implementation

Future<UpdateDomainNameserversResponse> updateDomainNameservers({
  required String domainName,
  required List<Nameserver> nameservers,
  String? fIAuthKey,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    0,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(nameservers, 'nameservers');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Domains_v20140515.UpdateDomainNameservers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainName': domainName,
      'Nameservers': nameservers,
      if (fIAuthKey != null) 'FIAuthKey': fIAuthKey,
    },
  );

  return UpdateDomainNameserversResponse.fromJson(jsonResponse.body);
}