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

#include "deviceapis/device/v1/deviceapis_device_reader_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 deviceapis {
namespace device {
namespace v1 {
template <typename>
PROTOBUF_CONSTEXPR EditReaderRequest::EditReaderRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.data_)*/nullptr
  , /*decltype(_impl_.update_mask_)*/nullptr} {}
struct EditReaderRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR EditReaderRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~EditReaderRequestDefaultTypeInternal() {}
  union {
    EditReaderRequest _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EditReaderRequestDefaultTypeInternal _EditReaderRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR EditReaderResponse_Error::EditReaderResponse_Error(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct EditReaderResponse_ErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR EditReaderResponse_ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~EditReaderResponse_ErrorDefaultTypeInternal() {}
  union {
    EditReaderResponse_Error _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EditReaderResponse_ErrorDefaultTypeInternal _EditReaderResponse_Error_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR EditReaderResponse::EditReaderResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct EditReaderResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR EditReaderResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~EditReaderResponseDefaultTypeInternal() {}
  union {
    EditReaderResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EditReaderResponseDefaultTypeInternal _EditReaderResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetReaderRequest::GetReaderRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.id_)*/ 0

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetReaderRequestDefaultTypeInternal _GetReaderRequest_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR GetReaderResponse::GetReaderResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.type_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct GetReaderResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GetReaderResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~GetReaderResponseDefaultTypeInternal() {}
  union {
    GetReaderResponse _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetReaderResponseDefaultTypeInternal _GetReaderResponse_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Reader_SavingError_ProfileIsNotSupported::Reader_SavingError_ProfileIsNotSupported(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.profile_ids_)*/ {}
  ,/* _impl_._profile_ids_cached_byte_size_ = */ { 0 }

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Reader_SavingError_ProfileIsNotSupportedDefaultTypeInternal _Reader_SavingError_ProfileIsNotSupported_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Reader_SavingError_ProfileNotFound::Reader_SavingError_ProfileNotFound(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct Reader_SavingError_ProfileNotFoundDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Reader_SavingError_ProfileNotFoundDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Reader_SavingError_ProfileNotFoundDefaultTypeInternal() {}
  union {
    Reader_SavingError_ProfileNotFound _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Reader_SavingError_ProfileNotFoundDefaultTypeInternal _Reader_SavingError_ProfileNotFound_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Reader_SavingError_ReaderNotFound::Reader_SavingError_ReaderNotFound(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._cached_size_)*/{}} {}
struct Reader_SavingError_ReaderNotFoundDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Reader_SavingError_ReaderNotFoundDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Reader_SavingError_ReaderNotFoundDefaultTypeInternal() {}
  union {
    Reader_SavingError_ReaderNotFound _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Reader_SavingError_ReaderNotFoundDefaultTypeInternal _Reader_SavingError_ReaderNotFound_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Reader_SavingError::Reader_SavingError(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.reason_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct Reader_SavingErrorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Reader_SavingErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~Reader_SavingErrorDefaultTypeInternal() {}
  union {
    Reader_SavingError _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Reader_SavingErrorDefaultTypeInternal _Reader_SavingError_default_instance_;
template <typename>
PROTOBUF_CONSTEXPR Reader::Reader(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.encryption_profile_ids_)*/ {}
  ,/* _impl_._encryption_profile_ids_cached_byte_size_ = */ { 0 }

  , /*decltype(_impl_.relay_indexes_)*/ {}
  ,/* _impl_._relay_indexes_cached_byte_size_ = */ { 0 }

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

  , /*decltype(_impl_.is_none_secure_mode_)*/ false

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

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

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReaderDefaultTypeInternal _Reader_default_instance_;
}  // namespace v1
}  // namespace device
}  // namespace deviceapis
namespace deviceapis {
namespace device {
namespace v1 {
bool Reader_DirectionType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string>
    Reader_DirectionType_strings[3] = {};

static const char Reader_DirectionType_names[] = {
    "DIRECTION_TYPE_UNKNOWN"
    "IN"
    "OUT"
};

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Reader_DirectionType_entries[] =
    {
        {{&Reader_DirectionType_names[0], 22}, 0},
        {{&Reader_DirectionType_names[22], 2}, 1},
        {{&Reader_DirectionType_names[24], 3}, 2},
};

static const int Reader_DirectionType_entries_by_number[] = {
    0,  // 0 -> DIRECTION_TYPE_UNKNOWN
    1,  // 1 -> IN
    2,  // 2 -> OUT
};

const std::string& Reader_DirectionType_Name(Reader_DirectionType value) {
  static const bool kDummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Reader_DirectionType_entries, Reader_DirectionType_entries_by_number,
          3, Reader_DirectionType_strings);
  (void)kDummy;

  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Reader_DirectionType_entries, Reader_DirectionType_entries_by_number, 3,
      value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString()
                   : Reader_DirectionType_strings[idx].get();
}

bool Reader_DirectionType_Parse(absl::string_view name, Reader_DirectionType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      Reader_DirectionType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<Reader_DirectionType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && \
  (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

constexpr Reader_DirectionType Reader::DIRECTION_TYPE_UNKNOWN;
constexpr Reader_DirectionType Reader::IN;
constexpr Reader_DirectionType Reader::OUT;
constexpr Reader_DirectionType Reader::DirectionType_MIN;
constexpr Reader_DirectionType Reader::DirectionType_MAX;
constexpr int Reader::DirectionType_ARRAYSIZE;

#endif  // (__cplusplus < 201703) &&
        // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================

class EditReaderRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<EditReaderRequest>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
    8 * PROTOBUF_FIELD_OFFSET(EditReaderRequest, _impl_._has_bits_);
  static const ::deviceapis::device::v1::Reader& data(const EditReaderRequest* msg);
  static void set_has_data(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::PROTOBUF_NAMESPACE_ID::FieldMask& update_mask(const EditReaderRequest* msg);
  static void set_has_update_mask(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::deviceapis::device::v1::Reader&
EditReaderRequest::_Internal::data(const EditReaderRequest* msg) {
  return *msg->_impl_.data_;
}
const ::PROTOBUF_NAMESPACE_ID::FieldMask&
EditReaderRequest::_Internal::update_mask(const EditReaderRequest* msg) {
  return *msg->_impl_.update_mask_;
}
void EditReaderRequest::clear_update_mask() {
  if (_impl_.update_mask_ != nullptr) _impl_.update_mask_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
EditReaderRequest::EditReaderRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.EditReaderRequest)
}
EditReaderRequest::EditReaderRequest(const EditReaderRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  EditReaderRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.data_){nullptr}
    , decltype(_impl_.update_mask_){nullptr}};

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
    _this->_impl_.data_ = new ::deviceapis::device::v1::Reader(*from._impl_.data_);
  }
  if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) {
    _this->_impl_.update_mask_ = new ::PROTOBUF_NAMESPACE_ID::FieldMask(*from._impl_.update_mask_);
  }
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.EditReaderRequest)
}

inline void EditReaderRequest::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.data_){nullptr}
    , decltype(_impl_.update_mask_){nullptr}
  };
}

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

inline void EditReaderRequest::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.data_;
  if (this != internal_default_instance()) delete _impl_.update_mask_;
}

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      ABSL_DCHECK(_impl_.data_ != nullptr);
      _impl_.data_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      ABSL_DCHECK(_impl_.update_mask_ != nullptr);
      _impl_.update_mask_->Clear();
    }
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* EditReaderRequest::_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) {
      // .deviceapis.device.v1.Reader data = 1 [(.google.api.field_behavior) = REQUIRED];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .google.protobuf.FieldMask update_mask = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_update_mask(), 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* EditReaderRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.EditReaderRequest)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // .deviceapis.device.v1.Reader data = 1 [(.google.api.field_behavior) = REQUIRED];
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::data(this),
        _Internal::data(this).GetCachedSize(), target, stream);
  }

  // .google.protobuf.FieldMask update_mask = 2;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::update_mask(this),
        _Internal::update_mask(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:deviceapis.device.v1.EditReaderRequest)
  return target;
}

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    // .deviceapis.device.v1.Reader data = 1 [(.google.api.field_behavior) = REQUIRED];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.data_);
    }

    // .google.protobuf.FieldMask update_mask = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.update_mask_);
    }

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

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

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_data()->::deviceapis::device::v1::Reader::MergeFrom(
          from._internal_data());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_update_mask()->::PROTOBUF_NAMESPACE_ID::FieldMask::MergeFrom(
          from._internal_update_mask());
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void EditReaderRequest::InternalSwap(EditReaderRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(EditReaderRequest, _impl_.update_mask_)
      + sizeof(EditReaderRequest::_impl_.update_mask_)
      - PROTOBUF_FIELD_OFFSET(EditReaderRequest, _impl_.data_)>(
          reinterpret_cast<char*>(&_impl_.data_),
          reinterpret_cast<char*>(&other->_impl_.data_));
}

