Skip to content

Commit

Permalink
Release 1.6.1. For changelog, check CHANGELOG.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ask-pyth committed Dec 20, 2018
1 parent b2be629 commit 833242f
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 13 deletions.
9 changes: 9 additions & 0 deletions ask-sdk-model/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ This release includes the following:
This release includes the following :

- Models for Reminders


1.6.1
^^^^^^^

This release contains the following changes:

- Updated enum values for Reminder Status
- Updated OutputSpeech model
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.6.0'
__version__ = '1.6.1'
__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 @@ -31,9 +31,9 @@ class Status(Enum):
Allowed enum values: [true, COMPLETED]
Allowed enum values: [ON, COMPLETED]
"""
true = "true"
ON = "ON"
COMPLETED = "COMPLETED"
def to_dict(self):
# type: () -> Dict[str, object]
Expand Down
1 change: 1 addition & 0 deletions ask-sdk-model/ask_sdk_model/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
from .output_speech import OutputSpeech
from .image import Image
from .card import Card
from .play_behavior import PlayBehavior
from .ask_for_permissions_consent_card import AskForPermissionsConsentCard
from .simple_card import SimpleCard
16 changes: 12 additions & 4 deletions ask-sdk-model/ask_sdk_model/ui/output_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
from ask_sdk_model.ui.play_behavior import PlayBehavior


class OutputSpeech(object):
"""
:param object_type:
:type object_type: (optional) str
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
.. note::
Expand All @@ -43,11 +46,13 @@ class OutputSpeech(object):
"""
deserialized_types = {
'object_type': 'str'
'object_type': 'str',
'play_behavior': 'ask_sdk_model.ui.play_behavior.PlayBehavior'
}

attribute_map = {
'object_type': 'type'
'object_type': 'type',
'play_behavior': 'playBehavior'
}

discriminator_value_class_map = {
Expand All @@ -60,16 +65,19 @@ class OutputSpeech(object):
__metaclass__ = ABCMeta

@abstractmethod
def __init__(self, object_type=None):
# type: (Optional[str]) -> None
def __init__(self, object_type=None, play_behavior=None):
# type: (Optional[str], Optional[PlayBehavior]) -> None
"""
:param object_type:
:type object_type: (optional) str
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
"""
self.__discriminator_value = None

self.object_type = object_type
self.play_behavior = play_behavior

@classmethod
def get_real_child_model(cls, data):
Expand Down
13 changes: 10 additions & 3 deletions ask-sdk-model/ask_sdk_model/ui/plain_text_output_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,43 @@
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
from ask_sdk_model.ui.play_behavior import PlayBehavior


class PlainTextOutputSpeech(OutputSpeech):
"""
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
:param text:
:type text: (optional) str
"""
deserialized_types = {
'object_type': 'str',
'play_behavior': 'ask_sdk_model.ui.play_behavior.PlayBehavior',
'text': 'str'
}

attribute_map = {
'object_type': 'type',
'play_behavior': 'playBehavior',
'text': 'text'
}

def __init__(self, text=None):
# type: (Optional[str]) -> None
def __init__(self, play_behavior=None, text=None):
# type: (Optional[PlayBehavior], Optional[str]) -> None
"""
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
:param text:
:type text: (optional) str
"""
self.__discriminator_value = "PlainText"

self.object_type = self.__discriminator_value
super(PlainTextOutputSpeech, self).__init__(object_type=self.__discriminator_value)
super(PlainTextOutputSpeech, self).__init__(object_type=self.__discriminator_value, play_behavior=play_behavior)
self.text = text

def to_dict(self):
Expand Down
66 changes: 66 additions & 0 deletions ask-sdk-model/ask_sdk_model/ui/play_behavior.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.
#

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 PlayBehavior(Enum):
"""
Determines whether Alexa will queue or play this output speech immediately interrupting other speech
Allowed enum values: [ENQUEUE, REPLACE_ALL, REPLACE_ENQUEUED]
"""
ENQUEUE = "ENQUEUE"
REPLACE_ALL = "REPLACE_ALL"
REPLACE_ENQUEUED = "REPLACE_ENQUEUED"
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, PlayBehavior):
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
13 changes: 10 additions & 3 deletions ask-sdk-model/ask_sdk_model/ui/ssml_output_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,43 @@
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
from ask_sdk_model.ui.play_behavior import PlayBehavior


class SsmlOutputSpeech(OutputSpeech):
"""
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
:param ssml:
:type ssml: (optional) str
"""
deserialized_types = {
'object_type': 'str',
'play_behavior': 'ask_sdk_model.ui.play_behavior.PlayBehavior',
'ssml': 'str'
}

attribute_map = {
'object_type': 'type',
'play_behavior': 'playBehavior',
'ssml': 'ssml'
}

def __init__(self, ssml=None):
# type: (Optional[str]) -> None
def __init__(self, play_behavior=None, ssml=None):
# type: (Optional[PlayBehavior], Optional[str]) -> None
"""
:param play_behavior:
:type play_behavior: (optional) ask_sdk_model.ui.play_behavior.PlayBehavior
:param ssml:
:type ssml: (optional) str
"""
self.__discriminator_value = "SSML"

self.object_type = self.__discriminator_value
super(SsmlOutputSpeech, self).__init__(object_type=self.__discriminator_value)
super(SsmlOutputSpeech, self).__init__(object_type=self.__discriminator_value, play_behavior=play_behavior)
self.ssml = ssml

def to_dict(self):
Expand Down

0 comments on commit 833242f

Please sign in to comment.