// This is a generated file - do not edit.
//
// Generated from alt/v1/live_trading.proto.

// @dart = 3.3

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports

import 'dart:core' as $core;

import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;

import 'backtest.pb.dart' as $2;
import 'common.pb.dart' as $0;
import 'market.pb.dart' as $1;

export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;

/// GetLiveBrokerCapabilitiesRequest is a query sent to the worker to discover
/// what markets, venues, and order types the live broker adapter supports.
class GetLiveBrokerCapabilitiesRequest extends $pb.GeneratedMessage {
  factory GetLiveBrokerCapabilitiesRequest({
    $core.String? accountId,
  }) {
    final result = create();
    if (accountId != null) result.accountId = accountId;
    return result;
  }

  GetLiveBrokerCapabilitiesRequest._();

  factory GetLiveBrokerCapabilitiesRequest.fromBuffer(
          $core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory GetLiveBrokerCapabilitiesRequest.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'GetLiveBrokerCapabilitiesRequest',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'accountId')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  GetLiveBrokerCapabilitiesRequest clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  GetLiveBrokerCapabilitiesRequest copyWith(
          void Function(GetLiveBrokerCapabilitiesRequest) updates) =>
      super.copyWith(
              (message) => updates(message as GetLiveBrokerCapabilitiesRequest))
          as GetLiveBrokerCapabilitiesRequest;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static GetLiveBrokerCapabilitiesRequest create() =>
      GetLiveBrokerCapabilitiesRequest._();
  @$core.override
  GetLiveBrokerCapabilitiesRequest createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static GetLiveBrokerCapabilitiesRequest getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<GetLiveBrokerCapabilitiesRequest>(
          create);
  static GetLiveBrokerCapabilitiesRequest? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get accountId => $_getSZ(0);
  @$pb.TagNumber(1)
  set accountId($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasAccountId() => $_has(0);
  @$pb.TagNumber(1)
  void clearAccountId() => $_clearField(1);
}

/// GetLiveBrokerCapabilitiesResponse wraps the broker capability report or an
/// error explaining why the probe failed.
class GetLiveBrokerCapabilitiesResponse extends $pb.GeneratedMessage {
  factory GetLiveBrokerCapabilitiesResponse({
    LiveBrokerCapability? brokerCapabilities,
    $0.ErrorInfo? error,
  }) {
    final result = create();
    if (brokerCapabilities != null)
      result.brokerCapabilities = brokerCapabilities;
    if (error != null) result.error = error;
    return result;
  }

  GetLiveBrokerCapabilitiesResponse._();

  factory GetLiveBrokerCapabilitiesResponse.fromBuffer(
          $core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory GetLiveBrokerCapabilitiesResponse.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'GetLiveBrokerCapabilitiesResponse',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOM<LiveBrokerCapability>(1, _omitFieldNames ? '' : 'brokerCapabilities',
        subBuilder: LiveBrokerCapability.create)
    ..aOM<$0.ErrorInfo>(2, _omitFieldNames ? '' : 'error',
        subBuilder: $0.ErrorInfo.create)
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  GetLiveBrokerCapabilitiesResponse clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  GetLiveBrokerCapabilitiesResponse copyWith(
          void Function(GetLiveBrokerCapabilitiesResponse) updates) =>
      super.copyWith((message) =>
              updates(message as GetLiveBrokerCapabilitiesResponse))
          as GetLiveBrokerCapabilitiesResponse;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static GetLiveBrokerCapabilitiesResponse create() =>
      GetLiveBrokerCapabilitiesResponse._();
  @$core.override
  GetLiveBrokerCapabilitiesResponse createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static GetLiveBrokerCapabilitiesResponse getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<GetLiveBrokerCapabilitiesResponse>(
          create);
  static GetLiveBrokerCapabilitiesResponse? _defaultInstance;

  @$pb.TagNumber(1)
  LiveBrokerCapability get brokerCapabilities => $_getN(0);
  @$pb.TagNumber(1)
  set brokerCapabilities(LiveBrokerCapability value) => $_setField(1, value);
  @$pb.TagNumber(1)
  $core.bool hasBrokerCapabilities() => $_has(0);
  @$pb.TagNumber(1)
  void clearBrokerCapabilities() => $_clearField(1);
  @$pb.TagNumber(1)
  LiveBrokerCapability ensureBrokerCapabilities() => $_ensure(0);

  @$pb.TagNumber(2)
  $0.ErrorInfo get error => $_getN(1);
  @$pb.TagNumber(2)
  set error($0.ErrorInfo value) => $_setField(2, value);
  @$pb.TagNumber(2)
  $core.bool hasError() => $_has(1);
  @$pb.TagNumber(2)
  void clearError() => $_clearField(2);
  @$pb.TagNumber(2)
  $0.ErrorInfo ensureError() => $_ensure(1);
}

/// LiveBrokerCapability describes what a live broker supports. It mirrors the
/// domain types in packages/domain/trading but is wire-format only so that
/// generated code stays minimal for this milestone.
class LiveBrokerCapability extends $pb.GeneratedMessage {
  factory LiveBrokerCapability({
    $core.String? broker,
    $core.Iterable<$0.Market>? markets,
    $core.Iterable<$0.Venue>? venues,
    $core.Iterable<$core.String>? orderTypes,
    $core.bool? supportsAmend,
    $core.bool? supportsCancel,
    $core.bool? supportsAccount,
    $core.bool? supportsAuditTags,
    $fixnum.Int64? checkedAtUnixMs,
  }) {
    final result = create();
    if (broker != null) result.broker = broker;
    if (markets != null) result.markets.addAll(markets);
    if (venues != null) result.venues.addAll(venues);
    if (orderTypes != null) result.orderTypes.addAll(orderTypes);
    if (supportsAmend != null) result.supportsAmend = supportsAmend;
    if (supportsCancel != null) result.supportsCancel = supportsCancel;
    if (supportsAccount != null) result.supportsAccount = supportsAccount;
    if (supportsAuditTags != null) result.supportsAuditTags = supportsAuditTags;
    if (checkedAtUnixMs != null) result.checkedAtUnixMs = checkedAtUnixMs;
    return result;
  }

