package com.github.cato447.handlers;

import com.amazon.ask.dispatcher.request.handler.HandlerInput;
import com.amazon.ask.dispatcher.request.handler.RequestHandler;
import com.amazon.ask.model.Response;

import java.util.Optional;

import static com.amazon.ask.request.Predicates.intentName;

public class HelloWorldIntentHandler implements RequestHandler {

    public boolean canHandle(HandlerInput input) {
        return input.matches(intentName("HelloWorldIntent"));
    }

    public Optional<Response> handle(HandlerInput input) {
        String speechText = "I am alive Hello World!";
        return input.getResponseBuilder()
                .withSpeech(speechText)
                .withSimpleCard("Hello World", speechText)
                .build();
    }

}
