// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: OrderState.proto

#include "OrderState.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_OrderAllocation_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_OrderAllocation_OrderAllocation_2eproto;
namespace protobuf {
class OrderStateDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<OrderState> _instance;
} _OrderState_default_instance_;
}  // namespace protobuf
static void InitDefaultsscc_info_OrderState_OrderState_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::protobuf::_OrderState_default_instance_;
    new (ptr) ::protobuf::OrderState();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::protobuf::OrderState::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_OrderState_OrderState_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_OrderState_OrderState_2eproto}, {
      &scc_info_OrderAllocation_OrderAllocation_2eproto.base,}};

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_OrderState_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_OrderState_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_OrderState_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_OrderState_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, status_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginbefore_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginbefore_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanbefore_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginchange_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginchange_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanchange_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginafter_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginafter_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanafter_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, commissionandfees_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, mincommissionandfees_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maxcommissionandfees_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, commissionandfeescurrency_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, margincurrency_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginbeforeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginbeforeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanbeforeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginchangeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginchangeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanchangeoutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, initmarginafteroutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, maintmarginafteroutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, equitywithloanafteroutsiderth_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, suggestedsize_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, rejectreason_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, orderallocations_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, warningtext_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, completedtime_),
  PROTOBUF_FIELD_OFFSET(::protobuf::OrderState, completedstatus_),
  0,
  8,
  9,
  10,
  11,
  12,
  13,
  14,
  15,
  16,
  17,
  18,
  19,
  1,
  2,
  20,
  21,
  22,
  23,
  24,
  25,
  26,
  27,
  28,
  3,
  4,
  ~0u,
  5,
  6,
  7,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 35, sizeof(::protobuf::OrderState)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::protobuf::_OrderState_default_instance_),
};

