use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class StandingOrderDialog method getStandingOrdersModifyResponse.
private SpeechletResponse getStandingOrdersModifyResponse(Intent intent, SessionStorage.Storage storage) {
String standingOrderToModify = (String) storage.get("StandingOrderToModify");
String newAmount = (String) storage.get("NewAmount");
String newExecutionRate = (String) storage.get("NewExecutionRate");
String newFirstExecution = (String) storage.get("NewFirstExecution");
ObjectMapper mapper = new ObjectMapper();
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("Ändere Dauerauftrag");
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
JSONObject jsonObject = new JSONObject();
try {
//TODO
jsonObject.put("payee", "Max Mustermann");
jsonObject.put("amount", newAmount);
jsonObject.put("destinationAccount", "DE39100000007777777777");
jsonObject.put("firstExecution", "2017-06-01");
jsonObject.put("executionRate", "MONTHLY");
jsonObject.put("description", "Updated standing Order");
} catch (JSONException e) {
LOGGER.error(e.getMessage());
}
BankingRESTClient bankingRESTClient = BankingRESTClient.getInstance();
bankingRESTClient.putBankingModelObject("/api/v1_0/accounts/9999999999/standingorders/" + standingOrderToModify, jsonObject.toString(), StandingOrder.class);
card.setContent("Dauerauftrag Nummer " + standingOrderToModify + " wurde geändert.");
speech.setText("Dauerauftrag Nummer " + standingOrderToModify + " wurde geaendert.");
return SpeechletResponse.newTellResponse(speech, card);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class AbstractSpeechService method getPlainTextOutputSpeech.
/**
* Helper method for retrieving an OutputSpeech object when given a string of TTS.
*
* @param speechText the text that should be spoken out to the user.
* @return an instance of SpeechOutput.
*/
protected PlainTextOutputSpeech getPlainTextOutputSpeech(String speechText) {
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
return speech;
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class DummyDepot method getSpeechletResponse.
private static SpeechletResponse getSpeechletResponse(String speechText, String repromptText) {
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("Bank Information");
card.setContent(speechText);
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
return SpeechletResponse.newTellResponse(speech, card);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class StandingOrderDialog method getNextStandingOrderInfo.
private SpeechletResponse getNextStandingOrderInfo(SessionStorage.Storage storage) {
int nextEntry = (int) storage.get("NextStandingOrder");
StandingOrder nextSO;
StringBuilder textBuilder = new StringBuilder();
if (nextEntry < standingOrders.length) {
nextSO = standingOrders[nextEntry];
textBuilder.append("Dauerauftrag Nummer ").append(nextSO.getStandingOrderId()).append(": ");
textBuilder.append("Ueberweise ").append(nextSO.getExecutionRateString()).append(nextSO.getAmount()).append(" Euro an ").append(nextSO.getPayee()).append(".");
// Save current list offset in this session
storage.put("NextStandingOrder", nextEntry + 1);
String text = textBuilder.toString();
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(text);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
} else {
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText("Das waren alle vorhandenen Dauerauftraege.");
return SpeechletResponse.newTellResponse(speech);
}
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class TestListDialog method initialList.
private SpeechletResponse initialList(SessionStorage.Storage storage) {
// Return the first three list entries
String speechText = exampleList[0] + ". " + exampleList[1] + ". " + exampleList[2] + ". Möchtest du noch mehr hören?";
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
// Save current list offset in this session
storage.put("TestList.NextEntry", 3);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
Aggregations