use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method getIntent.
/**
* Get intent.
*
* Get information about an intent, optionally including all intent content. With **export**=`false`, this operation
* is limited to 6000 requests per 5 minutes. With **export**=`true`, the limit is 400 requests per 30 minutes. For
* more information, see **Rate limiting**.
*
* @param getIntentOptions the {@link GetIntentOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link IntentExport}
*/
public ServiceCall<IntentExport> getIntent(GetIntentOptions getIntentOptions) {
Validator.notNull(getIntentOptions, "getIntentOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "intents" };
String[] pathParameters = { getIntentOptions.workspaceId(), getIntentOptions.intent() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (getIntentOptions.export() != null) {
builder.query("export", String.valueOf(getIntentOptions.export()));
}
if (getIntentOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getIntentOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentExport.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method getSynonym.
/**
* Get entity value synonym.
*
* Get information about a synonym of an entity value. This operation is limited to 6000 requests per 5 minutes. For
* more information, see **Rate limiting**.
*
* @param getSynonymOptions the {@link GetSynonymOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link Synonym}
*/
public ServiceCall<Synonym> getSynonym(GetSynonymOptions getSynonymOptions) {
Validator.notNull(getSynonymOptions, "getSynonymOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "entities", "values", "synonyms" };
String[] pathParameters = { getSynonymOptions.workspaceId(), getSynonymOptions.entity(), getSynonymOptions.value(), getSynonymOptions.synonym() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (getSynonymOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getSynonymOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Synonym.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method deleteEntity.
/**
* Delete entity.
*
* Delete an entity from a workspace. This operation is limited to 1000 requests per 30 minutes. For more information,
* see **Rate limiting**.
*
* @param deleteEntityOptions the {@link DeleteEntityOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteEntity(DeleteEntityOptions deleteEntityOptions) {
Validator.notNull(deleteEntityOptions, "deleteEntityOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "entities" };
String[] pathParameters = { deleteEntityOptions.workspaceId(), deleteEntityOptions.entity() };
RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method getExample.
/**
* Get user input example.
*
* Get information about a user input example. This operation is limited to 6000 requests per 5 minutes. For more
* information, see **Rate limiting**.
*
* @param getExampleOptions the {@link GetExampleOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link Example}
*/
public ServiceCall<Example> getExample(GetExampleOptions getExampleOptions) {
Validator.notNull(getExampleOptions, "getExampleOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "intents", "examples" };
String[] pathParameters = { getExampleOptions.workspaceId(), getExampleOptions.intent(), getExampleOptions.text() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (getExampleOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getExampleOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Example.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method listEntities.
/**
* List entities.
*
* List the entities for a workspace. With **export**=`false`, this operation is limited to 1000 requests per 30
* minutes. With **export**=`true`, the limit is 200 requests per 30 minutes. For more information, see **Rate
* limiting**.
*
* @param listEntitiesOptions the {@link ListEntitiesOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link EntityCollection}
*/
public ServiceCall<EntityCollection> listEntities(ListEntitiesOptions listEntitiesOptions) {
Validator.notNull(listEntitiesOptions, "listEntitiesOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "entities" };
String[] pathParameters = { listEntitiesOptions.workspaceId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (listEntitiesOptions.export() != null) {
builder.query("export", String.valueOf(listEntitiesOptions.export()));
}
if (listEntitiesOptions.pageLimit() != null) {
builder.query("page_limit", String.valueOf(listEntitiesOptions.pageLimit()));
}
if (listEntitiesOptions.includeCount() != null) {
builder.query("include_count", String.valueOf(listEntitiesOptions.includeCount()));
}
if (listEntitiesOptions.sort() != null) {
builder.query("sort", listEntitiesOptions.sort());
}
if (listEntitiesOptions.cursor() != null) {
builder.query("cursor", listEntitiesOptions.cursor());
}
if (listEntitiesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listEntitiesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityCollection.class));
}
Aggregations