Initialize DynamoDBEvent Objects Easily #1700
Labels
feature-request
A feature should be added or improved.
module/lambda-client-lib
p1
This is a high priority issue
queued
Context: Separating this out of #1657. With the change in 3.0.0 to separate the type definitions in Amazon.Lambda.DynamoDBEvents from the equivalent types in the AWS SDK, users may now need to manually convert from the event types to SDK types or vice-versa. For #1657 in versions 3.1.0 and 3.1.1, we addressed the Event -> SDK direction by adding
ToJson
. This issue is now tracking the opposite direction, from SDK (or JSON) -> Event.We have a scenario (testing) where we are building a DynamoDB stream event based of an object - see code
Now I want to return an Dictionary<string, DynamoDBEvent.AttributeValue, but not really sure how I would go about it now that ToAttributeMap() returns a different AttributeValue. What's the best approach here?
Originally posted by @psdanielhosseini in #1657 (comment)
Any workaround using AWSSDK.DynamoDBv2 would be fine, e.g. JSON -> DynamoDBv2.Document -> Dictionary<string, DynamoDBEvent.AttributeValue>.
I've tried to get a "DynamoDB" JSON from Document, so I could deserialize it to Dictionary<string, DynamoDBEvent.AttributeValue>. Unfortunately, I haven't found an easy way to do that.
Originally posted by @Dreamescaper in #1657 (comment)
The text was updated successfully, but these errors were encountered: