resetPassword method

Future<void> resetPassword({
  1. required String organizationId,
  2. required String password,
  3. required String userId,
})

Allows the administrator to reset the password for a user.

May throw DirectoryServiceAuthenticationFailedException. May throw DirectoryUnavailableException. May throw EntityNotFoundException. May throw EntityStateException. May throw InvalidParameterException. May throw InvalidPasswordException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw UnsupportedOperationException.

Parameter organizationId : The identifier of the organization that contains the user for which the password is reset.

Parameter password : The new password for the user.

Parameter userId : The identifier of the user for whom the password is reset.

Implementation

Future<void> resetPassword({
  required String organizationId,
  required String password,
  required String userId,
}) async {
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  ArgumentError.checkNotNull(password, 'password');
  _s.validateStringLength(
    'password',
    password,
    0,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userId, 'userId');
  _s.validateStringLength(
    'userId',
    userId,
    12,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.ResetPassword'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OrganizationId': organizationId,
      'Password': password,
      'UserId': userId,
    },
  );
}