// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: keyapis/subscription/v1/keyapis_subscription_events_v1.proto

#include "keyapis/subscription/v1/keyapis_subscription_events_v1.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/io/zero_copy_stream_impl_lite.h"
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
namespace keyapis {
namespace subscription {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR CommercialOfferCmsAvailableTask::CommercialOfferCmsAvailableTask(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.privileged_room_numbers_)*/{}
  , /*decltype(_impl_.request_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.orpon_id_)*/ ::int64_t{0}

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct CommercialOfferCmsAvailableTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CommercialOfferCmsAvailableTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CommercialOfferCmsAvailableTaskDefaultTypeInternal() {}
  union {
    CommercialOfferCmsAvailableTask _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommercialOfferCmsAvailableTaskDefaultTypeInternal _CommercialOfferCmsAvailableTask_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CommercialOfferCmsUnavailableTask::CommercialOfferCmsUnavailableTask(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.request_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.orpon_id_)*/ ::int64_t{0}

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct CommercialOfferCmsUnavailableTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CommercialOfferCmsUnavailableTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CommercialOfferCmsUnavailableTaskDefaultTypeInternal() {}
  union {
    CommercialOfferCmsUnavailableTask _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommercialOfferCmsUnavailableTaskDefaultTypeInternal _CommercialOfferCmsUnavailableTask_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PrivilegeStateChangeTask::PrivilegeStateChangeTask(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.request_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.room_number_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_.updated_at_)*/nullptr
  , /*decltype(_impl_.orpon_id_)*/ ::int64_t{0}

  , /*decltype(_impl_.privilege_type_)*/ 0

  , /*decltype(_impl_.state_type_)*/ 0

  , /*decltype(_impl_.previous_state_type_)*/ 0
} {}
struct PrivilegeStateChangeTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PrivilegeStateChangeTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PrivilegeStateChangeTaskDefaultTypeInternal() {}
  union {
    PrivilegeStateChangeTask _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PrivilegeStateChangeTaskDefaultTypeInternal _PrivilegeStateChangeTask_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR CmsInitTask::CmsInitTask(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.orpons_)*/ {}
  ,/* _impl_._orpons_cached_byte_size_ = */ { 0 }

  , /*decltype(_impl_.request_id_)*/ {
    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  }

  , /*decltype(_impl_._cached_size_)*/{}} {}
struct CmsInitTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CmsInitTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~CmsInitTaskDefaultTypeInternal() {}
  union {
    CmsInitTask _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CmsInitTaskDefaultTypeInternal _CmsInitTask_default_instance_;
}  // namespace v1
}  // namespace subscription
}  // namespace keyapis
namespace keyapis {
namespace subscription {
namespace v1 {
// ===================================================================

class CommercialOfferCmsAvailableTask::_Internal {
 public:
};

CommercialOfferCmsAvailableTask::CommercialOfferCmsAvailableTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
}
CommercialOfferCmsAvailableTask::CommercialOfferCmsAvailableTask(const CommercialOfferCmsAvailableTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CommercialOfferCmsAvailableTask* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.privileged_room_numbers_){from._impl_.privileged_room_numbers_}
    , decltype(_impl_.request_id_) {}

    , decltype(_impl_.orpon_id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_request_id().empty()) {
    _this->_impl_.request_id_.Set(from._internal_request_id(), _this->GetArenaForAllocation());
  }
  _this->_impl_.orpon_id_ = from._impl_.orpon_id_;
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
}

inline void CommercialOfferCmsAvailableTask::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.privileged_room_numbers_){arena}
    , decltype(_impl_.request_id_) {}

    , decltype(_impl_.orpon_id_) { ::int64_t{0} }

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

CommercialOfferCmsAvailableTask::~CommercialOfferCmsAvailableTask() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void CommercialOfferCmsAvailableTask::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _internal_mutable_privileged_room_numbers()->~RepeatedPtrField();
  _impl_.request_id_.Destroy();
}

