Skip to content

AWS/Query and EC2 marshaller support. #760

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

Merged
merged 8 commits into from
Oct 23, 2018
Merged

Conversation

shorea
Copy link
Contributor

@shorea shorea commented Oct 15, 2018

No description provided.

if (queryName != null && !queryName.trim().isEmpty()) {
return queryName;
} else {
final String locationName = member.getLocationName();
String locationName = memberShape.getListMember() != null && memberShape.isFlattened() && !protocol.equals("ec2") ?
Copy link
Contributor

Choose a reason for hiding this comment

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

If ec2 lists are always flattened, why are we using parent location name instead of list member location name?

if (StringUtils.isNotBlank(shapeModel.getMarshaller().getTarget())) {
initializationCodeBlockBuilder.add(".operationIdentifier($S)", shapeModel.getMarshaller().getTarget())
.add(".apiVersion($S)", metadata.getApiVersion())
.add(".serviceName($S)", metadata.getServiceName());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move the apiVersion and serviceName outside this if block. We need service name always to create the Default request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

@@ -130,6 +125,24 @@ private static MarshallerRegistry createMarshallerRegistry() {
.build();
}

private static Map<MarshallLocation, TimestampFormatTrait.Format> getDefaultTimestampFormats() {
Map<MarshallLocation, TimestampFormatTrait.Format> formats = new HashMap<>();
formats.put(MarshallLocation.HEADER, TimestampFormatTrait.Format.ISO_8601);
Copy link
Contributor

Choose a reason for hiding this comment

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

Header default format is rfc822

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our protocol tests have ISO for marshalling and RFC822 for unmarshalling, not sure why. Did a search and no service is currently using timestamps in input headers so we may just have this wrong in our tests. I'll create a task to investigate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, for v1, we have to keep using iso as default for header marshalling for backwards compatibility reason. For v2, I think we can make it right and keep the same behavior as other SDKs.

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 can change it to Rfc822. Or you can add a TODO to investigate

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO?

.marshaller(MarshallingType.NULL, SimpleTypeQueryMarshaller.NULL)
.marshaller(MarshallingType.MAP, new MapMarshaller())
.marshaller(MarshallingType.LIST, new ListMarshaller())
.marshaller(MarshallingType.SDK_POJO, (req, path, val, sdkField) -> doMarshall(path, req, val))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a BigDecimal marshalling type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nah we have that as a customization for budgets. We actually don't support the "true" big decimal type as defined in the aws service framework. It's modeled as a string in budgets.

import org.junit.Test;
import software.amazon.awssdk.utils.StringInputStream;

public class XmlDomParserTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a test case where multiple top elements have same member name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep will do!

@varunnvs92
Copy link
Contributor

Overall Lgtm. Are there other changes you will included in this PR? If not, I can approve the PR

@shorea shorea force-pushed the shorea-marshaller-phase-two branch from b1147f0 to 58ff306 Compare October 23, 2018 02:06
@shorea
Copy link
Contributor Author

shorea commented Oct 23, 2018

Are there other changes you will included in this PR?

Running through the integ tests right now and making small tweaks based on that. I'll merge from master after that's done and will ask for a ship it then.

@shorea shorea force-pushed the shorea-marshaller-phase-two branch from 58ff306 to 4289ccf Compare October 23, 2018 17:50
@shorea shorea force-pushed the shorea-marshaller-phase-two branch from 4289ccf to ebf23e9 Compare October 23, 2018 18:18
@@ -189,13 +190,14 @@ public void tearDown() throws Exception {
*/
@Test
public void testLoadBalancerInstanceOperations() throws Exception {
BasicConfigurator.configure();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, will remove

@shorea shorea merged commit 2f0cdc4 into master Oct 23, 2018
aws-sdk-java-automation added a commit that referenced this pull request Mar 19, 2020
…49e11238

Pull request: release <- staging/58b3f082-0e5e-44f5-91e7-a4da49e11238
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