get method

Future<QuickbooksProduct?> get({
  1. required String accessToken,
  2. required String companyId,
  3. required String id,
})

Gets a QuickbooksProduct from the Quickbooks API with the given accessToken, companyId and id. Returns null if no data found.

Implementation

Future<QuickbooksProduct?> get({
  required String accessToken,
  required String companyId,
  required String id,
}) async {
  Map<String, dynamic>? item = await getOne(
    accessToken: accessToken,
    companyId: companyId,
    id: id,
  );
  if (item == null) {
    return null;
  }
  try {
    var result = QuickbooksProduct.fromMap(item);
    return result;
  } catch (_) {
    return null;
  }
}