summaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-sqs/source/model/MessageSystemAttributeName.cpp
blob: 67da7f863589496b6637505391d8855539e34c96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#include <aws/sqs/model/MessageSystemAttributeName.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;


namespace Aws
{
  namespace SQS
  {
    namespace Model
    {
      namespace MessageSystemAttributeNameMapper
      {

        static const int SenderId_HASH = HashingUtils::HashString("SenderId");
        static const int SentTimestamp_HASH = HashingUtils::HashString("SentTimestamp");
        static const int ApproximateReceiveCount_HASH = HashingUtils::HashString("ApproximateReceiveCount");
        static const int ApproximateFirstReceiveTimestamp_HASH = HashingUtils::HashString("ApproximateFirstReceiveTimestamp");
        static const int SequenceNumber_HASH = HashingUtils::HashString("SequenceNumber");
        static const int MessageDeduplicationId_HASH = HashingUtils::HashString("MessageDeduplicationId");
        static const int MessageGroupId_HASH = HashingUtils::HashString("MessageGroupId");
        static const int AWSTraceHeader_HASH = HashingUtils::HashString("AWSTraceHeader");


        MessageSystemAttributeName GetMessageSystemAttributeNameForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == SenderId_HASH)
          {
            return MessageSystemAttributeName::SenderId;
          }
          else if (hashCode == SentTimestamp_HASH)
          {
            return MessageSystemAttributeName::SentTimestamp;
          }
          else if (hashCode == ApproximateReceiveCount_HASH)
          {
            return MessageSystemAttributeName::ApproximateReceiveCount;
          }
          else if (hashCode == ApproximateFirstReceiveTimestamp_HASH)
          {
            return MessageSystemAttributeName::ApproximateFirstReceiveTimestamp;
          }
          else if (hashCode == SequenceNumber_HASH)
          {
            return MessageSystemAttributeName::SequenceNumber;
          }
          else if (hashCode == MessageDeduplicationId_HASH)
          {
            return MessageSystemAttributeName::MessageDeduplicationId;
          }
          else if (hashCode == MessageGroupId_HASH)
          {
            return MessageSystemAttributeName::MessageGroupId;
          }
          else if (hashCode == AWSTraceHeader_HASH)
          {
            return MessageSystemAttributeName::AWSTraceHeader;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<MessageSystemAttributeName>(hashCode);
          }

          return MessageSystemAttributeName::NOT_SET;
        }

        Aws::String GetNameForMessageSystemAttributeName(MessageSystemAttributeName enumValue)
        {
          switch(enumValue)
          {
          case MessageSystemAttributeName::SenderId:
            return "SenderId";
          case MessageSystemAttributeName::SentTimestamp:
            return "SentTimestamp";
          case MessageSystemAttributeName::ApproximateReceiveCount:
            return "ApproximateReceiveCount";
          case MessageSystemAttributeName::ApproximateFirstReceiveTimestamp:
            return "ApproximateFirstReceiveTimestamp";
          case MessageSystemAttributeName::SequenceNumber:
            return "SequenceNumber";
          case MessageSystemAttributeName::MessageDeduplicationId:
            return "MessageDeduplicationId";
          case MessageSystemAttributeName::MessageGroupId:
            return "MessageGroupId";
          case MessageSystemAttributeName::AWSTraceHeader:
            return "AWSTraceHeader";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace MessageSystemAttributeNameMapper
    } // namespace Model
  } // namespace SQS
} // namespace Aws