/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::PaymentCryptographyData; using namespace Aws::PaymentCryptographyData::Model; namespace Aws { namespace PaymentCryptographyData { template<> AWS_PAYMENTCRYPTOGRAPHYDATA_API ResourceNotFoundException PaymentCryptographyDataError::GetModeledError() { assert(this->GetErrorType() == PaymentCryptographyDataErrors::RESOURCE_NOT_FOUND); return ResourceNotFoundException(this->GetJsonPayload().View()); } template<> AWS_PAYMENTCRYPTOGRAPHYDATA_API ValidationException PaymentCryptographyDataError::GetModeledError() { assert(this->GetErrorType() == PaymentCryptographyDataErrors::VALIDATION); return ValidationException(this->GetJsonPayload().View()); } template<> AWS_PAYMENTCRYPTOGRAPHYDATA_API VerificationFailedException PaymentCryptographyDataError::GetModeledError() { assert(this->GetErrorType() == PaymentCryptographyDataErrors::VERIFICATION_FAILED); return VerificationFailedException(this->GetJsonPayload().View()); } namespace PaymentCryptographyDataErrorMapper { static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int VERIFICATION_FAILED_HASH = HashingUtils::HashString("VerificationFailedException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(PaymentCryptographyDataErrors::INTERNAL_SERVER), false); } else if (hashCode == VERIFICATION_FAILED_HASH) { return AWSError(static_cast(PaymentCryptographyDataErrors::VERIFICATION_FAILED), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace PaymentCryptographyDataErrorMapper } // namespace PaymentCryptographyData } // namespace Aws