-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include Kinesis Analytics Events #232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple comments to take care of and then we can get this shipped.
/// The approximate arrival timestamp. | ||
/// </value> | ||
[DataMember(Name = "approximateArrivalTimestamp")] | ||
public long ApproximateArrivalTimestamp { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning longs for dates in .NET makes it hard to use. Users have to understand that it is an Epoch and figure out how to convert from Epoch to DateTime.
We should do what we did for the KinesisFirehoseEvent and rename this property to ApproximateArrivalEpoch and then provide a second read only property called ApproximateArrivalTimestamp that converts the Epoch property to DateTime. Here is the code on how we did this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be cleaner to have the property of the dto of type DateTimeOffset and use a JsonConverter responsible for converting to/from Unix epoch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try in the event POCOs to not have anything specific to Newtonsoft in case we want to swap out the serializer in the future. That is why we use the DataContracts attributes instead of Newtonsoft's attributes.
You are probably right that I should have used DateTimeOffset when creating the KinesisFirehoseEvent but changing now would be breaking and since this is basically the same property I would prefer to be consistent with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
/// The approximate arrival timestamp. | ||
/// </value> | ||
[DataMember(Name = "approximateArrivalTimestamp")] | ||
public long ApproximateArrivalTimestamp { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as before about return dates as long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
public class LambdaDeliveryRecordMetadata | ||
{ | ||
/// <summary> | ||
/// Gets or sets the retry hint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add documentation that says retry hints are the number of delivery retries. Otherwise it is a confusing property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
All merged and NuGet package released https://www.nuget.org/packages/Amazon.Lambda.KinesisAnalyticsEvents/. Thanks for the pull request. |
Including Kinesis Analytics events and response models with tests.