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

#include "keyapis/preset/v1/keyapis_preset_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 preset {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR PostEventPresetInstallRequest::PostEventPresetInstallRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.id_)*/ 0

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostEventPresetInstallRequestDefaultTypeInternal _PostEventPresetInstallRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostEventPresetInstallResponse::PostEventPresetInstallResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct PostEventPresetInstallResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostEventPresetInstallResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostEventPresetInstallResponseDefaultTypeInternal() {}
  union {
    PostEventPresetInstallResponse _instance;
  };
};

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

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

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

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

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

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

  , /*decltype(_impl_.preset_)*/nullptr
  , /*decltype(_impl_.device_id_)*/ 0
} {}
struct PresetConfigurationTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PresetConfigurationTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PresetConfigurationTaskDefaultTypeInternal() {}
  union {
    PresetConfigurationTask _instance;
  };
};

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

  , /*decltype(_impl_.configured_at_)*/nullptr
  , /*decltype(_impl_.device_id_)*/ 0

  , /*decltype(_impl_.preset_id_)*/ 0
} {}
struct PresetConfigurationSuccessTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PresetConfigurationSuccessTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PresetConfigurationSuccessTaskDefaultTypeInternal() {}
  union {
    PresetConfigurationSuccessTask _instance;
  };
};

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

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

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

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

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

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

  , /*decltype(_impl_.preset_)*/nullptr} {}
struct PresetInstallTaskDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PresetInstallTaskDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PresetInstallTaskDefaultTypeInternal() {}
  union {
    PresetInstallTask _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PresetInstallTaskDefaultTypeInternal _PresetInstallTask_default_instance_;
}  // namespace v1
}  // namespace preset
}  // namespace keyapis
namespace keyapis {
namespace preset {
namespace v1 {
// ===================================================================

class PostEventPresetInstallRequest::_Internal {
 public:
};

PostEventPresetInstallRequest::PostEventPresetInstallRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.preset.v1.PostEventPresetInstallRequest)
}
PostEventPresetInstallRequest::PostEventPresetInstallRequest(const PostEventPresetInstallRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PostEventPresetInstallRequest)
}

inline void PostEventPresetInstallRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.id_) { 0 }

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

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

inline void PostEventPresetInstallRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

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

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

  _impl_.id_ = 0;
  _internal_metadata_.Clear<std::string>();
}

const char* PostEventPresetInstallRequest::_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) {
      // int32 id = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
          _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* PostEventPresetInstallRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PostEventPresetInstallRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_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.preset.v1.PostEventPresetInstallRequest)
  return target;
}

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

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

  // int32 id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_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 PostEventPresetInstallRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostEventPresetInstallRequest*>(
      &from));
}

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

  if (from._internal_id() != 0) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostEventPresetInstallRequest::InternalSwap(PostEventPresetInstallRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);

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

std::string PostEventPresetInstallRequest::GetTypeName() const {
  return "keyapis.preset.v1.PostEventPresetInstallRequest";
}

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

class PostEventPresetInstallResponse::_Internal {
 public:
};

PostEventPresetInstallResponse::PostEventPresetInstallResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.preset.v1.PostEventPresetInstallResponse)
}
PostEventPresetInstallResponse::PostEventPresetInstallResponse(const PostEventPresetInstallResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _impl_(from._impl_) {
  _internal_metadata_.MergeFrom<std::string>(
      from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PostEventPresetInstallResponse)
}

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

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

inline void PostEventPresetInstallResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
}

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

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

  _internal_metadata_.Clear<std::string>();
}

const char* PostEventPresetInstallResponse::_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);
    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* PostEventPresetInstallResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PostEventPresetInstallResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  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.preset.v1.PostEventPresetInstallResponse)
  return target;
}

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

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

  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 PostEventPresetInstallResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostEventPresetInstallResponse*>(
      &from));
}

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

  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostEventPresetInstallResponse::InternalSwap(PostEventPresetInstallResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
}

std::string PostEventPresetInstallResponse::GetTypeName() const {
  return "keyapis.preset.v1.PostEventPresetInstallResponse";
}

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

