-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.22.0. For changelog, check CHANGELOG.rst
- Loading branch information
ask-pyth
committed
Mar 16, 2020
1 parent
b4a7388
commit 5adfd53
Showing
28 changed files
with
2,657 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.21.0' | ||
__version__ = '1.22.0' | ||
__author__ = 'Alexa Skills Kit' | ||
__author_email__ = '[email protected]' | ||
__license__ = 'Apache 2.0' | ||
|
16 changes: 16 additions & 0 deletions
16
ask-sdk-model/ask_sdk_model/interfaces/alexa/comms/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 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 | ||
|
17 changes: 17 additions & 0 deletions
17
ask-sdk-model/ask_sdk_model/interfaces/alexa/comms/messagingcontroller/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .status_map import StatusMap |
Empty file.
115 changes: 115 additions & 0 deletions
115
ask-sdk-model/ask_sdk_model/interfaces/alexa/comms/messagingcontroller/status_map.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# 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, Union | ||
from datetime import datetime | ||
|
||
|
||
class StatusMap(object): | ||
""" | ||
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. | ||
:param read: List of read messages | ||
:type read: (optional) list[str] | ||
:param deleted: List of deleted messages | ||
:type deleted: (optional) list[str] | ||
""" | ||
deserialized_types = { | ||
'read': 'list[str]', | ||
'deleted': 'list[str]' | ||
} # type: Dict | ||
|
||
attribute_map = { | ||
'read': 'read', | ||
'deleted': 'deleted' | ||
} # type: Dict | ||
supports_multiple_types = False | ||
|
||
def __init__(self, read=None, deleted=None): | ||
# type: (Optional[List[object]], Optional[List[object]]) -> None | ||
"""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. | ||
:param read: List of read messages | ||
:type read: (optional) list[str] | ||
:param deleted: List of deleted messages | ||
:type deleted: (optional) list[str] | ||
""" | ||
self.__discriminator_value = None # type: str | ||
|
||
self.read = read | ||
self.deleted = deleted | ||
|
||
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, StatusMap): | ||
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
ask-sdk-model/ask_sdk_model/services/timer_management/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 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 .error import Error | ||
from .notification_config import NotificationConfig | ||
from .timer_response import TimerResponse | ||
from .timer_request import TimerRequest | ||
from .display_experience import DisplayExperience | ||
from .task import Task | ||
from .launch_task_operation import LaunchTaskOperation | ||
from .visibility import Visibility | ||
from .status import Status | ||
from .triggering_behavior import TriggeringBehavior | ||
from .text_to_confirm import TextToConfirm | ||
from .creation_behavior import CreationBehavior | ||
from .timer_management_service_client import TimerManagementServiceClient | ||
from .announce_operation import AnnounceOperation | ||
from .timers_response import TimersResponse | ||
from .operation import Operation | ||
from .text_to_announce import TextToAnnounce | ||
from .notify_only_operation import NotifyOnlyOperation |
114 changes: 114 additions & 0 deletions
114
ask-sdk-model/ask_sdk_model/services/timer_management/announce_operation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# 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 | ||
from ask_sdk_model.services.timer_management.operation import Operation | ||
|
||
|
||
if typing.TYPE_CHECKING: | ||
from typing import Dict, List, Optional, Union | ||
from datetime import datetime | ||
from ask_sdk_model.services.timer_management.text_to_announce import TextToAnnounce | ||
|
||
|
||
class AnnounceOperation(Operation): | ||
""" | ||
ANNOUNCE trigger behavior represents announcing a certain text that the developer wants to be read out at the expiration of the timer. | ||
:param text_to_announce: | ||
:type text_to_announce: (optional) list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce] | ||
""" | ||
deserialized_types = { | ||
'object_type': 'str', | ||
'text_to_announce': 'list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce]' | ||
} # type: Dict | ||
|
||
attribute_map = { | ||
'object_type': 'type', | ||
'text_to_announce': 'textToAnnounce' | ||
} # type: Dict | ||
supports_multiple_types = False | ||
|
||
def __init__(self, text_to_announce=None): | ||
# type: (Optional[List[TextToAnnounce]]) -> None | ||
"""ANNOUNCE trigger behavior represents announcing a certain text that the developer wants to be read out at the expiration of the timer. | ||
:param text_to_announce: | ||
:type text_to_announce: (optional) list[ask_sdk_model.services.timer_management.text_to_announce.TextToAnnounce] | ||
""" | ||
self.__discriminator_value = "ANNOUNCE" # type: str | ||
|
||
self.object_type = self.__discriminator_value | ||
super(AnnounceOperation, self).__init__(object_type=self.__discriminator_value) | ||
self.text_to_announce = text_to_announce | ||
|
||
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, AnnounceOperation): | ||
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 |
Oops, something went wrong.