std::string EditReaderRequest::GetTypeName() const {
  return "deviceapis.device.v1.EditReaderRequest";
}

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

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

const ::deviceapis::device::v1::ValidationError&
EditReaderResponse_Error::_Internal::validation(const EditReaderResponse_Error* msg) {
  return *msg->_impl_.reason_.validation_;
}
const ::deviceapis::device::v1::Reader_SavingError&
EditReaderResponse_Error::_Internal::saving(const EditReaderResponse_Error* msg) {
  return *msg->_impl_.reason_.saving_;
}
void EditReaderResponse_Error::set_allocated_validation(::deviceapis::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:deviceapis.device.v1.EditReaderResponse.Error.validation)
}
void EditReaderResponse_Error::clear_validation() {
  if (reason_case() == kValidation) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.reason_.validation_;
    }
    clear_has_reason();
  }
}
void EditReaderResponse_Error::set_allocated_saving(::deviceapis::device::v1::Reader_SavingError* saving) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (saving) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(saving);
    if (message_arena != submessage_arena) {
      saving = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, saving, submessage_arena);
    }
    set_has_saving();
    _impl_.reason_.saving_ = saving;
  }
  // @@protoc_insertion_point(field_set_allocated:deviceapis.device.v1.EditReaderResponse.Error.saving)
}
EditReaderResponse_Error::EditReaderResponse_Error(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.EditReaderResponse.Error)
}
EditReaderResponse_Error::EditReaderResponse_Error(const EditReaderResponse_Error& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  EditReaderResponse_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()->::deviceapis::device::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::deviceapis::device::v1::Reader_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.EditReaderResponse.Error)
}

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

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

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

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

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