class PresetConfigurationTask::_Internal {
 public:
  using HasBits = decltype(std::declval<PresetConfigurationTask>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(PresetConfigurationTask, _impl_._has_bits_);
  static const ::keyapis::preset::v1::Preset& preset(const PresetConfigurationTask* msg);
  static void set_has_preset(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::keyapis::preset::v1::Preset&
PresetConfigurationTask::_Internal::preset(const PresetConfigurationTask* msg) {
  return *msg->_impl_.preset_;
}
void PresetConfigurationTask::clear_preset() {
  if (_impl_.preset_ != nullptr) _impl_.preset_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
PresetConfigurationTask::PresetConfigurationTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.preset.v1.PresetConfigurationTask)
}
PresetConfigurationTask::PresetConfigurationTask(const PresetConfigurationTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PresetConfigurationTask* 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_.model_) {}

    , decltype(_impl_.host_) {}

    , decltype(_impl_.username_) {}

    , decltype(_impl_.password_) {}

    , decltype(_impl_.ntp_timezone_) {}

    , decltype(_impl_.preset_){nullptr}
    , decltype(_impl_.device_id_) {}
  };

  _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_.model_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.model_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_model().empty()) {
    _this->_impl_.model_.Set(from._internal_model(), _this->GetArenaForAllocation());
  }
  _impl_.host_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.host_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_host().empty()) {
    _this->_impl_.host_.Set(from._internal_host(), _this->GetArenaForAllocation());
  }
  _impl_.username_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.username_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_username().empty()) {
    _this->_impl_.username_.Set(from._internal_username(), _this->GetArenaForAllocation());
  }
  _impl_.password_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.password_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_password().empty()) {
    _this->_impl_.password_.Set(from._internal_password(), _this->GetArenaForAllocation());
  }
  _impl_.ntp_timezone_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.ntp_timezone_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_ntp_timezone().empty()) {
    _this->_impl_.ntp_timezone_.Set(from._internal_ntp_timezone(), _this->GetArenaForAllocation());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.preset_ = new ::keyapis::preset::v1::Preset(*from._impl_.preset_);
  }
  _this->_impl_.device_id_ = from._impl_.device_id_;
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PresetConfigurationTask)
}

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

    , decltype(_impl_.model_) {}

    , decltype(_impl_.host_) {}

    , decltype(_impl_.username_) {}

    , decltype(_impl_.password_) {}

    , decltype(_impl_.ntp_timezone_) {}

    , decltype(_impl_.preset_){nullptr}
    , decltype(_impl_.device_id_) { 0 }

  };
  _impl_.request_id_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.request_id_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.model_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.model_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.host_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.host_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.username_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.username_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.password_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.password_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.ntp_timezone_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.ntp_timezone_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void PresetConfigurationTask::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.request_id_.Destroy();
  _impl_.model_.Destroy();
  _impl_.host_.Destroy();
  _impl_.username_.Destroy();
  _impl_.password_.Destroy();
  _impl_.ntp_timezone_.Destroy();
  if (this != internal_default_instance()) delete _impl_.preset_;
}

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

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

  _impl_.request_id_.ClearToEmpty();
  _impl_.model_.ClearToEmpty();
  _impl_.host_.ClearToEmpty();
  _impl_.username_.ClearToEmpty();
  _impl_.password_.ClearToEmpty();
  _impl_.ntp_timezone_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.preset_ != nullptr);
    _impl_.preset_->Clear();
  }
  _impl_.device_id_ = 0;
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PresetConfigurationTask::_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;
      // .keyapis.preset.v1.Preset preset = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_preset(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 device_id = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string model = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_model();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string host = 5 [(.google.api.field_behavior) = REQUIRED];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_host();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string username = 6 [(.google.api.field_behavior) = REQUIRED];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_username();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string password = 7 [(.google.api.field_behavior) = REQUIRED];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_password();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } else {
          goto handle_unusual;
        }
        continue;
      // string ntp_timezone = 8 [(.google.api.field_behavior) = REQUIRED];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
          auto str = _internal_mutable_ntp_timezone();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } 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* PresetConfigurationTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PresetConfigurationTask)
  ::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.preset.v1.PresetConfigurationTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.preset.v1.Preset preset = 2 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::preset(this),
        _Internal::preset(this).GetCachedSize(), target, stream);
  }

  // int32 device_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        3, this->_internal_device_id(), target);
  }

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

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

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

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

  // string ntp_timezone = 8 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_ntp_timezone().empty()) {
    const std::string& _s = this->_internal_ntp_timezone();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.preset.v1.PresetConfigurationTask.ntp_timezone");
    target = stream->WriteStringMaybeAliased(8, _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.preset.v1.PresetConfigurationTask)
  return target;
}

