Skip to content

Commit 5adfd53

Browse files
author
ask-pyth
committed
Release 1.22.0. For changelog, check CHANGELOG.rst
1 parent b4a7388 commit 5adfd53

28 files changed

+2657
-1
lines changed

ask-sdk-model/CHANGELOG.rst

+9
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,12 @@ This release contains the following changes :
291291
This release contains the following changes :
292292

293293
- Updated `rules for recurrence creation <https://developer.amazon.com/en-US/docs/alexa/smapi/alexa-reminders-api-reference.html#in-session-and-out-of-session-behavior-for-alexa-reminders-api>`__ in reminders.
294+
295+
296+
1.22.0
297+
~~~~~~
298+
299+
This release contains the following changes :
300+
301+
- APIs related to `timer management <https://developer.amazon.com/en-US/docs/alexa/smapi/alexa-timers-api-reference.html>`__.
302+

ask-sdk-model/ask_sdk_model/__version__.py

+1-1
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.21.0'
17+
__version__ = '1.22.0'
1818
__author__ = 'Alexa Skills Kit'
1919
__author_email__ = '[email protected]'
2020
__license__ = 'Apache 2.0'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
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 .status_map import StatusMap

ask-sdk-model/ask_sdk_model/interfaces/alexa/comms/messagingcontroller/py.typed

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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, Union
25+
from datetime import datetime
26+
27+
28+
class StatusMap(object):
29+
"""
30+
A map whose key is the new status and value is the message ID list. The status of the messages whose IDs are in the list will be updated to the new status from the key.
31+
32+
33+
:param read: List of read messages
34+
:type read: (optional) list[str]
35+
:param deleted: List of deleted messages
36+
:type deleted: (optional) list[str]
37+
38+
"""
39+
deserialized_types = {
40+
'read': 'list[str]',
41+
'deleted': 'list[str]'
42+
} # type: Dict
43+
44+
attribute_map = {
45+
'read': 'read',
46+
'deleted': 'deleted'
47+
} # type: Dict
48+
supports_multiple_types = False
49+
50+
def __init__(self, read=None, deleted=None):
51+
# type: (Optional[List[object]], Optional[List[object]]) -> None
52+
"""A map whose key is the new status and value is the message ID list. The status of the messages whose IDs are in the list will be updated to the new status from the key.
53+
54+
:param read: List of read messages
55+
:type read: (optional) list[str]
56+
:param deleted: List of deleted messages
57+
:type deleted: (optional) list[str]
58+
"""
59+
self.__discriminator_value = None # type: str
60+
61+
self.read = read
62+
self.deleted = deleted
63+
64+
def to_dict(self):
65+
# type: () -> Dict[str, object]
66+
"""Returns the model properties as a dict"""
67+
result = {} # type: Dict
68+
69+
for attr, _ in six.iteritems(self.deserialized_types):
70+
value = getattr(self, attr)
71+
if isinstance(value, list):
72+
result[attr] = list(map(
73+
lambda x: x.to_dict() if hasattr(x, "to_dict") else
74+
x.value if isinstance(x, Enum) else x,
75+
value
76+
))
77+
elif isinstance(value, Enum):
78+
result[attr] = value.value
79+
elif hasattr(value, "to_dict"):
80+
result[attr] = value.to_dict()
81+
elif isinstance(value, dict):
82+
result[attr] = dict(map(
83+
lambda item: (item[0], item[1].to_dict())
84+
if hasattr(item[1], "to_dict") else
85+
(item[0], item[1].value)
86+
if isinstance(item[1], Enum) else item,
87+
value.items()
88+
))
89+
else:
90+
result[attr] = value
91+
92+
return result
93+
94+
def to_str(self):
95+
# type: () -> str
96+
"""Returns the string representation of the model"""
97+
return pprint.pformat(self.to_dict())
98+
99+
def __repr__(self):
100+
# type: () -> str
101+
"""For `print` and `pprint`"""
102+
return self.to_str()
103+
104+
def __eq__(self, other):
105+
# type: (object) -> bool
106+
"""Returns true if both objects are equal"""
107+
if not isinstance(other, StatusMap):
108+
return False
109+
110+
return self.__dict__ == other.__dict__
111+
112+
def __ne__(self, other):
113+
# type: (object) -> bool
114+
"""Returns true if both objects are not equal"""
115+
return not self == other

ask-sdk-model/ask_sdk_model/interfaces/alexa/comms/py.typed

Whitespace-only changes.

ask-sdk-model/ask_sdk_model/services/service_client_factory.py

+15
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from .proactive_events import ProactiveEventsServiceClient
2727
from .reminder_management import ReminderManagementServiceClient
2828
from .skill_messaging import SkillMessagingServiceClient
29+
from .timer_management import TimerManagementServiceClient
2930
from .ups import UpsServiceClient
3031

3132
if typing.TYPE_CHECKING:
@@ -126,6 +127,20 @@ def get_reminder_management_service(self):
126127
raise ValueError(
127128
"ServiceClientFactory Error while initializing ReminderManagementServiceClient: " + str(e))
128129

