/** * 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 Inspector2 { namespace Model { namespace ReportFormatMapper { static const int CSV_HASH = HashingUtils::HashString("CSV"); static const int JSON_HASH = HashingUtils::HashString("JSON"); ReportFormat GetReportFormatForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CSV_HASH) { return ReportFormat::CSV; } else if (hashCode == JSON_HASH) { return ReportFormat::JSON; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ReportFormat::NOT_SET; } Aws::String GetNameForReportFormat(ReportFormat enumValue) { switch(enumValue) { case ReportFormat::CSV: return "CSV"; case ReportFormat::JSON: return "JSON"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ReportFormatMapper } // namespace Model } // namespace Inspector2 } // namespace Aws