enableUser method

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

Enables a user in the user pool. After being enabled, users can sign in to AppStream 2.0 and open applications from the stacks to which they are assigned.

May throw ResourceNotFoundException. May throw InvalidAccountStatusException.

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

Parameter userName : The email address of the user.

Implementation

Future<void> enableUser({
  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.EnableUser'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AuthenticationType': authenticationType.toValue(),
      'UserName': userName,
    },
  );
}