void CommercialOfferCmsAvailableTask::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void CommercialOfferCmsAvailableTask::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_mutable_privileged_room_numbers()->Clear();
  _impl_.request_id_.ClearToEmpty();
  _impl_.orpon_id_ = ::int64_t{0};
  _internal_metadata_.Clear<std::string>();
}

const char* CommercialOfferCmsAvailableTask::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_request_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          _impl_.orpon_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated string privileged_room_numbers = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_privileged_room_numbers();
            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            CHK_(::_pbi::VerifyUTF8(str, nullptr));
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(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_
}

::uint8_t* CommercialOfferCmsAvailableTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    const std::string& _s = this->_internal_request_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.CommercialOfferCmsAvailableTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(
        2, this->_internal_orpon_id(), target);
  }

  // repeated string privileged_room_numbers = 3;
  for (int i = 0, n = this->_internal_privileged_room_numbers_size(); i < n; ++i) {
    const auto& s = this->_internal_privileged_room_numbers(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        s.data(), static_cast<int>(s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.CommercialOfferCmsAvailableTask.privileged_room_numbers");
    target = stream->WriteString(3, s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  return target;
}

::size_t CommercialOfferCmsAvailableTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  ::size_t total_size = 0;

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

  // repeated string privileged_room_numbers = 3;
  total_size += 1 * ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_internal_privileged_room_numbers().size());
  for (int i = 0, n = _internal_privileged_room_numbers().size(); i < n; ++i) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        _internal_privileged_room_numbers().Get(i));
  }

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_request_id());
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
        this->_internal_orpon_id());
  }

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

void CommercialOfferCmsAvailableTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CommercialOfferCmsAvailableTask*>(
      &from));
}

void CommercialOfferCmsAvailableTask::MergeFrom(const CommercialOfferCmsAvailableTask& from) {
  CommercialOfferCmsAvailableTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_mutable_privileged_room_numbers()->MergeFrom(from._internal_privileged_room_numbers());
  if (!from._internal_request_id().empty()) {
    _this->_internal_set_request_id(from._internal_request_id());
  }
  if (from._internal_orpon_id() != 0) {
    _this->_internal_set_orpon_id(from._internal_orpon_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CommercialOfferCmsAvailableTask::CopyFrom(const CommercialOfferCmsAvailableTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.CommercialOfferCmsAvailableTask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CommercialOfferCmsAvailableTask::InternalSwap(CommercialOfferCmsAvailableTask* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _internal_mutable_privileged_room_numbers()->InternalSwap(
      other->_internal_mutable_privileged_room_numbers());
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, lhs_arena,
                                       &other->_impl_.request_id_, rhs_arena);

  swap(_impl_.orpon_id_, other->_impl_.orpon_id_);
}

std::string CommercialOfferCmsAvailableTask::GetTypeName() const {
  return "keyapis.subscription.v1.CommercialOfferCmsAvailableTask";
}

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

class CommercialOfferCmsUnavailableTask::_Internal {
 public:
};

CommercialOfferCmsUnavailableTask::CommercialOfferCmsUnavailableTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
}
CommercialOfferCmsUnavailableTask::CommercialOfferCmsUnavailableTask(const CommercialOfferCmsUnavailableTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CommercialOfferCmsUnavailableTask* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.request_id_) {}

    , decltype(_impl_.orpon_id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_request_id().empty()) {
    _this->_impl_.request_id_.Set(from._internal_request_id(), _this->GetArenaForAllocation());
  }
  _this->_impl_.orpon_id_ = from._impl_.orpon_id_;
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
}

inline void CommercialOfferCmsUnavailableTask::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.request_id_) {}

    , decltype(_impl_.orpon_id_) { ::int64_t{0} }

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

CommercialOfferCmsUnavailableTask::~CommercialOfferCmsUnavailableTask() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void CommercialOfferCmsUnavailableTask::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.request_id_.Destroy();
}

void CommercialOfferCmsUnavailableTask::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void CommercialOfferCmsUnavailableTask::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.request_id_.ClearToEmpty();
  _impl_.orpon_id_ = ::int64_t{0};
  _internal_metadata_.Clear<std::string>();
}

