/** * Query HP Haven OnDemand for documents using query text in a file using the given token * @param token The token to use to authenticate the request * @param file A file containing the query text * @param params Additional parameters to be sent as part of the request * @return A list of documents that match the query text */ @Multipart @POST(URL) Response findRelatedConceptsWithFile( @Header("token") AuthenticationToken<?, ?> token, @Part("file") TypedOutput file, @PartMap Map<String, Object> params ) throws HodErrorException; }
String transferEncoding = ((PartMap) annotation).encoding(); for (Map.Entry<?, ?> entry : ((Map<?, ?>) value).entrySet()) { Object entryKey = entry.getKey();
/** * Query HP Haven OnDemand for documents using query text in a file using the given token * @param token The token to use to authenticate the request * @param file A file containing the query text * @param params Additional parameters to be sent as part of the request * @return A list of documents that match the query text */ @Multipart @POST(URL) Response queryTextIndexWithFile( @Header("token") AuthenticationToken<?, ?> token, @Part("file") TypedOutput file, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Finds similar documents to the text in a file using the given token * @param token The token to use to authenticate the request * @param file A file containing the query text * @param params Additional parameters to be sent as part of the request * @return A list of documents that are similar to the query text */ @Multipart @POST(URL) Response findSimilarDocumentsToFile( @Header("token") AuthenticationToken<?, ?> token, @Part("file") TypedOutput file, @PartMap Map<String, Object> params ) throws HodErrorException; }
@POST(URL + V2) @Multipart Response createQueryProfile( @Header(TOKEN_HEADER) AuthenticationToken<?, ?> token, @Path(PROFILE_VARIABLE) String name, @Part(INDEX_PART) String queryManipulationIndex, @PartMap Map<String, Object> params ) throws HodErrorException;
@PUT(URL + V1) @Multipart Response updateQueryProfile( @Header(TOKEN_HEADER) AuthenticationToken<?, ?> token, @Path(PROFILE_VARIABLE) ResourceIdentifier queryProfile, @Part(INDEX_PART) String queryManipulationIndex, @PartMap Map<String, Object> params ) throws HodErrorException;
@PATCH("/2/api/sync/domain/{domain_name}/application/{application_name}/v1") @Multipart StatusResponse update( @Header("token") String signature, @Path("domain_name") String domain, @Path("application_name") String name, @PartMap Map<String, String> parts ) throws HodErrorException;
@POST(BASE_PATH + V1) @Multipart Response create( @Header(TOKEN_HEADER) AuthenticationToken<?, ?> token, @Path(USER_STORE_VARIABLE) ResourceIdentifier userStore, @Part("group_name") String name, @PartMap Map<String, Object> hierarchyParameters ) throws HodErrorException;
/** * Index a file into HP Haven OnDemand using the given token * @param token The API key to use to authenticate the request * @param file A file containing the content of the document * @param index The index to add to * @param params Additional parameters to be sent as part of the request * @return The job ID of the request * @throws HodErrorException */ @POST(URL) @Multipart Response addFileToTextIndex( @Header("token") AuthenticationToken<?, ?> token, @Part("file") TypedOutput file, @Path("indexName") ResourceIdentifier index, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Index JSON documents into HP Haven OnDemand using the given token * @param token The token to use to authenticate the request * @param documents A collection of objects to convert to JSON * @param indexName The index to add to * @param params Additional parameters to be sent as part of the request * @return The job ID of the request * @throws HodErrorException */ @POST(URL) @Multipart Response addJsonToTextIndex( @Header("token") AuthenticationToken<?, ?> token, @Part("json") Documents<?> documents, @Path("indexName") ResourceIdentifier indexName, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Index an object store object into HP Haven OnDemand using the given token * @param token The token to use to authenticate the request * @param reference An object store reference pointing at a file to be used for document content * @param index The index to add to * @param params Additional parameters to be sent as part of the request * @return The job ID of the request * @throws HodErrorException */ @POST(URL) @Multipart Response addReferenceToTextIndex( @Header("token") AuthenticationToken<?, ?> token, @Part("reference") String reference, @Path("indexName") ResourceIdentifier index, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a POST request to the given API * @param token The token used to authenticate the request * @param api The name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return A Map representing the result from HP Haven OnDemand * @throws HodErrorException */ @POST(SYNC_URL_ONE) @Multipart Response post( @Header("token") AuthenticationToken<?, ?> token, @Path("first") String api, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a POST request to the given API asynchronously * @param token The token used to authenticate the request * @param api The name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return A Map representing the result from HP Haven OnDemand * @throws HodErrorException */ @POST(ASYNC_URL_ONE) @Multipart Response postAsync( @Header("token") AuthenticationToken<?, ?> token, @Path("api") String api, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a PUT request to the given API * @param token The token used to authenticate the request * @param api The name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return A Map representing the result from HP Haven OnDemand * @throws HodErrorException */ @PUT(SYNC_URL_ONE) @Multipart Response put( @Header("token") AuthenticationToken<?, ?> token, @Path("first") String api, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Index a publicly accessible into HP Haven OnDemand using the given token * @param token The token to use to authenticate the request * @param url A publicly accessible url containing the document content * @param index The index to add to * @param params Additional parameters to be sent as part of the request * @return The job ID of the request * @throws HodErrorException */ @POST(URL) @Multipart Response addUrlToTextIndex( @Header("token") AuthenticationToken<?, ?> token, @Part("url") String url, @Path("indexName") ResourceIdentifier index, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Convert a file to HTML and retrieve the result as a stream containing the HTML using the given token * @param token The token to use to authenticate the request * @param file The file to view * @param params Additional parameters to use for the request * @return A response whose InputStream contains the HTML of the document. Use response.getBody().in() to access the * html. This stream must be closed after use. * @throws HodErrorException */ @POST(URL) @Multipart @Streaming Response viewFile( @Header("token") AuthenticationToken<?, ?> token, @Part("file") TypedOutput file, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a PUT request to the given API asynchronously * @param token The token used to authenticate the request * @param api The name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return The job ID of the request * @throws HodErrorException */ @PUT(ASYNC_URL_ONE) @Multipart Response putAsync( @Header("token") AuthenticationToken<?, ?> token, @Path("first") String api, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;
@POST(BASE_PATH + V1) @Multipart Response create( @Header(TOKEN_HEADER) AuthenticationToken<?, ?> token, @Path(USER_STORE_VARIABLE) ResourceIdentifier userStore, @Part("user_email") String email, @Part("on_success") String onSuccess, @Part("on_error") String onError, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a POST request to the given API asynchronously * @param token The token used to authenticate the request * @param first The first part of the name of the API * @param second The second part of the name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return A Map representing the result from HP Haven OnDemand * @throws HodErrorException */ @POST(ASYNC_URL_TWO) @Multipart Response postAsync( @Header("token") AuthenticationToken<?, ?> token, @Path("first") String first, @Path("second") String second, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;
/** * Sends a PUT request to the given API * @param token The token used to authenticate the request * @param first The first part of the name of the API * @param second The second part of the name of the API * @param version The version of the API * @param params The query parameters sent to the API * @return A Map representing the result from HP Haven OnDemand * @throws HodErrorException */ @PUT(SYNC_URL_TWO) @Multipart Response put( @Header("token") AuthenticationToken<?, ?> token, @Path("first") String first, @Path("second") String second, @Path("version") int version, @PartMap Map<String, Object> params ) throws HodErrorException;