String login) {
AccessController.ensurePrivilege(login, Privileges.EDIT_MEMBER);
if (contactDetails.size() > Limits.Member.MAX_NUMRECORDS_BULKIMPORT)
throw new APIException(Status.ERROR_OUT_OF_BOUNDS,
"No of records [" + contactDetails.size() + "] is greater than max allowed [" +
Limits.Member.MAX_NUMRECORDS_BULKIMPORT + "]");
SyntaxChecker.ensureValid(contactDetails);
List<String> emails = new ArrayList<>();
Set<String> emailSet = new HashSet<>();
for (ContactDetails contact : contactDetails) {
contact.email = contact.email.toLowerCase(); //email always in lower case
if (emailSet.contains(contact.email))
throw new APIException(Status.ERROR_RESOURCE_INCORRECTLY_SPECIFIED,
"Email [" + contact.email + "] is a duplicate");
emails.add(contact.email);
emailSet.add(contact.email);
}