fromMap static method

Implementation

static AccountPurchaseRefundsData? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return AccountPurchaseRefundsData(
    account: AccountPurchaseRefundsDataAccount.fromMap(source['account']),
    amount: readText(source['amount']),
    createdBy:
        AccountPurchaseRefundsDataCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditNote:
        AccountPurchaseRefundsDataCreditNote.fromMap(source['credit_note']),
    customAttributes: readList<AccountPurchaseRefundsDataCustomAttribute>(
        source['custom_attributes'],
        AccountPurchaseRefundsDataCustomAttribute.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']),
  );
}