@classmethod
def from_response(cls, user, response):
    """Construct a BaseNode from a response dict."""
    args = {'user': user, 'json': response, 'type': response.get('type'),
        'id': response.get('_id'), 'is_active': response.get('is_active'),
        'permission': response.get('allowed'), 'nickname': response['info']
        .get('nickname'), 'name_on_account': response['info'].get(
        'name_on_account'), 'bank_long_name': response['info'].get(
        'bank_long_name'), 'bank_name': response['info'].get('bank_name'),
        'account_type': response['info'].get('type'), 'account_class':
        response['info'].get('class'), 'account_number': response['info'].
        get('account_num'), 'routing_number': response['info'].get(
        'routing_num'), 'account_id': response['info'].get('account_id'),
        'address': response['info'].get('address'), 'swift': response[
        'info'].get('swift'), 'ifsc': response['info'].get('ifsc'),
        'payee_name': response['info'].get('payee_name'), 'document_id':
        response['info'].get('document_id'), 'network': response['info'].
        get('network'), 'interchange_type': response['info'].get('type'),
        'card_hash': response['info'].get('card_hash'), 'is_international':
        response['info'].get('is_international'), 'card_type': response[
        'info'].get('card_type')}
    if response['info'].get('correspondent_info'):
        info = response['info']['correspondent_info']
        args['correspondent_swift'] = info.get('swift')
        args['correspondent_bank_name'] = info.get('bank_name')
        args['correspondent_routing_number'] = info.get('routing_num')
        args['correspondent_address'] = info.get('address')
    if response['info'].get('match_info'):
        match_info = response['info']['match_info']
        args['email_match'] = match_info.get('email_match')
        args['name_match'] = match_info.get('name_match')
        args['phonenumber_match'] = match_info.get('phonenumber_match')
    if response['info'].get('balance'):
        info = response['info']['balance']
        args['balance'] = info.get('amount')
        args['currency'] = info.get('currency')
    if response.get('extra'):
        info = response['extra']
        args['supp_id'] = info.get('supp_id')
        args['gateway_restricted'] = info.get('gateway_restricted')
    if response['info'].get('payee_address'):
        info = response['info']['payee_address']
        args['address_street'] = info.get('address_street')
        args['address_city'] = info.get('address_city')
        args['address_subdivision'] = info.get('address_subdivision')
        args['address_country_code'] = info.get('address_country_code')
        args['address_postal_code'] = info.get('address_postal_code')
    if response['info'].get('preferences'):
        info = response['info']['preferences']
        args['allow_foreign_transactions'] = info.get(
            'allow_foreign_transactions')
        args['atm_withdrawal_limit'] = info.get('atm_withdrawal_limit')
        args['max_pin_attempts'] = info.get('max_pin_attempts')
        args['pos_withdrawal_limit'] = info.get('pos_withdrawal_limit')
        args['security_alerts'] = info.get('security_alerts')
    return cls(**args)
