@Override public <T> JsonResponseHandler<T> createResponseHandler(JsonOperationMetadata operationMetadata, Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller) { return new JsonResponseHandler(responseUnmarshaller, unmarshallers, customTypeMarshallers, jsonFactory, operationMetadata.isHasStreamingSuccessResponse(), operationMetadata.isPayloadJson()); }
@Override public ListVoicesResult listVoices(ListVoicesRequest listVoicesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listVoicesRequest); Request<ListVoicesRequest> request = ListVoicesRequestMarshallerFactory.getMarshaller( listVoicesRequest.getMethodType()).marshall(listVoicesRequest); Unmarshaller<ListVoicesResult, JsonUnmarshallerContext> unmarshaller = new ListVoicesResultJsonUnmarshaller(); JsonResponseHandler<ListVoicesResult> responseHandler = new JsonResponseHandler<ListVoicesResult>(unmarshaller); Response<ListVoicesResult> response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); }
@Override public void deleteLexicon(DeleteLexiconRequest deleteLexiconRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteLexiconRequest); DeleteLexiconRequestMarshaller marshaller = new DeleteLexiconPostRequestMarshaller(); Request<DeleteLexiconRequest> request = marshaller.marshall(deleteLexiconRequest); JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null); invoke(request, responseHandler, executionContext); }
@Override public GetLexiconResult getLexicon(GetLexiconRequest getLexiconRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getLexiconRequest); GetLexiconRequestMarshaller marshaller = new GetLexiconPostRequestMarshaller(); Request<GetLexiconRequest> request = marshaller.marshall(getLexiconRequest); Unmarshaller<GetLexiconResult, JsonUnmarshallerContext> unmarshaller = new GetLexiconResultJsonUnmarshaller(); JsonResponseHandler<GetLexiconResult> responseHandler = new JsonResponseHandler<GetLexiconResult>(unmarshaller); Response<GetLexiconResult> response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); }
@Override public ListLexiconsResult listLexicons() { ListLexiconsRequest listLexiconsRequest = new ListLexiconsRequest(); ExecutionContext executionContext = createExecutionContext(listLexiconsRequest); ListLexiconsRequestMarshaller marshaller = new ListLexiconsPostRequestMarshaller(); Request<ListLexiconsRequest> request = marshaller.marshall(listLexiconsRequest); Unmarshaller<ListLexiconsResult, JsonUnmarshallerContext> unmarshaller = new ListLexiconsResultJsonUnmarshaller(); JsonResponseHandler<ListLexiconsResult> responseHandler = new JsonResponseHandler<ListLexiconsResult>(unmarshaller); Response<ListLexiconsResult> response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); }
@Override public void putLexicon(PutLexiconRequest putLexiconRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(putLexiconRequest); PutLexiconRequestMarshaller marshaller = new PutLexiconPostRequestMarshaller(); Request<PutLexiconRequest> request = marshaller.marshall(putLexiconRequest); JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null); invoke(request, responseHandler, executionContext); }
HalResource getHalResource(String resourcePath) { JsonResponseHandler<HalResource> responseHandler = new JsonResponseHandler<>(HalJsonResourceUnmarshaller.getInstance()); return invoke(GET, resourcePath, null, responseHandler); }
/** * Returns the response handler to be used for handling a successfull response. * * @param operationMetadata Additional context information about an operation to create the * appropriate response handler. */ <T> JsonResponseHandler<T> createResponseHandler(JsonOperationMetadata operationMetadata, Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller);