com.amazonaws.http.JsonResponseHandler Java Examples

The following examples show how to use com.amazonaws.http.JsonResponseHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IvonaSpeechCloudClient.java    From ivona-speechcloud-sdk-java with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example #2
Source File: IvonaSpeechCloudClient.java    From ivona-speechcloud-sdk-java with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #3
Source File: IvonaSpeechCloudClient.java    From ivona-speechcloud-sdk-java with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example #4
Source File: IvonaSpeechCloudClient.java    From ivona-speechcloud-sdk-java with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example #5
Source File: IvonaSpeechCloudClient.java    From ivona-speechcloud-sdk-java with Apache License 2.0 5 votes vote down vote up
@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);
}