const char descriptor_table_protodef_OrderState_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\020OrderState.proto\022\010protobuf\032\025OrderAlloc"
  "ation.proto\"\365\r\n\nOrderState\022\023\n\006status\030\001 \001"
  "(\tH\000\210\001\001\022\035\n\020initMarginBefore\030\002 \001(\001H\001\210\001\001\022\036"
  "\n\021maintMarginBefore\030\003 \001(\001H\002\210\001\001\022!\n\024equity"
  "WithLoanBefore\030\004 \001(\001H\003\210\001\001\022\035\n\020initMarginC"
  "hange\030\005 \001(\001H\004\210\001\001\022\036\n\021maintMarginChange\030\006 "
  "\001(\001H\005\210\001\001\022!\n\024equityWithLoanChange\030\007 \001(\001H\006"
  "\210\001\001\022\034\n\017initMarginAfter\030\010 \001(\001H\007\210\001\001\022\035\n\020mai"
  "ntMarginAfter\030\t \001(\001H\010\210\001\001\022 \n\023equityWithLo"
  "anAfter\030\n \001(\001H\t\210\001\001\022\036\n\021commissionAndFees\030"
  "\013 \001(\001H\n\210\001\001\022!\n\024minCommissionAndFees\030\014 \001(\001"
  "H\013\210\001\001\022!\n\024maxCommissionAndFees\030\r \001(\001H\014\210\001\001"
  "\022&\n\031commissionAndFeesCurrency\030\016 \001(\tH\r\210\001\001"
  "\022\033\n\016marginCurrency\030\017 \001(\tH\016\210\001\001\022\'\n\032initMar"
  "ginBeforeOutsideRTH\030\020 \001(\001H\017\210\001\001\022(\n\033maintM"
  "arginBeforeOutsideRTH\030\021 \001(\001H\020\210\001\001\022+\n\036equi"
  "tyWithLoanBeforeOutsideRTH\030\022 \001(\001H\021\210\001\001\022\'\n"
  "\032initMarginChangeOutsideRTH\030\023 \001(\001H\022\210\001\001\022("
  "\n\033maintMarginChangeOutsideRTH\030\024 \001(\001H\023\210\001\001"
  "\022+\n\036equityWithLoanChangeOutsideRTH\030\025 \001(\001"
  "H\024\210\001\001\022&\n\031initMarginAfterOutsideRTH\030\026 \001(\001"
  "H\025\210\001\001\022\'\n\032maintMarginAfterOutsideRTH\030\027 \001("
  "\001H\026\210\001\001\022*\n\035equityWithLoanAfterOutsideRTH\030"
  "\030 \001(\001H\027\210\001\001\022\032\n\rsuggestedSize\030\031 \001(\tH\030\210\001\001\022\031"
  "\n\014rejectReason\030\032 \001(\tH\031\210\001\001\0223\n\020orderAlloca"
  "tions\030\033 \003(\0132\031.protobuf.OrderAllocation\022\030"
  "\n\013warningText\030\034 \001(\tH\032\210\001\001\022\032\n\rcompletedTim"
  "e\030\035 \001(\tH\033\210\001\001\022\034\n\017completedStatus\030\036 \001(\tH\034\210"
  "\001\001B\t\n\007_statusB\023\n\021_initMarginBeforeB\024\n\022_m"
  "aintMarginBeforeB\027\n\025_equityWithLoanBefor"
  "eB\023\n\021_initMarginChangeB\024\n\022_maintMarginCh"
  "angeB\027\n\025_equityWithLoanChangeB\022\n\020_initMa"
  "rginAfterB\023\n\021_maintMarginAfterB\026\n\024_equit"
  "yWithLoanAfterB\024\n\022_commissionAndFeesB\027\n\025"
  "_minCommissionAndFeesB\027\n\025_maxCommissionA"
  "ndFeesB\034\n\032_commissionAndFeesCurrencyB\021\n\017"
  "_marginCurrencyB\035\n\033_initMarginBeforeOuts"
  "ideRTHB\036\n\034_maintMarginBeforeOutsideRTHB!"
  "\n\037_equityWithLoanBeforeOutsideRTHB\035\n\033_in"
  "itMarginChangeOutsideRTHB\036\n\034_maintMargin"
  "ChangeOutsideRTHB!\n\037_equityWithLoanChang"
  "eOutsideRTHB\034\n\032_initMarginAfterOutsideRT"
  "HB\035\n\033_maintMarginAfterOutsideRTHB \n\036_equ"
  "ityWithLoanAfterOutsideRTHB\020\n\016_suggested"
  "SizeB\017\n\r_rejectReasonB\016\n\014_warningTextB\020\n"
  "\016_completedTimeB\022\n\020_completedStatusB:\n\026c"
  "om.ib.client.protobufB\017OrderStateProto\252\002"
  "\016IBApi.protobufb\006proto3"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_OrderState_2eproto_deps[1] = {
  &::descriptor_table_OrderAllocation_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_OrderState_2eproto_sccs[1] = {
  &scc_info_OrderState_OrderState_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_OrderState_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_OrderState_2eproto = {
  false, false, descriptor_table_protodef_OrderState_2eproto, "OrderState.proto", 1903,
  &descriptor_table_OrderState_2eproto_once, descriptor_table_OrderState_2eproto_sccs, descriptor_table_OrderState_2eproto_deps, 1, 1,
  schemas, file_default_instances, TableStruct_OrderState_2eproto::offsets,
  file_level_metadata_OrderState_2eproto, 1, file_level_enum_descriptors_OrderState_2eproto, file_level_service_descriptors_OrderState_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_OrderState_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_OrderState_2eproto)), true);
