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

#include "keyapis/device/v1/keyapis_device_command_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 device {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR PostCommandDeviceOpenRequest::PostCommandDeviceOpenRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.device_id_)*/ 0

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostCommandDeviceOpenRequestDefaultTypeInternal _PostCommandDeviceOpenRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostCommandDeviceOpenResponse_Error::PostCommandDeviceOpenResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct PostCommandDeviceOpenResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostCommandDeviceOpenResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostCommandDeviceOpenResponse_ErrorDefaultTypeInternal() {}
  union {
    PostCommandDeviceOpenResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostCommandDeviceOpenResponse_ErrorDefaultTypeInternal _PostCommandDeviceOpenResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR PostCommandDeviceOpenResponse::PostCommandDeviceOpenResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct PostCommandDeviceOpenResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostCommandDeviceOpenResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostCommandDeviceOpenResponseDefaultTypeInternal() {}
  union {
    PostCommandDeviceOpenResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostCommandDeviceOpenResponseDefaultTypeInternal _PostCommandDeviceOpenResponse_default_instance_;
}  // namespace v1
}  // namespace device
}  // namespace keyapis
namespace keyapis {
namespace device {
namespace v1 {
// ===================================================================

class PostCommandDeviceOpenRequest::_Internal {
 public:
};

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

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

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

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

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

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

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

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

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

  // int32 device_id = 1 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_device_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
        1, this->_internal_device_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.device.v1.PostCommandDeviceOpenRequest)
  return target;
}

::size_t PostCommandDeviceOpenRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.device.v1.PostCommandDeviceOpenRequest)
  ::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 device_id = 1 [(.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 PostCommandDeviceOpenRequest::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostCommandDeviceOpenRequest*>(
      &from));
}

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

  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 PostCommandDeviceOpenRequest::CopyFrom(const PostCommandDeviceOpenRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyapis.device.v1.PostCommandDeviceOpenRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

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

std::string PostCommandDeviceOpenRequest::GetTypeName() const {
  return "keyapis.device.v1.PostCommandDeviceOpenRequest";
}

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

class PostCommandDeviceOpenResponse_Error::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::device::v1::PostCommandDeviceOpenResponse_Error, _impl_._oneof_case_);
  static const ::keyapis::device::v1::ValidationError& validation(const PostCommandDeviceOpenResponse_Error* msg);
};

const ::keyapis::device::v1::ValidationError&
PostCommandDeviceOpenResponse_Error::_Internal::validation(const PostCommandDeviceOpenResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
void PostCommandDeviceOpenResponse_Error::set_allocated_validation(::keyapis::device::v1::ValidationError* validation) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (validation) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(validation));
    if (message_arena != submessage_arena) {
      validation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, validation, submessage_arena);
    }
    set_has_validation();
    _impl_.reason_.validation_ = validation;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.device.v1.PostCommandDeviceOpenResponse.Error.validation)
}
void PostCommandDeviceOpenResponse_Error::clear_validation() {
  if (reason_case() == kValidation) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.reason_.validation_;
    }
    clear_has_reason();
  }
}
PostCommandDeviceOpenResponse_Error::PostCommandDeviceOpenResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.device.v1.PostCommandDeviceOpenResponse.Error)
}
PostCommandDeviceOpenResponse_Error::PostCommandDeviceOpenResponse_Error(const PostCommandDeviceOpenResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostCommandDeviceOpenResponse_Error* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_reason();
  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::device::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.device.v1.PostCommandDeviceOpenResponse.Error)
}

inline void PostCommandDeviceOpenResponse_Error::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.reason_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_reason();
}

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

inline void PostCommandDeviceOpenResponse_Error::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_reason()) {
    clear_reason();
  }
}

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

void PostCommandDeviceOpenResponse_Error::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.device.v1.PostCommandDeviceOpenResponse.Error)
  switch (reason_case()) {
    case kValidation: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.validation_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


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

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

const char* PostCommandDeviceOpenResponse_Error::_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) {
      // .keyapis.device.v1.ValidationError validation = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_validation(), 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* PostCommandDeviceOpenResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.device.v1.PostCommandDeviceOpenResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.device.v1.ValidationError validation = 1;
  if (reason_case() == kValidation) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::validation(this),
        _Internal::validation(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.device.v1.PostCommandDeviceOpenResponse.Error)
  return target;
}

::size_t PostCommandDeviceOpenResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyapis.device.v1.PostCommandDeviceOpenResponse.Error)
  ::size_t total_size = 0;

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

  switch (reason_case()) {
    // .keyapis.device.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  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 PostCommandDeviceOpenResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostCommandDeviceOpenResponse_Error*>(
      &from));
}

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

  switch (from.reason_case()) {
    case kValidation: {
      _this->_internal_mutable_validation()->::keyapis::device::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostCommandDeviceOpenResponse_Error::InternalSwap(PostCommandDeviceOpenResponse_Error* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.reason_, other->_impl_.reason_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string PostCommandDeviceOpenResponse_Error::GetTypeName() const {
  return "keyapis.device.v1.PostCommandDeviceOpenResponse.Error";
}

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

class PostCommandDeviceOpenResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::keyapis::device::v1::PostCommandDeviceOpenResponse, _impl_._oneof_case_);
  static const ::keyapis::device::v1::PostCommandDeviceOpenResponse_Error& error(const PostCommandDeviceOpenResponse* msg);
};

const ::keyapis::device::v1::PostCommandDeviceOpenResponse_Error&
PostCommandDeviceOpenResponse::_Internal::error(const PostCommandDeviceOpenResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void PostCommandDeviceOpenResponse::set_allocated_error(::keyapis::device::v1::PostCommandDeviceOpenResponse_Error* error) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (error) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(error);
    if (message_arena != submessage_arena) {
      error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, error, submessage_arena);
    }
    set_has_error();
    _impl_.type_.error_ = error;
  }
  // @@protoc_insertion_point(field_set_allocated:keyapis.device.v1.PostCommandDeviceOpenResponse.error)
}
PostCommandDeviceOpenResponse::PostCommandDeviceOpenResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:keyapis.device.v1.PostCommandDeviceOpenResponse)
}
PostCommandDeviceOpenResponse::PostCommandDeviceOpenResponse(const PostCommandDeviceOpenResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  PostCommandDeviceOpenResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_type();
  switch (from.type_case()) {
    case kError: {
      _this->_internal_mutable_error()->::keyapis::device::v1::PostCommandDeviceOpenResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:keyapis.device.v1.PostCommandDeviceOpenResponse)
}

inline void PostCommandDeviceOpenResponse::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.type_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_type();
}

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

inline void PostCommandDeviceOpenResponse::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_type()) {
    clear_type();
  }
}

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

void PostCommandDeviceOpenResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:keyapis.device.v1.PostCommandDeviceOpenResponse)
  switch (type_case()) {
    case kError: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.error_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


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

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

const char* PostCommandDeviceOpenResponse::_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) {
      // .keyapis.device.v1.PostCommandDeviceOpenResponse.Error error = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_error(), 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* PostCommandDeviceOpenResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:keyapis.device.v1.PostCommandDeviceOpenResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .keyapis.device.v1.PostCommandDeviceOpenResponse.Error error = 1;
  if (type_case() == kError) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::error(this),
        _Internal::error(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.device.v1.PostCommandDeviceOpenResponse)
  return target;
}

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

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

  switch (type_case()) {
    // .keyapis.device.v1.PostCommandDeviceOpenResponse.Error error = 1;
    case kError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.error_);
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  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 PostCommandDeviceOpenResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PostCommandDeviceOpenResponse*>(
      &from));
}

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

  switch (from.type_case()) {
    case kError: {
      _this->_internal_mutable_error()->::keyapis::device::v1::PostCommandDeviceOpenResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void PostCommandDeviceOpenResponse::InternalSwap(PostCommandDeviceOpenResponse* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.type_, other->_impl_.type_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

std::string PostCommandDeviceOpenResponse::GetTypeName() const {
  return "keyapis.device.v1.PostCommandDeviceOpenResponse";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace device
}  // namespace keyapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyapis::device::v1::PostCommandDeviceOpenRequest*
Arena::CreateMaybeMessage< ::keyapis::device::v1::PostCommandDeviceOpenRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::device::v1::PostCommandDeviceOpenRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::device::v1::PostCommandDeviceOpenResponse_Error*
Arena::CreateMaybeMessage< ::keyapis::device::v1::PostCommandDeviceOpenResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::device::v1::PostCommandDeviceOpenResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::keyapis::device::v1::PostCommandDeviceOpenResponse*
Arena::CreateMaybeMessage< ::keyapis::device::v1::PostCommandDeviceOpenResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::keyapis::device::v1::PostCommandDeviceOpenResponse >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
