get method

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

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

Implementation

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