// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: proto/proximity_payloads.proto

#include "proto/proximity_payloads.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)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace securegcm {
constexpr CloudToDeviceProximityAuthPairing::CloudToDeviceProximityAuthPairing(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : initiating_device_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , initiating_device_bt_address_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , ephemeral_symmetric_key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , additional_metadata_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct CloudToDeviceProximityAuthPairingDefaultTypeInternal {
  constexpr CloudToDeviceProximityAuthPairingDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~CloudToDeviceProximityAuthPairingDefaultTypeInternal() {}
  union {
    CloudToDeviceProximityAuthPairing _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CloudToDeviceProximityAuthPairingDefaultTypeInternal _CloudToDeviceProximityAuthPairing_default_instance_;
constexpr DeviceProximityCallback::DeviceProximityCallback(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : callback_bluetooth_address_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , source_device_type_(0)

  , protocol_version_(0){}
struct DeviceProximityCallbackDefaultTypeInternal {
  constexpr DeviceProximityCallbackDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~DeviceProximityCallbackDefaultTypeInternal() {}
  union {
    DeviceProximityCallback _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DeviceProximityCallbackDefaultTypeInternal _DeviceProximityCallback_default_instance_;
}  // namespace securegcm
namespace securegcm {

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

class CloudToDeviceProximityAuthPairing::_Internal {
 public:
  using HasBits = decltype(std::declval<CloudToDeviceProximityAuthPairing>()._has_bits_);
  static void set_has_initiating_device_name(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_initiating_device_bt_address(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_ephemeral_symmetric_key(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_additional_metadata(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

CloudToDeviceProximityAuthPairing::CloudToDeviceProximityAuthPairing(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securegcm.CloudToDeviceProximityAuthPairing)
}
CloudToDeviceProximityAuthPairing::CloudToDeviceProximityAuthPairing(const CloudToDeviceProximityAuthPairing& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  initiating_device_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    initiating_device_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_initiating_device_name()) {
    initiating_device_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_initiating_device_name(), 
      GetArenaForAllocation());
  }
  initiating_device_bt_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    initiating_device_bt_address_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_initiating_device_bt_address()) {
    initiating_device_bt_address_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_initiating_device_bt_address(), 
      GetArenaForAllocation());
  }
  ephemeral_symmetric_key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    ephemeral_symmetric_key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_ephemeral_symmetric_key()) {
    ephemeral_symmetric_key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ephemeral_symmetric_key(), 
      GetArenaForAllocation());
  }
  additional_metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    additional_metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_additional_metadata()) {
    additional_metadata_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_additional_metadata(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:securegcm.CloudToDeviceProximityAuthPairing)
}

inline void CloudToDeviceProximityAuthPairing::SharedCtor() {
initiating_device_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  initiating_device_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
initiating_device_bt_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  initiating_device_bt_address_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
ephemeral_symmetric_key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  ephemeral_symmetric_key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
additional_metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  additional_metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

CloudToDeviceProximityAuthPairing::~CloudToDeviceProximityAuthPairing() {
  // @@protoc_insertion_point(destructor:securegcm.CloudToDeviceProximityAuthPairing)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void CloudToDeviceProximityAuthPairing::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  initiating_device_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  initiating_device_bt_address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ephemeral_symmetric_key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  additional_metadata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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

void CloudToDeviceProximityAuthPairing::Clear() {
// @@protoc_insertion_point(message_clear_start:securegcm.CloudToDeviceProximityAuthPairing)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      initiating_device_name_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      initiating_device_bt_address_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      ephemeral_symmetric_key_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000008u) {
      additional_metadata_.ClearNonDefaultToEmpty();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* CloudToDeviceProximityAuthPairing::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional string initiating_device_name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_initiating_device_name();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string initiating_device_bt_address = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_initiating_device_bt_address();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bytes ephemeral_symmetric_key = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_ephemeral_symmetric_key();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bytes additional_metadata = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_additional_metadata();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          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:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _has_bits_[0];
  // optional string initiating_device_name = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_initiating_device_name(), target);
  }

  // optional string initiating_device_bt_address = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_initiating_device_bt_address(), target);
  }

  // optional bytes ephemeral_symmetric_key = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->WriteBytesMaybeAliased(
        3, this->_internal_ephemeral_symmetric_key(), target);
  }

  // optional bytes additional_metadata = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_additional_metadata(), 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:securegcm.CloudToDeviceProximityAuthPairing)
  return target;
}

size_t CloudToDeviceProximityAuthPairing::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securegcm.CloudToDeviceProximityAuthPairing)
  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 = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    // optional string initiating_device_name = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_initiating_device_name());
    }

    // optional string initiating_device_bt_address = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_initiating_device_bt_address());
    }

    // optional bytes ephemeral_symmetric_key = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_ephemeral_symmetric_key());
    }

    // optional bytes additional_metadata = 4;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_additional_metadata());
    }

  }
  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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void CloudToDeviceProximityAuthPairing::MergeFrom(const CloudToDeviceProximityAuthPairing& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securegcm.CloudToDeviceProximityAuthPairing)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_initiating_device_name(from._internal_initiating_device_name());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_initiating_device_bt_address(from._internal_initiating_device_bt_address());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_set_ephemeral_symmetric_key(from._internal_ephemeral_symmetric_key());
    }
    if (cached_has_bits & 0x00000008u) {
      _internal_set_additional_metadata(from._internal_additional_metadata());
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CloudToDeviceProximityAuthPairing::CopyFrom(const CloudToDeviceProximityAuthPairing& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securegcm.CloudToDeviceProximityAuthPairing)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CloudToDeviceProximityAuthPairing::InternalSwap(CloudToDeviceProximityAuthPairing* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &initiating_device_name_, lhs_arena,
      &other->initiating_device_name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &initiating_device_bt_address_, lhs_arena,
      &other->initiating_device_bt_address_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &ephemeral_symmetric_key_, lhs_arena,
      &other->ephemeral_symmetric_key_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &additional_metadata_, lhs_arena,
      &other->additional_metadata_, rhs_arena
  );
}

