aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/source/model/Event.cpp
blob: e6aa390f59f023d4d756971caa51ae15c100c51e (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#include <aws/s3/model/Event.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 S3
  {
    namespace Model
    {
      namespace EventMapper
      {

        static const int s3_ReducedRedundancyLostObject_HASH = HashingUtils::HashString("s3:ReducedRedundancyLostObject");
        static const int s3_ObjectCreated_HASH = HashingUtils::HashString("s3:ObjectCreated:*");
        static const int s3_ObjectCreated_Put_HASH = HashingUtils::HashString("s3:ObjectCreated:Put");
        static const int s3_ObjectCreated_Post_HASH = HashingUtils::HashString("s3:ObjectCreated:Post");
        static const int s3_ObjectCreated_Copy_HASH = HashingUtils::HashString("s3:ObjectCreated:Copy");
        static const int s3_ObjectCreated_CompleteMultipartUpload_HASH = HashingUtils::HashString("s3:ObjectCreated:CompleteMultipartUpload");
        static const int s3_ObjectRemoved_HASH = HashingUtils::HashString("s3:ObjectRemoved:*");
        static const int s3_ObjectRemoved_Delete_HASH = HashingUtils::HashString("s3:ObjectRemoved:Delete");
        static const int s3_ObjectRemoved_DeleteMarkerCreated_HASH = HashingUtils::HashString("s3:ObjectRemoved:DeleteMarkerCreated");
        static const int s3_ObjectRestore_HASH = HashingUtils::HashString("s3:ObjectRestore:*");
        static const int s3_ObjectRestore_Post_HASH = HashingUtils::HashString("s3:ObjectRestore:Post");
        static const int s3_ObjectRestore_Completed_HASH = HashingUtils::HashString("s3:ObjectRestore:Completed");
        static const int s3_Replication_HASH = HashingUtils::HashString("s3:Replication:*");
        static const int s3_Replication_OperationFailedReplication_HASH = HashingUtils::HashString("s3:Replication:OperationFailedReplication");
        static const int s3_Replication_OperationNotTracked_HASH = HashingUtils::HashString("s3:Replication:OperationNotTracked");
        static const int s3_Replication_OperationMissedThreshold_HASH = HashingUtils::HashString("s3:Replication:OperationMissedThreshold");
        static const int s3_Replication_OperationReplicatedAfterThreshold_HASH = HashingUtils::HashString("s3:Replication:OperationReplicatedAfterThreshold");
        static const int s3_ObjectRestore_Delete_HASH = HashingUtils::HashString("s3:ObjectRestore:Delete");
        static const int s3_LifecycleTransition_HASH = HashingUtils::HashString("s3:LifecycleTransition");
        static const int s3_IntelligentTiering_HASH = HashingUtils::HashString("s3:IntelligentTiering");
        static const int s3_ObjectAcl_Put_HASH = HashingUtils::HashString("s3:ObjectAcl:Put");
        static const int s3_LifecycleExpiration_HASH = HashingUtils::HashString("s3:LifecycleExpiration:*");
        static const int s3_LifecycleExpiration_Delete_HASH = HashingUtils::HashString("s3:LifecycleExpiration:Delete");
        static const int s3_LifecycleExpiration_DeleteMarkerCreated_HASH = HashingUtils::HashString("s3:LifecycleExpiration:DeleteMarkerCreated");
        static const int s3_ObjectTagging_HASH = HashingUtils::HashString("s3:ObjectTagging:*");
        static const int s3_ObjectTagging_Put_HASH = HashingUtils::HashString("s3:ObjectTagging:Put");
        static const int s3_ObjectTagging_Delete_HASH = HashingUtils::HashString("s3:ObjectTagging:Delete");


        Event GetEventForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == s3_ReducedRedundancyLostObject_HASH)
          {
            return Event::s3_ReducedRedundancyLostObject;
          }
          else if (hashCode == s3_ObjectCreated_HASH)
          {
            return Event::s3_ObjectCreated;
          }
          else if (hashCode == s3_ObjectCreated_Put_HASH)
          {
            return Event::s3_ObjectCreated_Put;
          }
          else if (hashCode == s3_ObjectCreated_Post_HASH)
          {
            return Event::s3_ObjectCreated_Post;
          }
          else if (hashCode == s3_ObjectCreated_Copy_HASH)
          {
            return Event::s3_ObjectCreated_Copy;
          }
          else if (hashCode == s3_ObjectCreated_CompleteMultipartUpload_HASH)
          {
            return Event::s3_ObjectCreated_CompleteMultipartUpload;
          }
          else if (hashCode == s3_ObjectRemoved_HASH)
          {
            return Event::s3_ObjectRemoved;
          }
          else if (hashCode == s3_ObjectRemoved_Delete_HASH)
          {
            return Event::s3_ObjectRemoved_Delete;
          }
          else if (hashCode == s3_ObjectRemoved_DeleteMarkerCreated_HASH)
          {
            return Event::s3_ObjectRemoved_DeleteMarkerCreated;
          }
          else if (hashCode == s3_ObjectRestore_HASH)
          {
            return Event::s3_ObjectRestore;
          }
          else if (hashCode == s3_ObjectRestore_Post_HASH)
          {
            return Event::s3_ObjectRestore_Post;
          }
          else if (hashCode == s3_ObjectRestore_Completed_HASH)
          {
            return Event::s3_ObjectRestore_Completed;
          }
          else if (hashCode == s3_Replication_HASH)
          {
            return Event::s3_Replication;
          }
          else if (hashCode == s3_Replication_OperationFailedReplication_HASH)
          {
            return Event::s3_Replication_OperationFailedReplication;
          }
          else if (hashCode == s3_Replication_OperationNotTracked_HASH)
          {
            return Event::s3_Replication_OperationNotTracked;
          }
          else if (hashCode == s3_Replication_OperationMissedThreshold_HASH)
          {
            return Event::s3_Replication_OperationMissedThreshold;
          }
          else if (hashCode == s3_Replication_OperationReplicatedAfterThreshold_HASH)
          {
            return Event::s3_Replication_OperationReplicatedAfterThreshold;
          }
          else if (hashCode == s3_ObjectRestore_Delete_HASH)
          {
            return Event::s3_ObjectRestore_Delete;
          }
          else if (hashCode == s3_LifecycleTransition_HASH)
          {
            return Event::s3_LifecycleTransition;
          }
          else if (hashCode == s3_IntelligentTiering_HASH)
          {
            return Event::s3_IntelligentTiering;
          }
          else if (hashCode == s3_ObjectAcl_Put_HASH)
          {
            return Event::s3_ObjectAcl_Put;
          }
          else if (hashCode == s3_LifecycleExpiration_HASH)
          {
            return Event::s3_LifecycleExpiration;
          }
          else if (hashCode == s3_LifecycleExpiration_Delete_HASH)
          {
            return Event::s3_LifecycleExpiration_Delete;
          }
          else if (hashCode == s3_LifecycleExpiration_DeleteMarkerCreated_HASH)
          {
            return Event::s3_LifecycleExpiration_DeleteMarkerCreated;
          }
          else if (hashCode == s3_ObjectTagging_HASH)
          {
            return Event::s3_ObjectTagging;
          }
          else if (hashCode == s3_ObjectTagging_Put_HASH)
          {
            return Event::s3_ObjectTagging_Put;
          }
          else if (hashCode == s3_ObjectTagging_Delete_HASH)
          {
            return Event::s3_ObjectTagging_Delete;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<Event>(hashCode);
          }

          return Event::NOT_SET;
        }

        Aws::String GetNameForEvent(Event enumValue)
        {
          switch(enumValue)
          {
          case Event::s3_ReducedRedundancyLostObject:
            return "s3:ReducedRedundancyLostObject";
          case Event::s3_ObjectCreated:
            return "s3:ObjectCreated:*";
          case Event::s3_ObjectCreated_Put:
            return "s3:ObjectCreated:Put";
          case Event::s3_ObjectCreated_Post:
            return "s3:ObjectCreated:Post";
          case Event::s3_ObjectCreated_Copy:
            return "s3:ObjectCreated:Copy";
          case Event::s3_ObjectCreated_CompleteMultipartUpload:
            return "s3:ObjectCreated:CompleteMultipartUpload";
          case Event::s3_ObjectRemoved:
            return "s3:ObjectRemoved:*";
          case Event::s3_ObjectRemoved_Delete:
            return "s3:ObjectRemoved:Delete";
          case Event::s3_ObjectRemoved_DeleteMarkerCreated:
            return "s3:ObjectRemoved:DeleteMarkerCreated";
          case Event::s3_ObjectRestore:
            return "s3:ObjectRestore:*";
          case Event::s3_ObjectRestore_Post:
            return "s3:ObjectRestore:Post";
          case Event::s3_ObjectRestore_Completed:
            return "s3:ObjectRestore:Completed";
          case Event::s3_Replication:
            return "s3:Replication:*";
          case Event::s3_Replication_OperationFailedReplication:
            return "s3:Replication:OperationFailedReplication";
          case Event::s3_Replication_OperationNotTracked:
            return "s3:Replication:OperationNotTracked";
          case Event::s3_Replication_OperationMissedThreshold:
            return "s3:Replication:OperationMissedThreshold";
          case Event::s3_Replication_OperationReplicatedAfterThreshold:
            return "s3:Replication:OperationReplicatedAfterThreshold";
          case Event::s3_ObjectRestore_Delete:
            return "s3:ObjectRestore:Delete";
          case Event::s3_LifecycleTransition:
            return "s3:LifecycleTransition";
          case Event::s3_IntelligentTiering:
            return "s3:IntelligentTiering";
          case Event::s3_ObjectAcl_Put:
            return "s3:ObjectAcl:Put";
          case Event::s3_LifecycleExpiration:
            return "s3:LifecycleExpiration:*";
          case Event::s3_LifecycleExpiration_Delete:
            return "s3:LifecycleExpiration:Delete";
          case Event::s3_LifecycleExpiration_DeleteMarkerCreated:
            return "s3:LifecycleExpiration:DeleteMarkerCreated";
          case Event::s3_ObjectTagging:
            return "s3:ObjectTagging:*";
          case Event::s3_ObjectTagging_Put:
            return "s3:ObjectTagging:Put";
          case Event::s3_ObjectTagging_Delete:
            return "s3:ObjectTagging:Delete";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace EventMapper
    } // namespace Model
  } // namespace S3
} // namespace Aws