Package com.mindee.http
Class MindeeApiV2
- java.lang.Object
-
- com.mindee.http.MindeeApiCommon
-
- com.mindee.http.MindeeApiV2
-
- Direct Known Subclasses:
MindeeHttpApiV2
public abstract class MindeeApiV2 extends MindeeApiCommon
Defines required methods for an API.
-
-
Constructor Summary
Constructors Constructor Description MindeeApiV2()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ErrorResponsemakeUnknownError(int statusCode)Creates an "unknown error" response from an HTTP status code.abstract InferenceResponsereqGetInference(String inferenceId)Retrieves the inference from a 302 redirect.abstract JobResponsereqGetJob(String jobId)Attempts to poll the queue.abstract JobResponsereqPostInferenceEnqueue(LocalInputSource inputSource, InferenceParameters options)Send a file to the prediction queue with a local file.abstract JobResponsereqPostInferenceEnqueue(URLInputSource inputSource, InferenceParameters options)Send a file to the prediction queue with a remote file.-
Methods inherited from class com.mindee.http.MindeeApiCommon
getUserAgent, isInvalidStatusCode, readRawResponse
-
-
-
-
Method Detail
-
reqPostInferenceEnqueue
public abstract JobResponse reqPostInferenceEnqueue(LocalInputSource inputSource, InferenceParameters options) throws IOException
Send a file to the prediction queue with a local file.- Parameters:
inputSource- Local input source from URL.options- parameters.- Throws:
IOException
-
reqPostInferenceEnqueue
public abstract JobResponse reqPostInferenceEnqueue(URLInputSource inputSource, InferenceParameters options) throws IOException
Send a file to the prediction queue with a remote file.- Parameters:
inputSource- Remote input source from URL.options- parameters.- Throws:
IOException
-
reqGetJob
public abstract JobResponse reqGetJob(String jobId)
Attempts to poll the queue.- Parameters:
jobId- id of the job to get.
-
reqGetInference
public abstract InferenceResponse reqGetInference(String inferenceId)
Retrieves the inference from a 302 redirect.- Parameters:
inferenceId- ID of the inference to poll.
-
makeUnknownError
protected ErrorResponse makeUnknownError(int statusCode)
Creates an "unknown error" response from an HTTP status code.
-
-