'generated source for method reqContractDetails'

@synchronized(mlock)
def reqContractDetails(self, reqId, contract):

    if (not self.m_connected):
        self.notConnected()
        return
    if (self.m_serverVersion < 4):
        self.error(EClientErrors.NO_VALID_ID, EClientErrors.UPDATE_TWS.code(), EClientErrors.UPDATE_TWS.msg())
        return
    if (self.m_serverVersion < self.MIN_SERVER_VER_SEC_ID_TYPE):
        if ((not self.IsEmpty(contract.m_secIdType)) or (not self.IsEmpty(contract.m_secId))):
            self.error(reqId, EClientErrors.UPDATE_TWS, '        It    does    not    support    secIdType    and    secId    parameters.')
            return
    if (self.m_serverVersion < self.MIN_SERVER_VER_TRADING_CLASS):
        if (not self.IsEmpty(contract.m_tradingClass)):
            self.error(reqId, EClientErrors.UPDATE_TWS, '        It    does    not    support    tradingClass    parameter    in    reqContractDetails.')
            return
    VERSION = 7
    try:
        self.send(self.REQ_CONTRACT_DATA)
        self.send(VERSION)
        if (self.m_serverVersion >= self.MIN_SERVER_VER_CONTRACT_DATA_CHAIN):
            self.send(reqId)
        if (self.m_serverVersion >= self.MIN_SERVER_VER_CONTRACT_CONID):
            self.send(contract.m_conId)
        self.send(contract.m_symbol)
        self.send(contract.m_secType)
        self.send(contract.m_expiry)
        self.send(contract.m_strike)
        self.send(contract.m_right)
        if (self.m_serverVersion >= 15):
            self.send(contract.m_multiplier)
        self.send(contract.m_exchange)
        self.send(contract.m_currency)
        self.send(contract.m_localSymbol)
        if (self.m_serverVersion >= self.MIN_SERVER_VER_TRADING_CLASS):
            self.send(contract.m_tradingClass)
        if (self.m_serverVersion >= 31):
            self.send(contract.m_includeExpired)
        if (self.m_serverVersion >= self.MIN_SERVER_VER_SEC_ID_TYPE):
            self.send(contract.m_secIdType)
            self.send(contract.m_secId)
    except Exception as e:
        self.error(EClientErrors.NO_VALID_ID, EClientErrors.FAIL_SEND_REQCONTRACT, str(e))
        self.close()
