-
Notifications
You must be signed in to change notification settings - Fork 6
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 methods for conversions to SDK maps #8
Conversation
Very nice little util methods and exactly what I'd need! 👍 |
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.
Sorry for the delay looking at this PR :)
I'm okay with these being here even though it's easy to do it yourself. Left a couple of suggestions on shape, then I'd like to see docs (and minimal tests) if possible.
@@ -219,6 +219,21 @@ object DynamoValue { | |||
def b(value: ByteVector): DynamoValue = | |||
make(_.b(SdkBytes.fromByteArray(value.toArray))) | |||
|
|||
/** Builds a DynamoValue from an AWS SDK-compatible attribute map, e.g. from a GetItem response. | |||
*/ | |||
def fromAttributeMap( |
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 be called attributeMap
for consistency
/** Converts a DynamoValue to an AWS SDK-compatible attribute map, e.g. for a PutItem operation. | ||
* Returns None if the value isn't backed by a map. | ||
*/ | ||
def toAttributeMap( |
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 be called attributeMap
for consistency, and be an instance method like the others
I suppose many people using dynosaur will be doing these at some point, so some place for conversions would be nice (I'm open to suggestions about moving these to some other place).
Should probably get some tests and documentation before merge.