::size_t PresetConfigurationTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.preset.v1.PresetConfigurationTask)
  ::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 model = 4 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_model().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_model());
  }

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

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

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

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

  // .keyapis.preset.v1.Preset preset = 2 [(.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_.preset_);
  }

  // int32 device_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_device_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 PresetConfigurationTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PresetConfigurationTask*>(
      &from));
}

void PresetConfigurationTask::MergeFrom(const PresetConfigurationTask& from) {
  PresetConfigurationTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.preset.v1.PresetConfigurationTask)
  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_model().empty()) {
    _this->_internal_set_model(from._internal_model());
  }
  if (!from._internal_host().empty()) {
    _this->_internal_set_host(from._internal_host());
  }
  if (!from._internal_username().empty()) {
    _this->_internal_set_username(from._internal_username());
  }
  if (!from._internal_password().empty()) {
    _this->_internal_set_password(from._internal_password());
  }
  if (!from._internal_ntp_timezone().empty()) {
    _this->_internal_set_ntp_timezone(from._internal_ntp_timezone());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_preset()->::keyapis::preset::v1::Preset::MergeFrom(
        from._internal_preset());
  }
  if (from._internal_device_id() != 0) {
    _this->_internal_set_device_id(from._internal_device_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PresetConfigurationTask::InternalSwap(PresetConfigurationTask* 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_.model_, lhs_arena,
                                       &other->_impl_.model_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.host_, lhs_arena,
                                       &other->_impl_.host_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.username_, lhs_arena,
                                       &other->_impl_.username_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.password_, lhs_arena,
                                       &other->_impl_.password_, rhs_arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.ntp_timezone_, lhs_arena,
                                       &other->_impl_.ntp_timezone_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PresetConfigurationTask, _impl_.device_id_)
      + sizeof(PresetConfigurationTask::_impl_.device_id_)
      - PROTOBUF_FIELD_OFFSET(PresetConfigurationTask, _impl_.preset_)>(
          reinterpret_cast<char*>(&_impl_.preset_),
          reinterpret_cast<char*>(&other->_impl_.preset_));
}

std::string PresetConfigurationTask::GetTypeName() const {
  return "keyapis.preset.v1.PresetConfigurationTask";
}

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

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

const ::PROTOBUF_NAMESPACE_ID::Timestamp&
PresetConfigurationSuccessTask::_Internal::configured_at(const PresetConfigurationSuccessTask* msg) {
  return *msg->_impl_.configured_at_;
}
void PresetConfigurationSuccessTask::clear_configured_at() {
  if (_impl_.configured_at_ != nullptr) _impl_.configured_at_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
PresetConfigurationSuccessTask::PresetConfigurationSuccessTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.preset.v1.PresetConfigurationSuccessTask)
}
PresetConfigurationSuccessTask::PresetConfigurationSuccessTask(const PresetConfigurationSuccessTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PresetConfigurationSuccessTask* 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_.configured_at_){nullptr}
    , decltype(_impl_.device_id_) {}

    , decltype(_impl_.preset_id_) {}
  };

  _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());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.configured_at_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.configured_at_);
  }
  ::memcpy(&_impl_.device_id_, &from._impl_.device_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.preset_id_) -
    reinterpret_cast<char*>(&_impl_.device_id_)) + sizeof(_impl_.preset_id_));
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PresetConfigurationSuccessTask)
}

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

    , decltype(_impl_.configured_at_){nullptr}
    , decltype(_impl_.device_id_) { 0 }

    , decltype(_impl_.preset_id_) { 0 }

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

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

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

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

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

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

const char* PresetConfigurationSuccessTask::_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;
      // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          _impl_.device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.preset_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.Timestamp configured_at = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_configured_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* PresetConfigurationSuccessTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PresetConfigurationSuccessTask)
  ::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.preset.v1.PresetConfigurationSuccessTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        2, this->_internal_device_id(), target);
  }

  // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_preset_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        3, this->_internal_preset_id(), target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .google.protobuf.Timestamp configured_at = 4 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::configured_at(this),
        _Internal::configured_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.preset.v1.PresetConfigurationSuccessTask)
  return target;
}

::size_t PresetConfigurationSuccessTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.preset.v1.PresetConfigurationSuccessTask)
  ::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());
  }

  // .google.protobuf.Timestamp configured_at = 4 [(.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_.configured_at_);
  }

  // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_device_id());
  }

  // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_preset_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_preset_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 PresetConfigurationSuccessTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PresetConfigurationSuccessTask*>(
      &from));
}

void PresetConfigurationSuccessTask::MergeFrom(const PresetConfigurationSuccessTask& from) {
  PresetConfigurationSuccessTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.preset.v1.PresetConfigurationSuccessTask)
  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._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_configured_at()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(
        from._internal_configured_at());
  }
  if (from._internal_device_id() != 0) {
    _this->_internal_set_device_id(from._internal_device_id());
  }
  if (from._internal_preset_id() != 0) {
    _this->_internal_set_preset_id(from._internal_preset_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PresetConfigurationSuccessTask::InternalSwap(PresetConfigurationSuccessTask* 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);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PresetConfigurationSuccessTask, _impl_.preset_id_)
      + sizeof(PresetConfigurationSuccessTask::_impl_.preset_id_)
      - PROTOBUF_FIELD_OFFSET(PresetConfigurationSuccessTask, _impl_.configured_at_)>(
          reinterpret_cast<char*>(&_impl_.configured_at_),
          reinterpret_cast<char*>(&other->_impl_.configured_at_));
}

std::string PresetConfigurationSuccessTask::GetTypeName() const {
  return "keyapis.preset.v1.PresetConfigurationSuccessTask";
}

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

class PresetConfigurationFailTask::_Internal {
 public:
};

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

    , decltype(_impl_.error_message_) {}

    , decltype(_impl_.device_id_) {}

    , decltype(_impl_.preset_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());
  }
  _impl_.error_message_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.error_message_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_error_message().empty()) {
    _this->_impl_.error_message_.Set(from._internal_error_message(), _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.device_id_, &from._impl_.device_id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.preset_id_) -
    reinterpret_cast<char*>(&_impl_.device_id_)) + sizeof(_impl_.preset_id_));
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PresetConfigurationFailTask)
}

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

    , decltype(_impl_.error_message_) {}

    , decltype(_impl_.device_id_) { 0 }

    , decltype(_impl_.preset_id_) { 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
  _impl_.error_message_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
        _impl_.error_message_.Set("", GetArenaForAllocation());
  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

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

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

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

  _impl_.request_id_.ClearToEmpty();
  _impl_.error_message_.ClearToEmpty();
  ::memset(&_impl_.device_id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.preset_id_) -
      reinterpret_cast<char*>(&_impl_.device_id_)) + sizeof(_impl_.preset_id_));
  _internal_metadata_.Clear<std::string>();
}

const char* PresetConfigurationFailTask::_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;
      // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
          _impl_.device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
          _impl_.preset_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // string error_message = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_error_message();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, nullptr));
        } 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* PresetConfigurationFailTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PresetConfigurationFailTask)
  ::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.preset.v1.PresetConfigurationFailTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        2, this->_internal_device_id(), target);
  }

  // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_preset_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        3, this->_internal_preset_id(), target);
  }

  // string error_message = 4 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_error_message().empty()) {
    const std::string& _s = this->_internal_error_message();
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "keyapis.preset.v1.PresetConfigurationFailTask.error_message");
    target = stream->WriteStringMaybeAliased(4, _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.preset.v1.PresetConfigurationFailTask)
  return target;
}

::size_t PresetConfigurationFailTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.preset.v1.PresetConfigurationFailTask)
  ::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 error_message = 4 [(.google.api.field_behavior) = REQUIRED];
  if (!this->_internal_error_message().empty()) {
    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
                                    this->_internal_error_message());
  }

  // int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_device_id());
  }

  // int32 preset_id = 3 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_preset_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_preset_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 PresetConfigurationFailTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PresetConfigurationFailTask*>(
      &from));
}

