-
Notifications
You must be signed in to change notification settings - Fork 916
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
Conversation
if (queryName != null && !queryName.trim().isEmpty()) { | ||
return queryName; | ||
} else { | ||
final String locationName = member.getLocationName(); | ||
String locationName = memberShape.getListMember() != null && memberShape.isFlattened() && !protocol.equals("ec2") ? |
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.
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()); |
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.
Can we move the apiVersion and serviceName outside this if block
. We need service name always to create the Default request.
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.
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); |
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.
Header default format is rfc822
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.
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.
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.
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.
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.
I think we can change it to Rfc822. Or you can add a TODO to investigate
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.
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)) |
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.
Do we need a BigDecimal marshalling type?
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.
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 { |
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.
Can you also add a test case where multiple top elements have same member name.
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.
Yep will do!
Overall Lgtm. Are there other changes you will included in this PR? If not, I can approve the PR |
b1147f0
to
58ff306
Compare
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. |
58ff306
to
4289ccf
Compare
4289ccf
to
ebf23e9
Compare
@@ -189,13 +190,14 @@ public void tearDown() throws Exception { | |||
*/ | |||
@Test | |||
public void testLoadBalancerInstanceOperations() throws Exception { | |||
BasicConfigurator.configure(); |
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.
Do we need it?
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.
Nope, will remove
…49e11238 Pull request: release <- staging/58b3f082-0e5e-44f5-91e7-a4da49e11238
No description provided.