SseKmsEncryptedObjectsStatus.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. * SPDX-License-Identifier: Apache-2.0.
  4. */
  5. #include <aws/s3/model/SseKmsEncryptedObjectsStatus.h>
  6. #include <aws/core/utils/HashingUtils.h>
  7. #include <aws/core/Globals.h>
  8. #include <aws/core/utils/EnumParseOverflowContainer.h>
  9. using namespace Aws::Utils;
  10. namespace Aws
  11. {
  12. namespace S3
  13. {
  14. namespace Model
  15. {
  16. namespace SseKmsEncryptedObjectsStatusMapper
  17. {
  18. static const int Enabled_HASH = HashingUtils::HashString("Enabled");
  19. static const int Disabled_HASH = HashingUtils::HashString("Disabled");
  20. SseKmsEncryptedObjectsStatus GetSseKmsEncryptedObjectsStatusForName(const Aws::String& name)
  21. {
  22. int hashCode = HashingUtils::HashString(name.c_str());
  23. if (hashCode == Enabled_HASH)
  24. {
  25. return SseKmsEncryptedObjectsStatus::Enabled;
  26. }
  27. else if (hashCode == Disabled_HASH)
  28. {
  29. return SseKmsEncryptedObjectsStatus::Disabled;
  30. }
  31. EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
  32. if(overflowContainer)
  33. {
  34. overflowContainer->StoreOverflow(hashCode, name);
  35. return static_cast<SseKmsEncryptedObjectsStatus>(hashCode);
  36. }
  37. return SseKmsEncryptedObjectsStatus::NOT_SET;
  38. }
  39. Aws::String GetNameForSseKmsEncryptedObjectsStatus(SseKmsEncryptedObjectsStatus enumValue)
  40. {
  41. switch(enumValue)
  42. {
  43. case SseKmsEncryptedObjectsStatus::Enabled:
  44. return "Enabled";
  45. case SseKmsEncryptedObjectsStatus::Disabled:
  46. return "Disabled";
  47. default:
  48. EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
  49. if(overflowContainer)
  50. {
  51. return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
  52. }
  53. return {};
  54. }
  55. }
  56. } // namespace SseKmsEncryptedObjectsStatusMapper
  57. } // namespace Model
  58. } // namespace S3
  59. } // namespace Aws