Skip to content

Commit cf421c8

Browse files
author
ask-pyth
committed
Release 1.26.0. For changelog, check CHANGELOG.rst
1 parent abb8d3d commit cf421c8

File tree

6 files changed

+151
-3
lines changed

6 files changed

+151
-3
lines changed

ask-sdk-model/CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,11 @@ This release contains the following changes :
332332
This release contains the following changes :
333333

334334
- Introducing `person-level permissions <https://developer.amazon.com/en-US/docs/alexa/smapi/skill-events-in-alexa-skills.html#skill-permission-changed-event>`__ for Skill events.
335+
336+
337+
1.26.0
338+
~~~~~~
339+
340+
This release contains the following changes :
341+
342+
- Support for 'Alexa for residential' properties. More information about 'Alexa for residential' can be found here : https://developer.amazon.com/en-US/docs/alexa/alexa-smart-properties/about-alexa-for-residential.html

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.25.0'
17+
__version__ = '1.26.0'
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/system/system_state.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from typing import Dict, List, Optional, Union
2525
from datetime import datetime
2626
from ask_sdk_model.device import Device
27+
from ask_sdk_model.interfaces.system_unit.unit import Unit
2728
from ask_sdk_model.person import Person
2829
from ask_sdk_model.application import Application
2930
from ask_sdk_model.user import User
@@ -40,6 +41,8 @@ class SystemState(object):
4041
:type device: (optional) ask_sdk_model.device.Device
4142
:param person:
4243
:type person: (optional) ask_sdk_model.person.Person
44+
:param unit:
45+
:type unit: (optional) ask_sdk_model.interfaces.system_unit.unit.Unit
4346
:param api_endpoint: A string that references the correct base URI to refer to by region, for use with APIs such as the Device Location API and Progressive Response API.
4447
:type api_endpoint: (optional) str
4548
:param api_access_token: A bearer token string that can be used by the skill (during the skill session) to access Alexa APIs resources of the registered Alexa customer and/or person who is making the request. This token encapsulates the permissions authorized under the registered Alexa account and device, and (optionally) the recognized person. Some resources, such as name or email, require explicit customer consent.\&quot;
@@ -51,6 +54,7 @@ class SystemState(object):
5154
'user': 'ask_sdk_model.user.User',
5255
'device': 'ask_sdk_model.device.Device',
5356
'person': 'ask_sdk_model.person.Person',
57+
'unit': 'ask_sdk_model.interfaces.system_unit.unit.Unit',
5458
'api_endpoint': 'str',
5559
'api_access_token': 'str'
5660
} # type: Dict
@@ -60,13 +64,14 @@ class SystemState(object):
6064
'user': 'user',
6165
'device': 'device',
6266
'person': 'person',
67+
'unit': 'unit',
6368
'api_endpoint': 'apiEndpoint',
6469
'api_access_token': 'apiAccessToken'
6570
} # type: Dict
6671
supports_multiple_types = False
6772

68-
def __init__(self, application=None, user=None, device=None, person=None, api_endpoint=None, api_access_token=None):
69-
# type: (Optional[Application], Optional[User], Optional[Device], Optional[Person], Optional[str], Optional[str]) -> None
73+
def __init__(self, application=None, user=None, device=None, person=None, unit=None, api_endpoint=None, api_access_token=None):
74+
# type: (Optional[Application], Optional[User], Optional[Device], Optional[Person], Optional[Unit], Optional[str], Optional[str]) -> None
7075
"""
7176
7277
:param application:
@@ -77,6 +82,8 @@ def __init__(self, application=None, user=None, device=None, person=None, api_en
7782
:type device: (optional) ask_sdk_model.device.Device
7883
:param person:
7984
:type person: (optional) ask_sdk_model.person.Person
85+
:param unit:
86+
:type unit: (optional) ask_sdk_model.interfaces.system_unit.unit.Unit
8087
:param api_endpoint: A string that references the correct base URI to refer to by region, for use with APIs such as the Device Location API and Progressive Response API.
8188
:type api_endpoint: (optional) str
8289
:param api_access_token: A bearer token string that can be used by the skill (during the skill session) to access Alexa APIs resources of the registered Alexa customer and/or person who is making the request. This token encapsulates the permissions authorized under the registered Alexa account and device, and (optionally) the recognized person. Some resources, such as name or email, require explicit customer consent.\&quot;
@@ -88,6 +95,7 @@ def __init__(self, application=None, user=None, device=None, person=None, api_en
8895
self.user = user
8996
self.device = device
9097
self.person = person
98+
self.unit = unit
9199
self.api_endpoint = api_endpoint
92100
self.api_access_token = api_access_token
93101

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 .unit import Unit

ask-sdk-model/ask_sdk_model/interfaces/system_unit/py.typed

Whitespace-only changes.
Lines changed: 115 additions & 0 deletions
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 Unit(object):
29+
"""
30+
An object that represents a logical entity for organizing actors and resources that interact with Alexa systems.
31+
32+
33+
:param unit_id: A string that represents unitId directed at skill level. Each skill gets a different directed identifier for same internal identifier. This is Skill enablement scoped identifier. This should be in format - amzn1.ask.unit.&lt;skillDirectedId&gt;
34+
:type unit_id: (optional) str
35+
:param persistent_unit_id: A string that represents a unitId directed using directedIdConfuser associated with the respective Organization&#39;s developer account. This identifier is directed at an Organization level. Same identifier is shared across Organization&#39;s backend systems (which invokes API), Skills owned by the organization and authorized 3P skills. This should be in format - amzn1.alexa.unit.did.&lt;LWAConfuserDirectedId&gt;
36+
:type persistent_unit_id: (optional) str
37+
38+
"""
39+
deserialized_types = {
40+
'unit_id': 'str',
41+
'persistent_unit_id': 'str'
42+
} # type: Dict
43+
44+
attribute_map = {
45+
'unit_id': 'unitId',
46+
'persistent_unit_id': 'persistentUnitId'
47+
} # type: Dict
48+
supports_multiple_types = False
49+
50+
def __init__(self, unit_id=None, persistent_unit_id=None):
51+
# type: (Optional[str], Optional[str]) -> None
52+
"""An object that represents a logical entity for organizing actors and resources that interact with Alexa systems.
53+
54+
:param unit_id: A string that represents unitId directed at skill level. Each skill gets a different directed identifier for same internal identifier. This is Skill enablement scoped identifier. This should be in format - amzn1.ask.unit.&lt;skillDirectedId&gt;
55+
:type unit_id: (optional) str
56+
:param persistent_unit_id: A string that represents a unitId directed using directedIdConfuser associated with the respective Organization&#39;s developer account. This identifier is directed at an Organization level. Same identifier is shared across Organization&#39;s backend systems (which invokes API), Skills owned by the organization and authorized 3P skills. This should be in format - amzn1.alexa.unit.did.&lt;LWAConfuserDirectedId&gt;
57+
:type persistent_unit_id: (optional) str
58+
"""
59+
self.__discriminator_value = None # type: str
60+
61+
self.unit_id = unit_id
62+
self.persistent_unit_id = persistent_unit_id
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, Unit):
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

0 commit comments

Comments
 (0)