const char* CommercialOfferCmsUnavailableTask::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_request_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          _impl_.orpon_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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_
}

::uint8_t* CommercialOfferCmsUnavailableTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    const std::string& _s = this->_internal_request_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.CommercialOfferCmsUnavailableTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(
        2, this->_internal_orpon_id(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  return target;
}

::size_t CommercialOfferCmsUnavailableTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  ::size_t total_size = 0;

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

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_request_id());
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
        this->_internal_orpon_id());
  }

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

void CommercialOfferCmsUnavailableTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CommercialOfferCmsUnavailableTask*>(
      &from));
}

void CommercialOfferCmsUnavailableTask::MergeFrom(const CommercialOfferCmsUnavailableTask& from) {
  CommercialOfferCmsUnavailableTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_request_id().empty()) {
    _this->_internal_set_request_id(from._internal_request_id());
  }
  if (from._internal_orpon_id() != 0) {
    _this->_internal_set_orpon_id(from._internal_orpon_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CommercialOfferCmsUnavailableTask::CopyFrom(const CommercialOfferCmsUnavailableTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.CommercialOfferCmsUnavailableTask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CommercialOfferCmsUnavailableTask::InternalSwap(CommercialOfferCmsUnavailableTask* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, lhs_arena,
                                       &other->_impl_.request_id_, rhs_arena);

  swap(_impl_.orpon_id_, other->_impl_.orpon_id_);
}

std::string CommercialOfferCmsUnavailableTask::GetTypeName() const {
  return "keyapis.subscription.v1.CommercialOfferCmsUnavailableTask";
}

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

class PrivilegeStateChangeTask::_Internal {
 public:
  using HasBits = decltype(std::declval<PrivilegeStateChangeTask>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(PrivilegeStateChangeTask, _impl_._has_bits_);
  static const ::PROTOBUF_NAMESPACE_ID::Timestamp& updated_at(const PrivilegeStateChangeTask* msg);
  static void set_has_updated_at(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::PROTOBUF_NAMESPACE_ID::Timestamp&
PrivilegeStateChangeTask::_Internal::updated_at(const PrivilegeStateChangeTask* msg) {
  return *msg->_impl_.updated_at_;
}
void PrivilegeStateChangeTask::clear_updated_at() {
  if (_impl_.updated_at_ != nullptr) _impl_.updated_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
PrivilegeStateChangeTask::PrivilegeStateChangeTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.PrivilegeStateChangeTask)
}
PrivilegeStateChangeTask::PrivilegeStateChangeTask(const PrivilegeStateChangeTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PrivilegeStateChangeTask* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.request_id_) {}

    , decltype(_impl_.room_number_) {}

    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.orpon_id_) {}

    , decltype(_impl_.privilege_type_) {}

    , decltype(_impl_.state_type_) {}

    , decltype(_impl_.previous_state_type_) {}
  };

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_request_id().empty()) {
    _this->_impl_.request_id_.Set(from._internal_request_id(), _this->GetArenaForAllocation());
  }
  _impl_.room_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.room_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_room_number().empty()) {
    _this->_impl_.room_number_.Set(from._internal_room_number(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.updated_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.updated_at_);
  }
  ::memcpy(&_impl_.orpon_id_, &from._impl_.orpon_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.previous_state_type_) -
    reinterpret_cast<char*>(&_impl_.orpon_id_)) + sizeof(_impl_.previous_state_type_));
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.PrivilegeStateChangeTask)
}

inline void PrivilegeStateChangeTask::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.request_id_) {}

    , decltype(_impl_.room_number_) {}

    , decltype(_impl_.updated_at_){nullptr}
    , decltype(_impl_.orpon_id_) { ::int64_t{0} }

    , decltype(_impl_.privilege_type_) { 0 }

    , decltype(_impl_.state_type_) { 0 }

    , decltype(_impl_.previous_state_type_) { 0 }

  };
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.room_number_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.room_number_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

PrivilegeStateChangeTask::~PrivilegeStateChangeTask() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.PrivilegeStateChangeTask)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PrivilegeStateChangeTask::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.request_id_.Destroy();
  _impl_.room_number_.Destroy();
  if (this != internal_default_instance()) delete _impl_.updated_at_;
}