std::string CloudToDeviceProximityAuthPairing::GetTypeName() const {
  return "securegcm.CloudToDeviceProximityAuthPairing";
}


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

class DeviceProximityCallback::_Internal {
 public:
  using HasBits = decltype(std::declval<DeviceProximityCallback>()._has_bits_);
  static void set_has_callback_bluetooth_address(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_source_device_type(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_protocol_version(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

DeviceProximityCallback::DeviceProximityCallback(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securegcm.DeviceProximityCallback)
}
DeviceProximityCallback::DeviceProximityCallback(const DeviceProximityCallback& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  callback_bluetooth_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    callback_bluetooth_address_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_callback_bluetooth_address()) {
    callback_bluetooth_address_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_callback_bluetooth_address(), 
      GetArenaForAllocation());
  }
  ::memcpy(&source_device_type_, &from.source_device_type_,
    static_cast<size_t>(reinterpret_cast<char*>(&protocol_version_) -
    reinterpret_cast<char*>(&source_device_type_)) + sizeof(protocol_version_));
  // @@protoc_insertion_point(copy_constructor:securegcm.DeviceProximityCallback)
}

inline void DeviceProximityCallback::SharedCtor() {
callback_bluetooth_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  callback_bluetooth_address_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&source_device_type_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&protocol_version_) -
    reinterpret_cast<char*>(&source_device_type_)) + sizeof(protocol_version_));
}

DeviceProximityCallback::~DeviceProximityCallback() {
  // @@protoc_insertion_point(destructor:securegcm.DeviceProximityCallback)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void DeviceProximityCallback::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  callback_bluetooth_address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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

void DeviceProximityCallback::Clear() {
// @@protoc_insertion_point(message_clear_start:securegcm.DeviceProximityCallback)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    callback_bluetooth_address_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x00000006u) {
    ::memset(&source_device_type_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&protocol_version_) -
        reinterpret_cast<char*>(&source_device_type_)) + sizeof(protocol_version_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* DeviceProximityCallback::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional string callback_bluetooth_address = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_callback_bluetooth_address();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .securegcm.DeviceType source_device_type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::securegcm::DeviceType_IsValid(val))) {
            _internal_set_source_device_type(static_cast<::securegcm::DeviceType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int32 protocol_version = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_protocol_version(&has_bits);
          protocol_version_ = ::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:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _has_bits_[0];
  // optional string callback_bluetooth_address = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_callback_bluetooth_address(), target);
  }

  // optional .securegcm.DeviceType source_device_type = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_source_device_type(), target);
  }

  // optional int32 protocol_version = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_protocol_version(), 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:securegcm.DeviceProximityCallback)
  return target;
}

size_t DeviceProximityCallback::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securegcm.DeviceProximityCallback)
  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 = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string callback_bluetooth_address = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_callback_bluetooth_address());
    }

    // optional .securegcm.DeviceType source_device_type = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_source_device_type());
    }

    // optional int32 protocol_version = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_protocol_version());
    }

  }
  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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void DeviceProximityCallback::MergeFrom(const DeviceProximityCallback& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securegcm.DeviceProximityCallback)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_callback_bluetooth_address(from._internal_callback_bluetooth_address());
    }
    if (cached_has_bits & 0x00000002u) {
      source_device_type_ = from.source_device_type_;
    }
    if (cached_has_bits & 0x00000004u) {
      protocol_version_ = from.protocol_version_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void DeviceProximityCallback::CopyFrom(const DeviceProximityCallback& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securegcm.DeviceProximityCallback)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void DeviceProximityCallback::InternalSwap(DeviceProximityCallback* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &callback_bluetooth_address_, lhs_arena,
      &other->callback_bluetooth_address_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(DeviceProximityCallback, protocol_version_)
      + sizeof(DeviceProximityCallback::protocol_version_)
      - PROTOBUF_FIELD_OFFSET(DeviceProximityCallback, source_device_type_)>(
          reinterpret_cast<char*>(&source_device_type_),
          reinterpret_cast<char*>(&other->source_device_type_));
}

std::string DeviceProximityCallback::GetTypeName() const {
  return "securegcm.DeviceProximityCallback";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace securegcm
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::securegcm::CloudToDeviceProximityAuthPairing* Arena::CreateMaybeMessage< ::securegcm::CloudToDeviceProximityAuthPairing >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securegcm::CloudToDeviceProximityAuthPairing >(arena);
}
template<> PROTOBUF_NOINLINE ::securegcm::DeviceProximityCallback* Arena::CreateMaybeMessage< ::securegcm::DeviceProximityCallback >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securegcm::DeviceProximityCallback >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
