From d20158ac63438fbf659e9bd41824be7c0741a3b6 Mon Sep 17 00:00:00 2001 From: hdavidh Date: Thu, 11 Jan 2024 16:52:05 -0800 Subject: [PATCH] Update javadocs for paginator style methods --- .../docs/AsyncOperationDocProvider.java | 2 +- .../codegen/docs/OperationDocProvider.java | 20 ++++++++----------- .../docs/SyncOperationDocProvider.java | 2 +- .../test-json-async-client-interface.java | 7 ++----- .../client/test-json-client-interface.java | 7 ++----- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/AsyncOperationDocProvider.java b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/AsyncOperationDocProvider.java index 54660a27c043..70fcc289d2da 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/AsyncOperationDocProvider.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/AsyncOperationDocProvider.java @@ -129,7 +129,7 @@ static class AsyncPaginated extends AsyncOperationDocProvider { } @Override - protected String appendToDescription() { + protected String getDescription() { return paginationDocs.getDocsForAsyncOperation(); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/OperationDocProvider.java b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/OperationDocProvider.java index d78e37b6c3ba..d9c2052b595c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/OperationDocProvider.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/OperationDocProvider.java @@ -69,19 +69,13 @@ abstract class OperationDocProvider { String getDocs() { DocumentationBuilder docBuilder = new DocumentationBuilder(); - String description = StringUtils.isNotBlank(opModel.getDocumentation()) ? - opModel.getDocumentation() : - getDefaultServiceDocs(); - - String appendedDescription = appendToDescription(); + String description = getDescription(); if (config.isConsumerBuilder()) { - appendedDescription += getConsumerBuilderDocs(); + description += "
" + getConsumerBuilderDocs(); } - docBuilder.description(StringUtils.isNotBlank(appendedDescription) ? - description + "
" + appendedDescription : - description); + docBuilder.description(description); applyParams(docBuilder); applyReturns(docBuilder); @@ -96,10 +90,12 @@ String getDocs() { } /** - * @return A string that will be appended to the standard description. + * @return The String description for the operation. */ - protected String appendToDescription() { - return ""; + protected String getDescription() { + return StringUtils.isNotBlank(opModel.getDocumentation()) ? + opModel.getDocumentation() : + getDefaultServiceDocs(); } /** diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/SyncOperationDocProvider.java b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/SyncOperationDocProvider.java index c199883683ba..d3149ccc58b3 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/docs/SyncOperationDocProvider.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/docs/SyncOperationDocProvider.java @@ -202,7 +202,7 @@ static class SyncPaginated extends SyncOperationDocProvider { } @Override - protected String appendToDescription() { + protected String getDescription() { return paginationDocs.getDocsForSyncOperation(); } diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java index 9b044964447a..ec3f92e7a92d 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java @@ -760,7 +760,6 @@ default CompletableFuture paginatedOper } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -835,7 +834,6 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -912,7 +910,6 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -966,6 +963,7 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} * operation. *

+ *
*

* This is a convenience which creates an instance of the {@link PaginatedOperationWithResultKeyRequest.Builder} * avoiding the need to create one manually via {@link PaginatedOperationWithResultKeyRequest#builder()} @@ -1055,7 +1053,6 @@ default CompletableFuture paginatedO } /** - * Some paginated operation without result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} @@ -1132,7 +1129,6 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes } /** - * Some paginated operation without result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} @@ -1186,6 +1182,7 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} * operation. *

+ *
*

* This is a convenience which creates an instance of the {@link PaginatedOperationWithoutResultKeyRequest.Builder} * avoiding the need to create one manually via {@link PaginatedOperationWithoutResultKeyRequest#builder()} diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java index f2586f4fd1d4..440ac2e7075f 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java @@ -525,7 +525,6 @@ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -601,7 +600,6 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -678,7 +676,6 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP } /** - * Some paginated operation with result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} @@ -734,6 +731,7 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * {@link #paginatedOperationWithResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest)} * operation. *

+ *
*

* This is a convenience which creates an instance of the {@link PaginatedOperationWithResultKeyRequest.Builder} * avoiding the need to create one manually via {@link PaginatedOperationWithResultKeyRequest#builder()} @@ -815,7 +813,6 @@ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResu } /** - * Some paginated operation without result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} @@ -892,7 +889,6 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu } /** - * Some paginated operation without result_key in paginators.json file
*

* This is a variant of * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} @@ -948,6 +944,7 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu * {@link #paginatedOperationWithoutResultKey(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest)} * operation. *

+ *
*

* This is a convenience which creates an instance of the {@link PaginatedOperationWithoutResultKeyRequest.Builder} * avoiding the need to create one manually via {@link PaginatedOperationWithoutResultKeyRequest#builder()}