namespace protobuf {

// ===================================================================

void OrderState::InitAsDefaultInstance() {
}
class OrderState::_Internal {
 public:
  using HasBits = decltype(std::declval<OrderState>()._has_bits_);
  static void set_has_status(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_initmarginbefore(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static void set_has_maintmarginbefore(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
  static void set_has_equitywithloanbefore(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static void set_has_initmarginchange(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_maintmarginchange(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static void set_has_equitywithloanchange(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static void set_has_initmarginafter(HasBits* has_bits) {
    (*has_bits)[0] |= 16384u;
  }
  static void set_has_maintmarginafter(HasBits* has_bits) {
    (*has_bits)[0] |= 32768u;
  }
  static void set_has_equitywithloanafter(HasBits* has_bits) {
    (*has_bits)[0] |= 65536u;
  }
  static void set_has_commissionandfees(HasBits* has_bits) {
    (*has_bits)[0] |= 131072u;
  }
  static void set_has_mincommissionandfees(HasBits* has_bits) {
    (*has_bits)[0] |= 262144u;
  }
  static void set_has_maxcommissionandfees(HasBits* has_bits) {
    (*has_bits)[0] |= 524288u;
  }
  static void set_has_commissionandfeescurrency(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_margincurrency(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_initmarginbeforeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 1048576u;
  }
  static void set_has_maintmarginbeforeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 2097152u;
  }
  static void set_has_equitywithloanbeforeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 4194304u;
  }
  static void set_has_initmarginchangeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 8388608u;
  }
  static void set_has_maintmarginchangeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 16777216u;
  }
  static void set_has_equitywithloanchangeoutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 33554432u;
  }
  static void set_has_initmarginafteroutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 67108864u;
  }
  static void set_has_maintmarginafteroutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 134217728u;
  }
  static void set_has_equitywithloanafteroutsiderth(HasBits* has_bits) {
    (*has_bits)[0] |= 268435456u;
  }
  static void set_has_suggestedsize(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_rejectreason(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_warningtext(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_completedtime(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_completedstatus(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
};

void OrderState::clear_orderallocations() {
  orderallocations_.Clear();
}
OrderState::OrderState(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena),
  orderallocations_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:protobuf.OrderState)
}
OrderState::OrderState(const OrderState& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      orderallocations_(from.orderallocations_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  status_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_status()) {
    status_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_status(),
      GetArena());
  }
  commissionandfeescurrency_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_commissionandfeescurrency()) {
    commissionandfeescurrency_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_commissionandfeescurrency(),
      GetArena());
  }
  margincurrency_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_margincurrency()) {
    margincurrency_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_margincurrency(),
      GetArena());
  }
  suggestedsize_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_suggestedsize()) {
    suggestedsize_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_suggestedsize(),
      GetArena());
  }
  rejectreason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_rejectreason()) {
    rejectreason_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_rejectreason(),
      GetArena());
  }
  warningtext_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_warningtext()) {
    warningtext_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_warningtext(),
      GetArena());
  }
  completedtime_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_completedtime()) {
    completedtime_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_completedtime(),
      GetArena());
  }
  completedstatus_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_completedstatus()) {
    completedstatus_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_completedstatus(),
      GetArena());
  }
  ::memcpy(&initmarginbefore_, &from.initmarginbefore_,
    static_cast<size_t>(reinterpret_cast<char*>(&equitywithloanafteroutsiderth_) -
    reinterpret_cast<char*>(&initmarginbefore_)) + sizeof(equitywithloanafteroutsiderth_));
  // @@protoc_insertion_point(copy_constructor:protobuf.OrderState)
}

void OrderState::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_OrderState_OrderState_2eproto.base);
  status_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  commissionandfeescurrency_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  margincurrency_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  suggestedsize_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  rejectreason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  warningtext_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  completedtime_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  completedstatus_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&initmarginbefore_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&equitywithloanafteroutsiderth_) -
      reinterpret_cast<char*>(&initmarginbefore_)) + sizeof(equitywithloanafteroutsiderth_));
}

OrderState::~OrderState() {
  // @@protoc_insertion_point(destructor:protobuf.OrderState)
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

void OrderState::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  status_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  commissionandfeescurrency_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  margincurrency_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  suggestedsize_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  rejectreason_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  warningtext_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  completedtime_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  completedstatus_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void OrderState::ArenaDtor(void* object) {
  OrderState* _this = reinterpret_cast< OrderState* >(object);
  (void)_this;
}
void OrderState::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void OrderState::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const OrderState& OrderState::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_OrderState_OrderState_2eproto.base);
  return *internal_default_instance();
}


