Skip to content

Commit e62e29d

Browse files
authored
Add tracking of RequestBody/ResponseTransfromer implementations used in UserAgent (#6171)
* Add useragent metadata execution attributes and apply them to useragent. Add basic tracking of requestbody/responeTransformer implementations to UA metadata. * Add delegate getter to the Notifying transformer + handle empty class names w/ unknown * Add name methods to body/response transfromer interfaces + add implementations * Checkstyle fixes + changelog * Update docs + AdditionalMetadata use builder + change all name methods to just name. * Use enum + single letter short form for RequestBody/ContentStreamProvider * Migrate to single character name + enum for remaining types * Fix test failures * Fix checkstyle, start adding tests * Add more tests * Try and fix arch test failure * Fix arch test + more test coverage * Improve test coverage * Improve regex for classWithInnerClassesToPattern * Fix minor pr issues * Fix unknown string to use enum * Fix changelog
1 parent e58ae12 commit e62e29d

File tree

48 files changed

+5779
-4856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5779
-4856
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Add tracking of RequestBody/ResponseTransfromer implementations used in UserAgent."
6+
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ public CodeBlock executionHandler(OperationModel opModel) {
235235

236236
codeBlock.add(RequestCompressionTrait.create(opModel, model));
237237

238+
if (opModel.hasStreamingOutput()) {
239+
codeBlock.add(".withResponseTransformer(responseTransformer)");
240+
}
241+
238242
if (opModel.hasStreamingInput()) {
239243
codeBlock.add(".withRequestBody(requestBody)")
240244
.add(".withMarshaller($L)", syncStreamingMarshaller(model, opModel, marshaller));
@@ -310,6 +314,10 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper
310314
builder.add(NoneAuthTypeRequestTrait.create(opModel));
311315
}
312316

317+
if (opModel.hasStreamingOutput()) {
318+
builder.add(".withAsyncResponseTransformer(asyncResponseTransformer)");
319+
}
320+
313321
builder.add(RequestCompressionTrait.create(opModel, model))
314322
.add(".withInput($L)$L)",
315323
opModel.getInput().getVariableName(), asyncResponseTransformerVariable(isStreaming, isRestJson, opModel))

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ public CodeBlock executionHandler(OperationModel opModel) {
128128
}
129129

130130
codeBlock.add(RequestCompressionTrait.create(opModel, intermediateModel));
131-
131+
if (opModel.hasStreamingOutput()) {
132+
codeBlock.add(".withResponseTransformer(responseTransformer)");
133+
}
132134
if (opModel.hasStreamingInput()) {
133135
return codeBlock.add(".withRequestBody(requestBody)")
134136
.add(".withMarshaller($L));", syncStreamingMarshaller(intermediateModel, opModel, marshaller))
@@ -170,6 +172,10 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper
170172

171173
builder.add(RequestCompressionTrait.create(opModel, intermediateModel));
172174

175+
if (opModel.hasStreamingOutput()) {
176+
builder.add(".withAsyncResponseTransformer(asyncResponseTransformer)");
177+
}
178+
173179
builder.add(hostPrefixExpression(opModel) + asyncRequestBody + ".withInput($L)$L);",
174180
opModel.getInput().getVariableName(),
175181
opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : "");

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-aws-json-async-client-class.java

Lines changed: 366 additions & 365 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-cbor-async-client-class.java

Lines changed: 366 additions & 365 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-json-async-client-class.java

Lines changed: 408 additions & 406 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-json-client-class.java

Lines changed: 300 additions & 298 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-query-async-client-class.java

Lines changed: 229 additions & 227 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-query-client-class.java

Lines changed: 237 additions & 236 deletions
Large diffs are not rendered by default.

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/sra/test-xml-async-client-class.java

Lines changed: 195 additions & 193 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)