Share via


DeviceManagementClient.DeleteDeviceClass(String, RequestContext) Method

Definition

Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the records from the system and to stop checking the compatibility of this device class with new updates. If a device is ever reconnected for this device class it will be re-created.

public virtual Azure.Response DeleteDeviceClass (string deviceClassId, Azure.RequestContext context = default);
abstract member DeleteDeviceClass : string * Azure.RequestContext -> Azure.Response
override this.DeleteDeviceClass : string * Azure.RequestContext -> Azure.Response
Public Overridable Function DeleteDeviceClass (deviceClassId As String, Optional context As RequestContext = Nothing) As Response

Parameters

deviceClassId
String

Device class identifier.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

deviceClassId is null.

deviceClassId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call DeleteDeviceClass with required parameters.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceManagementClient(endpoint, "<instanceId>", credential);

Response response = client.DeleteDeviceClass("<deviceClassId>");
Console.WriteLine(response.Status);

Applies to