/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace PrivateNetworks { namespace Model { namespace ValidationExceptionReasonMapper { static const int UNKNOWN_OPERATION_HASH = HashingUtils::HashString("UNKNOWN_OPERATION"); static const int CANNOT_PARSE_HASH = HashingUtils::HashString("CANNOT_PARSE"); static const int CANNOT_ASSUME_ROLE_HASH = HashingUtils::HashString("CANNOT_ASSUME_ROLE"); static const int FIELD_VALIDATION_FAILED_HASH = HashingUtils::HashString("FIELD_VALIDATION_FAILED"); static const int OTHER_HASH = HashingUtils::HashString("OTHER"); ValidationExceptionReason GetValidationExceptionReasonForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == UNKNOWN_OPERATION_HASH) { return ValidationExceptionReason::UNKNOWN_OPERATION; } else if (hashCode == CANNOT_PARSE_HASH) { return ValidationExceptionReason::CANNOT_PARSE; } else if (hashCode == CANNOT_ASSUME_ROLE_HASH) { return ValidationExceptionReason::CANNOT_ASSUME_ROLE; } else if (hashCode == FIELD_VALIDATION_FAILED_HASH) { return ValidationExceptionReason::FIELD_VALIDATION_FAILED; } else if (hashCode == OTHER_HASH) { return ValidationExceptionReason::OTHER; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ValidationExceptionReason::NOT_SET; } Aws::String GetNameForValidationExceptionReason(ValidationExceptionReason enumValue) { switch(enumValue) { case ValidationExceptionReason::UNKNOWN_OPERATION: return "UNKNOWN_OPERATION"; case ValidationExceptionReason::CANNOT_PARSE: return "CANNOT_PARSE"; case ValidationExceptionReason::CANNOT_ASSUME_ROLE: return "CANNOT_ASSUME_ROLE"; case ValidationExceptionReason::FIELD_VALIDATION_FAILED: return "FIELD_VALIDATION_FAILED"; case ValidationExceptionReason::OTHER: return "OTHER"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ValidationExceptionReasonMapper } // namespace Model } // namespace PrivateNetworks } // namespace Aws