void OrderState::Clear() {
// @@protoc_insertion_point(message_clear_start:protobuf.OrderState)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  orderallocations_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      status_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      commissionandfeescurrency_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      margincurrency_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000008u) {
      suggestedsize_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000010u) {
      rejectreason_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000020u) {
      warningtext_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000040u) {
      completedtime_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000080u) {
      completedstatus_.ClearNonDefaultToEmpty();
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    ::memset(&initmarginbefore_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&maintmarginafter_) -
        reinterpret_cast<char*>(&initmarginbefore_)) + sizeof(maintmarginafter_));
  }
  if (cached_has_bits & 0x00ff0000u) {
    ::memset(&equitywithloanafter_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&initmarginchangeoutsiderth_) -
        reinterpret_cast<char*>(&equitywithloanafter_)) + sizeof(initmarginchangeoutsiderth_));
  }
  if (cached_has_bits & 0x1f000000u) {
    ::memset(&maintmarginchangeoutsiderth_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&equitywithloanafteroutsiderth_) -
        reinterpret_cast<char*>(&maintmarginchangeoutsiderth_)) + sizeof(equitywithloanafteroutsiderth_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* OrderState::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // string status = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_status();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.status"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // double initMarginBefore = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) {
          _Internal::set_has_initmarginbefore(&has_bits);
          initmarginbefore_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginBefore = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25)) {
          _Internal::set_has_maintmarginbefore(&has_bits);
          maintmarginbefore_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanBefore = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 33)) {
          _Internal::set_has_equitywithloanbefore(&has_bits);
          equitywithloanbefore_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double initMarginChange = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 41)) {
          _Internal::set_has_initmarginchange(&has_bits);
          initmarginchange_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginChange = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) {
          _Internal::set_has_maintmarginchange(&has_bits);
          maintmarginchange_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanChange = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 57)) {
          _Internal::set_has_equitywithloanchange(&has_bits);
          equitywithloanchange_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double initMarginAfter = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 65)) {
          _Internal::set_has_initmarginafter(&has_bits);
          initmarginafter_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginAfter = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 73)) {
          _Internal::set_has_maintmarginafter(&has_bits);
          maintmarginafter_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanAfter = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 81)) {
          _Internal::set_has_equitywithloanafter(&has_bits);
          equitywithloanafter_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double commissionAndFees = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 89)) {
          _Internal::set_has_commissionandfees(&has_bits);
          commissionandfees_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double minCommissionAndFees = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 97)) {
          _Internal::set_has_mincommissionandfees(&has_bits);
          mincommissionandfees_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maxCommissionAndFees = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 105)) {
          _Internal::set_has_maxcommissionandfees(&has_bits);
          maxcommissionandfees_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // string commissionAndFeesCurrency = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
          auto str = _internal_mutable_commissionandfeescurrency();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.commissionAndFeesCurrency"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // string marginCurrency = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) {
          auto str = _internal_mutable_margincurrency();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.marginCurrency"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // double initMarginBeforeOutsideRTH = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 129)) {
          _Internal::set_has_initmarginbeforeoutsiderth(&has_bits);
          initmarginbeforeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginBeforeOutsideRTH = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 137)) {
          _Internal::set_has_maintmarginbeforeoutsiderth(&has_bits);
          maintmarginbeforeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanBeforeOutsideRTH = 18;
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 145)) {
          _Internal::set_has_equitywithloanbeforeoutsiderth(&has_bits);
          equitywithloanbeforeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double initMarginChangeOutsideRTH = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 153)) {
          _Internal::set_has_initmarginchangeoutsiderth(&has_bits);
          initmarginchangeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginChangeOutsideRTH = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 161)) {
          _Internal::set_has_maintmarginchangeoutsiderth(&has_bits);
          maintmarginchangeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanChangeOutsideRTH = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 169)) {
          _Internal::set_has_equitywithloanchangeoutsiderth(&has_bits);
          equitywithloanchangeoutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double initMarginAfterOutsideRTH = 22;
      case 22:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 177)) {
          _Internal::set_has_initmarginafteroutsiderth(&has_bits);
          initmarginafteroutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double maintMarginAfterOutsideRTH = 23;
      case 23:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 185)) {
          _Internal::set_has_maintmarginafteroutsiderth(&has_bits);
          maintmarginafteroutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // double equityWithLoanAfterOutsideRTH = 24;
      case 24:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 193)) {
          _Internal::set_has_equitywithloanafteroutsiderth(&has_bits);
          equitywithloanafteroutsiderth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else goto handle_unusual;
        continue;
      // string suggestedSize = 25;
      case 25:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 202)) {
          auto str = _internal_mutable_suggestedsize();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.suggestedSize"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // string rejectReason = 26;
      case 26:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 210)) {
          auto str = _internal_mutable_rejectreason();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.rejectReason"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .protobuf.OrderAllocation orderAllocations = 27;
      case 27:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 218)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(_internal_add_orderallocations(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<218>(ptr));
        } else goto handle_unusual;
        continue;
      // string warningText = 28;
      case 28:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 226)) {
          auto str = _internal_mutable_warningtext();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.warningText"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // string completedTime = 29;
      case 29:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 234)) {
          auto str = _internal_mutable_completedtime();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.completedTime"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // string completedStatus = 30;
      case 30:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 242)) {
          auto str = _internal_mutable_completedstatus();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.OrderState.completedStatus"));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* OrderState::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf.OrderState)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string status = 1;
  if (_internal_has_status()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_status().data(), static_cast<int>(this->_internal_status().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.status");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_status(), target);
  }

  // double initMarginBefore = 2;
  if (_internal_has_initmarginbefore()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_initmarginbefore(), target);
  }

  // double maintMarginBefore = 3;
  if (_internal_has_maintmarginbefore()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->_internal_maintmarginbefore(), target);
  }

  // double equityWithLoanBefore = 4;
  if (_internal_has_equitywithloanbefore()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(4, this->_internal_equitywithloanbefore(), target);
  }

  // double initMarginChange = 5;
  if (_internal_has_initmarginchange()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(5, this->_internal_initmarginchange(), target);
  }

  // double maintMarginChange = 6;
  if (_internal_has_maintmarginchange()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(6, this->_internal_maintmarginchange(), target);
  }

  // double equityWithLoanChange = 7;
  if (_internal_has_equitywithloanchange()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(7, this->_internal_equitywithloanchange(), target);
  }

  // double initMarginAfter = 8;
  if (_internal_has_initmarginafter()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(8, this->_internal_initmarginafter(), target);
  }

  // double maintMarginAfter = 9;
  if (_internal_has_maintmarginafter()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(9, this->_internal_maintmarginafter(), target);
  }

  // double equityWithLoanAfter = 10;
  if (_internal_has_equitywithloanafter()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(10, this->_internal_equitywithloanafter(), target);
  }

  // double commissionAndFees = 11;
  if (_internal_has_commissionandfees()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(11, this->_internal_commissionandfees(), target);
  }

  // double minCommissionAndFees = 12;
  if (_internal_has_mincommissionandfees()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(12, this->_internal_mincommissionandfees(), target);
  }

  // double maxCommissionAndFees = 13;
  if (_internal_has_maxcommissionandfees()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(13, this->_internal_maxcommissionandfees(), target);
  }

  // string commissionAndFeesCurrency = 14;
  if (_internal_has_commissionandfeescurrency()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_commissionandfeescurrency().data(), static_cast<int>(this->_internal_commissionandfeescurrency().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.commissionAndFeesCurrency");
    target = stream->WriteStringMaybeAliased(
        14, this->_internal_commissionandfeescurrency(), target);
  }

  // string marginCurrency = 15;
  if (_internal_has_margincurrency()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_margincurrency().data(), static_cast<int>(this->_internal_margincurrency().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.marginCurrency");
    target = stream->WriteStringMaybeAliased(
        15, this->_internal_margincurrency(), target);
  }

  // double initMarginBeforeOutsideRTH = 16;
  if (_internal_has_initmarginbeforeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(16, this->_internal_initmarginbeforeoutsiderth(), target);
  }

  // double maintMarginBeforeOutsideRTH = 17;
  if (_internal_has_maintmarginbeforeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(17, this->_internal_maintmarginbeforeoutsiderth(), target);
  }

  // double equityWithLoanBeforeOutsideRTH = 18;
  if (_internal_has_equitywithloanbeforeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(18, this->_internal_equitywithloanbeforeoutsiderth(), target);
  }

  // double initMarginChangeOutsideRTH = 19;
  if (_internal_has_initmarginchangeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(19, this->_internal_initmarginchangeoutsiderth(), target);
  }

  // double maintMarginChangeOutsideRTH = 20;
  if (_internal_has_maintmarginchangeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(20, this->_internal_maintmarginchangeoutsiderth(), target);
  }

  // double equityWithLoanChangeOutsideRTH = 21;
  if (_internal_has_equitywithloanchangeoutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(21, this->_internal_equitywithloanchangeoutsiderth(), target);
  }

  // double initMarginAfterOutsideRTH = 22;
  if (_internal_has_initmarginafteroutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(22, this->_internal_initmarginafteroutsiderth(), target);
  }

  // double maintMarginAfterOutsideRTH = 23;
  if (_internal_has_maintmarginafteroutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(23, this->_internal_maintmarginafteroutsiderth(), target);
  }

  // double equityWithLoanAfterOutsideRTH = 24;
  if (_internal_has_equitywithloanafteroutsiderth()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(24, this->_internal_equitywithloanafteroutsiderth(), target);
  }

  // string suggestedSize = 25;
  if (_internal_has_suggestedsize()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_suggestedsize().data(), static_cast<int>(this->_internal_suggestedsize().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.suggestedSize");
    target = stream->WriteStringMaybeAliased(
        25, this->_internal_suggestedsize(), target);
  }

  // string rejectReason = 26;
  if (_internal_has_rejectreason()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_rejectreason().data(), static_cast<int>(this->_internal_rejectreason().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.rejectReason");
    target = stream->WriteStringMaybeAliased(
        26, this->_internal_rejectreason(), target);
  }

  // repeated .protobuf.OrderAllocation orderAllocations = 27;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_orderallocations_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(27, this->_internal_orderallocations(i), target, stream);
  }

  // string warningText = 28;
  if (_internal_has_warningtext()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_warningtext().data(), static_cast<int>(this->_internal_warningtext().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.warningText");
    target = stream->WriteStringMaybeAliased(
        28, this->_internal_warningtext(), target);
  }

  // string completedTime = 29;
  if (_internal_has_completedtime()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_completedtime().data(), static_cast<int>(this->_internal_completedtime().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.completedTime");
    target = stream->WriteStringMaybeAliased(
        29, this->_internal_completedtime(), target);
  }

  // string completedStatus = 30;
  if (_internal_has_completedstatus()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_completedstatus().data(), static_cast<int>(this->_internal_completedstatus().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "protobuf.OrderState.completedStatus");
    target = stream->WriteStringMaybeAliased(
        30, this->_internal_completedstatus(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf.OrderState)
  return target;
}

size_t OrderState::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:protobuf.OrderState)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .protobuf.OrderAllocation orderAllocations = 27;
  total_size += 2UL * this->_internal_orderallocations_size();
  for (const auto& msg : this->orderallocations_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // string status = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_status());
    }

    // string commissionAndFeesCurrency = 14;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_commissionandfeescurrency());
    }

    // string marginCurrency = 15;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_margincurrency());
    }

    // string suggestedSize = 25;
    if (cached_has_bits & 0x00000008u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_suggestedsize());
    }

    // string rejectReason = 26;
    if (cached_has_bits & 0x00000010u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_rejectreason());
    }

    // string warningText = 28;
    if (cached_has_bits & 0x00000020u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_warningtext());
    }

    // string completedTime = 29;
    if (cached_has_bits & 0x00000040u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_completedtime());
    }

    // string completedStatus = 30;
    if (cached_has_bits & 0x00000080u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_completedstatus());
    }

  }
  if (cached_has_bits & 0x0000ff00u) {
    // double initMarginBefore = 2;
    if (cached_has_bits & 0x00000100u) {
      total_size += 1 + 8;
    }

    // double maintMarginBefore = 3;
    if (cached_has_bits & 0x00000200u) {
      total_size += 1 + 8;
    }

    // double equityWithLoanBefore = 4;
    if (cached_has_bits & 0x00000400u) {
      total_size += 1 + 8;
    }

    // double initMarginChange = 5;
    if (cached_has_bits & 0x00000800u) {
      total_size += 1 + 8;
    }

    // double maintMarginChange = 6;
    if (cached_has_bits & 0x00001000u) {
      total_size += 1 + 8;
    }

    // double equityWithLoanChange = 7;
    if (cached_has_bits & 0x00002000u) {
      total_size += 1 + 8;
    }

    // double initMarginAfter = 8;
    if (cached_has_bits & 0x00004000u) {
      total_size += 1 + 8;
    }

    // double maintMarginAfter = 9;
    if (cached_has_bits & 0x00008000u) {
      total_size += 1 + 8;
    }

  }
  if (cached_has_bits & 0x00ff0000u) {
    // double equityWithLoanAfter = 10;
    if (cached_has_bits & 0x00010000u) {
      total_size += 1 + 8;
    }

    // double commissionAndFees = 11;
    if (cached_has_bits & 0x00020000u) {
      total_size += 1 + 8;
    }

    // double minCommissionAndFees = 12;
    if (cached_has_bits & 0x00040000u) {
      total_size += 1 + 8;
    }

    // double maxCommissionAndFees = 13;
    if (cached_has_bits & 0x00080000u) {
      total_size += 1 + 8;
    }

    // double initMarginBeforeOutsideRTH = 16;
    if (cached_has_bits & 0x00100000u) {
      total_size += 2 + 8;
    }

    // double maintMarginBeforeOutsideRTH = 17;
    if (cached_has_bits & 0x00200000u) {
      total_size += 2 + 8;
    }

    // double equityWithLoanBeforeOutsideRTH = 18;
    if (cached_has_bits & 0x00400000u) {
      total_size += 2 + 8;
    }

    // double initMarginChangeOutsideRTH = 19;
    if (cached_has_bits & 0x00800000u) {
      total_size += 2 + 8;
    }

  }
  if (cached_has_bits & 0x1f000000u) {
    // double maintMarginChangeOutsideRTH = 20;
    if (cached_has_bits & 0x01000000u) {
      total_size += 2 + 8;
    }

    // double equityWithLoanChangeOutsideRTH = 21;
    if (cached_has_bits & 0x02000000u) {
      total_size += 2 + 8;
    }

    // double initMarginAfterOutsideRTH = 22;
    if (cached_has_bits & 0x04000000u) {
      total_size += 2 + 8;
    }

    // double maintMarginAfterOutsideRTH = 23;
    if (cached_has_bits & 0x08000000u) {
      total_size += 2 + 8;
    }

    // double equityWithLoanAfterOutsideRTH = 24;
    if (cached_has_bits & 0x10000000u) {
      total_size += 2 + 8;
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OrderState::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:protobuf.OrderState)
  GOOGLE_DCHECK_NE(&from, this);
  const OrderState* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<OrderState>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf.OrderState)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf.OrderState)
    MergeFrom(*source);
  }
}

