From dae580db3ff9885c39bc04ee853fea39fb96e272 Mon Sep 17 00:00:00 2001 From: hdavidh Date: Fri, 26 Jan 2024 11:28:58 -0800 Subject: [PATCH 1/2] Update codegen to get requestcompression instead of requestCompression --- .../software/amazon/awssdk/codegen/AddOperations.java | 2 +- .../awssdk/codegen/compression/RequestCompression.java | 2 +- .../codegen/model/intermediate/OperationModel.java | 10 +++++----- .../amazon/awssdk/codegen/model/service/Operation.java | 10 +++++----- .../poet/client/traits/RequestCompressionTrait.java | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java index 1680ab6178f3..5602025b6c1c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java @@ -176,7 +176,7 @@ public Map constructOperations() { operationModel.setEndpointTrait(op.getEndpoint()); operationModel.setHttpChecksumRequired(op.isHttpChecksumRequired()); operationModel.setHttpChecksum(op.getHttpChecksum()); - operationModel.setRequestCompression(op.getRequestCompression()); + operationModel.setRequestcompression(op.getRequestcompression()); operationModel.setStaticContextParams(op.getStaticContextParams()); operationModel.setAuth(getAuthFromOperation(op)); diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/compression/RequestCompression.java b/codegen/src/main/java/software/amazon/awssdk/codegen/compression/RequestCompression.java index 69d53bc7e30f..d76489cb1d8e 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/compression/RequestCompression.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/compression/RequestCompression.java @@ -19,7 +19,7 @@ import software.amazon.awssdk.annotations.SdkInternalApi; /** - * Class to map the RequestCompression trait of an operation. + * Class to map the requestcompression trait of an operation. */ @SdkInternalApi public class RequestCompression { diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java index 6702a4bc021b..a892bf6c897e 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java @@ -78,7 +78,7 @@ public class OperationModel extends DocumentationModel { private HttpChecksum httpChecksum; - private RequestCompression requestCompression; + private RequestCompression requestcompression; @JsonIgnore private Map staticContextParams; @@ -342,12 +342,12 @@ public void setHttpChecksum(HttpChecksum httpChecksum) { this.httpChecksum = httpChecksum; } - public RequestCompression getRequestCompression() { - return requestCompression; + public RequestCompression getRequestcompression() { + return requestcompression; } - public void setRequestCompression(RequestCompression requestCompression) { - this.requestCompression = requestCompression; + public void setRequestcompression(RequestCompression requestcompression) { + this.requestcompression = requestcompression; } public Map getStaticContextParams() { diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java index 182ef145f88d..b1d4fd69313c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java @@ -55,7 +55,7 @@ public class Operation { private HttpChecksum httpChecksum; - private RequestCompression requestCompression; + private RequestCompression requestcompression; private Map staticContextParams; @@ -202,12 +202,12 @@ public void setHttpChecksum(HttpChecksum httpChecksum) { this.httpChecksum = httpChecksum; } - public RequestCompression getRequestCompression() { - return requestCompression; + public RequestCompression getRequestcompression() { + return requestcompression; } - public void setRequestCompression(RequestCompression requestCompression) { - this.requestCompression = requestCompression; + public void setRequestcompression(RequestCompression requestcompression) { + this.requestcompression = requestcompression; } public Map getStaticContextParams() { diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/RequestCompressionTrait.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/RequestCompressionTrait.java index 9290e02a003a..b59fa7a0c2ff 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/RequestCompressionTrait.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/RequestCompressionTrait.java @@ -38,7 +38,7 @@ private RequestCompressionTrait() { * return an empty code-block. */ public static CodeBlock create(OperationModel operationModel, IntermediateModel model) { - if (operationModel.getRequestCompression() == null) { + if (operationModel.getRequestcompression() == null) { return CodeBlock.of(""); } @@ -49,7 +49,7 @@ public static CodeBlock create(OperationModel operationModel, IntermediateModel throw new IllegalStateException("Request compression for S3 is not yet supported in the AWS SDK for Java."); } - List encodings = operationModel.getRequestCompression().getEncodings(); + List encodings = operationModel.getRequestcompression().getEncodings(); return CodeBlock.of(".putExecutionAttribute($T.REQUEST_COMPRESSION, " + "$T.builder().encodings($L).isStreaming($L).build())", From 31ab2f3c42bf83f3b473f5a6f88a3235f645c2f8 Mon Sep 17 00:00:00 2001 From: hdavidh Date: Fri, 26 Jan 2024 11:43:44 -0800 Subject: [PATCH 2/2] Update test models --- .../amazon/awssdk/codegen/poet/client/c2j/json/service-2.json | 2 +- .../awssdk/codegen/poet/client/c2j/query/service-2.json | 2 +- .../awssdk/codegen/poet/client/c2j/rest-json/service-2.json | 2 +- .../amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json | 2 +- .../codegen-resources/customresponsemetadata/service-2.json | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json index 65d931001984..f7500034e765 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json @@ -36,7 +36,7 @@ "method": "POST", "requestUri": "/" }, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] } }, diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json index 940d58871464..6521234b771c 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json @@ -65,7 +65,7 @@ "method": "POST", "requestUri": "/" }, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] } }, diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rest-json/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rest-json/service-2.json index f003ba7d1e66..a144431455dd 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rest-json/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rest-json/service-2.json @@ -28,7 +28,7 @@ "method": "POST", "requestUri": "/" }, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] } }, diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json index 451eb30d1e28..bcc3b9796f47 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json @@ -35,7 +35,7 @@ "method": "POST", "requestUri": "/" }, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] } }, diff --git a/test/codegen-generated-classes-test/src/main/resources/codegen-resources/customresponsemetadata/service-2.json b/test/codegen-generated-classes-test/src/main/resources/codegen-resources/customresponsemetadata/service-2.json index 11d12c84f6ce..1a0e39d83572 100644 --- a/test/codegen-generated-classes-test/src/main/resources/codegen-resources/customresponsemetadata/service-2.json +++ b/test/codegen-generated-classes-test/src/main/resources/codegen-resources/customresponsemetadata/service-2.json @@ -294,7 +294,7 @@ }, "input":{"shape":"RequestCompressionStructure"}, "output":{"shape":"RequestCompressionStructure"}, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] } }, @@ -306,7 +306,7 @@ }, "input":{"shape":"RequestCompressionStructureWithStreaming"}, "output":{"shape":"RequestCompressionStructureWithStreaming"}, - "requestCompression": { + "requestcompression": { "encodings": ["gzip"] }, "authtype":"v4-unsigned-body"