void PrivilegeStateChangeTask::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void PrivilegeStateChangeTask::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.PrivilegeStateChangeTask)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.request_id_.ClearToEmpty();
  _impl_.room_number_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.updated_at_ != nullptr);
    _impl_.updated_at_->Clear();
  }
  ::memset(&_impl_.orpon_id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.previous_state_type_) -
      reinterpret_cast<char*>(&_impl_.orpon_id_)) + sizeof(_impl_.previous_state_type_));
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PrivilegeStateChangeTask::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_request_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          _impl_.orpon_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string room_number = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_room_number();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_privilege_type(static_cast<::keyapis::subscription::v1::Privilege_Type>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_state_type(static_cast<::keyapis::subscription::v1::Privilege_StateType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_previous_state_type(static_cast<::keyapis::subscription::v1::Privilege_StateType>(val));
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp updated_at = 7 [(.google.api.field_behavior) = REQUIRED];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          ptr = ctx->ParseMessage(_internal_mutable_updated_at(), 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:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

::uint8_t* PrivilegeStateChangeTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.PrivilegeStateChangeTask)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    const std::string& _s = this->_internal_request_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.PrivilegeStateChangeTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(
        2, this->_internal_orpon_id(), target);
  }

  // string room_number = 3 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_room_number().empty()) {
    const std::string& _s = this->_internal_room_number();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.PrivilegeStateChangeTask.room_number");
    target = stream->WriteStringMaybeAliased(3, _s, target);
  }

  // .keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_privilege_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        4, this->_internal_privilege_type(), target);
  }

  // .keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_state_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        5, this->_internal_state_type(), target);
  }

  // .keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;
  if (this->_internal_previous_state_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        6, this->_internal_previous_state_type(), target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.Timestamp updated_at = 7 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(7, _Internal::updated_at(this),
        _Internal::updated_at(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.PrivilegeStateChangeTask)
  return target;
}

::size_t PrivilegeStateChangeTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.PrivilegeStateChangeTask)
  ::size_t total_size = 0;

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

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_request_id());
  }

  // string room_number = 3 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_room_number().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_room_number());
  }

  // .google.protobuf.Timestamp updated_at = 7 [(.google.api.field_behavior) = REQUIRED];
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.updated_at_);
  }

  // int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_orpon_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
        this->_internal_orpon_id());
  }

  // .keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_privilege_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_privilege_type());
  }

  // .keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_state_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_state_type());
  }

  // .keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;
  if (this->_internal_previous_state_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_previous_state_type());
  }

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

void PrivilegeStateChangeTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PrivilegeStateChangeTask*>(
      &from));
}

