-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add S3Event #354
Add S3Event #354
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.
Thanks!
|
||
object S3EventRecord { | ||
|
||
implicit private val instantDecoder: Decoder[Instant] = Decoder[String].map(Instant.parse(_)) |
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.
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.
Probably, looks quite similar. I'll try, the test covers 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.
Yes, that works. Though, I had to keep the implicit val to prevent feral.lambda.events.instantDecoder
from being used.
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.
Oh I see, there was a conflict with this one 🤔
feral/lambda/shared/src/main/scala/feral/lambda/events/package.scala
Lines 26 to 27 in cbd83ba
implicit lazy val instantDecoder: Decoder[Instant] = | |
Decoder.decodeBigDecimal.emapTry { millis => |
Maybe we should make that one not implicit 🤔 anyway, that can be a follow-up PR.
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.
#356 could be that follow-up (or preparation) PR for this one.
} | ||
|
||
final case class S3EventRecordGlacierRestoreEventData( | ||
lifecycleRestorationExpiryTime: String, |
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.
Should this also be an Instant
?
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.
Yes, according to Event message structure it's a time in ISO-8601 format as well.
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.
Thank you for your contribution! I will release this shortly.
This PR adds case classes and json-decoders for
S3Event
. This allows S3 to trigger the lambda function as described here.