public class CustomSkill extends AbstractSkill<RequestEnvelope,ResponseEnvelope> implements AlexaSkill<RequestEnvelope,ResponseEnvelope>
Modifier and Type | Field and Description |
---|---|
protected com.amazon.ask.model.services.ApiClient |
apiClient
Client to make external API calls.
|
protected String |
customUserAgent
Custom user agent.
|
protected PersistenceAdapter |
persistenceAdapter
store skill attributes to a persistence layer.
|
protected GenericRequestDispatcher<HandlerInput,Optional<Response>> |
requestDispatcher
Request Dispatcher.
|
protected com.amazon.ask.model.services.Serializer |
serializer
Serializer for marshalling and un-marshalling purposes.
|
protected String |
skillId
Unique ID associated with a Skill.
|
protected TemplateFactory<HandlerInput,Response> |
templateFactory
Interface to process template and data to generate skill response.
|
marshaller, unmarshallerChain
Constructor and Description |
---|
CustomSkill(CustomSkillConfiguration configuration)
Constructor for CustomSkill.
|
Modifier and Type | Method and Description |
---|---|
protected com.amazon.ask.model.services.ApiConfiguration |
getApiConfiguration(RequestEnvelope requestEnvelope)
Getter for Api configuration.
|
ResponseEnvelope |
invoke(RequestEnvelope requestEnvelope)
.
|
ResponseEnvelope |
invoke(RequestEnvelope requestEnvelope,
Object context)
.
|
protected ResponseEnvelope |
invoke(UnmarshalledRequest<RequestEnvelope> unmarshalledRequest,
Object context)
Invokes the dispatcher to handler the request envelope and construct the handler input.
|
execute
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, execute
protected final GenericRequestDispatcher<HandlerInput,Optional<Response>> requestDispatcher
protected final PersistenceAdapter persistenceAdapter
protected final com.amazon.ask.model.services.ApiClient apiClient
protected final com.amazon.ask.model.services.Serializer serializer
protected final String customUserAgent
protected final String skillId
protected final TemplateFactory<HandlerInput,Response> templateFactory
public CustomSkill(CustomSkillConfiguration configuration)
configuration
- custom skill configuration.public ResponseEnvelope invoke(RequestEnvelope requestEnvelope)
public ResponseEnvelope invoke(RequestEnvelope requestEnvelope, Object context)
protected ResponseEnvelope invoke(UnmarshalledRequest<RequestEnvelope> unmarshalledRequest, Object context)
invoke
in class AbstractSkill<RequestEnvelope,ResponseEnvelope>
unmarshalledRequest
- unmarshalled output from JacksonJsonUnmarshaller
, containing a
RequestEnvelope
and a JSON representation of the request.context
- contextprotected com.amazon.ask.model.services.ApiConfiguration getApiConfiguration(RequestEnvelope requestEnvelope)
requestEnvelope
- request envelope.ApiConfiguration
.Copyright © 2023. All rights reserved.