-
Notifications
You must be signed in to change notification settings - Fork 478
/
S3Event.cs
227 lines (194 loc) · 7.7 KB
/
S3Event.cs
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
namespace Amazon.Lambda.S3Events
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
/// <summary>
/// AWS S3 event
/// http://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
/// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-s3-put
/// </summary>
public class S3Event
{
/// <summary>
/// Gets and sets the records for the S3 event notification
/// </summary>
public List<S3EventNotificationRecord> Records { get; set; }
/// <summary>
/// The class holds the user identity properties.
/// </summary>
public class UserIdentityEntity
{
/// <summary>
/// Gets and sets the PrincipalId property.
/// </summary>
public string PrincipalId { get; set; }
}
/// <summary>
/// This class contains the identity information for an S3 bucket.
/// </summary>
public class S3BucketEntity
{
/// <summary>
/// Gets and sets the name of the bucket.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets and sets the bucket owner id.
/// </summary>
public UserIdentityEntity OwnerIdentity { get; set; }
/// <summary>
/// Gets and sets the S3 bucket arn.
/// </summary>
public string Arn { get; set; }
}
/// <summary>
/// This class contains the information for an object in S3.
/// </summary>
public class S3ObjectEntity
{
/// <summary>
/// Gets and sets the key for the object stored in S3.
/// </summary>
public string Key { get; set; }
/// <summary>
/// Gets and sets the size of the object in S3.
/// </summary>
public long Size { get; set; }
/// <summary>
/// Gets and sets the etag of the object. This can be used to determine if the object has changed.
/// </summary>
public string ETag { get; set; }
/// <summary>
/// Gets and sets the version id of the object in S3.
/// </summary>
public string VersionId { get; set; }
/// <summary>
/// Gets and sets the sequencer a string representation of a hexadecimal value used to determine event sequence, only used with PUTs and DELETEs.
/// </summary>
public string Sequencer { get; set; }
}
/// <summary>
/// Gets and sets the meta information describing S3.
/// </summary>
public class S3Entity
{
/// <summary>
/// Gets and sets the ConfigurationId. This ID can be found in the bucket notification configuration.
/// </summary>
public string ConfigurationId { get; set; }
/// <summary>
/// Gets and sets the Bucket property.
/// </summary>
public S3BucketEntity Bucket { get; set; }
/// <summary>
/// Gets and sets the Object property.
/// </summary>
public S3ObjectEntity Object { get; set; }
/// <summary>
/// Gets and sets the S3SchemaVersion property.
/// </summary>
public string S3SchemaVersion { get; set; }
}
/// <summary>
/// The class holds the request parameters
/// </summary>
public class RequestParametersEntity
{
/// <summary>
/// Gets and sets the SourceIPAddress. This is the ip address where the request came from.
/// </summary>
public string SourceIPAddress { get; set; }
}
/// <summary>
/// This class holds the response elements.
/// </summary>
[DataContract]
public class ResponseElementsEntity
{
/// <summary>
/// Gets and sets the XAmzId2 Property. This is the Amazon S3 host that processed the request.
/// </summary>
[DataMember(Name = "x-amz-id-2", EmitDefaultValue = false)]
[System.Text.Json.Serialization.JsonPropertyName("x-amz-id-2")]
public string XAmzId2 { get; set; }
/// <summary>
/// Gets and sets the XAmzRequestId. This is the Amazon S3 generated request ID.
/// </summary>
[DataMember(Name = "x-amz-request-id", EmitDefaultValue = false)]
[System.Text.Json.Serialization.JsonPropertyName("x-amz-request-id")]
public string XAmzRequestId { get; set; }
}
/// <summary>
/// The class holds the glacier event data elements.
/// </summary>
public class S3GlacierEventDataEntity
{
/// <summary>
/// Gets and sets the RestoreEventData property.
/// </summary>
public S3RestoreEventDataEntity RestoreEventData { get; set; }
}
/// <summary>
/// The class holds the restore event data elements.
/// </summary>
public class S3RestoreEventDataEntity
{
/// <summary>
/// Gets and sets the LifecycleRestorationExpiryTime the time when the object restoration will be expired.
/// </summary>
public DateTime LifecycleRestorationExpiryTime { get; set; }
/// <summary>
/// Gets and sets the LifecycleRestoreStorageClass the source storage class for restore.
/// </summary>
public string LifecycleRestoreStorageClass { get; set; }
}
/// <summary>
/// The class holds the event notification.
/// </summary>
public class S3EventNotificationRecord
{
/// <summary>
/// Gets and sets the AwsRegion property.
/// </summary>
public string AwsRegion { get; set; }
/// <summary>
/// Gets and sets the EventName property. This identities what type of event occurred.
/// For example for an object just put in S3 this will be set to EventType.ObjectCreatedPut.
/// </summary>
public string EventName { get; set; }
/// <summary>
/// Gets and sets the EventSource property.
/// </summary>
public string EventSource { get; set; }
/// <summary>
/// Gets and sets the EventTime property. The time when S3 finished processing the request.
/// </summary>
public DateTime EventTime { get; set; }
/// <summary>
/// Gets and sets the EventVersion property.
/// </summary>
public string EventVersion { get; set; }
/// <summary>
/// Gets and sets the RequestParameters property.
/// </summary>
public RequestParametersEntity RequestParameters { get; set; }
/// <summary>
/// Gets and sets the ResponseElements property.
/// </summary>
public ResponseElementsEntity ResponseElements { get; set; }
/// <summary>
/// Gets and sets the S3 property.
/// </summary>
public S3Entity S3 { get; set; }
/// <summary>
/// Gets and sets the UserIdentity property.
/// </summary>
public UserIdentityEntity UserIdentity { get; set; }
/// <summary>
/// Get and sets the GlacierEventData property.
/// </summary>
public S3GlacierEventDataEntity GlacierEventData { get; set; }
}
}
}