Skip to content

Commit 1993dc9

Browse files
author
ask-pyth
committed
Release 1.10.2. For changelog, check CHANGELOG.rst
1 parent 031d996 commit 1993dc9

File tree

8 files changed

+211
-5
lines changed

8 files changed

+211
-5
lines changed

ask-sdk-model/CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,9 @@ This release includes the following :
153153

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

156+
157+
158+
1.10.2
159+
^^^^^^^
160+
161+
- Added video codecs information in the APL Viewport Characteristic `Video property <https://developer.amazon.com/docs/alexa-presentation-language/apl-viewport-characteristics.html#video>`__.

ask-sdk-model/ask_sdk_model/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
__pip_package_name__ = 'ask-sdk-model'
1515
__description__ = 'The ASK SDK Model package provides model definitions, for building Alexa Skills.'
1616
__url__ = 'https://github.com/alexa/alexa-apis-for-python'
17-
__version__ = '1.10.1'
17+
__version__ = '1.10.2'
1818
__author__ = 'Alexa Skills Kit'
1919
__author_email__ = 'ask-sdk-dynamic@amazon.com'
2020
__license__ = 'Apache 2.0'

ask-sdk-model/ask_sdk_model/interfaces/viewport/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
from .touch import Touch
1818
from .shape import Shape
1919
from .keyboard import Keyboard
20+
from .viewport_state_video import Video
2021
from .viewport_state import ViewportState
2122
from .experience import Experience
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# coding: utf-8
2+
3+
#
4+
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the 'License'). You may not use this file
7+
# except in compliance with the License. A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
13+
# the specific language governing permissions and limitations under the License.
14+
#
15+
from __future__ import absolute_import
16+
17+
from .codecs import Codecs
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# coding: utf-8
2+
3+
#
4+
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
7+
# except in compliance with the License. A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
13+
# the specific language governing permissions and limitations under the License.
14+
#
15+
16+
import pprint
17+
import re # noqa: F401
18+
import six
19+
import typing
20+
from enum import Enum
21+
22+
23+
if typing.TYPE_CHECKING:
24+
from typing import Dict, List, Optional
25+
from datetime import datetime
26+
27+
28+
class Codecs(Enum):
29+
"""
30+
A named bundle of codecs which are available for playing video on the viewport.
31+
32+
33+
34+
Allowed enum values: [H_264_41, H_264_42]
35+
"""
36+
H_264_41 = "H_264_41"
37+
H_264_42 = "H_264_42"
38+
39+
def to_dict(self):
40+
# type: () -> Dict[str, object]
41+
"""Returns the model properties as a dict"""
42+
result = {self.name: self.value}
43+
return result
44+
45+
def to_str(self):
46+
# type: () -> str
47+
"""Returns the string representation of the model"""
48+
return pprint.pformat(self.value)
49+
50+
def __repr__(self):
51+
# type: () -> str
52+
"""For `print` and `pprint`"""
53+
return self.to_str()
54+
55+
def __eq__(self, other):
56+
# type: (object) -> bool
57+
"""Returns true if both objects are equal"""
58+
if not isinstance(other, Codecs):
59+
return False
60+
61+
return self.__dict__ == other.__dict__
62+
63+
def __ne__(self, other):
64+
# type: (object) -> bool
65+
"""Returns true if both objects are not equal"""
66+
return not self == other

ask-sdk-model/ask_sdk_model/interfaces/viewport/video/py.typed

Whitespace-only changes.

ask-sdk-model/ask_sdk_model/interfaces/viewport/viewport_state.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from ask_sdk_model.interfaces.viewport.touch import Touch
2828
from ask_sdk_model.interfaces.viewport.keyboard import Keyboard
2929
from ask_sdk_model.interfaces.viewport.shape import Shape
30+
from ask_sdk_model.interfaces.viewport.video import Video
3031

3132