void EditReaderResponse_Error::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.EditReaderResponse.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* EditReaderResponse_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) {
      // .deviceapis.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;
      // .deviceapis.device.v1.Reader.SavingError saving = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_saving(), 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* EditReaderResponse_Error::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.EditReaderResponse.Error)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (reason_case()) {
    case kValidation: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::validation(this),
          _Internal::validation(this).GetCachedSize(), target, stream);
      break;
    }
    case kSaving: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::saving(this),
          _Internal::saving(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  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:deviceapis.device.v1.EditReaderResponse.Error)
  return target;
}

::size_t EditReaderResponse_Error::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.EditReaderResponse.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()) {
    // .deviceapis.device.v1.ValidationError validation = 1;
    case kValidation: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.validation_);
      break;
    }
    // .deviceapis.device.v1.Reader.SavingError saving = 2;
    case kSaving: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.saving_);
      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 EditReaderResponse_Error::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const EditReaderResponse_Error*>(
      &from));
}

void EditReaderResponse_Error::MergeFrom(const EditReaderResponse_Error& from) {
  EditReaderResponse_Error* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.EditReaderResponse.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()->::deviceapis::device::v1::ValidationError::MergeFrom(
          from._internal_validation());
      break;
    }
    case kSaving: {
      _this->_internal_mutable_saving()->::deviceapis::device::v1::Reader_SavingError::MergeFrom(
          from._internal_saving());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void EditReaderResponse_Error::InternalSwap(EditReaderResponse_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 EditReaderResponse_Error::GetTypeName() const {
  return "deviceapis.device.v1.EditReaderResponse.Error";
}

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

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

const ::deviceapis::device::v1::EditReaderResponse_Error&
EditReaderResponse::_Internal::error(const EditReaderResponse* msg) {
  return *msg->_impl_.type_.error_;
}
void EditReaderResponse::set_allocated_error(::deviceapis::device::v1::EditReaderResponse_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:deviceapis.device.v1.EditReaderResponse.error)
}
EditReaderResponse::EditReaderResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.EditReaderResponse)
}
EditReaderResponse::EditReaderResponse(const EditReaderResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  EditReaderResponse* 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()->::deviceapis::device::v1::EditReaderResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.EditReaderResponse)
}

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

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

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

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

void EditReaderResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:deviceapis.device.v1.EditReaderResponse)
  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 EditReaderResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.EditReaderResponse)
  ::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* EditReaderResponse::_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) {
      // .deviceapis.device.v1.EditReaderResponse.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* EditReaderResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.EditReaderResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .deviceapis.device.v1.EditReaderResponse.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:deviceapis.device.v1.EditReaderResponse)
  return target;
}

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

void EditReaderResponse::MergeFrom(const EditReaderResponse& from) {
  EditReaderResponse* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.EditReaderResponse)
  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()->::deviceapis::device::v1::EditReaderResponse_Error::MergeFrom(
          from._internal_error());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void EditReaderResponse::InternalSwap(EditReaderResponse* 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 EditReaderResponse::GetTypeName() const {
  return "deviceapis.device.v1.EditReaderResponse";
}

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

class GetReaderRequest::_Internal {
 public:
};

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

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

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

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

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

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

void GetReaderRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.GetReaderRequest)
  ::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* GetReaderRequest::_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* GetReaderRequest::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.GetReaderRequest)
  ::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:deviceapis.device.v1.GetReaderRequest)
  return target;
}

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

void GetReaderRequest::MergeFrom(const GetReaderRequest& from) {
  GetReaderRequest* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.GetReaderRequest)
  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 GetReaderRequest::CopyFrom(const GetReaderRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:deviceapis.device.v1.GetReaderRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

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

std::string GetReaderRequest::GetTypeName() const {
  return "deviceapis.device.v1.GetReaderRequest";
}

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

class GetReaderResponse::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::deviceapis::device::v1::GetReaderResponse, _impl_._oneof_case_);
  static const ::deviceapis::device::v1::Reader& data(const GetReaderResponse* msg);
};

const ::deviceapis::device::v1::Reader&
GetReaderResponse::_Internal::data(const GetReaderResponse* msg) {
  return *msg->_impl_.type_.data_;
}
void GetReaderResponse::set_allocated_data(::deviceapis::device::v1::Reader* data) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_type();
  if (data) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(data);
    if (message_arena != submessage_arena) {
      data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, data, submessage_arena);
    }
    set_has_data();
    _impl_.type_.data_ = data;
  }
  // @@protoc_insertion_point(field_set_allocated:deviceapis.device.v1.GetReaderResponse.data)
}
GetReaderResponse::GetReaderResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.GetReaderResponse)
}
GetReaderResponse::GetReaderResponse(const GetReaderResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  GetReaderResponse* 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 kData: {
      _this->_internal_mutable_data()->::deviceapis::device::v1::Reader::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.GetReaderResponse)
}

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

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

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

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

void GetReaderResponse::clear_type() {
// @@protoc_insertion_point(one_of_clear_start:deviceapis.device.v1.GetReaderResponse)
  switch (type_case()) {
    case kData: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.type_.data_;
      }
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = TYPE_NOT_SET;
}


void GetReaderResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.GetReaderResponse)
  ::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* GetReaderResponse::_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) {
      // .deviceapis.device.v1.Reader data = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), 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* GetReaderResponse::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.GetReaderResponse)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .deviceapis.device.v1.Reader data = 1;
  if (type_case() == kData) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::data(this),
        _Internal::data(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:deviceapis.device.v1.GetReaderResponse)
  return target;
}

::size_t GetReaderResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.GetReaderResponse)
  ::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()) {
    // .deviceapis.device.v1.Reader data = 1;
    case kData: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.type_.data_);
      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 GetReaderResponse::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const GetReaderResponse*>(
      &from));
}

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

  switch (from.type_case()) {
    case kData: {
      _this->_internal_mutable_data()->::deviceapis::device::v1::Reader::MergeFrom(
          from._internal_data());
      break;
    }
    case TYPE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GetReaderResponse::InternalSwap(GetReaderResponse* 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 GetReaderResponse::GetTypeName() const {
  return "deviceapis.device.v1.GetReaderResponse";
}

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

class Reader_SavingError_ProfileIsNotSupported::_Internal {
 public:
};

Reader_SavingError_ProfileIsNotSupported::Reader_SavingError_ProfileIsNotSupported(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
}
Reader_SavingError_ProfileIsNotSupported::Reader_SavingError_ProfileIsNotSupported(const Reader_SavingError_ProfileIsNotSupported& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Reader_SavingError_ProfileIsNotSupported* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.profile_ids_) { from._impl_.profile_ids_ }
    ,/* _impl_._profile_ids_cached_byte_size_ = */ { 0 }

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

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
}

inline void Reader_SavingError_ProfileIsNotSupported::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.profile_ids_) { arena }
    ,/* _impl_._profile_ids_cached_byte_size_ = */ { 0 }

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

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

