upsertDevice method

Future<Response<EntityRes>> upsertDevice({
  1. required DevicePostActionPostAction? action,
  2. required Device? entity,
  3. dynamic token,
})

Create or Update or Delete Device @param action @param entity Device Object

Implementation

Future<chopper.Response<EntityRes>> upsertDevice({
  required enums.DevicePostActionPostAction? action,
  required Device? entity,
  dynamic token,
}) {
  generatedMapping.putIfAbsent(EntityRes, () => EntityRes.fromJsonFactory);

  return _upsertDevice(
      action: action?.value?.toString(),
      entity: entity,
      token: token?.toString());
}