initiateDeviceClaim method

Future<InitiateDeviceClaimResponse> initiateDeviceClaim({
  1. required String deviceId,
})

Given a device ID, initiates a claim request for the associated device.

Claiming a device consists of initiating a claim, then publishing a device event, and finalizing the claim. For a device of type button, a device event can be published by simply clicking the device.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw InternalFailureException. May throw ResourceConflictException.

Parameter deviceId : The unique identifier of the device.

Implementation

Future<InitiateDeviceClaimResponse> initiateDeviceClaim({
  required String deviceId,
}) async {
  ArgumentError.checkNotNull(deviceId, 'deviceId');
  final response = await _protocol.send(
    payload: null,
    method: 'PUT',
    requestUri: '/devices/${Uri.encodeComponent(deviceId)}/initiate-claim',
    exceptionFnMap: _exceptionFns,
  );
  return InitiateDeviceClaimResponse.fromJson(response);
}