130+
def get_timer_management_service(self):
131+
# type: () -> TimerManagementServiceClient
132+
"""Get TimerManagementServiceClient for timer_management_service.
133+
134+
:return: Client for calling the service
135+
:rtype: TimerManagementServiceClient
136+
:raises: :py:class:`ValueError`
137+
"""
138+
try:
139+
return TimerManagementServiceClient(self.api_configuration)
140+
except Exception as e:
141+
raise ValueError(
142+
"ServiceClientFactory Error while initializing TimerManagementServiceClient: " + str(e))
143+
129144
def get_ups_service(self):
130145
# type: () -> UpsServiceClient
131146
"""Get UpsServiceClient for ups_service.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 .error import Error
18+
from .notification_config import NotificationConfig
19+
from .timer_response import TimerResponse
20+
from .timer_request import TimerRequest
21+
from .display_experience import DisplayExperience
22+
from .task import Task
23+
from .launch_task_operation import LaunchTaskOperation
24+
from .visibility import Visibility
25+
from .status import Status
26+
from .triggering_behavior import TriggeringBehavior
27+
from .text_to_confirm import TextToConfirm
28+
from .creation_behavior import CreationBehavior
29+
from .timer_management_service_client import TimerManagementServiceClient
30+
from .announce_operation import AnnounceOperation
31+
from .timers_response import TimersResponse
32+
from .operation import Operation
33+
from .text_to_announce import TextToAnnounce
34+
from .notify_only_operation import NotifyOnlyOperation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
from ask_sdk_model.services.timer_management.operation import Operation
22+
23+
24+
if typing.TYPE_CHECKING:
25+
from typing import Dict, List, Optional, Union
26+
from datetime import datetime
27+
from ask_sdk_model.services.timer_management.text_to_announce import TextToAnnounce
28+
29+
30+
class AnnounceOperation(Operation):
31+
"""
32+
ANNOUNCE trigger behavior represents announcing a certain text that the developer wants to be read out at the expiration of the timer.
33+
34+
35+
:param text_to_announce:
36+
:type text_to_announce: (optional) list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce]
37+
38+
"""
39+
deserialized_types = {
40+
'object_type': 'str',
41+
'text_to_announce': 'list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce]'
42+
} # type: Dict
43+
44+
attribute_map = {
45+
'object_type': 'type',
46+
'text_to_announce': 'textToAnnounce'
47+
} # type: Dict
48+
supports_multiple_types = False
49+
50+
def __init__(self, text_to_announce=None):
51+
# type: (Optional[List[TextToAnnounce]]) -> None
52+
"""ANNOUNCE trigger behavior represents announcing a certain text that the developer wants to be read out at the expiration of the timer.
53+
54+
:param text_to_announce:
55+
:type text_to_announce: (optional) list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce]
56+
"""
57+
self.__discriminator_value = "ANNOUNCE" # type: str
58+
59+
self.object_type = self.__discriminator_value
60+
super(AnnounceOperation, self).__init__(object_type=self.__discriminator_value)
61+
self.text_to_announce = text_to_announce
62+
63+
def to_dict(self):
64+
# type: () -> Dict[str, object]
65+
"""Returns the model properties as a dict"""
66+
result = {} # type: Dict
67+
68+
for attr, _ in six.iteritems(self.deserialized_types):
69+
value = getattr(self, attr)
70+
if isinstance(value, list):
71+
result[attr] = list(map(
72+
lambda x: x.to_dict() if hasattr(x, "to_dict") else
73+
x.value if isinstance(x, Enum) else x,
74+
value
75+
))
76+
elif isinstance(value, Enum):
77+
result[attr] = value.value
78+
elif hasattr(value, "to_dict"):
79+
result[attr] = value.to_dict()
80+
elif isinstance(value, dict):
81+
result[attr] = dict(map(
82+
lambda item: (item[0], item[1].to_dict())
83+
if hasattr(item[1], "to_dict") else
84+
(item[0], item[1].value)
85+
if isinstance(item[1], Enum) else item,
86+
value.items()
87+
))
88+
else:
89+
result[attr] = value
90+
91+
return result
92+
93+
def to_str(self):
94+
# type: () -> str
95+
"""Returns the string representation of the model"""
96+
return pprint.pformat(self.to_dict())
97+
98+
def __repr__(self):
99+
# type: () -> str
100+
"""For `print` and `pprint`"""
101+
return self.to_str()
102+
103+
def __eq__(self, other):
104+
# type: (object) -> bool
105+
"""Returns true if both objects are equal"""
106+
if not isinstance(other, AnnounceOperation):
107+
return False
108+
109+
return self.__dict__ == other.__dict__
110+
111+
def __ne__(self, other):
112+
# type: (object) -> bool
113+
"""Returns true if both objects are not equal"""
114+
return not self == other

0 commit comments

Comments
 (0)