// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: client/v3beta/dto/message/event/message_event.proto

#include "client/v3beta/dto/message/event/message_event.pb.h"

#include <algorithm>

#include <herogoogle/protobuf/io/coded_stream.h>
#include <herogoogle/protobuf/extension_set.h>
#include <herogoogle/protobuf/wire_format_lite.h>
#include <herogoogle/protobuf/descriptor.h>
#include <herogoogle/protobuf/generated_message_reflection.h>
#include <herogoogle/protobuf/reflection_ops.h>
#include <herogoogle/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)


PROTOBUF_PRAGMA_INIT_SEG
namespace heroim {
namespace client {
namespace v3beta {
namespace dto {
namespace message {
namespace event {
constexpr MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse(
  ::herogoogle::protobuf::internal::ConstantInitialized){}
struct MessageStatusChangedEvent_SdkExtraEntry_DoNotUseDefaultTypeInternal {
  constexpr MessageStatusChangedEvent_SdkExtraEntry_DoNotUseDefaultTypeInternal()
    : _instance(::herogoogle::protobuf::internal::ConstantInitialized{}) {}
  ~MessageStatusChangedEvent_SdkExtraEntry_DoNotUseDefaultTypeInternal() {}
  union {
    MessageStatusChangedEvent_SdkExtraEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MessageStatusChangedEvent_SdkExtraEntry_DoNotUseDefaultTypeInternal _MessageStatusChangedEvent_SdkExtraEntry_DoNotUse_default_instance_;
constexpr MessageStatusChangedEvent::MessageStatusChangedEvent(
  ::herogoogle::protobuf::internal::ConstantInitialized)
  : sdkextra_(::herogoogle::protobuf::internal::ConstantInitialized{})
  , productid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , msgid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , clientmsgid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , sessionid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , sessionkey_(nullptr)
  , status_(0){}
struct MessageStatusChangedEventDefaultTypeInternal {
  constexpr MessageStatusChangedEventDefaultTypeInternal()
    : _instance(::herogoogle::protobuf::internal::ConstantInitialized{}) {}
  ~MessageStatusChangedEventDefaultTypeInternal() {}
  union {
    MessageStatusChangedEvent _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MessageStatusChangedEventDefaultTypeInternal _MessageStatusChangedEvent_default_instance_;
}  // namespace event
}  // namespace message
}  // namespace dto
}  // namespace v3beta
}  // namespace client
}  // namespace heroim
static ::herogoogle::protobuf::Metadata file_level_metadata_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto[2];
static constexpr ::herogoogle::protobuf::EnumDescriptor const** file_level_enum_descriptors_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto = nullptr;
static constexpr ::herogoogle::protobuf::ServiceDescriptor const** file_level_service_descriptors_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto = nullptr;

const ::herogoogle::protobuf::uint32 TableStruct_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, productid_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, msgid_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, clientmsgid_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, status_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, sessionid_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, sdkextra_),
  PROTOBUF_FIELD_OFFSET(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent, sessionkey_),
};
static const ::herogoogle::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse)},
  { 10, -1, -1, sizeof(::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent)},
};

static ::herogoogle::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::herogoogle::protobuf::Message*>(&::heroim::client::v3beta::dto::message::event::_MessageStatusChangedEvent_SdkExtraEntry_DoNotUse_default_instance_),
  reinterpret_cast<const ::herogoogle::protobuf::Message*>(&::heroim::client::v3beta::dto::message::event::_MessageStatusChangedEvent_default_instance_),
};
#ifdef _MSC_VER
#  pragma warning(disable : 4125)
#endif  /* _MSC_VER */
const char descriptor_table_protodef_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n3client/v3beta/dto/message/event/messag"
  "e_event.proto\022&heroim.client.v3beta.dto."
  "message.event\0323client/v3beta/dto/message"
  "/model/message_model.proto\"\321\002\n\031MessageSt"
  "atusChangedEvent\022\021\n\tproductId\030\001 \001(\t\022\r\n\005m"
  "sgId\030\002 \001(\t\022\023\n\013clientMsgId\030\003 \001(\t\022\016\n\006statu"
  "s\030\004 \001(\005\022\021\n\tsessionId\030\005 \001(\t\022a\n\010sdkExtra\030\006"
  " \003(\0132O.heroim.client.v3beta.dto.message."
  "event.MessageStatusChangedEvent.SdkExtra"
  "Entry\022F\n\nsessionKey\030\007 \001(\01322.heroim.clien"
  "t.v3beta.dto.message.model.SessionKey\032/\n"
  "\rSdkExtraEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001"
  "(\t:\0028\001B\235\001\n*com.hero.csdk.api.v3beta.dto."
  "message.eventP\001Z*heroim/api/client/v3bet"
  "a/dto/message/event\242\002\005IMSdk\252\0028Im.CSDK.Un"
  "ity.chat.entry.Runtime.entry2.v3.message"
  ".Eventb\006proto3"
  ;
