/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::PinpointEmail; namespace Aws { namespace PinpointEmail { namespace PinpointEmailErrorMapper { static const int NOT_FOUND_HASH = HashingUtils::HashString("NotFoundException"); static const int MESSAGE_REJECTED_HASH = HashingUtils::HashString("MessageRejected"); static const int SENDING_PAUSED_HASH = HashingUtils::HashString("SendingPausedException"); static const int MAIL_FROM_DOMAIN_NOT_VERIFIED_HASH = HashingUtils::HashString("MailFromDomainNotVerifiedException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); static const int ALREADY_EXISTS_HASH = HashingUtils::HashString("AlreadyExistsException"); static const int TOO_MANY_REQUESTS_HASH = HashingUtils::HashString("TooManyRequestsException"); static const int CONCURRENT_MODIFICATION_HASH = HashingUtils::HashString("ConcurrentModificationException"); static const int BAD_REQUEST_HASH = HashingUtils::HashString("BadRequestException"); static const int ACCOUNT_SUSPENDED_HASH = HashingUtils::HashString("AccountSuspendedException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == NOT_FOUND_HASH) { return AWSError(static_cast(PinpointEmailErrors::NOT_FOUND), false); } else if (hashCode == MESSAGE_REJECTED_HASH) { return AWSError(static_cast(PinpointEmailErrors::MESSAGE_REJECTED), false); } else if (hashCode == SENDING_PAUSED_HASH) { return AWSError(static_cast(PinpointEmailErrors::SENDING_PAUSED), false); } else if (hashCode == MAIL_FROM_DOMAIN_NOT_VERIFIED_HASH) { return AWSError(static_cast(PinpointEmailErrors::MAIL_FROM_DOMAIN_NOT_VERIFIED), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(PinpointEmailErrors::LIMIT_EXCEEDED), true); } else if (hashCode == ALREADY_EXISTS_HASH) { return AWSError(static_cast(PinpointEmailErrors::ALREADY_EXISTS), false); } else if (hashCode == TOO_MANY_REQUESTS_HASH) { return AWSError(static_cast(PinpointEmailErrors::TOO_MANY_REQUESTS), true); } else if (hashCode == CONCURRENT_MODIFICATION_HASH) { return AWSError(static_cast(PinpointEmailErrors::CONCURRENT_MODIFICATION), false); } else if (hashCode == BAD_REQUEST_HASH) { return AWSError(static_cast(PinpointEmailErrors::BAD_REQUEST), false); } else if (hashCode == ACCOUNT_SUSPENDED_HASH) { return AWSError(static_cast(PinpointEmailErrors::ACCOUNT_SUSPENDED), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace PinpointEmailErrorMapper } // namespace PinpointEmail } // namespace Aws