/** * 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 DLM { namespace Model { namespace RetentionIntervalUnitValuesMapper { static const int DAYS_HASH = HashingUtils::HashString("DAYS"); static const int WEEKS_HASH = HashingUtils::HashString("WEEKS"); static const int MONTHS_HASH = HashingUtils::HashString("MONTHS"); static const int YEARS_HASH = HashingUtils::HashString("YEARS"); RetentionIntervalUnitValues GetRetentionIntervalUnitValuesForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == DAYS_HASH) { return RetentionIntervalUnitValues::DAYS; } else if (hashCode == WEEKS_HASH) { return RetentionIntervalUnitValues::WEEKS; } else if (hashCode == MONTHS_HASH) { return RetentionIntervalUnitValues::MONTHS; } else if (hashCode == YEARS_HASH) { return RetentionIntervalUnitValues::YEARS; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return RetentionIntervalUnitValues::NOT_SET; } Aws::String GetNameForRetentionIntervalUnitValues(RetentionIntervalUnitValues enumValue) { switch(enumValue) { case RetentionIntervalUnitValues::DAYS: return "DAYS"; case RetentionIntervalUnitValues::WEEKS: return "WEEKS"; case RetentionIntervalUnitValues::MONTHS: return "MONTHS"; case RetentionIntervalUnitValues::YEARS: return "YEARS"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace RetentionIntervalUnitValuesMapper } // namespace Model } // namespace DLM } // namespace Aws