  LiveBrokerCapability._();

  factory LiveBrokerCapability.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LiveBrokerCapability.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LiveBrokerCapability',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'broker')
    ..pc<$0.Market>(2, _omitFieldNames ? '' : 'markets', $pb.PbFieldType.KE,
        valueOf: $0.Market.valueOf,
        enumValues: $0.Market.values,
        defaultEnumValue: $0.Market.MARKET_UNSPECIFIED)
    ..pc<$0.Venue>(3, _omitFieldNames ? '' : 'venues', $pb.PbFieldType.KE,
        valueOf: $0.Venue.valueOf,
        enumValues: $0.Venue.values,
        defaultEnumValue: $0.Venue.VENUE_UNSPECIFIED)
    ..pPS(4, _omitFieldNames ? '' : 'orderTypes')
    ..aOB(5, _omitFieldNames ? '' : 'supportsAmend')
    ..aOB(6, _omitFieldNames ? '' : 'supportsCancel')
    ..aOB(7, _omitFieldNames ? '' : 'supportsAccount')
    ..aOB(8, _omitFieldNames ? '' : 'supportsAuditTags')
    ..aInt64(9, _omitFieldNames ? '' : 'checkedAtUnixMs')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveBrokerCapability clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveBrokerCapability copyWith(void Function(LiveBrokerCapability) updates) =>
      super.copyWith((message) => updates(message as LiveBrokerCapability))
          as LiveBrokerCapability;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LiveBrokerCapability create() => LiveBrokerCapability._();
  @$core.override
  LiveBrokerCapability createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LiveBrokerCapability getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<LiveBrokerCapability>(create);
  static LiveBrokerCapability? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get broker => $_getSZ(0);
  @$pb.TagNumber(1)
  set broker($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasBroker() => $_has(0);
  @$pb.TagNumber(1)
  void clearBroker() => $_clearField(1);

  @$pb.TagNumber(2)
  $pb.PbList<$0.Market> get markets => $_getList(1);

  @$pb.TagNumber(3)
  $pb.PbList<$0.Venue> get venues => $_getList(2);

  @$pb.TagNumber(4)
  $pb.PbList<$core.String> get orderTypes => $_getList(3);

  @$pb.TagNumber(5)
  $core.bool get supportsAmend => $_getBF(4);
  @$pb.TagNumber(5)
  set supportsAmend($core.bool value) => $_setBool(4, value);
  @$pb.TagNumber(5)
  $core.bool hasSupportsAmend() => $_has(4);
  @$pb.TagNumber(5)
  void clearSupportsAmend() => $_clearField(5);

  @$pb.TagNumber(6)
  $core.bool get supportsCancel => $_getBF(5);
  @$pb.TagNumber(6)
  set supportsCancel($core.bool value) => $_setBool(5, value);
  @$pb.TagNumber(6)
  $core.bool hasSupportsCancel() => $_has(5);
  @$pb.TagNumber(6)
  void clearSupportsCancel() => $_clearField(6);

  @$pb.TagNumber(7)
  $core.bool get supportsAccount => $_getBF(6);
  @$pb.TagNumber(7)
  set supportsAccount($core.bool value) => $_setBool(6, value);
  @$pb.TagNumber(7)
  $core.bool hasSupportsAccount() => $_has(6);
  @$pb.TagNumber(7)
  void clearSupportsAccount() => $_clearField(7);

  @$pb.TagNumber(8)
  $core.bool get supportsAuditTags => $_getBF(7);
  @$pb.TagNumber(8)
  set supportsAuditTags($core.bool value) => $_setBool(7, value);
  @$pb.TagNumber(8)
  $core.bool hasSupportsAuditTags() => $_has(7);
  @$pb.TagNumber(8)
  void clearSupportsAuditTags() => $_clearField(8);

  @$pb.TagNumber(9)
  $fixnum.Int64 get checkedAtUnixMs => $_getI64(8);
  @$pb.TagNumber(9)
  set checkedAtUnixMs($fixnum.Int64 value) => $_setInt64(8, value);
  @$pb.TagNumber(9)
  $core.bool hasCheckedAtUnixMs() => $_has(8);
  @$pb.TagNumber(9)
  void clearCheckedAtUnixMs() => $_clearField(9);
}

/// LiveOrderIntent mirrors the backtest/trading domain intent but belongs to
/// the live protobuf surface so live consumers can decode it without importing
/// backtest messages. Side/type/status stay string-typed to match the domain
/// vocabulary and to keep the lifecycle additive without new enums.
class LiveOrderIntent extends $pb.GeneratedMessage {
  factory LiveOrderIntent({
    $core.String? instrumentId,
    $core.String? side,
    $1.Quantity? quantity,
    $core.String? type,
    $core.String? timeInForce,
    $1.Price? limitPrice,
    $core.String? brokerClientId,
    $core.Iterable<$core.MapEntry<$core.String, $core.String>>? customTags,
  }) {
    final result = create();
    if (instrumentId != null) result.instrumentId = instrumentId;
    if (side != null) result.side = side;
    if (quantity != null) result.quantity = quantity;
    if (type != null) result.type = type;
    if (timeInForce != null) result.timeInForce = timeInForce;
    if (limitPrice != null) result.limitPrice = limitPrice;
    if (brokerClientId != null) result.brokerClientId = brokerClientId;
    if (customTags != null) result.customTags.addEntries(customTags);
    return result;
  }