static const ::herogoogle::protobuf::internal::DescriptorTable*const descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_deps[1] = {
  &::descriptor_table_client_2fv3beta_2fdto_2fmessage_2fmodel_2fmessage_5fmodel_2eproto,
};
static ::herogoogle::protobuf::internal::once_flag descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_once;
const ::herogoogle::protobuf::internal::DescriptorTable descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto = {
  false, false, 654, descriptor_table_protodef_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto, "client/v3beta/dto/message/event/message_event.proto", 
  &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_once, descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_deps, 1, 2,
  schemas, file_default_instances, TableStruct_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto::offsets,
  file_level_metadata_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto, file_level_enum_descriptors_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto, file_level_service_descriptors_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::herogoogle::protobuf::internal::DescriptorTable* descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_getter() {
  return &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::herogoogle::protobuf::internal::AddDescriptorsRunner dynamic_init_dummy_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto(&descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto);
namespace heroim {
namespace client {
namespace v3beta {
namespace dto {
namespace message {
namespace event {

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

MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse() {}
MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse(::herogoogle::protobuf::Arena* arena)
    : SuperType(arena) {}
void MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::MergeFrom(const MessageStatusChangedEvent_SdkExtraEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::herogoogle::protobuf::Metadata MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::GetMetadata() const {
  return ::herogoogle::protobuf::internal::AssignDescriptors(
      &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_getter, &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_once,
      file_level_metadata_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto[0]);
}

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

class MessageStatusChangedEvent::_Internal {
 public:
  static const ::heroim::client::v3beta::dto::message::model::SessionKey& sessionkey(const MessageStatusChangedEvent* msg);
};

const ::heroim::client::v3beta::dto::message::model::SessionKey&
MessageStatusChangedEvent::_Internal::sessionkey(const MessageStatusChangedEvent* msg) {
  return *msg->sessionkey_;
}
void MessageStatusChangedEvent::clear_sessionkey() {
  if (GetArenaForAllocation() == nullptr && sessionkey_ != nullptr) {
    delete sessionkey_;
  }
  sessionkey_ = nullptr;
}
MessageStatusChangedEvent::MessageStatusChangedEvent(::herogoogle::protobuf::Arena* arena,
                         bool is_message_owned)
  : ::herogoogle::protobuf::Message(arena, is_message_owned),
  sdkextra_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
}
MessageStatusChangedEvent::MessageStatusChangedEvent(const MessageStatusChangedEvent& from)
  : ::herogoogle::protobuf::Message() {
  _internal_metadata_.MergeFrom<::herogoogle::protobuf::UnknownFieldSet>(from._internal_metadata_);
  sdkextra_.MergeFrom(from.sdkextra_);
  productid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_productid().empty()) {
    productid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_productid(), 
      GetArenaForAllocation());
  }
  msgid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_msgid().empty()) {
    msgid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_msgid(), 
      GetArenaForAllocation());
  }
  clientmsgid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_clientmsgid().empty()) {
    clientmsgid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_clientmsgid(), 
      GetArenaForAllocation());
  }
  sessionid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_sessionid().empty()) {
    sessionid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_sessionid(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_sessionkey()) {
    sessionkey_ = new ::heroim::client::v3beta::dto::message::model::SessionKey(*from.sessionkey_);
  } else {
    sessionkey_ = nullptr;
  }
  status_ = from.status_;
  // @@protoc_insertion_point(copy_constructor:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
}

void MessageStatusChangedEvent::SharedCtor() {
productid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
msgid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
clientmsgid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
sessionid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&sessionkey_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&status_) -
    reinterpret_cast<char*>(&sessionkey_)) + sizeof(status_));
}