void PresetConfigurationFailTask::MergeFrom(const PresetConfigurationFailTask& from) {
  PresetConfigurationFailTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.preset.v1.PresetConfigurationFailTask)
  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_error_message().empty()) {
    _this->_internal_set_error_message(from._internal_error_message());
  }
  if (from._internal_device_id() != 0) {
    _this->_internal_set_device_id(from._internal_device_id());
  }
  if (from._internal_preset_id() != 0) {
    _this->_internal_set_preset_id(from._internal_preset_id());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PresetConfigurationFailTask::InternalSwap(PresetConfigurationFailTask* 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);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_message_, lhs_arena,
                                       &other->_impl_.error_message_, rhs_arena);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PresetConfigurationFailTask, _impl_.preset_id_)
      + sizeof(PresetConfigurationFailTask::_impl_.preset_id_)
      - PROTOBUF_FIELD_OFFSET(PresetConfigurationFailTask, _impl_.device_id_)>(
          reinterpret_cast<char*>(&_impl_.device_id_),
          reinterpret_cast<char*>(&other->_impl_.device_id_));
}

std::string PresetConfigurationFailTask::GetTypeName() const {
  return "keyapis.preset.v1.PresetConfigurationFailTask";
}

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

class PresetInstallTask::_Internal {
 public:
  using HasBits = decltype(std::declval<PresetInstallTask>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(PresetInstallTask, _impl_._has_bits_);
  static const ::keyapis::preset::v1::Preset& preset(const PresetInstallTask* msg);
  static void set_has_preset(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::keyapis::preset::v1::Preset&
PresetInstallTask::_Internal::preset(const PresetInstallTask* msg) {
  return *msg->_impl_.preset_;
}
void PresetInstallTask::clear_preset() {
  if (_impl_.preset_ != nullptr) _impl_.preset_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
PresetInstallTask::PresetInstallTask(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.preset.v1.PresetInstallTask)
}
PresetInstallTask::PresetInstallTask(const PresetInstallTask& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PresetInstallTask* 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_.preset_){nullptr}};

  _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());
  }
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.preset_ = new ::keyapis::preset::v1::Preset(*from._impl_.preset_);
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.preset.v1.PresetInstallTask)
}

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

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

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

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

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

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

  _impl_.request_id_.ClearToEmpty();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    ABSL_DCHECK(_impl_.preset_ != nullptr);
    _impl_.preset_->Clear();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PresetInstallTask::_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;
      // .keyapis.preset.v1.Preset preset = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_preset(), 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* PresetInstallTask::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.preset.v1.PresetInstallTask)
  ::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.preset.v1.PresetInstallTask.request_id");
    target = stream->WriteStringMaybeAliased(1, _s, target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // .keyapis.preset.v1.Preset preset = 2 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::preset(this),
        _Internal::preset(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.preset.v1.PresetInstallTask)
  return target;
}

::size_t PresetInstallTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.preset.v1.PresetInstallTask)
  ::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());
  }

  // .keyapis.preset.v1.Preset preset = 2 [(.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_.preset_);
  }

  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 PresetInstallTask::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PresetInstallTask*>(
      &from));
}

void PresetInstallTask::MergeFrom(const PresetInstallTask& from) {
  PresetInstallTask* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:keyapis.preset.v1.PresetInstallTask)
  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._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_internal_mutable_preset()->::keyapis::preset::v1::Preset::MergeFrom(
        from._internal_preset());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PresetInstallTask::InternalSwap(PresetInstallTask* 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);
  swap(_impl_.preset_, other->_impl_.preset_);
}

std::string PresetInstallTask::GetTypeName() const {
  return "keyapis.preset.v1.PresetInstallTask";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace preset
}  // namespace keyapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PostEventPresetInstallRequest*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PostEventPresetInstallRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PostEventPresetInstallRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PostEventPresetInstallResponse*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PostEventPresetInstallResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PostEventPresetInstallResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PresetConfigurationTask*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PresetConfigurationTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PresetConfigurationTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PresetConfigurationSuccessTask*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PresetConfigurationSuccessTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PresetConfigurationSuccessTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PresetConfigurationFailTask*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PresetConfigurationFailTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PresetConfigurationFailTask >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::preset::v1::PresetInstallTask*
Arena::CreateMaybeMessage< ::keyapis::preset::v1::PresetInstallTask >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::preset::v1::PresetInstallTask >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
