Package com.mindee.v2.http
Class MindeeApiV2
- java.lang.Object
-
- com.mindee.http.MindeeApiCommon
-
- com.mindee.v2.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 Deprecated Methods Modifier and Type Method Description protected ProductAttributesgetParamsProductAttributes(Class<? extends BaseProductParameters> paramsClass)protected ProductAttributesgetResponseProductAttributes(Class<? extends CommonResponse> responseClass)protected ErrorResponsemakeUnknownError(int statusCode)Creates an "unknown error" response from an HTTP status code.abstract JobResponsereqGetJobById(String jobId)Attempts to poll the queue.abstract <TResponse extends CommonResponse>
TResponsereqGetResultById(Class<TResponse> responseClass, String inferenceId)Retrieves the inference from a 302 redirect.abstract <TResponse extends CommonResponse>
TResponsereqGetResultByUrl(Class<TResponse> responseClass, String inferenceUrl)Retrieves the inference from a given URL.abstract <TSearchResponse extends BaseSearchResponse>
TSearchResponsereqGetSearch(BaseSearchParameters<TSearchResponse> parameters)Retrieves a list of resources with the given criteria.abstract SearchResponsereqGetSearch(ModelSearchParameters parameters)Deprecated.abstract JobResponsereqPostEnqueue(LocalInputSource inputSource, BaseProductParameters parameters)Send a file to the prediction queue with a local file.abstract JobResponsereqPostEnqueue(URLInputSource inputSource, BaseProductParameters parameters)Send a file to the prediction queue with a remote file.-
Methods inherited from class com.mindee.http.MindeeApiCommon
getUserAgent, isInvalidStatusCode, readRawResponse
-
-
-
-
Method Detail
-
reqPostEnqueue
public abstract JobResponse reqPostEnqueue(LocalInputSource inputSource, BaseProductParameters parameters) throws IOException
Send a file to the prediction queue with a local file.- Parameters:
inputSource- Local input source from URL.parameters- parameters.- Throws:
IOException
-
reqPostEnqueue
public abstract JobResponse reqPostEnqueue(URLInputSource inputSource, BaseProductParameters parameters) throws IOException
Send a file to the prediction queue with a remote file.- Parameters:
inputSource- Remote input source from URL.parameters- parameters.- Throws:
IOException
-
reqGetJobById
public abstract JobResponse reqGetJobById(String jobId)
Attempts to poll the queue.- Parameters:
jobId- id of the job to get.
-
reqGetResultById
public abstract <TResponse extends CommonResponse> TResponse reqGetResultById(Class<TResponse> responseClass, String inferenceId)
Retrieves the inference from a 302 redirect.- Parameters:
inferenceId- ID of the inference to poll.
-
reqGetResultByUrl
public abstract <TResponse extends CommonResponse> TResponse reqGetResultByUrl(Class<TResponse> responseClass, String inferenceUrl)
Retrieves the inference from a given URL. The inference will only be available after it has finished processing.
-
reqGetSearch
public abstract <TSearchResponse extends BaseSearchResponse> TSearchResponse reqGetSearch(BaseSearchParameters<TSearchResponse> parameters)
Retrieves a list of resources with the given criteria.
-
reqGetSearch
@Deprecated public abstract SearchResponse reqGetSearch(ModelSearchParameters parameters)
Deprecated.
-
makeUnknownError
protected ErrorResponse makeUnknownError(int statusCode)
Creates an "unknown error" response from an HTTP status code.
-
getResponseProductAttributes
protected ProductAttributes getResponseProductAttributes(Class<? extends CommonResponse> responseClass)
-
getParamsProductAttributes
protected ProductAttributes getParamsProductAttributes(Class<? extends BaseProductParameters> paramsClass)
-
-