Search in sources :

Example 1 with ResponseTransformer

use of software.amazon.awssdk.core.sync.ResponseTransformer in project aws-sdk-java-v2 by aws.

the class SyncClientInterface method streamingMethod.

private static void streamingMethod(MethodSpec.Builder methodBuilder, OperationModel opModel, TypeName responseType) {
    if (opModel.hasStreamingInput()) {
        methodBuilder.addParameter(ClassName.get(RequestBody.class), "requestBody");
    }
    if (opModel.hasStreamingOutput()) {
        methodBuilder.addTypeVariable(STREAMING_TYPE_VARIABLE);
        ParameterizedTypeName streamingResponseHandlerType = ParameterizedTypeName.get(ClassName.get(ResponseTransformer.class), responseType, STREAMING_TYPE_VARIABLE);
        methodBuilder.addParameter(streamingResponseHandlerType, "responseTransformer");
    }
}
Also used : ResponseTransformer(software.amazon.awssdk.core.sync.ResponseTransformer) RequestBody(software.amazon.awssdk.core.sync.RequestBody) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName)

Aggregations

ParameterizedTypeName (com.squareup.javapoet.ParameterizedTypeName)1 RequestBody (software.amazon.awssdk.core.sync.RequestBody)1 ResponseTransformer (software.amazon.awssdk.core.sync.ResponseTransformer)1