MessageStatusChangedEvent::~MessageStatusChangedEvent() {
  // @@protoc_insertion_point(destructor:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::herogoogle::protobuf::UnknownFieldSet>();
}

inline void MessageStatusChangedEvent::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  productid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  msgid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  clientmsgid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  sessionid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete sessionkey_;
}

void MessageStatusChangedEvent::ArenaDtor(void* object) {
  MessageStatusChangedEvent* _this = reinterpret_cast< MessageStatusChangedEvent* >(object);
  (void)_this;
  _this->sdkextra_. ~MapField();
}
inline void MessageStatusChangedEvent::RegisterArenaDtor(::herogoogle::protobuf::Arena* arena) {
  if (arena != nullptr) {
    arena->OwnCustomDestructor(this, &MessageStatusChangedEvent::ArenaDtor);
  }
}
void MessageStatusChangedEvent::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void MessageStatusChangedEvent::Clear() {
// @@protoc_insertion_point(message_clear_start:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  ::herogoogle::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  sdkextra_.Clear();
  productid_.ClearToEmpty();
  msgid_.ClearToEmpty();
  clientmsgid_.ClearToEmpty();
  sessionid_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && sessionkey_ != nullptr) {
    delete sessionkey_;
  }
  sessionkey_ = nullptr;
  status_ = 0;
  _internal_metadata_.Clear<::herogoogle::protobuf::UnknownFieldSet>();
}

