Created
September 2, 2019 21:06
-
-
Save xximjasonxx/f0dda7ed3e21afad02424e0ece9637b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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