use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Conversation method deleteDialogNode.
/**
* Delete dialog node.
*
* Delete a dialog node from the workspace.
*
* @param deleteDialogNodeOptions the {@link DeleteDialogNodeOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteDialogNode(DeleteDialogNodeOptions deleteDialogNodeOptions) {
Validator.notNull(deleteDialogNodeOptions, "deleteDialogNodeOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "dialog_nodes" };
String[] pathParameters = { deleteDialogNodeOptions.workspaceId(), deleteDialogNodeOptions.dialogNode() };
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 deleteSynonym.
/**
* Delete entity value synonym.
*
* Delete a synonym for an entity value.
*
* @param deleteSynonymOptions the {@link DeleteSynonymOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteSynonym(DeleteSynonymOptions deleteSynonymOptions) {
Validator.notNull(deleteSynonymOptions, "deleteSynonymOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "entities", "values", "synonyms" };
String[] pathParameters = { deleteSynonymOptions.workspaceId(), deleteSynonymOptions.entity(), deleteSynonymOptions.value(), deleteSynonymOptions.synonym() };
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 updateIntent.
/**
* Update intent.
*
* Update an existing intent with new or modified data. You must provide data defining the content of the updated
* intent.
*
* @param updateIntentOptions the {@link UpdateIntentOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link Intent}
*/
public ServiceCall<Intent> updateIntent(UpdateIntentOptions updateIntentOptions) {
Validator.notNull(updateIntentOptions, "updateIntentOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "intents" };
String[] pathParameters = { updateIntentOptions.workspaceId(), updateIntentOptions.intent() };
RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
final JsonObject contentJson = new JsonObject();
if (updateIntentOptions.newIntent() != null) {
contentJson.addProperty("intent", updateIntentOptions.newIntent());
}
if (updateIntentOptions.newExamples() != null) {
contentJson.add("examples", GsonSingleton.getGson().toJsonTree(updateIntentOptions.newExamples()));
}
if (updateIntentOptions.newDescription() != null) {
contentJson.addProperty("description", updateIntentOptions.newDescription());
}
builder.bodyJson(contentJson);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Intent.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Conversation method getValue.
/**
* Get entity value.
*
* Get information about an entity value.
*
* @param getValueOptions the {@link GetValueOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link ValueExport}
*/
public ServiceCall<ValueExport> getValue(GetValueOptions getValueOptions) {
Validator.notNull(getValueOptions, "getValueOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "entities", "values" };
String[] pathParameters = { getValueOptions.workspaceId(), getValueOptions.entity(), getValueOptions.value() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
if (getValueOptions.export() != null) {
builder.query("export", String.valueOf(getValueOptions.export()));
}
if (getValueOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getValueOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueExport.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Assistant method deleteWorkspace.
/**
* Delete workspace.
*
* Delete a workspace from the service instance. This operation is limited to 30 requests per 30 minutes. For more
* information, see **Rate limiting**.
*
* @param deleteWorkspaceOptions the {@link DeleteWorkspaceOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteWorkspace(DeleteWorkspaceOptions deleteWorkspaceOptions) {
Validator.notNull(deleteWorkspaceOptions, "deleteWorkspaceOptions cannot be null");
String[] pathSegments = { "v1/workspaces" };
String[] pathParameters = { deleteWorkspaceOptions.workspaceId() };
RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}
Aggregations