Skip to content

Commit

Permalink
Release 1.10.2. For changelog, check CHANGELOG.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ask-pyth committed Apr 30, 2019
1 parent 031d996 commit 1993dc9
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ask-sdk-model/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,9 @@ This release includes the following :

- Fixing the imports under `reminder_management` service, to deserialize the reminders correctly.



1.10.2
^^^^^^^

- Added video codecs information in the APL Viewport Characteristic `Video property <https://developer.amazon.com/docs/alexa-presentation-language/apl-viewport-characteristics.html#video>`__.
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.10.1'
__version__ = '1.10.2'
__author__ = 'Alexa Skills Kit'
__author_email__ = 'ask-sdk-dynamic@amazon.com'
__license__ = 'Apache 2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
from .touch import Touch
from .shape import Shape
from .keyboard import Keyboard
from .viewport_state_video import Video
from .viewport_state import ViewportState
from .experience import Experience
17 changes: 17 additions & 0 deletions ask-sdk-model/ask_sdk_model/interfaces/viewport/video/__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 .codecs import Codecs
66 changes: 66 additions & 0 deletions ask-sdk-model/ask_sdk_model/interfaces/viewport/video/codecs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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 Codecs(Enum):
"""
A named bundle of codecs which are available for playing video on the viewport.
Allowed enum values: [H_264_41, H_264_42]
"""
H_264_41 = "H_264_41"
H_264_42 = "H_264_42"

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

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

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, Codecs):
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
Empty file.
16 changes: 12 additions & 4 deletions ask-sdk-model/ask_sdk_model/interfaces/viewport/viewport_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from ask_sdk_model.interfaces.viewport.touch import Touch
from ask_sdk_model.interfaces.viewport.keyboard import Keyboard
from ask_sdk_model.interfaces.viewport.shape import Shape
from ask_sdk_model.interfaces.viewport.video import Video


class ViewportState(object):
Expand All @@ -52,6 +53,8 @@ class ViewportState(object):
:type touch: (optional) list[ask_sdk_model.interfaces.viewport.touch.Touch]
:param keyboard: The physical button input mechanisms supported by the device. An empty array indicates physical button input is unsupported.
:type keyboard: (optional) list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]
:param video:
:type video: (optional) ask_sdk_model.interfaces.viewport.video.Video
"""
deserialized_types = {
Expand All @@ -63,7 +66,8 @@ class ViewportState(object):
'current_pixel_width': 'float',
'current_pixel_height': 'float',
'touch': 'list[ask_sdk_model.interfaces.viewport.touch.Touch]',
'keyboard': 'list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]'
'keyboard': 'list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]',
'video': 'ask_sdk_model.interfaces.viewport.video.Video'
} # type: Dict

attribute_map = {
Expand All @@ -75,11 +79,12 @@ class ViewportState(object):
'current_pixel_width': 'currentPixelWidth',
'current_pixel_height': 'currentPixelHeight',
'touch': 'touch',
'keyboard': 'keyboard'
'keyboard': 'keyboard',
'video': 'video'
} # type: Dict

def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=None, dpi=None, current_pixel_width=None, current_pixel_height=None, touch=None, keyboard=None):
# type: (Optional[List[Experience]], Optional[Shape], Optional[float], Optional[float], Optional[float], Optional[float], Optional[float], Optional[List[Touch]], Optional[List[Keyboard]]) -> None
def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=None, dpi=None, current_pixel_width=None, current_pixel_height=None, touch=None, keyboard=None, video=None):
# type: (Optional[List[Experience]], Optional[Shape], Optional[float], Optional[float], Optional[float], Optional[float], Optional[float], Optional[List[Touch]], Optional[List[Keyboard]], Optional[Video]) -> None
"""This object contains the characteristics related to the device&#39;s viewport.
:param experiences: The experiences supported by the device, in descending order of arcMinuteWidth and arcMinuteHeight.
Expand All @@ -100,6 +105,8 @@ def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=
:type touch: (optional) list[ask_sdk_model.interfaces.viewport.touch.Touch]
:param keyboard: The physical button input mechanisms supported by the device. An empty array indicates physical button input is unsupported.
:type keyboard: (optional) list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]
:param video:
:type video: (optional) ask_sdk_model.interfaces.viewport.video.Video
"""
self.__discriminator_value = None # type: str

Expand All @@ -112,6 +119,7 @@ def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=
self.current_pixel_height = current_pixel_height
self.touch = touch
self.keyboard = keyboard
self.video = video

def to_dict(self):
# type: () -> Dict[str, object]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# 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
from ask_sdk_model.interfaces.viewport.video.codecs import Codecs


class Video(object):
"""
Details of the technologies which are available for playing video on the device.
:param codecs: Codecs which are available for playing video on the device.
:type codecs: (optional) list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]
"""
deserialized_types = {
'codecs': 'list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]'
} # type: Dict

attribute_map = {
'codecs': 'codecs'
} # type: Dict

def __init__(self, codecs=None):
# type: (Optional[List[Codecs]]) -> None
"""Details of the technologies which are available for playing video on the device.
:param codecs: Codecs which are available for playing video on the device.
:type codecs: (optional) list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]
"""
self.__discriminator_value = None # type: str

self.codecs = codecs

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

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, Video):
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 1993dc9

Please sign in to comment.