/** * 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 Glacier { namespace Model { namespace StorageClassMapper { static const int STANDARD_HASH = HashingUtils::HashString("STANDARD"); static const int REDUCED_REDUNDANCY_HASH = HashingUtils::HashString("REDUCED_REDUNDANCY"); static const int STANDARD_IA_HASH = HashingUtils::HashString("STANDARD_IA"); StorageClass GetStorageClassForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == STANDARD_HASH) { return StorageClass::STANDARD; } else if (hashCode == REDUCED_REDUNDANCY_HASH) { return StorageClass::REDUCED_REDUNDANCY; } else if (hashCode == STANDARD_IA_HASH) { return StorageClass::STANDARD_IA; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return StorageClass::NOT_SET; } Aws::String GetNameForStorageClass(StorageClass enumValue) { switch(enumValue) { case StorageClass::STANDARD: return "STANDARD"; case StorageClass::REDUCED_REDUNDANCY: return "REDUCED_REDUNDANCY"; case StorageClass::STANDARD_IA: return "STANDARD_IA"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace StorageClassMapper } // namespace Model } // namespace Glacier } // namespace Aws