deleteUserPoolDomain method

Future<void> deleteUserPoolDomain({
  1. required String domain,
  2. required String userPoolId,
})

Given a user pool ID and domain identifier, deletes a user pool domain. After you delete a user pool domain, your managed login pages and authorization server are no longer available.

May throw ConcurrentModificationException. May throw InternalErrorException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw OperationNotEnabledException. May throw ResourceNotFoundException.

Parameter domain : The domain that you want to delete. For custom domains, this is the fully-qualified domain name like auth.example.com. For Amazon Cognito prefix domains, this is the prefix alone, like myprefix.

Parameter userPoolId : The ID of the user pool where you want to delete the domain.

Implementation

Future<void> deleteUserPoolDomain({
  required String domain,
  required String userPoolId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.DeleteUserPoolDomain'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Domain': domain,
      'UserPoolId': userPoolId,
    },
  );
}