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
Communicate with the Mindee HTTP API V2.You may use this base class to make your own custom class. However, we may introduce breaking changes in minor versions as needed.
-
-
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 JobResponsereqGetJobByUrl(String pollingUrl)Get the status of an inference that was previously enqueued.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 JobResponsereqPostProductEnqueue(InputSource inputSource, BaseProductParameters parameters)Send a file to the asynchronous processing queue for a product.-
Methods inherited from class com.mindee.http.MindeeApiCommon
getUserAgent, isInvalidStatusCode, readRawResponse
-
-
-
-
Method Detail
-
reqPostProductEnqueue
public abstract JobResponse reqPostProductEnqueue(InputSource inputSource, BaseProductParameters parameters) throws IOException
Send a file to the asynchronous processing queue for a product.- Parameters:
inputSource- Local input source from URL.parameters- parameters.- Throws:
IOException
-
reqGetJobByUrl
public abstract JobResponse reqGetJobByUrl(String pollingUrl)
Get the status of an inference that was previously enqueued.- Parameters:
pollingUrl- The job URL as returned by the predict_async route.
-
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)
-
-