Skip to content

Commit

Permalink
Release 1.8.0. For changelog, check CHANGELOG.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ask-pyth committed Mar 13, 2019
1 parent 4429ef8 commit 57d7a1e
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 3 deletions.
8 changes: 8 additions & 0 deletions ask-sdk-model/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,11 @@ This release contains the following changes :

- Support for proactive event calls from out of skill session.
- Remove delete reminders support.


1.8.0
~~~~~~~

This release contains the following :
Introduces support for customizing your skill’s experience for Echo Auto, which is now shipping to select customers via our invite program, and vehicles and other aftermarket devices that support Alexa Auto.
The automotive experience introduces another way for customers to interact with skills, while they are on-the-go and their attention is on the road. Now you can adapt your skill experience to be succinct, location-aware, and adaptive to your customer’s needs while they’re outside the home.
2 changes: 1 addition & 1 deletion ask-sdk-model/ask_sdk_model/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__pip_package_name__ = 'ask-sdk-model'
__description__ = 'The ASK SDK Model package provides model definitions, for building Alexa Skills.'
__url__ = 'https://github.com/alexa/alexa-apis-for-python'
__version__ = '1.7.0'
__version__ = '1.8.0'
__author__ = 'Alexa Skills Kit'
__author_email__ = 'ask-sdk-dynamic@amazon.com'
__license__ = 'Apache 2.0'
Expand Down
12 changes: 10 additions & 2 deletions ask-sdk-model/ask_sdk_model/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from typing import Dict, List, Optional
from datetime import datetime
from ask_sdk_model.interfaces.system.system_state import SystemState
from ask_sdk_model.interfaces.automotive.automotive_state import AutomotiveState
from ask_sdk_model.interfaces.geolocation.geolocation_state import GeolocationState
from ask_sdk_model.interfaces.audioplayer.audio_player_state import AudioPlayerState
from ask_sdk_model.interfaces.viewport.viewport_state import ViewportState
Expand All @@ -37,6 +38,8 @@ class Context(object):
:type system: (optional) ask_sdk_model.interfaces.system.system_state.SystemState
:param audio_player: Provides the current state for the AudioPlayer interface.
:type audio_player: (optional) ask_sdk_model.interfaces.audioplayer.audio_player_state.AudioPlayerState
:param automotive: Provides the automotive specific information of the device.
:type automotive: (optional) ask_sdk_model.interfaces.automotive.automotive_state.AutomotiveState
:param display: Provides the current state for the Display interface.
:type display: (optional) ask_sdk_model.interfaces.display.display_state.DisplayState
:param geolocation: Provides the last gathered geolocation information of the device.
Expand All @@ -48,6 +51,7 @@ class Context(object):
deserialized_types = {
'system': 'ask_sdk_model.interfaces.system.system_state.SystemState',
'audio_player': 'ask_sdk_model.interfaces.audioplayer.audio_player_state.AudioPlayerState',
'automotive': 'ask_sdk_model.interfaces.automotive.automotive_state.AutomotiveState',
'display': 'ask_sdk_model.interfaces.display.display_state.DisplayState',
'geolocation': 'ask_sdk_model.interfaces.geolocation.geolocation_state.GeolocationState',
'viewport': 'ask_sdk_model.interfaces.viewport.viewport_state.ViewportState'
Expand All @@ -56,19 +60,22 @@ class Context(object):
attribute_map = {
'system': 'System',
'audio_player': 'AudioPlayer',
'automotive': 'Automotive',
'display': 'Display',
'geolocation': 'Geolocation',
'viewport': 'Viewport'
}

def __init__(self, system=None, audio_player=None, display=None, geolocation=None, viewport=None):
# type: (Optional[SystemState], Optional[AudioPlayerState], Optional[DisplayState], Optional[GeolocationState], Optional[ViewportState]) -> None
def __init__(self, system=None, audio_player=None, automotive=None, display=None, geolocation=None, viewport=None):
# type: (Optional[SystemState], Optional[AudioPlayerState], Optional[AutomotiveState], Optional[DisplayState], Optional[GeolocationState], Optional[ViewportState]) -> None
"""
:param system: Provides information about the current state of the Alexa service and the device interacting with your skill.
:type system: (optional) ask_sdk_model.interfaces.system.system_state.SystemState
:param audio_player: Provides the current state for the AudioPlayer interface.
:type audio_player: (optional) ask_sdk_model.interfaces.audioplayer.audio_player_state.AudioPlayerState
:param automotive: Provides the automotive specific information of the device.
:type automotive: (optional) ask_sdk_model.interfaces.automotive.automotive_state.AutomotiveState
:param display: Provides the current state for the Display interface.
:type display: (optional) ask_sdk_model.interfaces.display.display_state.DisplayState
:param geolocation: Provides the last gathered geolocation information of the device.
Expand All @@ -80,6 +87,7 @@ def __init__(self, system=None, audio_player=None, display=None, geolocation=Non

self.system = system
self.audio_player = audio_player
self.automotive = automotive
self.display = display
self.geolocation = geolocation
self.viewport = viewport
Expand Down
17 changes: 17 additions & 0 deletions ask-sdk-model/ask_sdk_model/interfaces/automotive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# coding: utf-8

#
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License.
#
from __future__ import absolute_import

from .automotive_state import AutomotiveState
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# coding: utf-8

#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License.
#

import pprint
import re # noqa: F401
import six
import typing
from enum import Enum


if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime


class AutomotiveState(object):
"""
This object contains the automotive specific information of the device
"""
deserialized_types = {
}

attribute_map = {
}

def __init__(self):
# type: () -> None
"""This object contains the automotive specific information of the device
"""
self.__discriminator_value = None

def to_dict(self):
# type: () -> Dict[str, object]
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.deserialized_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else
x.value if isinstance(x, Enum) else x,
value
))
elif isinstance(value, Enum):
result[attr] = value.value
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else
(item[0], item[1].value)
if isinstance(item[1], Enum) else item,
value.items()
))
else:
result[attr] = value

return result

def to_str(self):
# type: () -> str
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __repr__(self):
# type: () -> str
"""For `print` and `pprint`"""
return self.to_str()

def __eq__(self, other):
# type: (object) -> bool
"""Returns true if both objects are equal"""
if not isinstance(other, AutomotiveState):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
# type: (object) -> bool
"""Returns true if both objects are not equal"""
return not self == other

0 comments on commit 57d7a1e

Please sign in to comment.