use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Conversation method getIntent.
/**
* Get intent.
*
* Get information about an intent, optionally including all intent content.
*
* @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 Conversation method deleteExample.
/**
* Delete user input example.
*
* Delete a user input example from an intent.
*
* @param deleteExampleOptions the {@link DeleteExampleOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteExample(DeleteExampleOptions deleteExampleOptions) {
Validator.notNull(deleteExampleOptions, "deleteExampleOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "intents", "examples" };
String[] pathParameters = { deleteExampleOptions.workspaceId(), deleteExampleOptions.intent(), deleteExampleOptions.text() };
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 Conversation method getCounterexample.
/**
* Get counterexample.
*
* Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.
*
* @param getCounterexampleOptions the {@link GetCounterexampleOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link Counterexample}
*/
public ServiceCall<Counterexample> getCounterexample(GetCounterexampleOptions getCounterexampleOptions) {
Validator.notNull(getCounterexampleOptions, "getCounterexampleOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "counterexamples" };
String[] pathParameters = { getCounterexampleOptions.workspaceId(), getCounterexampleOptions.text() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (getCounterexampleOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getCounterexampleOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Counterexample.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Conversation method listLogs.
/**
* List log events in a workspace.
*
* List log events in a specific workspace.
*
* @param listLogsOptions the {@link ListLogsOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link LogCollection}
*/
public ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions) {
Validator.notNull(listLogsOptions, "listLogsOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "logs" };
String[] pathParameters = { listLogsOptions.workspaceId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (listLogsOptions.sort() != null) {
builder.query("sort", listLogsOptions.sort());
}
if (listLogsOptions.filter() != null) {
builder.query("filter", listLogsOptions.filter());
}
if (listLogsOptions.pageLimit() != null) {
builder.query("page_limit", String.valueOf(listLogsOptions.pageLimit()));
}
if (listLogsOptions.cursor() != null) {
builder.query("cursor", listLogsOptions.cursor());
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(LogCollection.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Conversation method listIntents.
/**
* List intents.
*
* List the intents for a workspace.
*
* @param listIntentsOptions the {@link ListIntentsOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link IntentCollection}
*/
public ServiceCall<IntentCollection> listIntents(ListIntentsOptions listIntentsOptions) {
Validator.notNull(listIntentsOptions, "listIntentsOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "intents" };
String[] pathParameters = { listIntentsOptions.workspaceId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (listIntentsOptions.export() != null) {
builder.query("export", String.valueOf(listIntentsOptions.export()));
}
if (listIntentsOptions.pageLimit() != null) {
builder.query("page_limit", String.valueOf(listIntentsOptions.pageLimit()));
}
if (listIntentsOptions.includeCount() != null) {
builder.query("include_count", String.valueOf(listIntentsOptions.includeCount()));
}
if (listIntentsOptions.sort() != null) {
builder.query("sort", listIntentsOptions.sort());
}
if (listIntentsOptions.cursor() != null) {
builder.query("cursor", listIntentsOptions.cursor());
}
if (listIntentsOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listIntentsOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentCollection.class));
}
Aggregations