'''
 Generated by EZX Code Generator  
Date: 02/24/22 
'''


from iserver.EzxMsg import EzxMsg, EzxMsgMeta
from iserver.msgs import *
from iserver.enums import api

from .Destination import Destination
from .AccountInfo import AccountInfo
from .RiskProfile import RiskProfile
from .RegisteredRep import RegisteredRep
from .TradeUser import TradeUser
from .Settings import Settings


class LogonResponse(EzxMsg, metaclass=EzxMsgMeta):

	__block_fields__ = {
		'DESTSTRATBL' : Field('destStrategies', 'DESTSTRATBL', noop_decode_func, update_list_item), 
		'ACCTINFO' : Field('accountList', 'ACCTINFO', noop_decode_func, update_list_item), 
		'RISKPROFILE' : Field('riskProfileList', 'RISKPROFILE', noop_decode_func, update_list_item), 
		'REGREP' : Field('rrList', 'REGREP', noop_decode_func, update_list_item), 
		'TRDUSER' : Field('tradeUserList', 'TRDUSER', noop_decode_func, update_list_item), 
		'SETTBLK' : Field('settings', 'SETTBLK', noop_decode_func, ), 
	}

	def __init__(self, **kwargs):
		self.destinations : list[list] = None
		self.destStrategies : list[Destination] = None
		self.accountList : list[AccountInfo] = None
		self.riskProfileList : list[RiskProfile] = None
		self.rrList : list[RegisteredRep] = None
		self.tradeUserList : list[TradeUser] = None
		self.settings : Settings = None
		self.returnCode : int = None
		self.returnDesc : str = None
		self.heartbeatIntervalSecs : int = None
		self.creditLimit : float = None
		self.creditUsed : float = None
		self.positionLimit : int = None
		self.positionLimitUsed : int = None
		self.riskUserType : int = None
		super(LogonResponse, self).__init__(**kwargs)
		self.msg_type = api.IserverMsgType.APPLICATION.value
		self.msg_subtype = api.IserverMsgSubType.LOGONRESPONSE.value

