/** * 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::WorkMailMessageFlow; namespace Aws { namespace WorkMailMessageFlow { namespace WorkMailMessageFlowErrorMapper { static const int MESSAGE_FROZEN_HASH = HashingUtils::HashString("MessageFrozen"); static const int MESSAGE_REJECTED_HASH = HashingUtils::HashString("MessageRejected"); static const int INVALID_CONTENT_LOCATION_HASH = HashingUtils::HashString("InvalidContentLocation"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == MESSAGE_FROZEN_HASH) { return AWSError(static_cast(WorkMailMessageFlowErrors::MESSAGE_FROZEN), false); } else if (hashCode == MESSAGE_REJECTED_HASH) { return AWSError(static_cast(WorkMailMessageFlowErrors::MESSAGE_REJECTED), false); } else if (hashCode == INVALID_CONTENT_LOCATION_HASH) { return AWSError(static_cast(WorkMailMessageFlowErrors::INVALID_CONTENT_LOCATION), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace WorkMailMessageFlowErrorMapper } // namespace WorkMailMessageFlow } // namespace Aws