ask_sdk_model.services.game_engine package

Submodules

Note

Canonical imports have been added in the __init__.py of the package. This helps in importing the class directly from the package, than through the module.

For eg: if package a has module b with class C, you can do from a import C instead of from a.b import C.

ask_sdk_model.services.game_engine.deviation_recognizer module

class ask_sdk_model.services.game_engine.deviation_recognizer.DeviationRecognizer(recognizer=None)

Bases: ask_sdk_model.services.game_engine.recognizer.Recognizer

The deviation recognizer returns true when another specified recognizer reports that the player has deviated from its expected pattern.

Parameters:recognizer ((optional) str) – The name of the recognizer that defines a pattern that must not be deviated from.
attribute_map = {'object_type': 'type', 'recognizer': 'recognizer'}
deserialized_types = {'object_type': 'str', 'recognizer': 'str'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.event module

class ask_sdk_model.services.game_engine.event.Event(should_end_input_handler=None, meets=None, fails=None, reports=None, maximum_invocations=None, trigger_time_milliseconds=None)

Bases: object

The events object is where you define the conditions that must be met for your skill to be notified of Echo Button input. You must define at least one event.

Parameters:
  • should_end_input_handler ((optional) bool) – Whether the Input Handler should end after this event fires. If true, the Input Handler will stop and no further events will be sent to your skill unless you call StartInputHandler again.
  • meets ((optional) list[str]) –
  • fails ((optional) list[str]) –
  • reports ((optional) ask_sdk_model.services.game_engine.event_reporting_type.EventReportingType) –
  • maximum_invocations ((optional) int) – Enables you to limit the number of times that the skill is notified about the same event during the course of the Input Handler. The default value is 1. This property is mutually exclusive with triggerTimeMilliseconds.
  • trigger_time_milliseconds ((optional) int) – Adds a time constraint to the event. Instead of being considered whenever a raw button event occurs, an event that has this parameter will only be considered once at triggerTimeMilliseconds after the Input Handler has started. Because a time-triggered event can only fire once, the maximumInvocations value is ignored. Omit this property entirely if you do not want to time-constrain the event.
attribute_map = {'fails': 'fails', 'maximum_invocations': 'maximumInvocations', 'meets': 'meets', 'reports': 'reports', 'should_end_input_handler': 'shouldEndInputHandler', 'trigger_time_milliseconds': 'triggerTimeMilliseconds'}
deserialized_types = {'fails': 'list[str]', 'maximum_invocations': 'int', 'meets': 'list[str]', 'reports': 'ask_sdk_model.services.game_engine.event_reporting_type.EventReportingType', 'should_end_input_handler': 'bool', 'trigger_time_milliseconds': 'int'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.event_reporting_type module

class ask_sdk_model.services.game_engine.event_reporting_type.EventReportingType

Bases: enum.Enum

Specifies what raw button presses to put in the inputEvents field of the event. * history - All button presses since this Input Handler was started. * matches - Just the button presses that contributed to this event (that is, were in the recognizers). To receive no raw button presses, leave this array empty or do not specify it at all.

Allowed enum values: [history, matches]

history = 'history'
matches = 'matches'
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.input_event module

class ask_sdk_model.services.game_engine.input_event.InputEvent(gadget_id=None, timestamp=None, action=None, color=None, feature=None)

Bases: object

Parameters:
  • gadget_id ((optional) str) – The identifier of the Echo Button in question. It matches the gadgetId that you will have discovered in roll call.
  • timestamp ((optional) str) – The event's original moment of occurrence, in ISO format.
  • action ((optional) ask_sdk_model.services.game_engine.input_event_action_type.InputEventActionType) –
  • color ((optional) str) – The hexadecimal RGB values of the button LED at the time of the event.
  • feature ((optional) str) – For gadgets with multiple features, this is the feature that the event represents. Echo Buttons have one feature only, so this is always `press`.
attribute_map = {'action': 'action', 'color': 'color', 'feature': 'feature', 'gadget_id': 'gadgetId', 'timestamp': 'timestamp'}
deserialized_types = {'action': 'ask_sdk_model.services.game_engine.input_event_action_type.InputEventActionType', 'color': 'str', 'feature': 'str', 'gadget_id': 'str', 'timestamp': 'str'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.input_event_action_type module

class ask_sdk_model.services.game_engine.input_event_action_type.InputEventActionType

Bases: enum.Enum

Either "down" for a button pressed or "up" for a button released.

Allowed enum values: [down, up]

down = 'down'
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

up = 'up'

ask_sdk_model.services.game_engine.input_handler_event module

class ask_sdk_model.services.game_engine.input_handler_event.InputHandlerEvent(name=None, input_events=None)

Bases: object

Parameters:
attribute_map = {'input_events': 'inputEvents', 'name': 'name'}
deserialized_types = {'input_events': 'list[ask_sdk_model.services.game_engine.input_event.InputEvent]', 'name': 'str'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.pattern module

class ask_sdk_model.services.game_engine.pattern.Pattern(gadget_ids=None, colors=None, action=None, repeat=None)

Bases: object

An object that provides all of the events that need to occur, in a specific order, for this recognizer to be true. Omitting any parameters in this object means "match anything".

Parameters:
attribute_map = {'action': 'action', 'colors': 'colors', 'gadget_ids': 'gadgetIds', 'repeat': 'repeat'}
deserialized_types = {'action': 'ask_sdk_model.services.game_engine.input_event_action_type.InputEventActionType', 'colors': 'list[str]', 'gadget_ids': 'list[str]', 'repeat': 'int'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.pattern_recognizer module

class ask_sdk_model.services.game_engine.pattern_recognizer.PatternRecognizer(anchor=None, fuzzy=None, gadget_ids=None, actions=None, pattern=None)

Bases: ask_sdk_model.services.game_engine.recognizer.Recognizer

This recognizer is true when all of the specified events have occurred in the specified order.

Parameters:
attribute_map = {'actions': 'actions', 'anchor': 'anchor', 'fuzzy': 'fuzzy', 'gadget_ids': 'gadgetIds', 'object_type': 'type', 'pattern': 'pattern'}
deserialized_types = {'actions': 'list[str]', 'anchor': 'ask_sdk_model.services.game_engine.pattern_recognizer_anchor_type.PatternRecognizerAnchorType', 'fuzzy': 'bool', 'gadget_ids': 'list[str]', 'object_type': 'str', 'pattern': 'list[ask_sdk_model.services.game_engine.pattern.Pattern]'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.pattern_recognizer_anchor_type module

class ask_sdk_model.services.game_engine.pattern_recognizer_anchor_type.PatternRecognizerAnchorType

Bases: enum.Enum

Where the pattern must appear in the history of this input handler. * `start` - (Default) The first event in the pattern must be the first event in the history of raw Echo Button events. * `end` - The last event in the pattern must be the last event in the history of raw Echo Button events. * `anywhere` - The pattern may appear anywhere in the history of raw Echo Button events.

Allowed enum values: [start, end, anywhere]

anywhere = 'anywhere'
end = 'end'
start = 'start'
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.progress_recognizer module

class ask_sdk_model.services.game_engine.progress_recognizer.ProgressRecognizer(recognizer=None, completion=None)

Bases: ask_sdk_model.services.game_engine.recognizer.Recognizer

This recognizer consults another recognizer for the degree of completion, and is true if that degree is above the specified threshold. The completion parameter is specified as a decimal percentage.

Parameters:
  • recognizer ((optional) str) – The name of a recognizer for which to track the progress.
  • completion ((optional) float) – The completion threshold, as a decimal percentage, of the specified recognizer before which this recognizer becomes true.
attribute_map = {'completion': 'completion', 'object_type': 'type', 'recognizer': 'recognizer'}
deserialized_types = {'completion': 'float', 'object_type': 'str', 'recognizer': 'str'}
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model

ask_sdk_model.services.game_engine.recognizer module

class ask_sdk_model.services.game_engine.recognizer.Recognizer(object_type=None)

Bases: object

Recognizers are conditions that, at any moment, are either true or false, based on all the raw button events that the Input Handler has received in the time elapsed since the Input Handler session started.

Parameters:object_type ((optional) str) –

Note

This is an abstract class. Use the following mapping, to figure out the model class to be instantiated, that sets type variable.

attribute_map = {'object_type': 'type'}
deserialized_types = {'object_type': 'str'}
discriminator_value_class_map = {'deviation': 'ask_sdk_model.services.game_engine.deviation_recognizer.DeviationRecognizer', 'match': 'ask_sdk_model.services.game_engine.pattern_recognizer.PatternRecognizer', 'progress': 'ask_sdk_model.services.game_engine.progress_recognizer.ProgressRecognizer'}
classmethod get_real_child_model(data)

Returns the real base class specified by the discriminator

json_discriminator_key = 'type'
supports_multiple_types = False
to_dict()

Returns the model properties as a dict

to_str()

Returns the string representation of the model