// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: client/v3beta/dto/user/commands/command.proto

#include "client/v3beta/dto/user/commands/command.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/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)


PROTOBUF_PRAGMA_INIT_SEG
namespace heroim {
namespace client {
namespace v3beta {
namespace dto {
namespace user {
namespace commands {
constexpr MessageCleanCommand::MessageCleanCommand(
  ::herogoogle::protobuf::internal::ConstantInitialized)
  : productid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , uid_(&::herogoogle::protobuf::internal::fixed_address_empty_string)
  , userkey_(nullptr){}
struct MessageCleanCommandDefaultTypeInternal {
  constexpr MessageCleanCommandDefaultTypeInternal()
    : _instance(::herogoogle::protobuf::internal::ConstantInitialized{}) {}
  ~MessageCleanCommandDefaultTypeInternal() {}
  union {
    MessageCleanCommand _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MessageCleanCommandDefaultTypeInternal _MessageCleanCommand_default_instance_;
}  // namespace commands
}  // namespace user
}  // namespace dto
}  // namespace v3beta
}  // namespace client
}  // namespace heroim
namespace heroim {
namespace client {
namespace v3beta {
namespace dto {
namespace user {
namespace commands {

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

class MessageCleanCommand::_Internal {
 public:
  static const ::heroim::client::v3beta::dto::user::model::UserKey& userkey(const MessageCleanCommand* msg);
};

const ::heroim::client::v3beta::dto::user::model::UserKey&
MessageCleanCommand::_Internal::userkey(const MessageCleanCommand* msg) {
  return *msg->userkey_;
}
void MessageCleanCommand::clear_userkey() {
  if (GetArenaForAllocation() == nullptr && userkey_ != nullptr) {
    delete userkey_;
  }
  userkey_ = nullptr;
}
MessageCleanCommand::MessageCleanCommand(::herogoogle::protobuf::Arena* arena,
                         bool is_message_owned)
  : ::herogoogle::protobuf::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
}
MessageCleanCommand::MessageCleanCommand(const MessageCleanCommand& from)
  : ::herogoogle::protobuf::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  productid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_productid().empty()) {
    productid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_productid(), 
      GetArenaForAllocation());
  }
  uid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_uid().empty()) {
    uid_.Set(::herogoogle::protobuf::internal::ArenaStringPtr::EmptyDefault{}, from._internal_uid(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_userkey()) {
    userkey_ = new ::heroim::client::v3beta::dto::user::model::UserKey(*from.userkey_);
  } else {
    userkey_ = nullptr;
  }
  // @@protoc_insertion_point(copy_constructor:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
}

void MessageCleanCommand::SharedCtor() {
productid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
uid_.UnsafeSetDefault(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
userkey_ = nullptr;
}

MessageCleanCommand::~MessageCleanCommand() {
  // @@protoc_insertion_point(destructor:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void MessageCleanCommand::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  productid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  uid_.DestroyNoArena(&::herogoogle::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete userkey_;
}

void MessageCleanCommand::ArenaDtor(void* object) {
  MessageCleanCommand* _this = reinterpret_cast< MessageCleanCommand* >(object);
  (void)_this;
}
void MessageCleanCommand::RegisterArenaDtor(::herogoogle::protobuf::Arena*) {
}
void MessageCleanCommand::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

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

  productid_.ClearToEmpty();
  uid_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && userkey_ != nullptr) {
    delete userkey_;
  }
  userkey_ = nullptr;
  _internal_metadata_.Clear<std::string>();
}

const char* MessageCleanCommand::_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, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string uid = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 18)) {
          auto str = _internal_mutable_uid();
          ptr = ::herogoogle::protobuf::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::herogoogle::protobuf::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .heroim.client.v3beta.dto.user.model.UserKey userKey = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::herogoogle::protobuf::uint8>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_userkey(), 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<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::herogoogle::protobuf::uint8* MessageCleanCommand::_InternalSerialize(
    ::herogoogle::protobuf::uint8* target, ::herogoogle::protobuf::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
  ::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.user.commands.MessageCleanCommand.productId");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_productid(), target);
  }

  // string uid = 2;
  if (!this->_internal_uid().empty()) {
    ::herogoogle::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_uid().data(), static_cast<int>(this->_internal_uid().length()),
      ::herogoogle::protobuf::internal::WireFormatLite::SERIALIZE,
      "heroim.client.v3beta.dto.user.commands.MessageCleanCommand.uid");
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_uid(), target);
  }

  // .heroim.client.v3beta.dto.user.model.UserKey userKey = 3;
  if (this->_internal_has_userkey()) {
    target = stream->EnsureSpace(target);
    target = ::herogoogle::protobuf::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::userkey(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::herogoogle::protobuf::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::herogoogle::protobuf::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
  return target;
}

size_t MessageCleanCommand::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:heroim.client.v3beta.dto.user.commands.MessageCleanCommand)
  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;

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

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

  // .heroim.client.v3beta.dto.user.model.UserKey userKey = 3;
  if (this->_internal_has_userkey()) {
    total_size += 1 +
      ::herogoogle::protobuf::internal::WireFormatLite::MessageSize(
        *userkey_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::herogoogle::protobuf::internal::GetEmptyString).size();
  }
  int cached_size = ::herogoogle::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void MessageCleanCommand::CheckTypeAndMergeFrom(
    const ::herogoogle::protobuf::MessageLite& from) {
  MergeFrom(*::herogoogle::protobuf::internal::DownCast<const MessageCleanCommand*>(
      &from));
}

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

  if (!from._internal_productid().empty()) {
    _internal_set_productid(from._internal_productid());
  }
  if (!from._internal_uid().empty()) {
    _internal_set_uid(from._internal_uid());
  }
  if (from._internal_has_userkey()) {
    _internal_mutable_userkey()->::heroim::client::v3beta::dto::user::model::UserKey::MergeFrom(from._internal_userkey());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void MessageCleanCommand::InternalSwap(MessageCleanCommand* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::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(),
      &uid_, lhs_arena,
      &other->uid_, rhs_arena
  );
  swap(userkey_, other->userkey_);
}

std::string MessageCleanCommand::GetTypeName() const {
  return "heroim.client.v3beta.dto.user.commands.MessageCleanCommand";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace commands
}  // namespace user
}  // namespace dto
}  // namespace v3beta
}  // namespace client
}  // namespace heroim
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::heroim::client::v3beta::dto::user::commands::MessageCleanCommand* Arena::CreateMaybeMessage< ::heroim::client::v3beta::dto::user::commands::MessageCleanCommand >(Arena* arena) {
  return Arena::CreateMessageInternal< ::heroim::client::v3beta::dto::user::commands::MessageCleanCommand >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)