3233
class ViewportState(object):
@@ -52,6 +53,8 @@ class ViewportState(object):
5253
:type touch: (optional) list[ask_sdk_model.interfaces.viewport.touch.Touch]
5354
:param keyboard: The physical button input mechanisms supported by the device. An empty array indicates physical button input is unsupported.
5455
:type keyboard: (optional) list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]
56+
:param video:
57+
:type video: (optional) ask_sdk_model.interfaces.viewport.video.Video
5558
5659
"""
5760
deserialized_types = {
@@ -63,7 +66,8 @@ class ViewportState(object):
6366
'current_pixel_width': 'float',
6467
'current_pixel_height': 'float',
6568
'touch': 'list[ask_sdk_model.interfaces.viewport.touch.Touch]',
66-
'keyboard': 'list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]'
69+
'keyboard': 'list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]',
70+
'video': 'ask_sdk_model.interfaces.viewport.video.Video'
6771
} # type: Dict
6872

6973
attribute_map = {
@@ -75,11 +79,12 @@ class ViewportState(object):
7579
'current_pixel_width': 'currentPixelWidth',
7680
'current_pixel_height': 'currentPixelHeight',
7781
'touch': 'touch',
78-
'keyboard': 'keyboard'
82+
'keyboard': 'keyboard',
83+
'video': 'video'
7984
} # type: Dict
8085

81-
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):
82-
# type: (Optional[List[Experience]], Optional[Shape], Optional[float], Optional[float], Optional[float], Optional[float], Optional[float], Optional[List[Touch]], Optional[List[Keyboard]]) -> None
86+
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):
87+
# 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
8388
"""This object contains the characteristics related to the device&#39;s viewport.
8489
8590
:param experiences: The experiences supported by the device, in descending order of arcMinuteWidth and arcMinuteHeight.
@@ -100,6 +105,8 @@ def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=
100105
:type touch: (optional) list[ask_sdk_model.interfaces.viewport.touch.Touch]
101106
:param keyboard: The physical button input mechanisms supported by the device. An empty array indicates physical button input is unsupported.
102107
:type keyboard: (optional) list[ask_sdk_model.interfaces.viewport.keyboard.Keyboard]
108+
:param video:
109+
:type video: (optional) ask_sdk_model.interfaces.viewport.video.Video
103110
"""
104111
self.__discriminator_value = None # type: str
105112

@@ -112,6 +119,7 @@ def __init__(self, experiences=None, shape=None, pixel_width=None, pixel_height=
112119
self.current_pixel_height = current_pixel_height
113120
self.touch = touch
114121
self.keyboard = keyboard
122+
self.video = video
115123

116124
def to_dict(self):
117125
# type: () -> Dict[str, object]
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# coding: utf-8
2+
3+
#
4+
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
7+
# except in compliance with the License. A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
13+
# the specific language governing permissions and limitations under the License.
14+
#
15+
16+
import pprint
17+
import re # noqa: F401
18+
import six
19+
import typing
20+
from enum import Enum
21+
22+
23+
if typing.TYPE_CHECKING:
24+
from typing import Dict, List, Optional
25+
from datetime import datetime
26+
from ask_sdk_model.interfaces.viewport.video.codecs import Codecs
27+
28+
29+
class Video(object):
30+
"""
31+
Details of the technologies which are available for playing video on the device.
32+
33+
34+
:param codecs: Codecs which are available for playing video on the device.
35+
:type codecs: (optional) list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]
36+
37+
"""
38+
deserialized_types = {
39+
'codecs': 'list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]'
40+
} # type: Dict
41+
42+
attribute_map = {
43+
'codecs': 'codecs'
44+
} # type: Dict
45+
46+
def __init__(self, codecs=None):
47+
# type: (Optional[List[Codecs]]) -> None
48+
"""Details of the technologies which are available for playing video on the device.
49+
50+
:param codecs: Codecs which are available for playing video on the device.
51+
:type codecs: (optional) list[ask_sdk_model.interfaces.viewport.video.codecs.Codecs]
52+
"""
53+
self.__discriminator_value = None # type: str
54+
55+
self.codecs = codecs
56+
57+
def to_dict(self):
58+
# type: () -> Dict[str, object]
59+
"""Returns the model properties as a dict"""
60+
result = {} # type: Dict
61+
62+
for attr, _ in six.iteritems(self.deserialized_types):
63+
value = getattr(self, attr)
64+
if isinstance(value, list):
65+
result[attr] = list(map(
66+
lambda x: x.to_dict() if hasattr(x, "to_dict") else
67+
x.value if isinstance(x, Enum) else x,
68+
value
69+
))
70+
elif isinstance(value, Enum):
71+
result[attr] = value.value
72+
elif hasattr(value, "to_dict"):
73+
result[attr] = value.to_dict()
74+
elif isinstance(value, dict):
75+
result[attr] = dict(map(
76+
lambda item: (item[0], item[1].to_dict())
77+
if hasattr(item[1], "to_dict") else
78+
(item[0], item[1].value)
79+
if isinstance(item[1], Enum) else item,
80+
value.items()
81+
))
82+
else:
83+
result[attr] = value
84+
85+
return result
86+
87+
def to_str(self):
88+
# type: () -> str
89+
"""Returns the string representation of the model"""
90+
return pprint.pformat(self.to_dict())
91+
92+
def __repr__(self):
93+
# type: () -> str
94+
"""For `print` and `pprint`"""
95+
return self.to_str()
96+
97+
def __eq__(self, other):
98+
# type: (object) -> bool
99+
"""Returns true if both objects are equal"""
100+
if not isinstance(other, Video):
101+
return False
102+
103+
return self.__dict__ == other.__dict__
104+
105+
def __ne__(self, other):
106+
# type: (object) -> bool
107+
"""Returns true if both objects are not equal"""
108+
return not self == other

0 commit comments

Comments
 (0)