use of com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders in project azure-iot-sdk-java by Azure.
the class TemperatureController method GetDigitalTwin.
private static ServiceResponseWithHeaders<String, DigitalTwinGetHeaders> GetDigitalTwin() {
ServiceResponseWithHeaders<String, DigitalTwinGetHeaders> getResponse = client.getDigitalTwinWithResponse(digitalTwinid, String.class);
JsonObject jsonObject = new JsonParser().parse(getResponse.body()).getAsJsonObject();
String modelId = jsonObject.getAsJsonObject("$metadata").get("$model").getAsString();
System.out.println("Digital Twin Model Id:" + modelId);
System.out.println("Digital Twin: " + prettyString(getResponse.body()));
System.out.println("Digital Twin eTag: " + getResponse.headers().eTag());
System.out.println("Digital Twin get response message: " + getResponse.response().message());
return getResponse;
}
Aggregations