  LiveOrderIntent._();

  factory LiveOrderIntent.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LiveOrderIntent.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LiveOrderIntent',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'instrumentId')
    ..aOS(2, _omitFieldNames ? '' : 'side')
    ..aOM<$1.Quantity>(3, _omitFieldNames ? '' : 'quantity',
        subBuilder: $1.Quantity.create)
    ..aOS(4, _omitFieldNames ? '' : 'type')
    ..aOS(5, _omitFieldNames ? '' : 'timeInForce')
    ..aOM<$1.Price>(6, _omitFieldNames ? '' : 'limitPrice',
        subBuilder: $1.Price.create)
    ..aOS(7, _omitFieldNames ? '' : 'brokerClientId')
    ..m<$core.String, $core.String>(8, _omitFieldNames ? '' : 'customTags',
        entryClassName: 'LiveOrderIntent.CustomTagsEntry',
        keyFieldType: $pb.PbFieldType.OS,
        valueFieldType: $pb.PbFieldType.OS,
        packageName: const $pb.PackageName('alt.v1'))
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveOrderIntent clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveOrderIntent copyWith(void Function(LiveOrderIntent) updates) =>
      super.copyWith((message) => updates(message as LiveOrderIntent))
          as LiveOrderIntent;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LiveOrderIntent create() => LiveOrderIntent._();
  @$core.override
  LiveOrderIntent createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LiveOrderIntent getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<LiveOrderIntent>(create);
  static LiveOrderIntent? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get instrumentId => $_getSZ(0);
  @$pb.TagNumber(1)
  set instrumentId($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasInstrumentId() => $_has(0);
  @$pb.TagNumber(1)
  void clearInstrumentId() => $_clearField(1);

  /// side is "buy" or "sell".
  @$pb.TagNumber(2)
  $core.String get side => $_getSZ(1);
  @$pb.TagNumber(2)
  set side($core.String value) => $_setString(1, value);
  @$pb.TagNumber(2)
  $core.bool hasSide() => $_has(1);
  @$pb.TagNumber(2)
  void clearSide() => $_clearField(2);

  @$pb.TagNumber(3)
  $1.Quantity get quantity => $_getN(2);
  @$pb.TagNumber(3)
  set quantity($1.Quantity value) => $_setField(3, value);
  @$pb.TagNumber(3)
  $core.bool hasQuantity() => $_has(2);
  @$pb.TagNumber(3)
  void clearQuantity() => $_clearField(3);
  @$pb.TagNumber(3)
  $1.Quantity ensureQuantity() => $_ensure(2);

  /// type is "market", "limit", or broker-specific (e.g. "kis_best_limit").
  @$pb.TagNumber(4)
  $core.String get type => $_getSZ(3);
  @$pb.TagNumber(4)
  set type($core.String value) => $_setString(3, value);
  @$pb.TagNumber(4)
  $core.bool hasType() => $_has(3);
  @$pb.TagNumber(4)
  void clearType() => $_clearField(4);

  @$pb.TagNumber(5)
  $core.String get timeInForce => $_getSZ(4);
  @$pb.TagNumber(5)
  set timeInForce($core.String value) => $_setString(4, value);
  @$pb.TagNumber(5)
  $core.bool hasTimeInForce() => $_has(4);
  @$pb.TagNumber(5)
  void clearTimeInForce() => $_clearField(5);

  @$pb.TagNumber(6)
  $1.Price get limitPrice => $_getN(5);
  @$pb.TagNumber(6)
  set limitPrice($1.Price value) => $_setField(6, value);
  @$pb.TagNumber(6)
  $core.bool hasLimitPrice() => $_has(5);
  @$pb.TagNumber(6)
  void clearLimitPrice() => $_clearField(6);
  @$pb.TagNumber(6)
  $1.Price ensureLimitPrice() => $_ensure(5);

  @$pb.TagNumber(7)
  $core.String get brokerClientId => $_getSZ(6);
  @$pb.TagNumber(7)
  set brokerClientId($core.String value) => $_setString(6, value);
  @$pb.TagNumber(7)
  $core.bool hasBrokerClientId() => $_has(6);
  @$pb.TagNumber(7)
  void clearBrokerClientId() => $_clearField(7);

  @$pb.TagNumber(8)
  $pb.PbMap<$core.String, $core.String> get customTags => $_getMap(7);
}

/// LiveOrder is a broker-submitted order with execution status updates. It uses
/// string-typed side/type/status so unknown broker values are preserved.
class LiveOrder extends $pb.GeneratedMessage {
  factory LiveOrder({
    $core.String? id,
    $core.String? brokerId,
    $core.String? clientId,
    $core.String? accountId,
    $core.String? instrumentId,
    $core.String? side,
    $1.Quantity? quantity,
    $core.String? type,
    $core.String? timeInForce,
    $1.Price? limitPrice,
    $core.String? status,
    $core.String? brokerStatus,
    $2.BacktestTrade? fill,
    $core.String? rejectionReason,
    $fixnum.Int64? createdAtUnixMs,
    $fixnum.Int64? updatedAtUnixMs,
  }) {
    final result = create();
    if (id != null) result.id = id;
    if (brokerId != null) result.brokerId = brokerId;
    if (clientId != null) result.clientId = clientId;
    if (accountId != null) result.accountId = accountId;
    if (instrumentId != null) result.instrumentId = instrumentId;
    if (side != null) result.side = side;
    if (quantity != null) result.quantity = quantity;
    if (type != null) result.type = type;
    if (timeInForce != null) result.timeInForce = timeInForce;
    if (limitPrice != null) result.limitPrice = limitPrice;
    if (status != null) result.status = status;
    if (brokerStatus != null) result.brokerStatus = brokerStatus;
    if (fill != null) result.fill = fill;
    if (rejectionReason != null) result.rejectionReason = rejectionReason;
    if (createdAtUnixMs != null) result.createdAtUnixMs = createdAtUnixMs;
    if (updatedAtUnixMs != null) result.updatedAtUnixMs = updatedAtUnixMs;
    return result;
  }

