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

UpdateExpression API #2900

Conversation

cenedhryn
Copy link
Contributor

@cenedhryn cenedhryn commented Dec 8, 2021

Motivation and Context

In order to support DynamoDB UpdateExpressions we need a representation of these concepts in the public API.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html

Description

Adding a set of classes to represent UpdateExpression actions, and an UpdateExpression class to contain them. See separate design document for motivation and architecture.

Testing

Unit tested.

@cenedhryn cenedhryn requested a review from a team as a code owner December 8, 2021 21:22
@cenedhryn cenedhryn requested a review from zoewangg December 8, 2021 21:25
private AddUpdateAction(Builder builder) {
this.path = Validate.paramNotNull(builder.path, "path");
this.value = Validate.paramNotNull(builder.value, "value");
this.expressionValues = unmodifiableMap(Validate.paramNotNull(builder.expressionValues, "expressionValues"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it true that this must always be non-null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK; not sure if you're just referring to expressionValues or all of them. For expressionValues I believe so, but we should test this premise before release. I figured it's better to be restrictive at first.

this.path = Validate.paramNotNull(builder.path, "path");
this.value = Validate.paramNotNull(builder.value, "value");
this.expressionValues = unmodifiableMap(Validate.paramNotNull(builder.expressionValues, "expressionValues"));
this.expressionNames = unmodifiableMap(builder.expressionNames != null ? builder.expressionNames : new HashMap<>());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to wrap it with a new HashMap?

}

public List<RemoveUpdateAction> removeActions() {
return Collections.unmodifiableList(removeActions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should create a new List and wrap it with unmodifiableList in the ctor. Can we do a find and replace to fix all occurrences of list and map?

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
22.6% 22.6% Duplication

@cenedhryn cenedhryn merged commit 642ae05 into feature/master/ddbenhanced-updateexpression Dec 10, 2021
@cenedhryn cenedhryn deleted the salande/updateexpression-api branch December 10, 2021 18:28
aws-sdk-java-automation added a commit that referenced this pull request Feb 14, 2024
…22e43c3d4

Pull request: release <- staging/82f02350-8349-48bb-a3e4-b3f22e43c3d4
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