/** * 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 CodeArtifact { namespace Model { namespace PackageFormatMapper { static const int npm_HASH = HashingUtils::HashString("npm"); static const int pypi_HASH = HashingUtils::HashString("pypi"); static const int maven_HASH = HashingUtils::HashString("maven"); PackageFormat GetPackageFormatForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == npm_HASH) { return PackageFormat::npm; } else if (hashCode == pypi_HASH) { return PackageFormat::pypi; } else if (hashCode == maven_HASH) { return PackageFormat::maven; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return PackageFormat::NOT_SET; } Aws::String GetNameForPackageFormat(PackageFormat enumValue) { switch(enumValue) { case PackageFormat::npm: return "npm"; case PackageFormat::pypi: return "pypi"; case PackageFormat::maven: return "maven"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace PackageFormatMapper } // namespace Model } // namespace CodeArtifact } // namespace Aws