assignDeviceToCustomer method

Future<Device?> assignDeviceToCustomer(
  1. String customerId,
  2. String deviceId, {
  3. RequestConfig? requestConfig,
})

Implementation

Future<Device?> assignDeviceToCustomer(String customerId, String deviceId,
    {RequestConfig? requestConfig}) async {
  return nullIfNotFound(
    (RequestConfig requestConfig) async {
      var response = await _tbClient.post<Map<String, dynamic>>(
          '/api/customer/$customerId/device/$deviceId',
          options: defaultHttpOptionsFromConfig(requestConfig));
      return response.data != null ? Device.fromJson(response.data!) : null;
    },
    requestConfig: requestConfig,
  );
}