inline void Reader_SavingError_ProfileIsNotSupported::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.profile_ids_.~RepeatedField();
}

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

void Reader_SavingError_ProfileIsNotSupported::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

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

const char* Reader_SavingError_ProfileIsNotSupported::_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) {
      // repeated int32 profile_ids = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_profile_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 8) {
          _internal_add_profile_ids(::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* Reader_SavingError_ProfileIsNotSupported::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 profile_ids = 1;
  {
    int byte_size = _impl_._profile_ids_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(1, _internal_profile_ids(),
                                                 byte_size, target);
    }
  }

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

::size_t Reader_SavingError_ProfileIsNotSupported::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
  ::size_t total_size = 0;

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

  // repeated int32 profile_ids = 1;
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
        this->_internal_profile_ids())
    ;
    _impl_._profile_ids_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 1 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

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

void Reader_SavingError_ProfileIsNotSupported::MergeFrom(const Reader_SavingError_ProfileIsNotSupported& from) {
  Reader_SavingError_ProfileIsNotSupported* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

void Reader_SavingError_ProfileIsNotSupported::CopyFrom(const Reader_SavingError_ProfileIsNotSupported& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string Reader_SavingError_ProfileIsNotSupported::GetTypeName() const {
  return "deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported";
}

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

class Reader_SavingError_ProfileNotFound::_Internal {
 public:
};

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

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

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

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

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

void Reader_SavingError_ProfileNotFound::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  ::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* Reader_SavingError_ProfileNotFound::_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* Reader_SavingError_ProfileNotFound::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  ::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:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  return target;
}

::size_t Reader_SavingError_ProfileNotFound::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  ::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 Reader_SavingError_ProfileNotFound::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Reader_SavingError_ProfileNotFound*>(
      &from));
}

void Reader_SavingError_ProfileNotFound::MergeFrom(const Reader_SavingError_ProfileNotFound& from) {
  Reader_SavingError_ProfileNotFound* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  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 Reader_SavingError_ProfileNotFound::CopyFrom(const Reader_SavingError_ProfileNotFound& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:deviceapis.device.v1.Reader.SavingError.ProfileNotFound)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string Reader_SavingError_ProfileNotFound::GetTypeName() const {
  return "deviceapis.device.v1.Reader.SavingError.ProfileNotFound";
}

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

class Reader_SavingError_ReaderNotFound::_Internal {
 public:
};

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

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

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

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

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

void Reader_SavingError_ReaderNotFound::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  ::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* Reader_SavingError_ReaderNotFound::_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* Reader_SavingError_ReaderNotFound::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  ::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:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  return target;
}

::size_t Reader_SavingError_ReaderNotFound::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  ::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 Reader_SavingError_ReaderNotFound::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Reader_SavingError_ReaderNotFound*>(
      &from));
}

void Reader_SavingError_ReaderNotFound::MergeFrom(const Reader_SavingError_ReaderNotFound& from) {
  Reader_SavingError_ReaderNotFound* const _this = this;
  // @@protoc_insertion_point(class_specific_merge_from_start:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  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 Reader_SavingError_ReaderNotFound::CopyFrom(const Reader_SavingError_ReaderNotFound& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:deviceapis.device.v1.Reader.SavingError.ReaderNotFound)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string Reader_SavingError_ReaderNotFound::GetTypeName() const {
  return "deviceapis.device.v1.Reader.SavingError.ReaderNotFound";
}

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

class Reader_SavingError::_Internal {
 public:
  static constexpr ::int32_t kOneofCaseOffset =
    PROTOBUF_FIELD_OFFSET(::deviceapis::device::v1::Reader_SavingError, _impl_._oneof_case_);
  static const ::deviceapis::device::v1::Reader_SavingError_ReaderNotFound& reader_not_found(const Reader_SavingError* msg);
  static const ::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported& profile_is_not_supported(const Reader_SavingError* msg);
  static const ::deviceapis::device::v1::Reader_SavingError_ProfileNotFound& profile_not_found(const Reader_SavingError* msg);
};

