-
- All Implemented Interfaces:
-
net.gini.android.capture.logging.ErrorLoggerListener
public interface GiniCaptureNetworkService implements ErrorLoggerListener
Interface specifying network related tasks required by the Gini Capture SDK in order to communicate with the Gini API.
The easiest way to get started is to use the Gini Capture Network Library package which provides a default implementation.
You can also create your own implementation and communicate directly with the Gini API or pass requests through your backend. For direct communication with the Gini API we recommend using the Gini Bank API lib.
In order for the Gini Capture SDK to use your implementation pass an instance of it to setGiniCaptureNetworkService when creating a GiniCapture instance.
-
-
Method Summary
-
-
Method Detail
-
upload
abstract CancellationToken upload(@NonNull() Document document, @NonNull() GiniCaptureNetworkCallback<Result, Error> callback)
Called when a document needs to be uploaded to the Gini API.
You should only upload the document. Polling or retrieving extractions is not needed atthis point.
- Parameters:
document- a Document containing an image, pdf or other supported formatscallback- a callback implementation to return the outcome of the upload
-
delete
abstract CancellationToken delete(@NonNull() String giniApiDocumentId, @NonNull() GiniCaptureNetworkCallback<Result, Error> callback)
Called when a document needs to be deleted from the Gini API.
- Parameters:
giniApiDocumentId- id of the document received when it was uploaded to the Gini APIcallback- a callback implementation to return the outcome of the deletion
-
analyze
abstract CancellationToken analyze(@NonNull() LinkedHashMap<String, Integer> giniApiDocumentIdRotationMap, @NonNull() GiniCaptureNetworkCallback<AnalysisResult, Error> callback)
Called when a document needs to be analyzed by the Gini API.
The documents were already uploaded and only the Gini API document ids of documents arepassed in along with the user applied document rotations.
- Parameters:
giniApiDocumentIdRotationMap- a map of Gini API document ids and the user applieddocument rotationscallback- a callback implementation to return the outcome of theanalysis
-
sendFeedback
abstract void sendFeedback(@NonNull() Map<String, GiniCaptureSpecificExtraction> extractions, @NonNull() Map<String, GiniCaptureCompoundExtraction> compoundExtractions, @NonNull() GiniCaptureNetworkCallback<Void, Error> callback)
Call this method with the extractions the user has seen and accepted. The s must contain the final user corrected and/or accepted values.
- Parameters:
extractions- a map of extraction labels and specific extractionscallback- a callback implementation to return the outcome
-
deleteGiniUserCredentials
abstract void deleteGiniUserCredentials()
Delete the anonymous gini user credentials. These were automatically generated when the first document was uploaded.
By deleting the credentials, new ones will be generated at the next upload.
-
cleanup
abstract void cleanup()
Called when the Gini Capture SDK is not needed anymore and the method has been called.
Free up any resources your implementation is using.
-
getConfiguration
CancellationToken getConfiguration(@NonNull() GiniCaptureNetworkCallback<Configuration, Error> callback)
-
getDocumentLayout
CancellationToken getDocumentLayout(@NonNull() String documentId, @NonNull() GiniCaptureNetworkCallback<DocumentLayout, Error> callback)
-
getDocumentPages
CancellationToken getDocumentPages(@NonNull() String documentId, @NonNull() GiniCaptureNetworkCallback<List<DocumentPage>, Error> callback)
-
getFile
CancellationToken getFile(@NonNull() String fileUrl, @NonNull() GiniCaptureNetworkCallback<Array<Byte>, Error> callback)
-
sendEvents
CancellationToken sendEvents(@NonNull() AmplitudeRootModel amplitudeRootModel, @NonNull() GiniCaptureNetworkCallback<Void, Error> callback)
-
handleErrorLog
void handleErrorLog(@NonNull() ErrorLog errorLog)
-
-
-
-