Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class BasicDigitalTwin {
private String id;

@JsonProperty(value = DigitalTwinsJsonPropertyNames.DIGITAL_TWIN_ETAG, required = true)
private String twinETag;
private String etag;

@JsonProperty(value = DigitalTwinsJsonPropertyNames.DIGITAL_TWIN_METADATA, required = true)
private BasicDigitalTwinMetadata metadata;
Expand Down Expand Up @@ -62,16 +62,16 @@ public String getId() {
* @return A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
*/
public String getETag() {
return twinETag;
return etag;
}

/**
* Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @param twinETag A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @param etag A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @return The BasicDigitalTwin object itself.
*/
public BasicDigitalTwin setETag(String twinETag) {
this.twinETag = twinETag;
public BasicDigitalTwin setETag(String etag) {
this.etag = etag;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public final class BasicRelationship {
@JsonProperty(value = DigitalTwinsJsonPropertyNames.RELATIONSHIP_NAME, required = true)
private String name;

@JsonProperty(value = DigitalTwinsJsonPropertyNames.DIGITAL_TWIN_ETAG)
private String etag;

@JsonIgnore
private final Map<String, Object> properties = new HashMap<>();

Expand Down Expand Up @@ -94,6 +97,24 @@ public String getName() {
return name;
}

/**
* Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @return A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
*/
public String getETag() {
return etag;
}

/**
* Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @param etag A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
* @return The BasicRelationship object itself.
*/
public BasicRelationship setETag(String etag) {
this.etag = etag;
return this;
}

/**
* Gets the additional custom properties defined in the model. This field will contain any properties of the relationship that are not already defined by the other strong types of this class.
* @return The additional custom properties defined in the model. This field will contain any properties of the relationship that are not already defined by the other strong types of this class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ public static void runRelationshipsSample() throws JsonProcessingException {
BasicRelationship retrievedRelationship = getRelationshipResponse.getValue();
ConsoleLogger.printSuccess("Retrieved relationship: " + retrievedRelationship.getId() + " from twin: " + retrievedRelationship.getSourceId() + "\n\t" +
"Prop1: " + retrievedRelationship.getProperties().get("Prop1") + "\n\t" +
"Prop2: " + retrievedRelationship.getProperties().get("Prop2"));
"Prop2: " + retrievedRelationship.getProperties().get("Prop2") + "\n");

ConsoleLogger.printSuccess("Retrieved relationship has ETag: " + retrievedRelationship.getETag() + "\n\t");
}

ConsoleLogger.printHeader("List relationships");
Expand Down