Skip to content

Commit

Permalink
Added ClientToken to ShadowDeltaUpdated (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedTwigleg authored Apr 20, 2022
1 parent 1c75f3d commit b69a8f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions samples/Shadow/src/main/java/shadow/ShadowSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ static void onShadowDeltaUpdated(ShadowDeltaUpdatedEvent response) {
if (response.state != null && response.state.containsKey(SHADOW_PROPERTY)) {
String value = response.state.get(SHADOW_PROPERTY).toString();
System.out.println(" Delta wants to change value to '" + value + "'. Changing local value...");
if (!response.clientToken.isEmpty()) {
System.out.print(" ClientToken: " + response.clientToken + "\n");
}
changeShadowValue(value);
} else {
System.out.println(" Delta did not report a change in " + SHADOW_PROPERTY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
*/
public class ShadowDeltaUpdatedEvent {

/**
* An opaque token used to correlate requests and responses. Present only if a client token was used in the request.
*
*/
public String clientToken;


/**
* The current version of the document for the device's shadow.
*
Expand Down

0 comments on commit b69a8f5

Please sign in to comment.