using System.Collections.Generic;
public static void Main()
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<RecordCollection>(JSON);
string key = data.Records.First().S3.Object.Key;
public static string JSON = @"{
""eventVersion"": ""2.1"",
""eventSource"": ""aws:s3"",
""awsRegion"": ""us-east-1"",
""eventTime"": ""2023-12-05T17:23:02.224Z"",
""eventName"": ""ObjectCreated:Put"",
""principalId"": ""AWS:AROAS5H3QG7KOVIL3BB2:AKhan@acme.com""
""sourceIPAddress"": ""165.225.37.34""
""x-amz-request-id"": ""FRWTRYC074JJJNQ"",
""x-amz-id-2"": ""FeHspqXTy4RoPNzWRqoz6bx9oBGODiKnBjHdf/RgnahoWVQ2c/wO/qnb84oNfiiftMCBOoZGsGvYMNQ+z/gFV47dZEW3eHtYKZYU+uB45Ao""
""s3SchemaVersion"": ""1.0"",
""configurationId"": ""AS400Sqs"",
""name"": ""oola-as400"",
""principalId"": ""A2Y4V7DQVMOJS""
""arn"": ""arn:aws:s3:::oola-as400""
""key"": ""C0067391_test1_new.xml"",
""eTag"": ""c6715fc835acab3281f93c42e66c3f5"",
""sequencer"": ""00656F5C762884679""
public class RecordCollection
public List<EventRecord> Records { get;set; }
public string EventVersion { get;set; }
public S3 S3 { get;set; }
public string S3SchemaVersion { get;set; }
public string ConfigurationId { get;set; }
public Entry Object { get;set; }
public string Key { get;set; }
public string Size { get;set; }
public string ETag { get;set; }
public string Sequencer { get;set; }