public final class ConversationService extends WatsonService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION_DATE_2016_07_11
The Constant VERSION_DATE_2016-07-11.
|
static java.lang.String |
VERSION_DATE_2016_09_20
The Constant VERSION_DATE_2016-09-20.
|
static java.lang.String |
VERSION_DATE_2017_02_03
The Constant VERSION_DATE_2017-02-03.
|
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
ConversationService(java.lang.String versionDate)
Returns an instance of the Conversation Service using the service's default endpoint (URL).
|
ConversationService(java.lang.String versionDate,
java.lang.String username,
java.lang.String password)
Returns an instance of the Conversation Service using the service's default endpoint (URL), username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<ExampleResponse> |
createCounterexample(java.lang.String workspaceId,
java.lang.String text)
Create counterexample.
|
ServiceCall<ExampleResponse> |
createExample(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String text)
Create user input example.
|
ServiceCall<IntentResponse> |
createIntent(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String description,
java.util.List<CreateExample> examples)
Create intent.
|
ServiceCall<WorkspaceResponse> |
createWorkspace(CreateWorkspace body)
Create workspace.
|
ServiceCall<java.lang.Void> |
deleteCounterexample(java.lang.String workspaceId,
java.lang.String text)
Delete counterexample.
|
ServiceCall<java.lang.Void> |
deleteExample(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String text)
Delete user input example.
|
ServiceCall<java.lang.Void> |
deleteIntent(java.lang.String workspaceId,
java.lang.String intent)
Delete intent.
|
ServiceCall<java.lang.Void> |
deleteWorkspace(java.lang.String workspaceId)
Delete workspace.
|
ServiceCall<ExampleResponse> |
getCounterexample(java.lang.String workspaceId,
java.lang.String text)
Get counterexample.
|
ServiceCall<ExampleResponse> |
getExample(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String text)
Get user input example.
|
ServiceCall<IntentExportResponse> |
getIntent(java.lang.String workspaceId,
java.lang.String intent,
java.lang.Boolean export)
Get intent.
|
ServiceCall<WorkspaceExportResponse> |
getWorkspace(java.lang.String workspaceId,
java.lang.Boolean export)
Get information about a workspace.
|
ServiceCall<CounterexampleCollectionResponse> |
listCounterexamples(java.lang.String workspaceId,
java.lang.Long pageLimit,
java.lang.Boolean includeCount,
java.lang.String sort,
java.lang.String cursor)
List counterexamples.
|
ServiceCall<ExampleCollectionResponse> |
listExamples(java.lang.String workspaceId,
java.lang.String intent,
java.lang.Long pageLimit,
java.lang.Boolean includeCount,
java.lang.String sort,
java.lang.String cursor)
List user input examples.
|
ServiceCall<IntentCollectionResponse> |
listIntents(java.lang.String workspaceId,
java.lang.Boolean export,
java.lang.Long pageLimit,
java.lang.Boolean includeCount,
java.lang.String sort,
java.lang.String cursor)
List intents.
|
ServiceCall<WorkspaceCollectionResponse> |
listWorkspaces(java.lang.Long pageLimit,
java.lang.Boolean includeCount,
java.lang.String sort,
java.lang.String cursor)
List workspaces.
|
ServiceCall<MessageResponse> |
message(java.lang.String workspaceId,
MessageRequest request)
Sends a message to the service through a
MessageRequest . |
ServiceCall<ExampleResponse> |
updateCounterexample(java.lang.String workspaceId,
java.lang.String text,
java.lang.String newText)
Update counterexample.
|
ServiceCall<ExampleResponse> |
updateExample(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String text,
java.lang.String newText)
Update user input example.
|
ServiceCall<IntentResponse> |
updateIntent(java.lang.String workspaceId,
java.lang.String intent,
java.lang.String newIntent,
java.lang.String newDescription,
java.util.List<CreateExample> newExamples)
Update intent.
|
ServiceCall<WorkspaceResponse> |
updateWorkspace(java.lang.String workspaceId,
UpdateWorkspace body)
Update workspace.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public static final java.lang.String VERSION_DATE_2017_02_03
public static final java.lang.String VERSION_DATE_2016_09_20
public static final java.lang.String VERSION_DATE_2016_07_11
public ConversationService(java.lang.String versionDate)
versionDate
- Version of the API which is to be invoked by the REST client.public ConversationService(java.lang.String versionDate, java.lang.String username, java.lang.String password)
versionDate
- Version of the API which is to be invoked by the REST client.username
- the usernamepassword
- the passwordpublic ServiceCall<MessageResponse> message(java.lang.String workspaceId, MessageRequest request)
MessageRequest
.workspaceId
- the workspace idrequest
- the requestpublic ServiceCall<ExampleResponse> createCounterexample(java.lang.String workspaceId, java.lang.String text)
workspaceId
- The workspace ID.text
- The text of a user input example.ExampleResponse
with the responsepublic ServiceCall<java.lang.Void> deleteCounterexample(java.lang.String workspaceId, java.lang.String text)
workspaceId
- The workspace ID.text
- The text of a user input counterexample (for example, `What are you wearing?`).public ServiceCall<ExampleResponse> getCounterexample(java.lang.String workspaceId, java.lang.String text)
workspaceId
- The workspace ID.text
- The text of a user input counterexample (for example, `What are you wearing?`).ExampleResponse
with the responsepublic ServiceCall<CounterexampleCollectionResponse> listCounterexamples(java.lang.String workspaceId, java.lang.Long pageLimit, java.lang.Boolean includeCount, java.lang.String sort, java.lang.String cursor)
workspaceId
- The workspace ID.pageLimit
- The number of records to return in each page of results. The default page limit is 100.includeCount
- Whether to include information about the number of records returned.sort
- The sort order that determines the behavior of the pagination cursor.cursor
- A token identifying the last value from the previous page of results.CounterexampleCollectionResponse
with the responsepublic ServiceCall<ExampleResponse> updateCounterexample(java.lang.String workspaceId, java.lang.String text, java.lang.String newText)
workspaceId
- The workspace ID.text
- The text of a user input counterexample (for example, `What are you wearing?`).newText
- The text of the user input example.ExampleResponse
with the responsepublic ServiceCall<ExampleResponse> createExample(java.lang.String workspaceId, java.lang.String intent, java.lang.String text)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).text
- The text of a user input example.ExampleResponse
with the responsepublic ServiceCall<java.lang.Void> deleteExample(java.lang.String workspaceId, java.lang.String intent, java.lang.String text)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).text
- The text of the user input example.public ServiceCall<ExampleResponse> getExample(java.lang.String workspaceId, java.lang.String intent, java.lang.String text)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).text
- The text of the user input example.ExampleResponse
with the responsepublic ServiceCall<ExampleCollectionResponse> listExamples(java.lang.String workspaceId, java.lang.String intent, java.lang.Long pageLimit, java.lang.Boolean includeCount, java.lang.String sort, java.lang.String cursor)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).pageLimit
- The number of records to return in each page of results. The default page limit is 100.includeCount
- Whether to include information about the number of records returned.sort
- The sort order that determines the behavior of the pagination cursor.cursor
- A token identifying the last value from the previous page of results.ExampleCollectionResponse
with the responsepublic ServiceCall<ExampleResponse> updateExample(java.lang.String workspaceId, java.lang.String intent, java.lang.String text, java.lang.String newText)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).text
- The text of the user input example.newText
- The text of the user input example.ExampleResponse
with the responsepublic ServiceCall<IntentResponse> createIntent(java.lang.String workspaceId, java.lang.String intent, java.lang.String description, java.util.List<CreateExample> examples)
workspaceId
- The workspace ID.intent
- The name of the intent.description
- The description of the intent.examples
- An array of user input examples.IntentResponse
with the responsepublic ServiceCall<java.lang.Void> deleteIntent(java.lang.String workspaceId, java.lang.String intent)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).public ServiceCall<IntentExportResponse> getIntent(java.lang.String workspaceId, java.lang.String intent, java.lang.Boolean export)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).export
- Whether to include all element content in the returned data. If export=`false`, the returned
data includes only information about the element itself. If export=`true`, all content,
including subelements, is included. The default value is `false`.IntentExportResponse
with the responsepublic ServiceCall<IntentCollectionResponse> listIntents(java.lang.String workspaceId, java.lang.Boolean export, java.lang.Long pageLimit, java.lang.Boolean includeCount, java.lang.String sort, java.lang.String cursor)
workspaceId
- The workspace ID.export
- Whether to include all element content in the returned data. If export=`false`, the returned
data includes only information about the element itself. If export=`true`, all content,
including subelements, is included. The default value is `false`.pageLimit
- The number of records to return in each page of results. The default page limit is 100.includeCount
- Whether to include information about the number of records returned.sort
- The sort order that determines the behavior of the pagination cursor.cursor
- A token identifying the last value from the previous page of results.IntentCollectionResponse
with the responsepublic ServiceCall<IntentResponse> updateIntent(java.lang.String workspaceId, java.lang.String intent, java.lang.String newIntent, java.lang.String newDescription, java.util.List<CreateExample> newExamples)
workspaceId
- The workspace ID.intent
- The intent name (for example, `pizza_order`).newIntent
- The name of the intent.newDescription
- The description of the intent.newExamples
- An array of user input examples for the intent.IntentResponse
with the responsepublic ServiceCall<WorkspaceResponse> createWorkspace(CreateWorkspace body)
body
- Valid JSON data defining the content of the new workspace.WorkspaceResponse
with the responsepublic ServiceCall<java.lang.Void> deleteWorkspace(java.lang.String workspaceId)
workspaceId
- The workspace ID.public ServiceCall<WorkspaceExportResponse> getWorkspace(java.lang.String workspaceId, java.lang.Boolean export)
workspaceId
- The workspace ID.export
- Whether to include all element content in the returned data. If export=`false`, the returned
data includes only information about the element itself. If export=`true`, all content,
including subelements, is included. The default value is `false`.WorkspaceExportResponse
with the responsepublic ServiceCall<WorkspaceCollectionResponse> listWorkspaces(java.lang.Long pageLimit, java.lang.Boolean includeCount, java.lang.String sort, java.lang.String cursor)
pageLimit
- The number of records to return in each page of results. The default page limit is 100.includeCount
- Whether to include information about the number of records returned.sort
- The sort order that determines the behavior of the pagination cursor.cursor
- A token identifying the last value from the previous page of results.WorkspaceCollectionResponse
with the responsepublic ServiceCall<WorkspaceResponse> updateWorkspace(java.lang.String workspaceId, UpdateWorkspace body)
workspaceId
- The workspace ID.body
- Valid JSON data defining the new workspace content. Any elements included in the new JSON
will completely replace the existing elements, including all subelements. Previously existing
subelements are not retained unless they are included in the new JSON.WorkspaceResponse
with the response