disableUser method

Future<void> disableUser({
  1. required AuthenticationType authenticationType,
  2. required String userName,
})

Disables the specified user in the user pool. Users can't sign in to AppStream 2.0 until they are re-enabled. This action does not delete the user.

May throw ResourceNotFoundException.

Parameter authenticationType : The authentication type for the user. You must specify USERPOOL.

Parameter userName : The email address of the user.

Implementation

Future<void> disableUser({
  required AuthenticationType authenticationType,
  required String userName,
}) async {
  ArgumentError.checkNotNull(authenticationType, 'authenticationType');
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.DisableUser'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AuthenticationType': authenticationType.toValue(),
      'UserName': userName,
    },
  );
}