const ::deviceapis::device::v1::Reader_SavingError_ReaderNotFound&
Reader_SavingError::_Internal::reader_not_found(const Reader_SavingError* msg) {
  return *msg->_impl_.reason_.reader_not_found_;
}
const ::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported&
Reader_SavingError::_Internal::profile_is_not_supported(const Reader_SavingError* msg) {
  return *msg->_impl_.reason_.profile_is_not_supported_;
}
const ::deviceapis::device::v1::Reader_SavingError_ProfileNotFound&
Reader_SavingError::_Internal::profile_not_found(const Reader_SavingError* msg) {
  return *msg->_impl_.reason_.profile_not_found_;
}
void Reader_SavingError::set_allocated_reader_not_found(::deviceapis::device::v1::Reader_SavingError_ReaderNotFound* reader_not_found) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (reader_not_found) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reader_not_found);
    if (message_arena != submessage_arena) {
      reader_not_found = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, reader_not_found, submessage_arena);
    }
    set_has_reader_not_found();
    _impl_.reason_.reader_not_found_ = reader_not_found;
  }
  // @@protoc_insertion_point(field_set_allocated:deviceapis.device.v1.Reader.SavingError.reader_not_found)
}
void Reader_SavingError::set_allocated_profile_is_not_supported(::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported* profile_is_not_supported) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (profile_is_not_supported) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile_is_not_supported);
    if (message_arena != submessage_arena) {
      profile_is_not_supported = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, profile_is_not_supported, submessage_arena);
    }
    set_has_profile_is_not_supported();
    _impl_.reason_.profile_is_not_supported_ = profile_is_not_supported;
  }
  // @@protoc_insertion_point(field_set_allocated:deviceapis.device.v1.Reader.SavingError.profile_is_not_supported)
}
void Reader_SavingError::set_allocated_profile_not_found(::deviceapis::device::v1::Reader_SavingError_ProfileNotFound* profile_not_found) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_reason();
  if (profile_not_found) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile_not_found);
    if (message_arena != submessage_arena) {
      profile_not_found = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, profile_not_found, submessage_arena);
    }
    set_has_profile_not_found();
    _impl_.reason_.profile_not_found_ = profile_not_found;
  }
  // @@protoc_insertion_point(field_set_allocated:deviceapis.device.v1.Reader.SavingError.profile_not_found)
}
Reader_SavingError::Reader_SavingError(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.Reader.SavingError)
}
Reader_SavingError::Reader_SavingError(const Reader_SavingError& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Reader_SavingError* 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 kReaderNotFound: {
      _this->_internal_mutable_reader_not_found()->::deviceapis::device::v1::Reader_SavingError_ReaderNotFound::MergeFrom(
          from._internal_reader_not_found());
      break;
    }
    case kProfileIsNotSupported: {
      _this->_internal_mutable_profile_is_not_supported()->::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported::MergeFrom(
          from._internal_profile_is_not_supported());
      break;
    }
    case kProfileNotFound: {
      _this->_internal_mutable_profile_not_found()->::deviceapis::device::v1::Reader_SavingError_ProfileNotFound::MergeFrom(
          from._internal_profile_not_found());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.Reader.SavingError)
}

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

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

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

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

void Reader_SavingError::clear_reason() {
// @@protoc_insertion_point(one_of_clear_start:deviceapis.device.v1.Reader.SavingError)
  switch (reason_case()) {
    case kReaderNotFound: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.reader_not_found_;
      }
      break;
    }
    case kProfileIsNotSupported: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.profile_is_not_supported_;
      }
      break;
    }
    case kProfileNotFound: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.reason_.profile_not_found_;
      }
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REASON_NOT_SET;
}


void Reader_SavingError::Clear() {
// @@protoc_insertion_point(message_clear_start:deviceapis.device.v1.Reader.SavingError)
  ::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* Reader_SavingError::_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) {
      // .deviceapis.device.v1.Reader.SavingError.ReaderNotFound reader_not_found = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_reader_not_found(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported profile_is_not_supported = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_profile_is_not_supported(), ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .deviceapis.device.v1.Reader.SavingError.ProfileNotFound profile_not_found = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_profile_not_found(), 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* Reader_SavingError::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.Reader.SavingError)
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (reason_case()) {
    case kReaderNotFound: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::reader_not_found(this),
          _Internal::reader_not_found(this).GetCachedSize(), target, stream);
      break;
    }
    case kProfileIsNotSupported: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::profile_is_not_supported(this),
          _Internal::profile_is_not_supported(this).GetCachedSize(), target, stream);
      break;
    }
    case kProfileNotFound: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(3, _Internal::profile_not_found(this),
          _Internal::profile_not_found(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  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:deviceapis.device.v1.Reader.SavingError)
  return target;
}

