QuickbooksCustomer.fromMap constructor

QuickbooksCustomer.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory QuickbooksCustomer.fromMap(Map<String, dynamic> map) {
  return QuickbooksCustomer(
    id: map['Id'],
    syncToken: map['SyncToken'],
    displayName: map['DisplayName'],
    title: map['Title'],
    givenName: map['GivenName'],
    middleName: map['MiddleName'],
    suffix: map['Suffix'],
    familyName: map['FamilyName'],
    primaryEmailAddr: map['PrimaryEmailAddr'] != null
        ? QuickbooksEmailAddress.fromMap(
            map['PrimaryEmailAddr'] as Map<String, dynamic>)
        : null,
    resaleNum: map['ResaleNum'],
    secondaryTaxIdentifier: map['SecondaryTaxIdentifier'],
    ARAccountRef: map['ARAccountRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['ARAccountRef'] as Map<String, dynamic>)
        : null,
    defaultTaxCodeRef: map['DefaultTaxCodeRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['DefaultTaxCodeRef'] as Map<String, dynamic>)
        : null,
    preferredDeliveryMethod: map['PreferredDeliveryMethod'],
    GSTIN: map['GSTIN'],
    salesTermRef: map['SalesTermRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['SalesTermRef'] as Map<String, dynamic>)
        : null,
    customerTypeRef: map['CustomerTypeRef'],
    fax: map['Fax'] != null
        ? QuickbooksPhoneNumber.fromMap(map['Fax'] as Map<String, dynamic>)
        : null,
    businessNumber: map['BusinessNumber'],
    billWithParent: map['BillWithParent'],
    currencyRef: map['CurrencyRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['CurrencyRef'] as Map<String, dynamic>)
        : null,
    mobile: map['Mobile'] != null
        ? QuickbooksPhoneNumber.fromMap(map['Mobile'] as Map<String, dynamic>)
        : null,
    job: map['Job'],
    balanceWithJobs: double.tryParse(map['BalanceWithJobs'].toString()),
    primaryPhone: map['PrimaryPhone'] != null
        ? QuickbooksPhoneNumber.fromMap(
            map['PrimaryPhone'] as Map<String, dynamic>)
        : null,
    openBalanceDate: DateTime.tryParse(map['OpenBalanceDate'].toString()),
    taxable: map['Taxable'],
    alternatePhone: map['AlternatePhone'] != null
        ? QuickbooksPhoneNumber.fromMap(
            map['AlternatePhone'] as Map<String, dynamic>)
        : null,
    metaData: map['MetaData'],
    parentRef: map['ParentRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['ParentRef'] as Map<String, dynamic>)
        : null,
    notes: map['Notes'],
    webAddr: map['WebAddr'] != null
        ? QuickbooksWebAddress.fromMap(map['WebAddr'] as Map<String, dynamic>)
        : null,
    active: map['Active'],
    companyName: map['CompanyName'],
    balance: double.tryParse(map['balance'].toString()),
    shipAddr: map['ShipAddr'] != null
        ? QuickbooksPhysicalAddress.fromMap(
            map['ShipAddr'] as Map<String, dynamic>)
        : null,
    paymentMethodRef: map['PaymentMethodRef'] != null
        ? QuickbooksReferenceType.fromMap(
            map['PaymentMethodRef'] as Map<String, dynamic>)
        : null,
    isProject: map['IsProject'],
    source: map['Source'],
    primaryTaxIdentifier: map['PrimaryTaxIdentifier'],
    GSTRegistrationType: map['GSTRegistrationType'],
    printOnCheckName: map['PrintOnCheckName'],
    billAddr: map['BillAddr'] != null
        ? QuickbooksPhysicalAddress.fromMap(
            map['BillAddr'] as Map<String, dynamic>)
        : null,
    fullyQualifiedName: map['FullyQualifiedName'],
    level: int.tryParse(map['Level'].toString()),
    taxExemptionReasonId: map['TaxExemptionReasonId'],
  );
}