void OrderState::MergeFrom(const OrderState& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:protobuf.OrderState)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  orderallocations_.MergeFrom(from.orderallocations_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_status(from._internal_status());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_commissionandfeescurrency(from._internal_commissionandfeescurrency());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_set_margincurrency(from._internal_margincurrency());
    }
    if (cached_has_bits & 0x00000008u) {
      _internal_set_suggestedsize(from._internal_suggestedsize());
    }
    if (cached_has_bits & 0x00000010u) {
      _internal_set_rejectreason(from._internal_rejectreason());
    }
    if (cached_has_bits & 0x00000020u) {
      _internal_set_warningtext(from._internal_warningtext());
    }
    if (cached_has_bits & 0x00000040u) {
      _internal_set_completedtime(from._internal_completedtime());
    }
    if (cached_has_bits & 0x00000080u) {
      _internal_set_completedstatus(from._internal_completedstatus());
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    if (cached_has_bits & 0x00000100u) {
      initmarginbefore_ = from.initmarginbefore_;
    }
    if (cached_has_bits & 0x00000200u) {
      maintmarginbefore_ = from.maintmarginbefore_;
    }
    if (cached_has_bits & 0x00000400u) {
      equitywithloanbefore_ = from.equitywithloanbefore_;
    }
    if (cached_has_bits & 0x00000800u) {
      initmarginchange_ = from.initmarginchange_;
    }
    if (cached_has_bits & 0x00001000u) {
      maintmarginchange_ = from.maintmarginchange_;
    }
    if (cached_has_bits & 0x00002000u) {
      equitywithloanchange_ = from.equitywithloanchange_;
    }
    if (cached_has_bits & 0x00004000u) {
      initmarginafter_ = from.initmarginafter_;
    }
    if (cached_has_bits & 0x00008000u) {
      maintmarginafter_ = from.maintmarginafter_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00ff0000u) {
    if (cached_has_bits & 0x00010000u) {
      equitywithloanafter_ = from.equitywithloanafter_;
    }
    if (cached_has_bits & 0x00020000u) {
      commissionandfees_ = from.commissionandfees_;
    }
    if (cached_has_bits & 0x00040000u) {
      mincommissionandfees_ = from.mincommissionandfees_;
    }
    if (cached_has_bits & 0x00080000u) {
      maxcommissionandfees_ = from.maxcommissionandfees_;
    }
    if (cached_has_bits & 0x00100000u) {
      initmarginbeforeoutsiderth_ = from.initmarginbeforeoutsiderth_;
    }
    if (cached_has_bits & 0x00200000u) {
      maintmarginbeforeoutsiderth_ = from.maintmarginbeforeoutsiderth_;
    }
    if (cached_has_bits & 0x00400000u) {
      equitywithloanbeforeoutsiderth_ = from.equitywithloanbeforeoutsiderth_;
    }
    if (cached_has_bits & 0x00800000u) {
      initmarginchangeoutsiderth_ = from.initmarginchangeoutsiderth_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x1f000000u) {
    if (cached_has_bits & 0x01000000u) {
      maintmarginchangeoutsiderth_ = from.maintmarginchangeoutsiderth_;
    }
    if (cached_has_bits & 0x02000000u) {
      equitywithloanchangeoutsiderth_ = from.equitywithloanchangeoutsiderth_;
    }
    if (cached_has_bits & 0x04000000u) {
      initmarginafteroutsiderth_ = from.initmarginafteroutsiderth_;
    }
    if (cached_has_bits & 0x08000000u) {
      maintmarginafteroutsiderth_ = from.maintmarginafteroutsiderth_;
    }
    if (cached_has_bits & 0x10000000u) {
      equitywithloanafteroutsiderth_ = from.equitywithloanafteroutsiderth_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void OrderState::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:protobuf.OrderState)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void OrderState::CopyFrom(const OrderState& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:protobuf.OrderState)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool OrderState::IsInitialized() const {
  return true;
}

void OrderState::InternalSwap(OrderState* other) {
  using std::swap;
  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  orderallocations_.InternalSwap(&other->orderallocations_);
  status_.Swap(&other->status_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  commissionandfeescurrency_.Swap(&other->commissionandfeescurrency_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  margincurrency_.Swap(&other->margincurrency_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  suggestedsize_.Swap(&other->suggestedsize_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  rejectreason_.Swap(&other->rejectreason_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  warningtext_.Swap(&other->warningtext_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  completedtime_.Swap(&other->completedtime_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  completedstatus_.Swap(&other->completedstatus_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(OrderState, equitywithloanafteroutsiderth_)
      + sizeof(OrderState::equitywithloanafteroutsiderth_)
      - PROTOBUF_FIELD_OFFSET(OrderState, initmarginbefore_)>(
          reinterpret_cast<char*>(&initmarginbefore_),
          reinterpret_cast<char*>(&other->initmarginbefore_));
}

::PROTOBUF_NAMESPACE_ID::Metadata OrderState::GetMetadata() const {
  return GetMetadataStatic();
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace protobuf
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::protobuf::OrderState* Arena::CreateMaybeMessage< ::protobuf::OrderState >(Arena* arena) {
  return Arena::CreateMessageInternal< ::protobuf::OrderState >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
