fromJson static method

LeadFinancialInformation? fromJson(
  1. dynamic value
)

Returns a new LeadFinancialInformation instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static LeadFinancialInformation? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();

    // Ensure that the map contains the required keys.
    // Note 1: the values aren't checked for validity beyond being non-null.
    // Note 2: this code is stripped in release mode!
    assert(() {
      return true;
    }());

    return LeadFinancialInformation(
      employmentStatus: EmploymentStatus.fromJson(json[r'employmentStatus']),
      employmentPayFrequency:
          EmploymentPayFrequency.fromJson(json[r'employmentPayFrequency']),
      annualIncome: mapValueOfType<int>(json, r'annualIncome'),
      monthlyNetIncome: mapValueOfType<int>(json, r'monthlyNetIncome'),
      bankName: mapValueOfType<String>(json, r'bankName'),
      bankRoutingNumber: mapValueOfType<String>(json, r'bankRoutingNumber'),
      bankAccountType: BankAccountType.fromJson(json[r'bankAccountType']),
      creditCardDebt: mapValueOfType<int>(json, r'creditCardDebt'),
      monthsAtBank: mapValueOfType<int>(json, r'monthsAtBank'),
      bankAccountNumber: mapValueOfType<String>(json, r'bankAccountNumber'),
      monthlyDebt: mapValueOfType<int>(json, r'monthlyDebt'),
      totalAssets: mapValueOfType<int>(json, r'totalAssets'),
      monthlyHousingPayment:
          mapValueOfType<int>(json, r'monthlyHousingPayment'),
      availableAssets: mapValueOfType<int>(json, r'availableAssets'),
      additionalIncome: mapValueOfType<int>(json, r'additionalIncome'),
      additionalIncomeFrequency:
          EmploymentPayFrequency.fromJson(json[r'additionalIncomeFrequency']),
      hasDirectDeposit: mapValueOfType<bool>(json, r'hasDirectDeposit'),
      totalUnsecuredDebt: mapValueOfType<int>(json, r'totalUnsecuredDebt'),
    );
  }
  return null;
}