::size_t Reader_SavingError::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:deviceapis.device.v1.Reader.SavingError)
  ::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()) {
    // .deviceapis.device.v1.Reader.SavingError.ReaderNotFound reader_not_found = 1;
    case kReaderNotFound: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.reader_not_found_);
      break;
    }
    // .deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported profile_is_not_supported = 2;
    case kProfileIsNotSupported: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.profile_is_not_supported_);
      break;
    }
    // .deviceapis.device.v1.Reader.SavingError.ProfileNotFound profile_not_found = 3;
    case kProfileNotFound: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.reason_.profile_not_found_);
      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 Reader_SavingError::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const Reader_SavingError*>(
      &from));
}

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

  switch (from.reason_case()) {
    case kReaderNotFound: {
      _this->_internal_mutable_reader_not_found()->::deviceapis::device::v1::Reader_SavingError_ReaderNotFound::MergeFrom(
          from._internal_reader_not_found());
      break;
    }
    case kProfileIsNotSupported: {
      _this->_internal_mutable_profile_is_not_supported()->::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported::MergeFrom(
          from._internal_profile_is_not_supported());
      break;
    }
    case kProfileNotFound: {
      _this->_internal_mutable_profile_not_found()->::deviceapis::device::v1::Reader_SavingError_ProfileNotFound::MergeFrom(
          from._internal_profile_not_found());
      break;
    }
    case REASON_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Reader_SavingError::InternalSwap(Reader_SavingError* 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 Reader_SavingError::GetTypeName() const {
  return "deviceapis.device.v1.Reader.SavingError";
}

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

class Reader::_Internal {
 public:
};

Reader::Reader(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:deviceapis.device.v1.Reader)
}
Reader::Reader(const Reader& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  Reader* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.encryption_profile_ids_) { from._impl_.encryption_profile_ids_ }
    ,/* _impl_._encryption_profile_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.relay_indexes_) { from._impl_.relay_indexes_ }
    ,/* _impl_._relay_indexes_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.id_) {}

    , decltype(_impl_.is_none_secure_mode_) {}

    , decltype(_impl_.direction_type_) {}

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

  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&_impl_.id_, &from._impl_.id_,
    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.direction_type_) -
    reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.direction_type_));
  // @@protoc_insertion_point(copy_constructor:deviceapis.device.v1.Reader)
}

inline void Reader::SharedCtor(::_pb::Arena* arena) {
  (void)arena;
  new (&_impl_) Impl_{
      decltype(_impl_.encryption_profile_ids_) { arena }
    ,/* _impl_._encryption_profile_ids_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.relay_indexes_) { arena }
    ,/* _impl_._relay_indexes_cached_byte_size_ = */ { 0 }

    , decltype(_impl_.id_) { 0 }

    , decltype(_impl_.is_none_secure_mode_) { false }

    , decltype(_impl_.direction_type_) { 0 }

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

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

inline void Reader::SharedDtor() {
  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.encryption_profile_ids_.~RepeatedField();
  _impl_.relay_indexes_.~RepeatedField();
}

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

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

  _internal_mutable_encryption_profile_ids()->Clear();
  _internal_mutable_relay_indexes()->Clear();
  ::memset(&_impl_.id_, 0, static_cast<::size_t>(
      reinterpret_cast<char*>(&_impl_.direction_type_) -
      reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.direction_type_));
  _internal_metadata_.Clear<std::string>();
}

