Azure / Azure/azure-iot-service-sdk-java
[Bug] The service SDK is 404 "page not found" that we are not able to see class/module for DeviceTwin in the github repository
- Dominant language
- Java
- Stars
- 5
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Hi Team,
Wish you all well!
We tried to carry out the action "delete" with following Java codes, but we are not able to find modules below in the azure service SDK for java, and the page in 404 "not found"
import com.microsoft.azure.sdk.iot.service.DeviceTwin;
import com.microsoft.azure.sdk.iot.service.DeviceTwinDevice
May I have your assistance on the symptom?
Thank you so much and have a nice day.
Java code:
import com.microsoft.azure.sdk.iot.service.DeviceTwin;
import com.microsoft.azure.sdk.iot.service.DeviceTwinDevice;
import com.microsoft.azure.sdk.iot.service.exceptions.IotHubException;
import com.microsoft.azure.sdk.iot.service.devicetwin.Pair;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class DeleteDesiredPropertySample {
private static final String IOT_HUB_CONNECTION_STRING = "Your IoT Hub Connection String";
private static final String DEVICE_ID = "Target Device ID";
private static final String PROPERTY_NAME = "Name of the desired property to delete";
public static void main(String[] args) throws IOException, IotHubException {
// Create a DeviceTwin instance
DeviceTwin twinClient = DeviceTwin.createFromConnectionString(IOT_HUB_CONNECTION_STRING);
// Create a DeviceTwinDevice instance, representing the target device
DeviceTwinDevice device = new DeviceTwinDevice(DEVICE_ID);
try {
// Get the Device Twin of the target device
twinClient.getTwin(device);
// Create a Map to store the property to be removed
Map propertiesToRemove = new HashMap<>();
propertiesToRemove.put(PROPERTY_NAME, null);
// Remove the desired property
device.setDesiredProperties(Pair.pairCollectionFromMap(propertiesToRemove));
twinClient.updateTwin(device);
System.out.println("Successfully deleted desired property: " + PROPERTY_NAME);
} catch (IotHubException | IOException e) {
System.out.println("An error occurred: " + e.getMessage());
e.printStackTrace();
}
}
}

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.