Skip to content

Feature/add client token to delta #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion awsiot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import json
from typing import Any, Callable, Dict, Optional, Tuple, TypeVar

__version__ = '1.0.0-dev'
__version__ = '1.0.1-dev'

T = TypeVar('T')

Expand Down
8 changes: 6 additions & 2 deletions awsiot/iotshadow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,16 +1191,17 @@ class ShadowDeltaUpdatedEvent(awsiot.ModeledClass):
version (int): The current version of the document for the device's shadow.
"""

__slots__ = ['metadata', 'state', 'timestamp', 'version']
__slots__ = ['metadata', 'state', 'timestamp', 'version', 'client_token']

def __init__(self, *args, **kwargs):
self.metadata = kwargs.get('metadata')
self.state = kwargs.get('state')
self.timestamp = kwargs.get('timestamp')
self.version = kwargs.get('version')
self.client_token = kwargs.get('client_token')

# for backwards compatibility, read any arguments that used to be accepted by position
for key, val in zip(['metadata', 'state', 'timestamp', 'version'], args):
for key, val in zip(['metadata', 'state', 'timestamp', 'version', 'client_token'], args):
setattr(self, key, val)

@classmethod
Expand All @@ -1219,6 +1220,9 @@ def from_payload(cls, payload):
val = payload.get('version')
if val is not None:
new.version = val
val = payload.get('clientToken')
if val is not None:
new.client_token = val
return new

class ShadowDeltaUpdatedSubscriptionRequest(awsiot.ModeledClass):
Expand Down