  LiveOrder._();

  factory LiveOrder.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LiveOrder.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LiveOrder',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'id')
    ..aOS(2, _omitFieldNames ? '' : 'brokerId')
    ..aOS(3, _omitFieldNames ? '' : 'clientId')
    ..aOS(4, _omitFieldNames ? '' : 'accountId')
    ..aOS(5, _omitFieldNames ? '' : 'instrumentId')
    ..aOS(6, _omitFieldNames ? '' : 'side')
    ..aOM<$1.Quantity>(7, _omitFieldNames ? '' : 'quantity',
        subBuilder: $1.Quantity.create)
    ..aOS(8, _omitFieldNames ? '' : 'type')
    ..aOS(9, _omitFieldNames ? '' : 'timeInForce')
    ..aOM<$1.Price>(10, _omitFieldNames ? '' : 'limitPrice',
        subBuilder: $1.Price.create)
    ..aOS(11, _omitFieldNames ? '' : 'status')
    ..aOS(12, _omitFieldNames ? '' : 'brokerStatus')
    ..aOM<$2.BacktestTrade>(13, _omitFieldNames ? '' : 'fill',
        subBuilder: $2.BacktestTrade.create)
    ..aOS(14, _omitFieldNames ? '' : 'rejectionReason')
    ..aInt64(15, _omitFieldNames ? '' : 'createdAtUnixMs')
    ..aInt64(16, _omitFieldNames ? '' : 'updatedAtUnixMs')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveOrder clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveOrder copyWith(void Function(LiveOrder) updates) =>
      super.copyWith((message) => updates(message as LiveOrder)) as LiveOrder;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LiveOrder create() => LiveOrder._();
  @$core.override
  LiveOrder createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LiveOrder getDefault() =>
      _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<LiveOrder>(create);
  static LiveOrder? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get id => $_getSZ(0);
  @$pb.TagNumber(1)
  set id($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasId() => $_has(0);
  @$pb.TagNumber(1)
  void clearId() => $_clearField(1);

  @$pb.TagNumber(2)
  $core.String get brokerId => $_getSZ(1);
  @$pb.TagNumber(2)
  set brokerId($core.String value) => $_setString(1, value);
  @$pb.TagNumber(2)
  $core.bool hasBrokerId() => $_has(1);
  @$pb.TagNumber(2)
  void clearBrokerId() => $_clearField(2);

  @$pb.TagNumber(3)
  $core.String get clientId => $_getSZ(2);
  @$pb.TagNumber(3)
  set clientId($core.String value) => $_setString(2, value);
  @$pb.TagNumber(3)
  $core.bool hasClientId() => $_has(2);
  @$pb.TagNumber(3)
  void clearClientId() => $_clearField(3);

  @$pb.TagNumber(4)
  $core.String get accountId => $_getSZ(3);
  @$pb.TagNumber(4)
  set accountId($core.String value) => $_setString(3, value);
  @$pb.TagNumber(4)
  $core.bool hasAccountId() => $_has(3);
  @$pb.TagNumber(4)
  void clearAccountId() => $_clearField(4);

  @$pb.TagNumber(5)
  $core.String get instrumentId => $_getSZ(4);
  @$pb.TagNumber(5)
  set instrumentId($core.String value) => $_setString(4, value);
  @$pb.TagNumber(5)
  $core.bool hasInstrumentId() => $_has(4);
  @$pb.TagNumber(5)
  void clearInstrumentId() => $_clearField(5);

  @$pb.TagNumber(6)
  $core.String get side => $_getSZ(5);
  @$pb.TagNumber(6)
  set side($core.String value) => $_setString(5, value);
  @$pb.TagNumber(6)
  $core.bool hasSide() => $_has(5);
  @$pb.TagNumber(6)
  void clearSide() => $_clearField(6);

  @$pb.TagNumber(7)
  $1.Quantity get quantity => $_getN(6);
  @$pb.TagNumber(7)
  set quantity($1.Quantity value) => $_setField(7, value);
  @$pb.TagNumber(7)
  $core.bool hasQuantity() => $_has(6);
  @$pb.TagNumber(7)
  void clearQuantity() => $_clearField(7);
  @$pb.TagNumber(7)
  $1.Quantity ensureQuantity() => $_ensure(6);

  @$pb.TagNumber(8)
  $core.String get type => $_getSZ(7);
  @$pb.TagNumber(8)
  set type($core.String value) => $_setString(7, value);
  @$pb.TagNumber(8)
  $core.bool hasType() => $_has(7);
  @$pb.TagNumber(8)
  void clearType() => $_clearField(8);

  @$pb.TagNumber(9)
  $core.String get timeInForce => $_getSZ(8);
  @$pb.TagNumber(9)
  set timeInForce($core.String value) => $_setString(8, value);
  @$pb.TagNumber(9)
  $core.bool hasTimeInForce() => $_has(8);
  @$pb.TagNumber(9)
  void clearTimeInForce() => $_clearField(9);

  @$pb.TagNumber(10)
  $1.Price get limitPrice => $_getN(9);
  @$pb.TagNumber(10)
  set limitPrice($1.Price value) => $_setField(10, value);
  @$pb.TagNumber(10)
  $core.bool hasLimitPrice() => $_has(9);
  @$pb.TagNumber(10)
  void clearLimitPrice() => $_clearField(10);
  @$pb.TagNumber(10)
  $1.Price ensureLimitPrice() => $_ensure(9);

  @$pb.TagNumber(11)
  $core.String get status => $_getSZ(10);
  @$pb.TagNumber(11)
  set status($core.String value) => $_setString(10, value);
  @$pb.TagNumber(11)
  $core.bool hasStatus() => $_has(10);
  @$pb.TagNumber(11)
  void clearStatus() => $_clearField(11);

  /// broker_status mirrors the raw status reported by the broker.
  @$pb.TagNumber(12)
  $core.String get brokerStatus => $_getSZ(11);
  @$pb.TagNumber(12)
  set brokerStatus($core.String value) => $_setString(11, value);
  @$pb.TagNumber(12)
  $core.bool hasBrokerStatus() => $_has(11);
  @$pb.TagNumber(12)
  void clearBrokerStatus() => $_clearField(12);

  @$pb.TagNumber(13)
  $2.BacktestTrade get fill => $_getN(12);
  @$pb.TagNumber(13)
  set fill($2.BacktestTrade value) => $_setField(13, value);
  @$pb.TagNumber(13)
  $core.bool hasFill() => $_has(12);
  @$pb.TagNumber(13)
  void clearFill() => $_clearField(13);
  @$pb.TagNumber(13)
  $2.BacktestTrade ensureFill() => $_ensure(12);

  @$pb.TagNumber(14)
  $core.String get rejectionReason => $_getSZ(13);
  @$pb.TagNumber(14)
  set rejectionReason($core.String value) => $_setString(13, value);
  @$pb.TagNumber(14)
  $core.bool hasRejectionReason() => $_has(13);
  @$pb.TagNumber(14)
  void clearRejectionReason() => $_clearField(14);

  @$pb.TagNumber(15)
  $fixnum.Int64 get createdAtUnixMs => $_getI64(14);
  @$pb.TagNumber(15)
  set createdAtUnixMs($fixnum.Int64 value) => $_setInt64(14, value);
  @$pb.TagNumber(15)
  $core.bool hasCreatedAtUnixMs() => $_has(14);
  @$pb.TagNumber(15)
  void clearCreatedAtUnixMs() => $_clearField(15);

  @$pb.TagNumber(16)
  $fixnum.Int64 get updatedAtUnixMs => $_getI64(15);
  @$pb.TagNumber(16)
  set updatedAtUnixMs($fixnum.Int64 value) => $_setInt64(15, value);
  @$pb.TagNumber(16)
  $core.bool hasUpdatedAtUnixMs() => $_has(15);
  @$pb.TagNumber(16)
  void clearUpdatedAtUnixMs() => $_clearField(16);
}

/// LiveAccountSnapshot carries live account state from a broker.
class LiveAccountSnapshot extends $pb.GeneratedMessage {
  factory LiveAccountSnapshot({
    $core.String? broker,
    $core.String? accountId,
    $0.Decimal? cash,
    $0.Decimal? totalEquity,
    $0.Decimal? availableMargin,
    $fixnum.Int64? snapshotTimeUnixMs,
  }) {
    final result = create();
    if (broker != null) result.broker = broker;
    if (accountId != null) result.accountId = accountId;
    if (cash != null) result.cash = cash;
    if (totalEquity != null) result.totalEquity = totalEquity;
    if (availableMargin != null) result.availableMargin = availableMargin;
    if (snapshotTimeUnixMs != null)
      result.snapshotTimeUnixMs = snapshotTimeUnixMs;
    return result;
  }

