deregisterMailDomain method

Future<void> deregisterMailDomain({
  1. required String domainName,
  2. required String organizationId,
})

Removes a domain from WorkMail, stops email routing to WorkMail, and removes the authorization allowing WorkMail use. SES keeps the domain because other applications may use it. You must first remove any email address used by WorkMail entities before you remove the domain.

May throw InvalidCustomSesConfigurationException. May throw InvalidParameterException. May throw MailDomainInUseException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter domainName : The domain to deregister in WorkMail and SES.

Parameter organizationId : The WorkMail organization for which the domain will be deregistered.

Implementation

Future<void> deregisterMailDomain({
  required String domainName,
  required String organizationId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.DeregisterMailDomain'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainName': domainName,
      'OrganizationId': organizationId,
    },
  );
}