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