Skip to content
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

Merged
merged 3 commits into from
Jun 19, 2022

Conversation

kubukoz
Copy link
Contributor

@kubukoz kubukoz commented Jul 9, 2021

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.

@marko-asplund
Copy link
Contributor

Very nice little util methods and exactly what I'd need! 👍
Are there any blockers to merging this? 🤔

Copy link
Owner

@SystemFw SystemFw left a 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(
Copy link
Owner

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(
Copy link
Owner

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

@SystemFw SystemFw marked this pull request as ready for review June 19, 2022 22:19
@SystemFw SystemFw merged commit b33a13e into SystemFw:main Jun 19, 2022
@kubukoz kubukoz deleted the convert-sdk-map branch June 20, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants