fromMap static method

PurchaseRefundsData? fromMap(
  1. Object? body
)

Implementation

static PurchaseRefundsData? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return PurchaseRefundsData(
    account: PurchaseRefundsDataAccount.fromMap(source['account']),
    amount: readText(source['amount']),
    createdBy: PurchaseRefundsDataCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditNote: PurchaseRefundsDataCreditNote.fromMap(source['credit_note']),
    customAttributes: readList<PurchaseRefundsDataCustomAttribute>(
        source['custom_attributes'],
        PurchaseRefundsDataCustomAttribute.fromMap),
    id: readText(source['id']),
    issueDate: readText(source['issue_date']),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readAny(source['last_updated_on']),
    note: readText(source['note']),
    object: readText(source['object']),
    paymentMethod: readText(source['payment_method']),
    paymentProcessor: readText(source['payment_processor']),
    reference: readText(source['reference']),
    status: readText(source['status']),
    uuid: readText(source['uuid']),
    version: readInteger(source['version']),
  );
}