Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Libraries/src/Amazon.Lambda.CloudWatchEvents/S3Events/Bucket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents an S3 bucket.
/// </summary>
public class Bucket
{
/// <summary>
/// The name of the bucket.
/// </summary>
public string Name { get; set; }
}
}
36 changes: 36 additions & 0 deletions Libraries/src/Amazon.Lambda.CloudWatchEvents/S3Events/S3Object.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents an S3 object.
/// </summary>
public class S3Object
{
/// <summary>
/// The key for the object stored in S3.
/// </summary>
public string Key { get; set; }

/// <summary>
/// The size of the object.
/// </summary>
public int Size { get; set; }

/// <summary>
/// The etag of the object.
/// </summary>
public string ETag { get; set; }

/// <summary>
/// The version ID of the object.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("version-id")]
#endif
public string VersionId { get; set; }

/// <summary>
/// A string used to determine event sequence in PUTs and DELETEs.
/// </summary>
public string Sequencer { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents the details of an S3 object create event sent via EventBridge.
/// </summary>
public class S3ObjectCreate : S3ObjectEventDetails
{
/// <summary>
/// The source IP of the API request.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("source-ip-address")]
#endif
public string SourceIpAddress { get; set; }

/// <summary>
/// The reason the event was fired.
/// </summary>
public string Reason { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Amazon.Lambda.CloudWatchEvents;

namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents an S3 object create event sent via EventBridge.
/// </summary>
public class S3ObjectCreateEvent : CloudWatchEvent<S3ObjectCreate> {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents the details of an S3 object delete event sent via EventBridge.
/// </summary>
public class S3ObjectDelete : S3ObjectEventDetails
{
/// <summary>
/// The source IP of the API request.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("source-ip-address")]
#endif
public string SourceIpAddress { get; set; }

/// <summary>
/// The reason the event was fired.
/// </summary>
public string Reason { get; set; }

/// <summary>
/// The type of object deletion event.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("deletion-type")]
#endif
public string DeletionType { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Amazon.Lambda.CloudWatchEvents;

namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents an S3 object delete event sent via EventBridge.
/// </summary>
public class S3ObjectDeleteEvent : CloudWatchEvent<S3ObjectDelete> {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents the details of an S3 object event sent via EventBridge.
/// </summary>
public class S3ObjectEventDetails
{
/// <summary>
/// The version of the event.
/// </summary>
public string Version { get; set; }

/// <summary>
/// The bucket details.
/// </summary>
public Bucket Bucket { get; set; }

/// <summary>
/// The object details.
/// </summary>
public S3Object Object { get; set; }

/// <summary>
/// The ID of the API request.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("request-id")]
#endif
public string RequestId { get; set; }

/// <summary>
/// The ID of the API requester.
/// </summary>
public string Requester { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents the details of an S3 object restore event sent via EventBridge.
/// </summary>
public class S3ObjectRestore : S3ObjectEventDetails
{
/// <summary>
/// The time when the temporary copy of the object will be deleted from S3.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("restore-expiry-time")]
#endif
public string RestoreExpiryTime { get; set; }

/// <summary>
/// The storage class of the object being restored.
/// </summary>
#if NETCOREAPP_3_1
[System.Text.Json.Serialization.JsonPropertyName("source-storage-class")]
#endif
public string SourceStorageClass { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Amazon.Lambda.CloudWatchEvents;

namespace Amazon.Lambda.CloudWatchEvents.S3Events
{
/// <summary>
/// This class represents an S3 object restore event sent via EventBridge.
/// </summary>
public class S3ObjectRestoreEvent : CloudWatchEvent<S3ObjectRestore> {}
}