This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dependencies> | |
| <dependency> | |
| <groupId>com.amazon.alexa</groupId> | |
| <artifactId>ask-sdk</artifactId> | |
| <version>2.9.2</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.amazonaws</groupId> | |
| <artifactId>aws-lambda-java-log4j2</artifactId> | |
| <version>1.0.0</version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class UpcomingMoviesStreamHandler extends SkillStreamHandler { | |
| public static final String CARD_TITLE = "Estrenos de cine"; | |
| public UpcomingMoviesStreamHandler() { | |
| super(getSkill()); | |
| } | |
| private static Skill getSkill() { | |
| return Skills.standard() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CancelAndStopIntentHandler implements RequestHandler { | |
| @Override | |
| public boolean canHandle(HandlerInput input) { | |
| return input.matches(intentName("AMAZON.StopIntent").or(intentName("AMAZON.CancelIntent"))); | |
| } | |
| @Override | |
| public Optional<Response> handle(HandlerInput input) { | |
| String text = "Gracias por usar Estrenos de cine"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "1.0", | |
| "session": { | |
| "new": true, | |
| "sessionId": "", | |
| "application": { | |
| "applicationId": "" | |
| }, | |
| "user": { | |
| "userId": "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "body": { | |
| "version": "1.0", | |
| "response": { | |
| "outputSpeech": { | |
| "type": "SSML", | |
| "ssml": "<speak>Bienvenido a Estrenos de Cine! Pregúntame por los estrenos de cine de esta semana</speak>" | |
| }, | |
| "card": { | |
| "type": "Simple", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "request": { | |
| "type": "IntentRequest", | |
| "requestId": "", | |
| "timestamp": "2019-02-23T19:05:38Z", | |
| "locale": "es-ES", | |
| "intent": { | |
| "name": "AMAZON.HelpIntent", | |
| "confirmationStatus": "NONE" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NewReleasesIntentHandler implements RequestHandler { | |
| ... | |
| @Override | |
| public Optional<Response> handle(HandlerInput input) { | |
| Request request = input.getRequestEnvelope().getRequest(); | |
| IntentRequest intentRequest = (IntentRequest) request; | |
| Intent intent = intentRequest.getIntent(); | |
| Map<String, Slot> slots = intent.getSlots(); | |
| Slot releasesDate = slots.get("releasesDate"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NewReleasesIntentHandler implements RequestHandler { | |
| ... | |
| @Override | |
| public Optional<Response> handle(HandlerInput input) { | |
| ... | |
| // Collect the slot from the request | |
| ... | |
| String text = null; | |
| String reprompText = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "interactionModel": { | |
| "languageModel": { | |
| "invocationName": "estrenos de cine", | |
| "intents": [ | |
| ... | |
| { | |
| "name": "NewReleasesIntent", | |
| "slots": [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LogRequestInterceptor : RequestInterceptor { | |
| override fun process(input: HandlerInput) { | |
| println("Request: ${JacksonSerializer().serialize(input.request)}") | |
| } | |
| } |