  LiveAccountSnapshot._();

  factory LiveAccountSnapshot.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LiveAccountSnapshot.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LiveAccountSnapshot',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'broker')
    ..aOS(2, _omitFieldNames ? '' : 'accountId')
    ..aOM<$0.Decimal>(3, _omitFieldNames ? '' : 'cash',
        subBuilder: $0.Decimal.create)
    ..aOM<$0.Decimal>(4, _omitFieldNames ? '' : 'totalEquity',
        subBuilder: $0.Decimal.create)
    ..aOM<$0.Decimal>(5, _omitFieldNames ? '' : 'availableMargin',
        subBuilder: $0.Decimal.create)
    ..aInt64(6, _omitFieldNames ? '' : 'snapshotTimeUnixMs')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveAccountSnapshot clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveAccountSnapshot copyWith(void Function(LiveAccountSnapshot) updates) =>
      super.copyWith((message) => updates(message as LiveAccountSnapshot))
          as LiveAccountSnapshot;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LiveAccountSnapshot create() => LiveAccountSnapshot._();
  @$core.override
  LiveAccountSnapshot createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LiveAccountSnapshot getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<LiveAccountSnapshot>(create);
  static LiveAccountSnapshot? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get broker => $_getSZ(0);
  @$pb.TagNumber(1)
  set broker($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasBroker() => $_has(0);
  @$pb.TagNumber(1)
  void clearBroker() => $_clearField(1);

  @$pb.TagNumber(2)
  $core.String get accountId => $_getSZ(1);
  @$pb.TagNumber(2)
  set accountId($core.String value) => $_setString(1, value);
  @$pb.TagNumber(2)
  $core.bool hasAccountId() => $_has(1);
  @$pb.TagNumber(2)
  void clearAccountId() => $_clearField(2);

  @$pb.TagNumber(3)
  $0.Decimal get cash => $_getN(2);
  @$pb.TagNumber(3)
  set cash($0.Decimal value) => $_setField(3, value);
  @$pb.TagNumber(3)
  $core.bool hasCash() => $_has(2);
  @$pb.TagNumber(3)
  void clearCash() => $_clearField(3);
  @$pb.TagNumber(3)
  $0.Decimal ensureCash() => $_ensure(2);

  @$pb.TagNumber(4)
  $0.Decimal get totalEquity => $_getN(3);
  @$pb.TagNumber(4)
  set totalEquity($0.Decimal value) => $_setField(4, value);
  @$pb.TagNumber(4)
  $core.bool hasTotalEquity() => $_has(3);
  @$pb.TagNumber(4)
  void clearTotalEquity() => $_clearField(4);
  @$pb.TagNumber(4)
  $0.Decimal ensureTotalEquity() => $_ensure(3);

  @$pb.TagNumber(5)
  $0.Decimal get availableMargin => $_getN(4);
  @$pb.TagNumber(5)
  set availableMargin($0.Decimal value) => $_setField(5, value);
  @$pb.TagNumber(5)
  $core.bool hasAvailableMargin() => $_has(4);
  @$pb.TagNumber(5)
  void clearAvailableMargin() => $_clearField(5);
  @$pb.TagNumber(5)
  $0.Decimal ensureAvailableMargin() => $_ensure(4);

  @$pb.TagNumber(6)
  $fixnum.Int64 get snapshotTimeUnixMs => $_getI64(5);
  @$pb.TagNumber(6)
  set snapshotTimeUnixMs($fixnum.Int64 value) => $_setInt64(5, value);
  @$pb.TagNumber(6)
  $core.bool hasSnapshotTimeUnixMs() => $_has(5);
  @$pb.TagNumber(6)
  void clearSnapshotTimeUnixMs() => $_clearField(6);
}

/// LivePositionSnapshot is a single position inside a live account.
class LivePositionSnapshot extends $pb.GeneratedMessage {
  factory LivePositionSnapshot({
    $core.String? instrumentId,
    $core.String? side,
    $1.Quantity? quantity,
    $1.Price? avgPrice,
    $1.Price? currentPrice,
    $0.Decimal? marketValue,
    $0.Decimal? pnl,
  }) {
    final result = create();
    if (instrumentId != null) result.instrumentId = instrumentId;
    if (side != null) result.side = side;
    if (quantity != null) result.quantity = quantity;
    if (avgPrice != null) result.avgPrice = avgPrice;
    if (currentPrice != null) result.currentPrice = currentPrice;
    if (marketValue != null) result.marketValue = marketValue;
    if (pnl != null) result.pnl = pnl;
    return result;
  }

