/** * 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::StorageGateway; using namespace Aws::StorageGateway::Model; namespace Aws { namespace StorageGateway { template<> AWS_STORAGEGATEWAY_API ServiceUnavailableError StorageGatewayError::GetModeledError() { assert(this->GetErrorType() == StorageGatewayErrors::SERVICE_UNAVAILABLE); return ServiceUnavailableError(this->GetJsonPayload().View()); } template<> AWS_STORAGEGATEWAY_API InternalServerError StorageGatewayError::GetModeledError() { assert(this->GetErrorType() == StorageGatewayErrors::INTERNAL_FAILURE); return InternalServerError(this->GetJsonPayload().View()); } template<> AWS_STORAGEGATEWAY_API InvalidGatewayRequestException StorageGatewayError::GetModeledError() { assert(this->GetErrorType() == StorageGatewayErrors::INVALID_GATEWAY_REQUEST); return InvalidGatewayRequestException(this->GetJsonPayload().View()); } namespace StorageGatewayErrorMapper { static const int INVALID_GATEWAY_REQUEST_HASH = HashingUtils::HashString("InvalidGatewayRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INVALID_GATEWAY_REQUEST_HASH) { return AWSError(static_cast(StorageGatewayErrors::INVALID_GATEWAY_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace StorageGatewayErrorMapper } // namespace StorageGateway } // namespace Aws