const char* MessageStatusChangedEvent::_InternalParse(const char* ptr, ::herogoogle::protobuf::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::herogoogle::protobuf::uint32 tag;
    ptr = ::herogoogle::protobuf::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string productId = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 10)) {
          auto str = _internal_mutable_productid();
          ptr = ::herogoogle::protobuf::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::herogoogle::protobuf::internal::VerifyUTF8(str, "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.productId"));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string msgId = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 18)) {
          auto str = _internal_mutable_msgid();
          ptr = ::herogoogle::protobuf::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::herogoogle::protobuf::internal::VerifyUTF8(str, "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.msgId"));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string clientMsgId = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 26)) {
          auto str = _internal_mutable_clientmsgid();
          ptr = ::herogoogle::protobuf::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::herogoogle::protobuf::internal::VerifyUTF8(str, "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.clientMsgId"));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int32 status = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 32)) {
          status_ = ::herogoogle::protobuf::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string sessionId = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 42)) {
          auto str = _internal_mutable_sessionid();
          ptr = ::herogoogle::protobuf::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::herogoogle::protobuf::internal::VerifyUTF8(str, "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.sessionId"));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // map<string, string> sdkExtra = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 50)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&sdkextra_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::herogoogle::protobuf::internal::ExpectTag<50>(ptr));
        } else
          goto handle_unusual;
        continue;
      // .heroim.client.v3beta.dto.message.model.SessionKey sessionKey = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 58)) {
          ptr = ctx->ParseMessage(_internal_mutable_sessionkey(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::herogoogle::protobuf::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::herogoogle::protobuf::uint8* MessageStatusChangedEvent::_InternalSerialize(
    ::herogoogle::protobuf::uint8* target, ::herogoogle::protobuf::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  ::herogoogle::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string productId = 1;
  if (!this->_internal_productid().empty()) {
    ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_productid().data(), static_cast<int>(this->_internal_productid().length()),
      ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
      "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.productId");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_productid(), target);
  }

  // string msgId = 2;
  if (!this->_internal_msgid().empty()) {
    ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_msgid().data(), static_cast<int>(this->_internal_msgid().length()),
      ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
      "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.msgId");
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_msgid(), target);
  }

  // string clientMsgId = 3;
  if (!this->_internal_clientmsgid().empty()) {
    ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_clientmsgid().data(), static_cast<int>(this->_internal_clientmsgid().length()),
      ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
      "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.clientMsgId");
    target = stream->WriteStringMaybeAliased(
        3, this->_internal_clientmsgid(), target);
  }

  // int32 status = 4;
  if (this->_internal_status() != 0) {
    target = stream->EnsureSpace(target);
    target = ::herogoogle::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_status(), target);
  }

  // string sessionId = 5;
  if (!this->_internal_sessionid().empty()) {
    ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_sessionid().data(), static_cast<int>(this->_internal_sessionid().length()),
      ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
      "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.sessionId");
    target = stream->WriteStringMaybeAliased(
        5, this->_internal_sessionid(), target);
  }

  // map<string, string> sdkExtra = 6;
  if (!this->_internal_sdkextra().empty()) {
    typedef ::herogoogle::protobuf::Map< std::string, std::string >::const_pointer
        ConstPtr;
    typedef ConstPtr SortItem;
    typedef ::herogoogle::protobuf::internal::CompareByDerefFirst<SortItem> Less;
    struct Utf8Check {
      static void Check(ConstPtr p) {
        (void)p;
        ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
          p->first.data(), static_cast<int>(p->first.length()),
          ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
          "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.SdkExtraEntry.key");
        ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
          p->second.data(), static_cast<int>(p->second.length()),
          ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
          "heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent.SdkExtraEntry.value");
      }
    };

    if (stream->IsSerializationDeterministic() &&
        this->_internal_sdkextra().size() > 1) {
      ::std::unique_ptr<SortItem[]> items(
          new SortItem[this->_internal_sdkextra().size()]);
      typedef ::herogoogle::protobuf::Map< std::string, std::string >::size_type size_type;
      size_type n = 0;
      for (::herogoogle::protobuf::Map< std::string, std::string >::const_iterator
          it = this->_internal_sdkextra().begin();
          it != this->_internal_sdkextra().end(); ++it, ++n) {
        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
      }
      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
      for (size_type i = 0; i < n; i++) {
        target = MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::Funcs::InternalSerialize(6, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
      }
    } else {
      for (::herogoogle::protobuf::Map< std::string, std::string >::const_iterator
          it = this->_internal_sdkextra().begin();
          it != this->_internal_sdkextra().end(); ++it) {
        target = MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::Funcs::InternalSerialize(6, it->first, it->second, target, stream);
        Utf8Check::Check(&(*it));
      }
    }
  }

  // .heroim.client.v3beta.dto.message.model.SessionKey sessionKey = 7;
  if (this->_internal_has_sessionkey()) {
    target = stream->EnsureSpace(target);
    target = ::herogoogle::protobuf::internal::WireFormatLite::
      InternalWriteMessage(
        7, _Internal::sessionkey(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::herogoogle::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::herogoogle::protobuf::UnknownFieldSet>(::herogoogle::protobuf::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  return target;
}

size_t MessageStatusChangedEvent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  size_t total_size = 0;

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

  // map<string, string> sdkExtra = 6;
  total_size += 1 *
      ::herogoogle::protobuf::internal::FromIntSize(this->_internal_sdkextra_size());
  for (::herogoogle::protobuf::Map< std::string, std::string >::const_iterator
      it = this->_internal_sdkextra().begin();
      it != this->_internal_sdkextra().end(); ++it) {
    total_size += MessageStatusChangedEvent_SdkExtraEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // string productId = 1;
  if (!this->_internal_productid().empty()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::StringSize(
        this->_internal_productid());
  }

  // string msgId = 2;
  if (!this->_internal_msgid().empty()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::StringSize(
        this->_internal_msgid());
  }

  // string clientMsgId = 3;
  if (!this->_internal_clientmsgid().empty()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::StringSize(
        this->_internal_clientmsgid());
  }

  // string sessionId = 5;
  if (!this->_internal_sessionid().empty()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::StringSize(
        this->_internal_sessionid());
  }

  // .heroim.client.v3beta.dto.message.model.SessionKey sessionKey = 7;
  if (this->_internal_has_sessionkey()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::MessageSize(
        *sessionkey_);
  }

  // int32 status = 4;
  if (this->_internal_status() != 0) {
    total_size += ::herogoogle::protobuf::internal::WireFormatLite::Int32SizePlusOne(this->_internal_status());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::herogoogle::protobuf::Message::ClassData MessageStatusChangedEvent::_class_data_ = {
    ::herogoogle::protobuf::Message::CopyWithSizeCheck,
    MessageStatusChangedEvent::MergeImpl
};
const ::herogoogle::protobuf::Message::ClassData*MessageStatusChangedEvent::GetClassData() const { return &_class_data_; }

void MessageStatusChangedEvent::MergeImpl(::herogoogle::protobuf::Message* to,
                      const ::herogoogle::protobuf::Message& from) {
  static_cast<MessageStatusChangedEvent *>(to)->MergeFrom(
      static_cast<const MessageStatusChangedEvent &>(from));
}


void MessageStatusChangedEvent::MergeFrom(const MessageStatusChangedEvent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  GOOGLE_DCHECK_NE(&from, this);
  ::herogoogle::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  sdkextra_.MergeFrom(from.sdkextra_);
  if (!from._internal_productid().empty()) {
    _internal_set_productid(from._internal_productid());
  }
  if (!from._internal_msgid().empty()) {
    _internal_set_msgid(from._internal_msgid());
  }
  if (!from._internal_clientmsgid().empty()) {
    _internal_set_clientmsgid(from._internal_clientmsgid());
  }
  if (!from._internal_sessionid().empty()) {
    _internal_set_sessionid(from._internal_sessionid());
  }
  if (from._internal_has_sessionkey()) {
    _internal_mutable_sessionkey()->::heroim::client::v3beta::dto::message::model::SessionKey::MergeFrom(from._internal_sessionkey());
  }
  if (from._internal_status() != 0) {
    _internal_set_status(from._internal_status());
  }
  _internal_metadata_.MergeFrom<::herogoogle::protobuf::UnknownFieldSet>(from._internal_metadata_);
}

void MessageStatusChangedEvent::CopyFrom(const MessageStatusChangedEvent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:heroim.client.v3beta.dto.message.event.MessageStatusChangedEvent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void MessageStatusChangedEvent::InternalSwap(MessageStatusChangedEvent* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  sdkextra_.InternalSwap(&other->sdkextra_);
  ::herogoogle::protobuf::internal::ArenaStringPtr::InternalSwap(
      &::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited(),
      &productid_, lhs_arena,
      &other->productid_, rhs_arena
  );
  ::herogoogle::protobuf::internal::ArenaStringPtr::InternalSwap(
      &::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited(),
      &msgid_, lhs_arena,
      &other->msgid_, rhs_arena
  );
  ::herogoogle::protobuf::internal::ArenaStringPtr::InternalSwap(
      &::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited(),
      &clientmsgid_, lhs_arena,
      &other->clientmsgid_, rhs_arena
  );
  ::herogoogle::protobuf::internal::ArenaStringPtr::InternalSwap(
      &::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited(),
      &sessionid_, lhs_arena,
      &other->sessionid_, rhs_arena
  );
  ::herogoogle::protobuf::internal::memswap<
      PROTOBUF_FIELD_OFFSET(MessageStatusChangedEvent, status_)
      + sizeof(MessageStatusChangedEvent::status_)
      - PROTOBUF_FIELD_OFFSET(MessageStatusChangedEvent, sessionkey_)>(
          reinterpret_cast<char*>(&sessionkey_),
          reinterpret_cast<char*>(&other->sessionkey_));
}

::herogoogle::protobuf::Metadata MessageStatusChangedEvent::GetMetadata() const {
  return ::herogoogle::protobuf::internal::AssignDescriptors(
      &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_getter, &descriptor_table_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto_once,
      file_level_metadata_client_2fv3beta_2fdto_2fmessage_2fevent_2fmessage_5fevent_2eproto[1]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace event
}  // namespace message
}  // namespace dto
}  // namespace v3beta
}  // namespace client
}  // namespace heroim
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse* Arena::CreateMaybeMessage< ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent_SdkExtraEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent* Arena::CreateMaybeMessage< ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent >(Arena* arena) {
  return Arena::CreateMessageInternal< ::heroim::client::v3beta::dto::message::event::MessageStatusChangedEvent >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)

