import 'package:protobuf/protobuf.dart';
import 'package:alt_client/src/generated/alt/v1/common.pb.dart';
import 'package:alt_client/src/generated/alt/v1/market.pb.dart';
import 'package:alt_client/src/generated/alt/v1/backtest.pb.dart';
import 'package:alt_client/src/generated/alt/v1/paper_trading.pb.dart';
import 'package:alt_client/src/generated/alt/v1/live_trading.pb.dart';

/// Returns the map of ALT Protobuf message qualified names to their respective parser functions.
Map<String, GeneratedMessage Function(List<int>)> altParserMap() {
  return {
    HelloRequest.getDefault().info_.qualifiedMessageName:
        HelloRequest.fromBuffer,
    HelloResponse.getDefault().info_.qualifiedMessageName:
        HelloResponse.fromBuffer,
    ListInstrumentsRequest.getDefault().info_.qualifiedMessageName:
        ListInstrumentsRequest.fromBuffer,
    ListInstrumentsResponse.getDefault().info_.qualifiedMessageName:
        ListInstrumentsResponse.fromBuffer,
    ListBarsRequest.getDefault().info_.qualifiedMessageName:
        ListBarsRequest.fromBuffer,
    ListBarsResponse.getDefault().info_.qualifiedMessageName:
        ListBarsResponse.fromBuffer,
    StartBacktestRequest.getDefault().info_.qualifiedMessageName:
        StartBacktestRequest.fromBuffer,
    StartBacktestResponse.getDefault().info_.qualifiedMessageName:
        StartBacktestResponse.fromBuffer,
    GetBacktestRunRequest.getDefault().info_.qualifiedMessageName:
        GetBacktestRunRequest.fromBuffer,
    GetBacktestRunResponse.getDefault().info_.qualifiedMessageName:
        GetBacktestRunResponse.fromBuffer,
    GetBacktestResultRequest.getDefault().info_.qualifiedMessageName:
        GetBacktestResultRequest.fromBuffer,
    GetBacktestResultResponse.getDefault().info_.qualifiedMessageName:
        GetBacktestResultResponse.fromBuffer,
    BacktestResult.getDefault().info_.qualifiedMessageName:
        BacktestResult.fromBuffer,
    ListBacktestRunsRequest.getDefault().info_.qualifiedMessageName:
        ListBacktestRunsRequest.fromBuffer,
    ListBacktestRunsResponse.getDefault().info_.qualifiedMessageName:
        ListBacktestRunsResponse.fromBuffer,
    GetBacktestRunDetailRequest.getDefault().info_.qualifiedMessageName:
        GetBacktestRunDetailRequest.fromBuffer,
    GetBacktestRunDetailResponse.getDefault().info_.qualifiedMessageName:
        GetBacktestRunDetailResponse.fromBuffer,
    CompareBacktestRunsRequest.getDefault().info_.qualifiedMessageName:
        CompareBacktestRunsRequest.fromBuffer,
    CompareBacktestRunsResponse.getDefault().info_.qualifiedMessageName:
        CompareBacktestRunsResponse.fromBuffer,
    StartPaperTradingRequest.getDefault().info_.qualifiedMessageName:
        StartPaperTradingRequest.fromBuffer,
    StartPaperTradingResponse.getDefault().info_.qualifiedMessageName:
        StartPaperTradingResponse.fromBuffer,
    GetPaperTradingStateRequest.getDefault().info_.qualifiedMessageName:
        GetPaperTradingStateRequest.fromBuffer,
    GetPaperTradingStateResponse.getDefault().info_.qualifiedMessageName:
        GetPaperTradingStateResponse.fromBuffer,
    PaperTradingState.getDefault().info_.qualifiedMessageName:
        PaperTradingState.fromBuffer,
    GetLiveBrokerCapabilitiesRequest.getDefault().info_.qualifiedMessageName:
        GetLiveBrokerCapabilitiesRequest.fromBuffer,
    GetLiveBrokerCapabilitiesResponse.getDefault().info_.qualifiedMessageName:
        GetLiveBrokerCapabilitiesResponse.fromBuffer,
    LiveBrokerCapability.getDefault().info_.qualifiedMessageName:
        LiveBrokerCapability.fromBuffer,
  };
}