  LivePositionSnapshot._();

  factory LivePositionSnapshot.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LivePositionSnapshot.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LivePositionSnapshot',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'instrumentId')
    ..aOS(2, _omitFieldNames ? '' : 'side')
    ..aOM<$1.Quantity>(3, _omitFieldNames ? '' : 'quantity',
        subBuilder: $1.Quantity.create)
    ..aOM<$1.Price>(4, _omitFieldNames ? '' : 'avgPrice',
        subBuilder: $1.Price.create)
    ..aOM<$1.Price>(5, _omitFieldNames ? '' : 'currentPrice',
        subBuilder: $1.Price.create)
    ..aOM<$0.Decimal>(6, _omitFieldNames ? '' : 'marketValue',
        subBuilder: $0.Decimal.create)
    ..aOM<$0.Decimal>(7, _omitFieldNames ? '' : 'pnl',
        subBuilder: $0.Decimal.create)
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LivePositionSnapshot clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LivePositionSnapshot copyWith(void Function(LivePositionSnapshot) updates) =>
      super.copyWith((message) => updates(message as LivePositionSnapshot))
          as LivePositionSnapshot;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LivePositionSnapshot create() => LivePositionSnapshot._();
  @$core.override
  LivePositionSnapshot createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LivePositionSnapshot getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<LivePositionSnapshot>(create);
  static LivePositionSnapshot? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get instrumentId => $_getSZ(0);
  @$pb.TagNumber(1)
  set instrumentId($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasInstrumentId() => $_has(0);
  @$pb.TagNumber(1)
  void clearInstrumentId() => $_clearField(1);

  @$pb.TagNumber(2)
  $core.String get side => $_getSZ(1);
  @$pb.TagNumber(2)
  set side($core.String value) => $_setString(1, value);
  @$pb.TagNumber(2)
  $core.bool hasSide() => $_has(1);
  @$pb.TagNumber(2)
  void clearSide() => $_clearField(2);

  @$pb.TagNumber(3)
  $1.Quantity get quantity => $_getN(2);
  @$pb.TagNumber(3)
  set quantity($1.Quantity value) => $_setField(3, value);
  @$pb.TagNumber(3)
  $core.bool hasQuantity() => $_has(2);
  @$pb.TagNumber(3)
  void clearQuantity() => $_clearField(3);
  @$pb.TagNumber(3)
  $1.Quantity ensureQuantity() => $_ensure(2);

  @$pb.TagNumber(4)
  $1.Price get avgPrice => $_getN(3);
  @$pb.TagNumber(4)
  set avgPrice($1.Price value) => $_setField(4, value);
  @$pb.TagNumber(4)
  $core.bool hasAvgPrice() => $_has(3);
  @$pb.TagNumber(4)
  void clearAvgPrice() => $_clearField(4);
  @$pb.TagNumber(4)
  $1.Price ensureAvgPrice() => $_ensure(3);

  @$pb.TagNumber(5)
  $1.Price get currentPrice => $_getN(4);
  @$pb.TagNumber(5)
  set currentPrice($1.Price value) => $_setField(5, value);
  @$pb.TagNumber(5)
  $core.bool hasCurrentPrice() => $_has(4);
  @$pb.TagNumber(5)
  void clearCurrentPrice() => $_clearField(5);
  @$pb.TagNumber(5)
  $1.Price ensureCurrentPrice() => $_ensure(4);

  @$pb.TagNumber(6)
  $0.Decimal get marketValue => $_getN(5);
  @$pb.TagNumber(6)
  set marketValue($0.Decimal value) => $_setField(6, value);
  @$pb.TagNumber(6)
  $core.bool hasMarketValue() => $_has(5);
  @$pb.TagNumber(6)
  void clearMarketValue() => $_clearField(6);
  @$pb.TagNumber(6)
  $0.Decimal ensureMarketValue() => $_ensure(5);

  @$pb.TagNumber(7)
  $0.Decimal get pnl => $_getN(6);
  @$pb.TagNumber(7)
  set pnl($0.Decimal value) => $_setField(7, value);
  @$pb.TagNumber(7)
  $core.bool hasPnl() => $_has(6);
  @$pb.TagNumber(7)
  void clearPnl() => $_clearField(7);
  @$pb.TagNumber(7)
  $0.Decimal ensurePnl() => $_ensure(6);
}

/// LiveAuditEvent is a broker-neutral event record for audit trails.
class LiveAuditEvent extends $pb.GeneratedMessage {
  factory LiveAuditEvent({
    $core.String? type,
    $fixnum.Int64? timestampUnixMs,
    $core.String? broker,
    $core.String? accountId,
    $core.Iterable<$core.MapEntry<$core.String, $core.String>>? detail,
  }) {
    final result = create();
    if (type != null) result.type = type;
    if (timestampUnixMs != null) result.timestampUnixMs = timestampUnixMs;
    if (broker != null) result.broker = broker;
    if (accountId != null) result.accountId = accountId;
    if (detail != null) result.detail.addEntries(detail);
    return result;
  }