const char* Reader::_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;
      // repeated int32 encryption_profile_ids = 2 [(.google.api.field_behavior) = REQUIRED];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_encryption_profile_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 16) {
          _internal_add_encryption_profile_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // repeated int32 relay_indexes = 3 [(.google.api.field_behavior) = REQUIRED];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_relay_indexes(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::uint8_t>(tag) == 24) {
          _internal_add_relay_indexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // bool is_none_secure_mode = 4 [(.google.api.field_behavior) = REQUIRED];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
          _impl_.is_none_secure_mode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else {
          goto handle_unusual;
        }
        continue;
      // .deviceapis.device.v1.Reader.DirectionType direction_type = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
          ::int32_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
          _internal_set_direction_type(static_cast<::deviceapis::device::v1::Reader_DirectionType>(val));
        } 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* Reader::_InternalSerialize(
    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:deviceapis.device.v1.Reader)
  ::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);
  }

  // repeated int32 encryption_profile_ids = 2 [(.google.api.field_behavior) = REQUIRED];
  {
    int byte_size = _impl_._encryption_profile_ids_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(2, _internal_encryption_profile_ids(),
                                                 byte_size, target);
    }
  }

  // repeated int32 relay_indexes = 3 [(.google.api.field_behavior) = REQUIRED];
  {
    int byte_size = _impl_._relay_indexes_cached_byte_size_.Get();
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(3, _internal_relay_indexes(),
                                                 byte_size, target);
    }
  }

  // bool is_none_secure_mode = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_is_none_secure_mode() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        4, this->_internal_is_none_secure_mode(), target);
  }

  // .deviceapis.device.v1.Reader.DirectionType direction_type = 5;
  if (this->_internal_direction_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
        5, this->_internal_direction_type(), 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:deviceapis.device.v1.Reader)
  return target;
}

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

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

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

  // repeated int32 relay_indexes = 3 [(.google.api.field_behavior) = REQUIRED];
  {
    std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
        this->_internal_relay_indexes())
    ;
    _impl_._relay_indexes_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size));
    std::size_t tag_size = data_size == 0
        ? 0
        : 1 + ::_pbi::WireFormatLite::Int32Size(
                            static_cast<int32_t>(data_size))
    ;
    total_size += tag_size + data_size;
  }

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

  // bool is_none_secure_mode = 4 [(.google.api.field_behavior) = REQUIRED];
  if (this->_internal_is_none_secure_mode() != 0) {
    total_size += 2;
  }

  // .deviceapis.device.v1.Reader.DirectionType direction_type = 5;
  if (this->_internal_direction_type() != 0) {
    total_size += 1 +
                  ::_pbi::WireFormatLite::EnumSize(this->_internal_direction_type());
  }

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

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

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

  _this->_impl_.encryption_profile_ids_.MergeFrom(from._impl_.encryption_profile_ids_);
  _this->_impl_.relay_indexes_.MergeFrom(from._impl_.relay_indexes_);
  if (from._internal_id() != 0) {
    _this->_internal_set_id(from._internal_id());
  }
  if (from._internal_is_none_secure_mode() != 0) {
    _this->_internal_set_is_none_secure_mode(from._internal_is_none_secure_mode());
  }
  if (from._internal_direction_type() != 0) {
    _this->_internal_set_direction_type(from._internal_direction_type());
  }
  _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Reader::InternalSwap(Reader* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.encryption_profile_ids_.InternalSwap(&other->_impl_.encryption_profile_ids_);
  _impl_.relay_indexes_.InternalSwap(&other->_impl_.relay_indexes_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Reader, _impl_.direction_type_)
      + sizeof(Reader::_impl_.direction_type_)
      - PROTOBUF_FIELD_OFFSET(Reader, _impl_.id_)>(
          reinterpret_cast<char*>(&_impl_.id_),
          reinterpret_cast<char*>(&other->_impl_.id_));
}

std::string Reader::GetTypeName() const {
  return "deviceapis.device.v1.Reader";
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace device
}  // namespace deviceapis
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::EditReaderRequest*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::EditReaderRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::EditReaderRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::EditReaderResponse_Error*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::EditReaderResponse_Error >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::EditReaderResponse_Error >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::EditReaderResponse*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::EditReaderResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::EditReaderResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::GetReaderRequest*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::GetReaderRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::GetReaderRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::GetReaderResponse*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::GetReaderResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::GetReaderResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::Reader_SavingError_ProfileIsNotSupported >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::Reader_SavingError_ProfileNotFound*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::Reader_SavingError_ProfileNotFound >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::Reader_SavingError_ProfileNotFound >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::Reader_SavingError_ReaderNotFound*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::Reader_SavingError_ReaderNotFound >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::Reader_SavingError_ReaderNotFound >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::Reader_SavingError*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::Reader_SavingError >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::Reader_SavingError >(arena);
}
template<> PROTOBUF_NOINLINE ::deviceapis::device::v1::Reader*
Arena::CreateMaybeMessage< ::deviceapis::device::v1::Reader >(Arena* arena) {
  return Arena::CreateMessageInternal< ::deviceapis::device::v1::Reader >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
