deleteDevice method

Future<DeleteDeviceResponse> deleteDevice({
  1. required String deviceId,
  2. required String globalNetworkId,
})

Deletes an existing device. You must first disassociate the device from any links and customer gateways.

May throw ValidationException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ConflictException. May throw ThrottlingException. May throw InternalServerException.

Parameter deviceId : The ID of the device.

Parameter globalNetworkId : The ID of the global network.

Implementation

Future<DeleteDeviceResponse> deleteDevice({
  required String deviceId,
  required String globalNetworkId,
}) async {
  ArgumentError.checkNotNull(deviceId, 'deviceId');
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/devices/${Uri.encodeComponent(deviceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteDeviceResponse.fromJson(response);
}