Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created September 2, 2019 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/f0dda7ed3e21afad02424e0ece9637b4 to your computer and use it in GitHub Desktop.
Save xximjasonxx/f0dda7ed3e21afad02424e0ece9637b4 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
namespace AnalyzeImageFunction
{
public class SnsRecord
{
public ICollection<SnsS3Model> Records { get; set; }
}
public class SnsS3Model
{
public S3Model S3 { get; set; }
}
public class S3Model
{
public S3BucketModel Bucket { get; set; }
public S3ObjectModel Object { get; set; }
}
public class S3BucketModel
{
public string Name { get; set; }
}
public class S3ObjectModel
{
public string Key { get; set; }
}
}
// usage
var snsData = JsonConvert.DeserializeObject<SnsRecord>(evnt.Records?[0].Sns.Message);
var s3Data = snsData.Records.ElementAt(0).S3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment