Package ai.tock.bot.api.client
Class TockClientBus
-
- All Implemented Interfaces:
-
ai.tock.bot.api.client.ClientBus,ai.tock.bot.engine.Bus,ai.tock.bot.engine.I18nTranslator,ai.tock.translator.I18nKeyProvider
public final class TockClientBus implements ClientBus
-
-
Field Summary
Fields Modifier and Type Field Description private final StringapplicationIdprivate final PlayerIduserIdprivate final PlayerIdbotIdprivate final IntentAwareintentprivate final Booleantestprivate final LocaleuserLocaleprivate final UserInterfaceTypeuserInterfaceTypeprivate final ConnectorTypesourceConnectorTypeprivate final ConnectorTypetargetConnectorTypeprivate final StringcontextIdprivate final IntegercurrentAnswerIndexprivate final List<Entity>entitiesprivate final UserMessagemessageprivate ClientStoryDefinitionstoryprivate ClientStepstepprivate final StringstepNameprivate final ClientBotDefinitionbotDefinitionprivate final StringrequestIdprivate final UserRequestrequestprivate final Function1<BotResponse, Unit>sendAnswerprivate final IntentAwarecurrentIntent
-
Constructor Summary
Constructors Constructor Description TockClientBus(ClientBotDefinition botDefinition, RequestData data, Function1<BotResponse, Unit> sendAnswer)TockClientBus(ClientBotDefinition botDefinition, String requestId, UserRequest request, Function1<BotResponse, Unit> sendAnswer)
-
Method Summary
Modifier and Type Method Description StringgetApplicationId()PlayerIdgetUserId()PlayerIdgetBotId()IntentAwaregetIntent()BooleangetTest()LocalegetUserLocale()UserInterfaceTypegetUserInterfaceType()ConnectorTypegetSourceConnectorType()ConnectorTypegetTargetConnectorType()StringgetContextId()IntegergetCurrentAnswerIndex()List<Entity>getEntities()The entity list. UserMessagegetMessage()The user message. ClientStoryDefinitiongetStory()The current story. UnitsetStory(ClientStoryDefinition story)The current story. ClientStepgetStep()The current step. UnitsetStep(ClientStep step)The current step. StringgetStepName()ClientBotDefinitiongetBotDefinition()The bot definition. final StringgetRequestId()final UserRequestgetRequest()final Function1<BotResponse, Unit>getSendAnswer()Unithandle()Handles the current request. LongdefaultDelay(Integer answerIndex)ClientBusendRawText(CharSequence plainText, Long delay)ClientBussendRawText(CharSequence plainText, Long delay)ClientBussendDebugData(String title, Object data)Add a debug data message for the test connector only ClientBussend(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)Sends a text with suggestions. ClientBussend(Carousel carousel)Sends a Carousel. ClientBussend(Card card)Sends a Card. ClientBusend(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)Sends a text with suggestions as last bot answer. ClientBusend(Card card)Sends a Card as last bot answer. ClientBusend(Carousel carousel)Sends a [Carousel as last bot answer. ClientBuswithMessage(ConnectorType connectorType, Function0<ConnectorMessage> messageProvider)ClientBuswithMessage(ConnectorType connectorType, String connectorId, Function0<ConnectorMessage> messageProvider)I18nLabelValuei18n(CharSequence defaultLabel, List<Object> args)-
Methods inherited from class ai.tock.bot.engine.Bus
end, end, end, end, getCurrentIntent, send, send, send, send, sendDebug, withMessage -
Methods inherited from class ai.tock.bot.api.client.ClientBus
end, entity, entityText, entityValue, isCompatibleWith, newAction, newAttachment, newCard, newCard, newCarousel, newCarousel, removeEntity, removeEntity, send, translate -
Methods inherited from class ai.tock.translator.I18nKeyProvider
i18n -
Methods inherited from class ai.tock.bot.engine.I18nTranslator
translate, translate, translateAndReturnBlankAsNull -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
TockClientBus
TockClientBus(ClientBotDefinition botDefinition, RequestData data, Function1<BotResponse, Unit> sendAnswer)
-
TockClientBus
TockClientBus(ClientBotDefinition botDefinition, String requestId, UserRequest request, Function1<BotResponse, Unit> sendAnswer)
-
-
Method Detail
-
getApplicationId
String getApplicationId()
-
getUserId
PlayerId getUserId()
-
getBotId
PlayerId getBotId()
-
getIntent
IntentAware getIntent()
-
getUserLocale
Locale getUserLocale()
-
getUserInterfaceType
UserInterfaceType getUserInterfaceType()
-
getSourceConnectorType
ConnectorType getSourceConnectorType()
-
getTargetConnectorType
ConnectorType getTargetConnectorType()
-
getContextId
String getContextId()
-
getCurrentAnswerIndex
Integer getCurrentAnswerIndex()
-
getEntities
List<Entity> getEntities()
The entity list.
-
getMessage
UserMessage getMessage()
The user message.
-
getStory
ClientStoryDefinition getStory()
The current story.
-
setStory
Unit setStory(ClientStoryDefinition story)
The current story.
-
getStep
ClientStep getStep()
The current step.
-
setStep
Unit setStep(ClientStep step)
The current step.
-
getStepName
String getStepName()
-
getBotDefinition
ClientBotDefinition getBotDefinition()
The bot definition.
-
getRequestId
final String getRequestId()
-
getRequest
final UserRequest getRequest()
-
getSendAnswer
final Function1<BotResponse, Unit> getSendAnswer()
-
defaultDelay
Long defaultDelay(Integer answerIndex)
-
endRawText
ClientBus endRawText(CharSequence plainText, Long delay)
-
sendRawText
ClientBus sendRawText(CharSequence plainText, Long delay)
-
sendDebugData
ClientBus sendDebugData(String title, Object data)
Add a debug data message for the test connector only
- Parameters:
title- title of debug messagedata- object corresponding to the debugging data
-
send
ClientBus send(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)
Sends a text with suggestions.
-
end
ClientBus end(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)
Sends a text with suggestions as last bot answer.
-
withMessage
ClientBus withMessage(ConnectorType connectorType, Function0<ConnectorMessage> messageProvider)
-
withMessage
ClientBus withMessage(ConnectorType connectorType, String connectorId, Function0<ConnectorMessage> messageProvider)
-
i18n
I18nLabelValue i18n(CharSequence defaultLabel, List<Object> args)
-
-
-
-