Package net.gini.android
Class ApiCommunicator
- java.lang.Object
-
- net.gini.android.ApiCommunicator
-
public class ApiCommunicator extends java.lang.Object
The ApiCommunicator is responsible for communication with the Gini API. It only converts the server's responses to more convenient objects (e.g. a JSON response to a JSONObject) but does not interpret the results in any way. Therefore it is not recommended to use the ApiCommunicator directly, but to use the DocumentTaskManager instead which provides much more convenient methods to work with the Gini API and uses defined models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApiCommunicator.PreviewSize
-
Constructor Summary
Constructors Constructor Description ApiCommunicator(java.lang.String baseUriString, GiniApiType giniApiType, com.android.volley.RequestQueue mRequestQueue, RetryPolicyFactory retryPolicyFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bolts.Task<java.lang.String>
deleteDocument(android.net.Uri documentUri, Session session)
bolts.Task<java.lang.String>
deleteDocument(java.lang.String documentId, Session session)
bolts.Task<org.json.JSONObject>
errorReportForDocument(java.lang.String documentId, java.lang.String summary, java.lang.String description, Session session)
bolts.Task<org.json.JSONObject>
getDocument(android.net.Uri documentUri, Session session)
bolts.Task<org.json.JSONObject>
getDocument(java.lang.String documentId, Session session)
bolts.Task<org.json.JSONObject>
getDocumentList(int offset, int limit, Session session)
bolts.Task<org.json.JSONObject>
getExtractions(java.lang.String documentId, Session session)
bolts.Task<org.json.JSONObject>
getIncubatorExtractions(java.lang.String documentId, Session session)
bolts.Task<org.json.JSONObject>
getLayoutForDocument(java.lang.String documentId, Session session)
bolts.Task<android.graphics.Bitmap>
getPreview(java.lang.String documentId, int pageNumber, ApiCommunicator.PreviewSize previewSize, Session session)
bolts.Task<org.json.JSONObject>
searchDocuments(java.lang.String searchTerm, java.lang.String docType, int offset, int limit, Session session)
bolts.Task<org.json.JSONObject>
sendFeedback(java.lang.String documentId, org.json.JSONObject extractions, Session session)
bolts.Task<org.json.JSONObject>
sendFeedback(java.lang.String documentId, org.json.JSONObject extractions, org.json.JSONObject compoundExtractions, Session session)
bolts.Task<android.net.Uri>
uploadDocument(byte[] documentData, java.lang.String contentType, java.lang.String documentName, java.lang.String docTypeHint, Session session, DocumentMetadata documentMetadata)
-
-
-
Constructor Detail
-
ApiCommunicator
public ApiCommunicator(java.lang.String baseUriString, GiniApiType giniApiType, com.android.volley.RequestQueue mRequestQueue, RetryPolicyFactory retryPolicyFactory)
-
-
Method Detail
-
uploadDocument
public bolts.Task<android.net.Uri> uploadDocument(byte[] documentData, java.lang.String contentType, @Nullable java.lang.String documentName, @Nullable java.lang.String docTypeHint, Session session, @Nullable DocumentMetadata documentMetadata)
-
getDocument
public bolts.Task<org.json.JSONObject> getDocument(java.lang.String documentId, Session session)
-
getDocument
public bolts.Task<org.json.JSONObject> getDocument(android.net.Uri documentUri, Session session)
-
getExtractions
public bolts.Task<org.json.JSONObject> getExtractions(java.lang.String documentId, Session session)
-
getIncubatorExtractions
public bolts.Task<org.json.JSONObject> getIncubatorExtractions(java.lang.String documentId, Session session)
-
deleteDocument
public bolts.Task<java.lang.String> deleteDocument(java.lang.String documentId, Session session)
-
deleteDocument
public bolts.Task<java.lang.String> deleteDocument(android.net.Uri documentUri, Session session)
-
errorReportForDocument
public bolts.Task<org.json.JSONObject> errorReportForDocument(java.lang.String documentId, @Nullable java.lang.String summary, @Nullable java.lang.String description, Session session)
-
sendFeedback
public bolts.Task<org.json.JSONObject> sendFeedback(java.lang.String documentId, org.json.JSONObject extractions, Session session) throws org.json.JSONException
- Throws:
org.json.JSONException
-
sendFeedback
public bolts.Task<org.json.JSONObject> sendFeedback(java.lang.String documentId, org.json.JSONObject extractions, org.json.JSONObject compoundExtractions, Session session) throws org.json.JSONException
- Throws:
org.json.JSONException
-
getPreview
public bolts.Task<android.graphics.Bitmap> getPreview(java.lang.String documentId, int pageNumber, ApiCommunicator.PreviewSize previewSize, Session session)
-
getLayoutForDocument
public bolts.Task<org.json.JSONObject> getLayoutForDocument(java.lang.String documentId, Session session)
-
getDocumentList
public bolts.Task<org.json.JSONObject> getDocumentList(int offset, int limit, Session session)
-
searchDocuments
public bolts.Task<org.json.JSONObject> searchDocuments(java.lang.String searchTerm, @Nullable java.lang.String docType, int offset, int limit, Session session)
-
-