  LiveAuditEvent._();

  factory LiveAuditEvent.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory LiveAuditEvent.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'LiveAuditEvent',
      package: const $pb.PackageName(_omitMessageNames ? '' : 'alt.v1'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'type')
    ..aInt64(2, _omitFieldNames ? '' : 'timestampUnixMs')
    ..aOS(3, _omitFieldNames ? '' : 'broker')
    ..aOS(4, _omitFieldNames ? '' : 'accountId')
    ..m<$core.String, $core.String>(5, _omitFieldNames ? '' : 'detail',
        entryClassName: 'LiveAuditEvent.DetailEntry',
        keyFieldType: $pb.PbFieldType.OS,
        valueFieldType: $pb.PbFieldType.OS,
        packageName: const $pb.PackageName('alt.v1'))
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveAuditEvent clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  LiveAuditEvent copyWith(void Function(LiveAuditEvent) updates) =>
      super.copyWith((message) => updates(message as LiveAuditEvent))
          as LiveAuditEvent;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static LiveAuditEvent create() => LiveAuditEvent._();
  @$core.override
  LiveAuditEvent createEmptyInstance() => create();
  @$core.pragma('dart2js:noInline')
  static LiveAuditEvent getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<LiveAuditEvent>(create);
  static LiveAuditEvent? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get type => $_getSZ(0);
  @$pb.TagNumber(1)
  set type($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasType() => $_has(0);
  @$pb.TagNumber(1)
  void clearType() => $_clearField(1);

  @$pb.TagNumber(2)
  $fixnum.Int64 get timestampUnixMs => $_getI64(1);
  @$pb.TagNumber(2)
  set timestampUnixMs($fixnum.Int64 value) => $_setInt64(1, value);
  @$pb.TagNumber(2)
  $core.bool hasTimestampUnixMs() => $_has(1);
  @$pb.TagNumber(2)
  void clearTimestampUnixMs() => $_clearField(2);

  @$pb.TagNumber(3)
  $core.String get broker => $_getSZ(2);
  @$pb.TagNumber(3)
  set broker($core.String value) => $_setString(2, value);
  @$pb.TagNumber(3)
  $core.bool hasBroker() => $_has(2);
  @$pb.TagNumber(3)
  void clearBroker() => $_clearField(3);

  @$pb.TagNumber(4)
  $core.String get accountId => $_getSZ(3);
  @$pb.TagNumber(4)
  set accountId($core.String value) => $_setString(3, value);
  @$pb.TagNumber(4)
  $core.bool hasAccountId() => $_has(3);
  @$pb.TagNumber(4)
  void clearAccountId() => $_clearField(4);

  @$pb.TagNumber(5)
  $pb.PbMap<$core.String, $core.String> get detail => $_getMap(4);
}

const $core.bool _omitFieldNames =
    $core.bool.fromEnvironment('protobuf.omit_field_names');
const $core.bool _omitMessageNames =
    $core.bool.fromEnvironment('protobuf.omit_message_names');
