use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class BankAccountService method getSpeechletResponse.
private SpeechletResponse getSpeechletResponse(String speechText) {
SimpleCard card = new SimpleCard();
card.setTitle(CARD_NAME);
card.setContent(speechText);
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 ReplacementCardDialog method cancelDialog.
private SpeechletResponse cancelDialog() {
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText("");
return SpeechletResponse.newTellResponse(speech);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class ReplacementCardDialog method askIfBlockedOrDamaged.
private SpeechletResponse askIfBlockedOrDamaged(Intent intent, SessionStorage.Storage storage) {
String fourDigits = intent.getSlot("FourDigits").getValue();
logger.info("Digits: " + fourDigits);
boolean validDigits = false;
// Check if these digits are valid
List<String> userCards = (List<String>) storage.get(STORAGE_VALID_CARDS);
for (String cardNumber : userCards) {
if (cardNumber.substring(cardNumber.length() - 4).equals(fourDigits)) {
// Digits are valid
storage.put(STORAGE_SELECTED_CARD, cardNumber);
validDigits = true;
break;
}
}
// If these are invalid digits, ask again
if (!validDigits) {
return askForCardNumber(storage, true);
}
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText("Wurde die Karte gesperrt oder wurde sie beschädigt?");
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class StandingOrderDialog method getStandingOrdersDeleteResponse.
private SpeechletResponse getStandingOrdersDeleteResponse(Intent intent, SessionStorage.Storage storage) {
LOGGER.info("StandingOrdersDeleteResponse called.");
String standingOrderToDelete = (String) storage.get("StandingOrderToDelete");
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("Lösche Dauerauftrag");
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
ApiHelper helper = new ApiHelper();
try {
helper.sendDelete("http://amos-bank-lb-723794096.eu-central-1.elb.amazonaws.com/api/v1_0/accounts/9999999999/standingorders/" + standingOrderToDelete);
} catch (Exception e) {
LOGGER.error(e.getMessage());
card.setContent("Dauerauftrag Nummer " + standingOrderToDelete + " wurde nicht gefunden.");
speech.setText("Dauerauftrag Nummer " + standingOrderToDelete + " wurde nicht gefunden.");
return SpeechletResponse.newTellResponse(speech, card);
}
card.setContent("Dauerauftrag Nummer " + standingOrderToDelete + " wurde gelöscht.");
speech.setText("Dauerauftrag Nummer " + standingOrderToDelete + " wurde geloescht.");
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 askForDDeletionConfirmation.
private SpeechletResponse askForDDeletionConfirmation(Intent intent, SessionStorage.Storage storage) {
Map<String, Slot> slots = intent.getSlots();
Slot numberSlot = slots.get("Number");
LOGGER.info("NumberSlot: " + numberSlot.getValue());
storage.put("StandingOrderToDelete", numberSlot.getValue());
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText("Moechtest du den Dauerauftrag mit der Nummer " + numberSlot.getValue() + " wirklich loeschen?");
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
Aggregations