void PrivilegeStateChangeTask::MergeFrom(const PrivilegeStateChangeTask& from) {
  PrivilegeStateChangeTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.PrivilegeStateChangeTask)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_request_id().empty()) {
    _this->_internal_set_request_id(from._internal_request_id());
  }
  if (!from._internal_room_number().empty()) {
    _this->_internal_set_room_number(from._internal_room_number());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_updated_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
        from._internal_updated_at());
  }
  if (from._internal_orpon_id() != 0) {
    _this->_internal_set_orpon_id(from._internal_orpon_id());
  }
  if (from._internal_privilege_type() != 0) {
    _this->_internal_set_privilege_type(from._internal_privilege_type());
  }
  if (from._internal_state_type() != 0) {
    _this->_internal_set_state_type(from._internal_state_type());
  }
  if (from._internal_previous_state_type() != 0) {
    _this->_internal_set_previous_state_type(from._internal_previous_state_type());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PrivilegeStateChangeTask::CopyFrom(const PrivilegeStateChangeTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.PrivilegeStateChangeTask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void PrivilegeStateChangeTask::InternalSwap(PrivilegeStateChangeTask* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, lhs_arena,
                                       &other->_impl_.request_id_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.room_number_, lhs_arena,
                                       &other->_impl_.room_number_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PrivilegeStateChangeTask, _impl_.previous_state_type_)
      + sizeof(PrivilegeStateChangeTask::_impl_.previous_state_type_)
      - PROTOBUF_FIELD_OFFSET(PrivilegeStateChangeTask, _impl_.updated_at_)>(
          reinterpret_cast<char*>(&_impl_.updated_at_),
          reinterpret_cast<char*>(&other->_impl_.updated_at_));
}

std::string PrivilegeStateChangeTask::GetTypeName() const {
  return "keyapis.subscription.v1.PrivilegeStateChangeTask";
}

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

class CmsInitTask::_Internal {
 public:
};

CmsInitTask::CmsInitTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.subscription.v1.CmsInitTask)
}
CmsInitTask::CmsInitTask(const CmsInitTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  CmsInitTask* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.orpons_) { from._impl_.orpons_ }
    ,/* _impl_._orpons_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.request_id_) {}

    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_request_id().empty()) {
    _this->_impl_.request_id_.Set(from._internal_request_id(), _this->GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.subscription.v1.CmsInitTask)
}

inline void CmsInitTask::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.orpons_) { arena }
    ,/* _impl_._orpons_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.request_id_) {}

    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

CmsInitTask::~CmsInitTask() {
  // @@protoc_insertion_point(destructor:keyapis.subscription.v1.CmsInitTask)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void CmsInitTask::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.orpons_.~RepeatedField();
  _impl_.request_id_.Destroy();
}

void CmsInitTask::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void CmsInitTask::Clear() {
// @@protoc_insertion_point(message_clear_start:keyapis.subscription.v1.CmsInitTask)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _internal_mutable_orpons()->Clear();
  _impl_.request_id_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* CmsInitTask::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_request_id();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated int64 orpons = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_orpons(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 16) {
          _internal_add_orpons(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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_
}

::uint8_t* CmsInitTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.subscription.v1.CmsInitTask)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    const std::string& _s = this->_internal_request_id();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.subscription.v1.CmsInitTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // repeated int64 orpons = 2 [(.google.api.field_behavior) = REQUIRED];
  {
    int byte_size = _impl_._orpons_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt64Packed(2, _internal_orpons(),
                                                 byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:keyapis.subscription.v1.CmsInitTask)
  return target;
}

::size_t CmsInitTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.subscription.v1.CmsInitTask)
  ::size_t total_size = 0;

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

  // repeated int64 orpons = 2 [(.google.api.field_behavior) = REQUIRED];
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int64Size(
        this->_internal_orpons())
    ;
    _impl_._orpons_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 1 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

  // string request_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_request_id().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_request_id());
  }

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

void CmsInitTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const CmsInitTask*>(
      &from));
}

void CmsInitTask::MergeFrom(const CmsInitTask& from) {
  CmsInitTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.subscription.v1.CmsInitTask)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.orpons_.MergeFrom(from._impl_.orpons_);
  if (!from._internal_request_id().empty()) {
    _this->_internal_set_request_id(from._internal_request_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CmsInitTask::CopyFrom(const CmsInitTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.subscription.v1.CmsInitTask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CmsInitTask::InternalSwap(CmsInitTask* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.orpons_.InternalSwap(&other->_impl_.orpons_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.request_id_, lhs_arena,
                                       &other->_impl_.request_id_, rhs_arena);
}

std::string CmsInitTask::GetTypeName() const {
  return "keyapis.subscription.v1.CmsInitTask";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace subscription
}  // namespace keyapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::CommercialOfferCmsAvailableTask*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::CommercialOfferCmsAvailableTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::CommercialOfferCmsAvailableTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::CommercialOfferCmsUnavailableTask*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::CommercialOfferCmsUnavailableTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::CommercialOfferCmsUnavailableTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::PrivilegeStateChangeTask*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::PrivilegeStateChangeTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::PrivilegeStateChangeTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::subscription::v1::CmsInitTask*
Arena::CreateMaybeMessage< ::keyapis::subscription::v1::CmsInitTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::subscription::v1::CmsInitTask >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
