#include "bind_md_api.h"

void bind_md_api(nb::module_ &m) {
    nb::class_<MdApi, PyMdApi> md_api(m, "MdApi");
    md_api
            .def(nb::init<>())
            .def("CreateQuoteApi", &MdApi::CreateQuoteApi)
            .def("Destroy", &MdApi::Destroy)
            .def("GetTradingDay", &MdApi::GetTradingDay)
            .def("GetApiVersion", &MdApi::GetApiVersion)
            .def("GetApiLastError", &MdApi::GetApiLastError)
            .def("SetUDPBufferSize", &MdApi::SetUDPBufferSize)
            .def("SetHeartBeatInterval", &MdApi::SetHeartBeatInterval)
            .def("SetUDPRecvThreadAffinity", &MdApi::SetUDPRecvThreadAffinity)
            .def("SetUDPRecvThreadAffinityArray", &MdApi::SetUDPRecvThreadAffinityArray)
            .def("SetUDPParseThreadAffinity", &MdApi::SetUDPParseThreadAffinity)
            .def("SetUDPParseThreadAffinityArray", &MdApi::SetUDPParseThreadAffinityArray)
            .def("SetUDPSeqLogOutPutFlag", &MdApi::SetUDPSeqLogOutPutFlag)
            .def("SubscribeMarketData", &MdApi::SubscribeMarketData)
            .def("UnSubscribeMarketData", &MdApi::UnSubscribeMarketData)
            .def("SubscribeOrderBook", &MdApi::SubscribeOrderBook)
            .def("UnSubscribeOrderBook", &MdApi::UnSubscribeOrderBook)
            .def("SubscribeTickByTick", &MdApi::SubscribeTickByTick)
            .def("UnSubscribeTickByTick", &MdApi::UnSubscribeTickByTick)
            .def("SubscribeAllMarketData", &MdApi::SubscribeAllMarketData)
            .def("UnSubscribeAllMarketData", &MdApi::UnSubscribeAllMarketData)
            .def("SubscribeAllOrderBook", &MdApi::SubscribeAllOrderBook)
            .def("UnSubscribeAllOrderBook", &MdApi::UnSubscribeAllOrderBook)
            .def("SubscribeAllTickByTick", &MdApi::SubscribeAllTickByTick)
            .def("UnSubscribeAllTickByTick", &MdApi::UnSubscribeAllTickByTick)
            .def("Login", &MdApi::Login)
            .def("Logout", &MdApi::Logout)
            .def("QueryAllTickers", &MdApi::QueryAllTickers)
            .def("QueryTickersPriceInfo", &MdApi::QueryTickersPriceInfo)
            .def("QueryAllTickersPriceInfo", &MdApi::QueryAllTickersPriceInfo)
            .def("SubscribeAllOptionMarketData", &MdApi::SubscribeAllOptionMarketData)
            .def("UnSubscribeAllOptionMarketData", &MdApi::UnSubscribeAllOptionMarketData)
            .def("SubscribeAllOptionOrderBook", &MdApi::SubscribeAllOptionOrderBook)
            .def("UnSubscribeAllOptionOrderBook", &MdApi::UnSubscribeAllOptionOrderBook)
            .def("SubscribeAllOptionTickByTick", &MdApi::SubscribeAllOptionTickByTick)
            .def("UnSubscribeAllOptionTickByTick", &MdApi::UnSubscribeAllOptionTickByTick)
            .def("QueryAllTickersFullInfo", &MdApi::QueryAllTickersFullInfo)
            .def("QueryAllNQTickersFullInfo", &MdApi::QueryAllNQTickersFullInfo)
            .def("LoginToRebuildQuoteServer", &MdApi::LoginToRebuildQuoteServer)
            .def("LogoutFromRebuildQuoteServer", &MdApi::LogoutFromRebuildQuoteServer)
            .def("RequestRebuildQuote", &MdApi::RequestRebuildQuote)

            // On Methods
            .def("OnDisconnected", &MdApi::PyOnDisconnected)
            .def("OnError", &MdApi::PyOnError)
            .def("OnSubMarketData", &MdApi::PyOnSubMarketData)
            .def("OnUnSubMarketData", &MdApi::PyOnUnSubMarketData)
            .def("OnDepthMarketData", &MdApi::PyOnDepthMarketData)
            .def("OnSubOrderBook", &MdApi::PyOnSubOrderBook)
            .def("OnUnSubOrderBook", &MdApi::PyOnUnSubOrderBook)
            .def("OnOrderBook", &MdApi::PyOnOrderBook)
            .def("OnSubTickByTick", &MdApi::PyOnSubTickByTick)
            .def("OnUnSubTickByTick", &MdApi::PyOnUnSubTickByTick)
            .def("OnTickByTick", &MdApi::PyOnTickByTick)
            .def("OnSubscribeAllMarketData", &MdApi::PyOnSubscribeAllMarketData)
            .def("OnUnSubscribeAllMarketData", &MdApi::PyOnUnSubscribeAllMarketData)
            .def("OnSubscribeAllOrderBook", &MdApi::PyOnSubscribeAllOrderBook)
            .def("OnUnSubscribeAllOrderBook", &MdApi::PyOnUnSubscribeAllOrderBook)
            .def("OnSubscribeAllTickByTick", &MdApi::PyOnSubscribeAllTickByTick)
            .def("OnUnSubscribeAllTickByTick", &MdApi::PyOnUnSubscribeAllTickByTick)
            .def("OnQueryAllTickers", &MdApi::PyOnQueryAllTickers)
            .def("OnQueryTickersPriceInfo", &MdApi::PyOnQueryTickersPriceInfo)
            .def("OnSubscribeAllOptionMarketData", &MdApi::PyOnSubscribeAllOptionMarketData)
            .def("OnUnSubscribeAllOptionMarketData", &MdApi::PyOnUnSubscribeAllOptionMarketData)
            .def("OnSubscribeAllOptionOrderBook", &MdApi::PyOnSubscribeAllOptionOrderBook)
            .def("OnUnSubscribeAllOptionOrderBook", &MdApi::PyOnUnSubscribeAllOptionOrderBook)
            .def("OnSubscribeAllOptionTickByTick", &MdApi::PyOnSubscribeAllOptionTickByTick)
            .def("OnUnSubscribeAllOptionTickByTick", &MdApi::PyOnUnSubscribeAllOptionTickByTick)
            .def("OnQueryAllTickersFullInfo", &MdApi::PyOnQueryAllTickersFullInfo)
            .def("OnQueryAllNQTickersFullInfo", &MdApi::PyOnQueryAllNQTickersFullInfo)
            .def("OnRebuildQuoteServerDisconnected", &MdApi::PyOnRebuildQuoteServerDisconnected)
            .def("OnRequestRebuildQuote", &MdApi::PyOnRequestRebuildQuote)
            .def("OnRebuildTickByTick", &MdApi::PyOnRebuildTickByTick)
            .def("OnRebuildMarketData", &MdApi::PyOnRebuildMarketData)
            ;
}
