// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: internal/proto/analytics/connections_log.proto

#include "internal/proto/analytics/connections_log.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 location {
namespace nearby {
namespace analytics {
namespace proto {
constexpr ConnectionsLog_ClientSession::ConnectionsLog_ClientSession(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : strategy_session_()
  , connection_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , duration_millis_(int64_t{0})
  , client_flow_id_(int64_t{0}){}
struct ConnectionsLog_ClientSessionDefaultTypeInternal {
  constexpr ConnectionsLog_ClientSessionDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_ClientSessionDefaultTypeInternal() {}
  union {
    ConnectionsLog_ClientSession _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_ClientSessionDefaultTypeInternal _ConnectionsLog_ClientSession_default_instance_;
constexpr ConnectionsLog_StrategySession::ConnectionsLog_StrategySession(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : role_()
  , discovery_phase_()
  , advertising_phase_()
  , connection_attempt_()
  , established_connection_()
  , upgrade_attempt_()
  , build_version_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , duration_millis_(int64_t{0})
  , strategy_(0)
{}
struct ConnectionsLog_StrategySessionDefaultTypeInternal {
  constexpr ConnectionsLog_StrategySessionDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_StrategySessionDefaultTypeInternal() {}
  union {
    ConnectionsLog_StrategySession _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_StrategySessionDefaultTypeInternal _ConnectionsLog_StrategySession_default_instance_;
constexpr ConnectionsLog_DiscoveryPhase::ConnectionsLog_DiscoveryPhase(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : medium_()
  , discovered_endpoint_()
  , sent_connection_request_()
  , uwb_ranging_()
  , discovery_metadata_(nullptr)
  , duration_millis_(int64_t{0})
  , client_flow_id_(int64_t{0}){}
struct ConnectionsLog_DiscoveryPhaseDefaultTypeInternal {
  constexpr ConnectionsLog_DiscoveryPhaseDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_DiscoveryPhaseDefaultTypeInternal() {}
  union {
    ConnectionsLog_DiscoveryPhase _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_DiscoveryPhaseDefaultTypeInternal _ConnectionsLog_DiscoveryPhase_default_instance_;
constexpr ConnectionsLog_DiscoveredEndpoint::ConnectionsLog_DiscoveredEndpoint(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : latency_millis_(int64_t{0})
  , medium_(0)
{}
struct ConnectionsLog_DiscoveredEndpointDefaultTypeInternal {
  constexpr ConnectionsLog_DiscoveredEndpointDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_DiscoveredEndpointDefaultTypeInternal() {}
  union {
    ConnectionsLog_DiscoveredEndpoint _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_DiscoveredEndpointDefaultTypeInternal _ConnectionsLog_DiscoveredEndpoint_default_instance_;
constexpr ConnectionsLog_UwbRangingProcess::ConnectionsLog_UwbRangingProcess(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : uwb_ranging_data_()
  , duration_millis_(int64_t{0})
  , number_of_ranging_data_(0)
  , distance_min_(0)
  , distance_max_(0)
  , distance_ave_(0)
  , distance_variance_(0)
  , azimuth_min_(0)
  , azimuth_max_(0)
  , azimuth_ave_(0)
  , azimuth_variance_(0){}
struct ConnectionsLog_UwbRangingProcessDefaultTypeInternal {
  constexpr ConnectionsLog_UwbRangingProcessDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_UwbRangingProcessDefaultTypeInternal() {}
  union {
    ConnectionsLog_UwbRangingProcess _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_UwbRangingProcessDefaultTypeInternal _ConnectionsLog_UwbRangingProcess_default_instance_;
constexpr ConnectionsLog_RawUwbRangingEvent::ConnectionsLog_RawUwbRangingEvent(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : distance_(0)
  , azimuth_angle_(0)
  , polar_angle_(0){}
struct ConnectionsLog_RawUwbRangingEventDefaultTypeInternal {
  constexpr ConnectionsLog_RawUwbRangingEventDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_RawUwbRangingEventDefaultTypeInternal() {}
  union {
    ConnectionsLog_RawUwbRangingEvent _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_RawUwbRangingEventDefaultTypeInternal _ConnectionsLog_RawUwbRangingEvent_default_instance_;
constexpr ConnectionsLog_AdvertisingPhase::ConnectionsLog_AdvertisingPhase(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : medium_()
  , received_connection_request_()
  , advertising_metadata_(nullptr)
  , duration_millis_(int64_t{0})
  , client_flow_id_(int64_t{0}){}
struct ConnectionsLog_AdvertisingPhaseDefaultTypeInternal {
  constexpr ConnectionsLog_AdvertisingPhaseDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_AdvertisingPhaseDefaultTypeInternal() {}
  union {
    ConnectionsLog_AdvertisingPhase _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_AdvertisingPhaseDefaultTypeInternal _ConnectionsLog_AdvertisingPhase_default_instance_;
constexpr ConnectionsLog_ConnectionRequest::ConnectionsLog_ConnectionRequest(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : duration_millis_(int64_t{0})
  , request_delay_millis_(int64_t{0})
  , local_response_(0)

  , remote_response_(0)

  , client_flow_id_(int64_t{0}){}
struct ConnectionsLog_ConnectionRequestDefaultTypeInternal {
  constexpr ConnectionsLog_ConnectionRequestDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_ConnectionRequestDefaultTypeInternal() {}
  union {
    ConnectionsLog_ConnectionRequest _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_ConnectionRequestDefaultTypeInternal _ConnectionsLog_ConnectionRequest_default_instance_;
constexpr ConnectionsLog_ConnectionAttempt::ConnectionsLog_ConnectionAttempt(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : connection_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , connection_attempt_metadata_(nullptr)
  , duration_millis_(int64_t{0})
  , type_(0)

  , direction_(0)

  , medium_(0)

  , attempt_result_(0)

  , client_flow_id_(int64_t{0}){}
struct ConnectionsLog_ConnectionAttemptDefaultTypeInternal {
  constexpr ConnectionsLog_ConnectionAttemptDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_ConnectionAttemptDefaultTypeInternal() {}
  union {
    ConnectionsLog_ConnectionAttempt _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_ConnectionAttemptDefaultTypeInternal _ConnectionsLog_ConnectionAttempt_default_instance_;
constexpr ConnectionsLog_EstablishedConnection::ConnectionsLog_EstablishedConnection(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : sent_payload_()
  , received_payload_()
  , connection_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , duration_millis_(int64_t{0})
  , medium_(0)

  , disconnection_reason_(0)

  , client_flow_id_(int64_t{0})
  , type_(0)

  , safe_disconnection_result_(0)
{}
struct ConnectionsLog_EstablishedConnectionDefaultTypeInternal {
  constexpr ConnectionsLog_EstablishedConnectionDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_EstablishedConnectionDefaultTypeInternal() {}
  union {
    ConnectionsLog_EstablishedConnection _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_EstablishedConnectionDefaultTypeInternal _ConnectionsLog_EstablishedConnection_default_instance_;
constexpr ConnectionsLog_Payload::ConnectionsLog_Payload(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : duration_millis_(int64_t{0})
  , total_size_bytes_(int64_t{0})
  , type_(0)

  , num_chunks_(0)
  , num_bytes_transferred_(int64_t{0})
  , status_(0)

  , num_successful_auto_resume_(0){}
struct ConnectionsLog_PayloadDefaultTypeInternal {
  constexpr ConnectionsLog_PayloadDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_PayloadDefaultTypeInternal() {}
  union {
    ConnectionsLog_Payload _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_PayloadDefaultTypeInternal _ConnectionsLog_Payload_default_instance_;
constexpr ConnectionsLog_BandwidthUpgradeAttempt::ConnectionsLog_BandwidthUpgradeAttempt(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : connection_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , duration_millis_(int64_t{0})
  , direction_(0)

  , from_medium_(0)

  , to_medium_(0)

  , upgrade_result_(0)

  , client_flow_id_(int64_t{0})
  , error_stage_(0)
{}
struct ConnectionsLog_BandwidthUpgradeAttemptDefaultTypeInternal {
  constexpr ConnectionsLog_BandwidthUpgradeAttemptDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_BandwidthUpgradeAttemptDefaultTypeInternal() {}
  union {
    ConnectionsLog_BandwidthUpgradeAttempt _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_BandwidthUpgradeAttemptDefaultTypeInternal _ConnectionsLog_BandwidthUpgradeAttempt_default_instance_;
constexpr ConnectionsLog_ErrorCode::ConnectionsLog_ErrorCode(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : service_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , connection_token_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , direction_(0)

  , medium_(0)

  , event_(0)

  , description_(0)

  , flow_id_(int64_t{0})
  , _oneof_case_{}{}
struct ConnectionsLog_ErrorCodeDefaultTypeInternal {
  constexpr ConnectionsLog_ErrorCodeDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_ErrorCodeDefaultTypeInternal() {}
  union {
    ConnectionsLog_ErrorCode _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_ErrorCodeDefaultTypeInternal _ConnectionsLog_ErrorCode_default_instance_;
constexpr ConnectionsLog_AdvertisingMetadata::ConnectionsLog_AdvertisingMetadata(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : connected_ap_frequency_(0)
  , supports_extended_ble_advertisements_(false)
  , supports_nfc_technology_(false)
  , multiple_advertisement_supported_(false)
  , supports_dual_band_(false)
  , power_level_(-1)
{}
struct ConnectionsLog_AdvertisingMetadataDefaultTypeInternal {
  constexpr ConnectionsLog_AdvertisingMetadataDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_AdvertisingMetadataDefaultTypeInternal() {}
  union {
    ConnectionsLog_AdvertisingMetadata _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_AdvertisingMetadataDefaultTypeInternal _ConnectionsLog_AdvertisingMetadata_default_instance_;
constexpr ConnectionsLog_DiscoveryMetadata::ConnectionsLog_DiscoveryMetadata(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : connected_ap_frequency_(0)
  , supports_extended_ble_advertisements_(false)
  , supports_nfc_technology_(false)
  , power_level_(-1)
{}
struct ConnectionsLog_DiscoveryMetadataDefaultTypeInternal {
  constexpr ConnectionsLog_DiscoveryMetadataDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_DiscoveryMetadataDefaultTypeInternal() {}
  union {
    ConnectionsLog_DiscoveryMetadata _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_DiscoveryMetadataDefaultTypeInternal _ConnectionsLog_DiscoveryMetadata_default_instance_;
constexpr ConnectionsLog_ConnectionAttemptMetadata::ConnectionsLog_ConnectionAttemptMetadata(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : network_operator_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , country_code_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , technology_(0)

  , band_(0)

  , frequency_(0)
  , try_counts_(0)
  , max_tx_speed_(0)
  , is_tdls_used_(false)
  , wifi_hotspot_status_(false)
  , is_mcc_mode_(false)
  , max_rx_speed_(0)
  , wifi_channel_width_(0)
  , send_buffer_size_(0)
  , receive_buffer_size_(0)
  , connected_ap_frequency_(0){}
struct ConnectionsLog_ConnectionAttemptMetadataDefaultTypeInternal {
  constexpr ConnectionsLog_ConnectionAttemptMetadataDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLog_ConnectionAttemptMetadataDefaultTypeInternal() {}
  union {
    ConnectionsLog_ConnectionAttemptMetadata _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLog_ConnectionAttemptMetadataDefaultTypeInternal _ConnectionsLog_ConnectionAttemptMetadata_default_instance_;
constexpr ConnectionsLog::ConnectionsLog(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : version_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , files_migration_phase_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , client_session_(nullptr)
  , error_code_(nullptr)
  , event_type_(0)

  , log_source_(0)
{}
struct ConnectionsLogDefaultTypeInternal {
  constexpr ConnectionsLogDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ConnectionsLogDefaultTypeInternal() {}
  union {
    ConnectionsLog _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConnectionsLogDefaultTypeInternal _ConnectionsLog_default_instance_;
}  // namespace proto
}  // namespace analytics
}  // namespace nearby
}  // namespace location
namespace location {
namespace nearby {
namespace analytics {
namespace proto {
bool ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_strings[3] = {};

static const char ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_names[] =
  "SAFE_DISCONNECTION"
  "UNKNOWN_SAFE_DISCONNECTION_RESULT"
  "UNSAFE_DISCONNECTION";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries[] = {
  { {ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_names + 0, 18}, 1 },
  { {ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_names + 18, 33}, 0 },
  { {ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_names + 51, 20}, 2 },
};

static const int ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries_by_number[] = {
  1, // 0 -> UNKNOWN_SAFE_DISCONNECTION_RESULT
  0, // 1 -> SAFE_DISCONNECTION
  2, // 2 -> UNSAFE_DISCONNECTION
};

const std::string& ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_Name(
    ConnectionsLog_EstablishedConnection_SafeDisconnectionResult value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries,
          ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries_by_number,
          3, ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries,
      ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_strings[idx].get();
}
bool ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ConnectionsLog_EstablishedConnection_SafeDisconnectionResult* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<ConnectionsLog_EstablishedConnection_SafeDisconnectionResult>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr ConnectionsLog_EstablishedConnection_SafeDisconnectionResult ConnectionsLog_EstablishedConnection::UNKNOWN_SAFE_DISCONNECTION_RESULT;
constexpr ConnectionsLog_EstablishedConnection_SafeDisconnectionResult ConnectionsLog_EstablishedConnection::SAFE_DISCONNECTION;
constexpr ConnectionsLog_EstablishedConnection_SafeDisconnectionResult ConnectionsLog_EstablishedConnection::UNSAFE_DISCONNECTION;
constexpr ConnectionsLog_EstablishedConnection_SafeDisconnectionResult ConnectionsLog_EstablishedConnection::SafeDisconnectionResult_MIN;
constexpr ConnectionsLog_EstablishedConnection_SafeDisconnectionResult ConnectionsLog_EstablishedConnection::SafeDisconnectionResult_MAX;
constexpr int ConnectionsLog_EstablishedConnection::SafeDisconnectionResult_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class ConnectionsLog_ClientSession::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_ClientSession>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_connection_token(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

ConnectionsLog_ClientSession::ConnectionsLog_ClientSession(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  strategy_session_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
}
ConnectionsLog_ClientSession::ConnectionsLog_ClientSession(const ConnectionsLog_ClientSession& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      strategy_session_(from.strategy_session_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    connection_token_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_connection_token()) {
    connection_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_connection_token(), 
      GetArenaForAllocation());
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
}

inline void ConnectionsLog_ClientSession::SharedCtor() {
connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  connection_token_.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*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
}

ConnectionsLog_ClientSession::~ConnectionsLog_ClientSession() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

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

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

void ConnectionsLog_ClientSession::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

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

const char* ConnectionsLog_ClientSession::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.StrategySession strategy_session = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_strategy_session(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string connection_token = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_connection_token();
          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* ConnectionsLog_ClientSession::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.StrategySession strategy_session = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_strategy_session_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_strategy_session(i), target, stream);
  }

  // optional int64 client_flow_id = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_client_flow_id(), target);
  }

  // optional string connection_token = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        4, this->_internal_connection_token(), 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:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  return target;
}

size_t ConnectionsLog_ClientSession::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  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 .location.nearby.analytics.proto.ConnectionsLog.StrategySession strategy_session = 2;
  total_size += 1UL * this->_internal_strategy_session_size();
  for (const auto& msg : this->strategy_session_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string connection_token = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_connection_token());
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional int64 client_flow_id = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_ClientSession::MergeFrom(const ConnectionsLog_ClientSession& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  strategy_session_.MergeFrom(from.strategy_session_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_connection_token(from._internal_connection_token());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      client_flow_id_ = from.client_flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_ClientSession::CopyFrom(const ConnectionsLog_ClientSession& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.ClientSession)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_ClientSession::InternalSwap(ConnectionsLog_ClientSession* 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]);
  strategy_session_.InternalSwap(&other->strategy_session_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &connection_token_, lhs_arena,
      &other->connection_token_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_ClientSession, client_flow_id_)
      + sizeof(ConnectionsLog_ClientSession::client_flow_id_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_ClientSession, duration_millis_)>(
          reinterpret_cast<char*>(&duration_millis_),
          reinterpret_cast<char*>(&other->duration_millis_));
}

std::string ConnectionsLog_ClientSession::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.ClientSession";
}


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

class ConnectionsLog_StrategySession::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_StrategySession>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_strategy(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_build_version(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

ConnectionsLog_StrategySession::ConnectionsLog_StrategySession(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  role_(arena),
  discovery_phase_(arena),
  advertising_phase_(arena),
  connection_attempt_(arena),
  established_connection_(arena),
  upgrade_attempt_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
}
ConnectionsLog_StrategySession::ConnectionsLog_StrategySession(const ConnectionsLog_StrategySession& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      role_(from.role_),
      discovery_phase_(from.discovery_phase_),
      advertising_phase_(from.advertising_phase_),
      connection_attempt_(from.connection_attempt_),
      established_connection_(from.established_connection_),
      upgrade_attempt_(from.upgrade_attempt_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  build_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    build_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_build_version()) {
    build_version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_build_version(), 
      GetArenaForAllocation());
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&strategy_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(strategy_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
}

inline void ConnectionsLog_StrategySession::SharedCtor() {
build_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  build_version_.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*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&strategy_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(strategy_));
}

ConnectionsLog_StrategySession::~ConnectionsLog_StrategySession() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

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

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

void ConnectionsLog_StrategySession::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  role_.Clear();
  discovery_phase_.Clear();
  advertising_phase_.Clear();
  connection_attempt_.Clear();
  established_connection_.Clear();
  upgrade_attempt_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    build_version_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x00000006u) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&strategy_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(strategy_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_StrategySession::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionsStrategy strategy = 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(::location::nearby::proto::connections::ConnectionsStrategy_IsValid(val))) {
            _internal_set_strategy(static_cast<::location::nearby::proto::connections::ConnectionsStrategy>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.proto.connections.SessionRole role = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          ptr -= 1;
          do {
            ptr += 1;
            uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
            CHK_(ptr);
            if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::SessionRole_IsValid(val))) {
              _internal_add_role(static_cast<::location::nearby::proto::connections::SessionRole>(val));
            } else {
              ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
            }
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
        } else if (static_cast<uint8_t>(tag) == 26) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_role(), ptr, ctx, ::location::nearby::proto::connections::SessionRole_IsValid, &_internal_metadata_, 3);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase discovery_phase = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_discovery_phase(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase advertising_phase = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_advertising_phase(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt connection_attempt = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_connection_attempt(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection established_connection = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_established_connection(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt upgrade_attempt = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_upgrade_attempt(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional string build_version = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_build_version();
          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* ConnectionsLog_StrategySession::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionsStrategy strategy = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_strategy(), target);
  }

  // repeated .location.nearby.proto.connections.SessionRole role = 3;
  for (int i = 0, n = this->_internal_role_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        3, this->_internal_role(i), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase discovery_phase = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_discovery_phase_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_discovery_phase(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase advertising_phase = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_advertising_phase_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, this->_internal_advertising_phase(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt connection_attempt = 6;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_connection_attempt_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(6, this->_internal_connection_attempt(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection established_connection = 7;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_established_connection_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(7, this->_internal_established_connection(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt upgrade_attempt = 9;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_upgrade_attempt_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, this->_internal_upgrade_attempt(i), target, stream);
  }

  // optional string build_version = 10;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        10, this->_internal_build_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:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  return target;
}

size_t ConnectionsLog_StrategySession::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  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 .location.nearby.proto.connections.SessionRole role = 3;
  {
    size_t data_size = 0;
    unsigned int count = static_cast<unsigned int>(this->_internal_role_size());for (unsigned int i = 0; i < count; i++) {
      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
        this->_internal_role(static_cast<int>(i)));
    }
    total_size += (1UL * count) + data_size;
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase discovery_phase = 4;
  total_size += 1UL * this->_internal_discovery_phase_size();
  for (const auto& msg : this->discovery_phase_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase advertising_phase = 5;
  total_size += 1UL * this->_internal_advertising_phase_size();
  for (const auto& msg : this->advertising_phase_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt connection_attempt = 6;
  total_size += 1UL * this->_internal_connection_attempt_size();
  for (const auto& msg : this->connection_attempt_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection established_connection = 7;
  total_size += 1UL * this->_internal_established_connection_size();
  for (const auto& msg : this->established_connection_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt upgrade_attempt = 9;
  total_size += 1UL * this->_internal_upgrade_attempt_size();
  for (const auto& msg : this->upgrade_attempt_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string build_version = 10;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_build_version());
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional .location.nearby.proto.connections.ConnectionsStrategy strategy = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_strategy());
    }

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

void ConnectionsLog_StrategySession::MergeFrom(const ConnectionsLog_StrategySession& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  role_.MergeFrom(from.role_);
  discovery_phase_.MergeFrom(from.discovery_phase_);
  advertising_phase_.MergeFrom(from.advertising_phase_);
  connection_attempt_.MergeFrom(from.connection_attempt_);
  established_connection_.MergeFrom(from.established_connection_);
  upgrade_attempt_.MergeFrom(from.upgrade_attempt_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_build_version(from._internal_build_version());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      strategy_ = from.strategy_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_StrategySession::CopyFrom(const ConnectionsLog_StrategySession& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.StrategySession)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_StrategySession::InternalSwap(ConnectionsLog_StrategySession* 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]);
  role_.InternalSwap(&other->role_);
  discovery_phase_.InternalSwap(&other->discovery_phase_);
  advertising_phase_.InternalSwap(&other->advertising_phase_);
  connection_attempt_.InternalSwap(&other->connection_attempt_);
  established_connection_.InternalSwap(&other->established_connection_);
  upgrade_attempt_.InternalSwap(&other->upgrade_attempt_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &build_version_, lhs_arena,
      &other->build_version_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_StrategySession, strategy_)
      + sizeof(ConnectionsLog_StrategySession::strategy_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_StrategySession, duration_millis_)>(
          reinterpret_cast<char*>(&duration_millis_),
          reinterpret_cast<char*>(&other->duration_millis_));
}

std::string ConnectionsLog_StrategySession::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.StrategySession";
}


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

class ConnectionsLog_DiscoveryPhase::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_DiscoveryPhase>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata& discovery_metadata(const ConnectionsLog_DiscoveryPhase* msg);
  static void set_has_discovery_metadata(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata&
ConnectionsLog_DiscoveryPhase::_Internal::discovery_metadata(const ConnectionsLog_DiscoveryPhase* msg) {
  return *msg->discovery_metadata_;
}
ConnectionsLog_DiscoveryPhase::ConnectionsLog_DiscoveryPhase(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  medium_(arena),
  discovered_endpoint_(arena),
  sent_connection_request_(arena),
  uwb_ranging_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
}
ConnectionsLog_DiscoveryPhase::ConnectionsLog_DiscoveryPhase(const ConnectionsLog_DiscoveryPhase& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      medium_(from.medium_),
      discovered_endpoint_(from.discovered_endpoint_),
      sent_connection_request_(from.sent_connection_request_),
      uwb_ranging_(from.uwb_ranging_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_discovery_metadata()) {
    discovery_metadata_ = new ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata(*from.discovery_metadata_);
  } else {
    discovery_metadata_ = nullptr;
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
}

inline void ConnectionsLog_DiscoveryPhase::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&discovery_metadata_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&discovery_metadata_)) + sizeof(client_flow_id_));
}

ConnectionsLog_DiscoveryPhase::~ConnectionsLog_DiscoveryPhase() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_DiscoveryPhase::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete discovery_metadata_;
}

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

void ConnectionsLog_DiscoveryPhase::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  medium_.Clear();
  discovered_endpoint_.Clear();
  sent_connection_request_.Clear();
  uwb_ranging_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(discovery_metadata_ != nullptr);
    discovery_metadata_->Clear();
  }
  if (cached_has_bits & 0x00000006u) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&client_flow_id_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_DiscoveryPhase::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.proto.connections.Medium medium = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          ptr -= 1;
          do {
            ptr += 1;
            uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
            CHK_(ptr);
            if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
              _internal_add_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
            } else {
              ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
            }
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
        } else if (static_cast<uint8_t>(tag) == 18) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_medium(), ptr, ctx, ::location::nearby::proto::connections::Medium_IsValid, &_internal_metadata_, 2);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint discovered_endpoint = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_discovered_endpoint(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest sent_connection_request = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_sent_connection_request(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess uwb_ranging = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_uwb_ranging(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata discovery_metadata = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          ptr = ctx->ParseMessage(_internal_mutable_discovery_metadata(), 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* ConnectionsLog_DiscoveryPhase::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // repeated .location.nearby.proto.connections.Medium medium = 2;
  for (int i = 0, n = this->_internal_medium_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        2, this->_internal_medium(i), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint discovered_endpoint = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_discovered_endpoint_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_discovered_endpoint(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest sent_connection_request = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_sent_connection_request_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_sent_connection_request(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess uwb_ranging = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_uwb_ranging_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, this->_internal_uwb_ranging(i), target, stream);
  }

  // optional int64 client_flow_id = 6;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_client_flow_id(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata discovery_metadata = 7;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        7, _Internal::discovery_metadata(this), 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:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  return target;
}

size_t ConnectionsLog_DiscoveryPhase::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  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 .location.nearby.proto.connections.Medium medium = 2;
  {
    size_t data_size = 0;
    unsigned int count = static_cast<unsigned int>(this->_internal_medium_size());for (unsigned int i = 0; i < count; i++) {
      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
        this->_internal_medium(static_cast<int>(i)));
    }
    total_size += (1UL * count) + data_size;
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint discovered_endpoint = 3;
  total_size += 1UL * this->_internal_discovered_endpoint_size();
  for (const auto& msg : this->discovered_endpoint_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest sent_connection_request = 4;
  total_size += 1UL * this->_internal_sent_connection_request_size();
  for (const auto& msg : this->sent_connection_request_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess uwb_ranging = 5;
  total_size += 1UL * this->_internal_uwb_ranging_size();
  for (const auto& msg : this->uwb_ranging_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional .location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata discovery_metadata = 7;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *discovery_metadata_);
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional int64 client_flow_id = 6;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_DiscoveryPhase::MergeFrom(const ConnectionsLog_DiscoveryPhase& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  medium_.MergeFrom(from.medium_);
  discovered_endpoint_.MergeFrom(from.discovered_endpoint_);
  sent_connection_request_.MergeFrom(from.sent_connection_request_);
  uwb_ranging_.MergeFrom(from.uwb_ranging_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_discovery_metadata()->::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata::MergeFrom(from._internal_discovery_metadata());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      client_flow_id_ = from.client_flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_DiscoveryPhase::CopyFrom(const ConnectionsLog_DiscoveryPhase& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_DiscoveryPhase::InternalSwap(ConnectionsLog_DiscoveryPhase* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  medium_.InternalSwap(&other->medium_);
  discovered_endpoint_.InternalSwap(&other->discovered_endpoint_);
  sent_connection_request_.InternalSwap(&other->sent_connection_request_);
  uwb_ranging_.InternalSwap(&other->uwb_ranging_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_DiscoveryPhase, client_flow_id_)
      + sizeof(ConnectionsLog_DiscoveryPhase::client_flow_id_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_DiscoveryPhase, discovery_metadata_)>(
          reinterpret_cast<char*>(&discovery_metadata_),
          reinterpret_cast<char*>(&other->discovery_metadata_));
}

std::string ConnectionsLog_DiscoveryPhase::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.DiscoveryPhase";
}


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

class ConnectionsLog_DiscoveredEndpoint::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_DiscoveredEndpoint>()._has_bits_);
  static void set_has_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_latency_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

ConnectionsLog_DiscoveredEndpoint::ConnectionsLog_DiscoveredEndpoint(::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:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
}
ConnectionsLog_DiscoveredEndpoint::ConnectionsLog_DiscoveredEndpoint(const ConnectionsLog_DiscoveredEndpoint& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&latency_millis_, &from.latency_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&medium_) -
    reinterpret_cast<char*>(&latency_millis_)) + sizeof(medium_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
}

inline void ConnectionsLog_DiscoveredEndpoint::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&latency_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&medium_) -
    reinterpret_cast<char*>(&latency_millis_)) + sizeof(medium_));
}

ConnectionsLog_DiscoveredEndpoint::~ConnectionsLog_DiscoveredEndpoint() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_DiscoveredEndpoint::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_DiscoveredEndpoint::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  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 & 0x00000003u) {
    ::memset(&latency_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&medium_) -
        reinterpret_cast<char*>(&latency_millis_)) + sizeof(medium_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_DiscoveredEndpoint::_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 .location.nearby.proto.connections.Medium medium = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 latency_millis = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_latency_millis(&has_bits);
          latency_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* ConnectionsLog_DiscoveredEndpoint::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .location.nearby.proto.connections.Medium medium = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_medium(), target);
  }

  // optional int64 latency_millis = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_latency_millis(), 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:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  return target;
}

size_t ConnectionsLog_DiscoveredEndpoint::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  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 & 0x00000003u) {
    // optional int64 latency_millis = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_latency_millis());
    }

    // optional .location.nearby.proto.connections.Medium medium = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_medium());
    }

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

void ConnectionsLog_DiscoveredEndpoint::MergeFrom(const ConnectionsLog_DiscoveredEndpoint& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  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 & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      latency_millis_ = from.latency_millis_;
    }
    if (cached_has_bits & 0x00000002u) {
      medium_ = from.medium_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_DiscoveredEndpoint::CopyFrom(const ConnectionsLog_DiscoveredEndpoint& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_DiscoveredEndpoint::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.DiscoveredEndpoint";
}


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

class ConnectionsLog_UwbRangingProcess::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_UwbRangingProcess>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_number_of_ranging_data(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_distance_min(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_distance_max(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_distance_ave(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_distance_variance(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_azimuth_min(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_azimuth_max(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_azimuth_ave(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static void set_has_azimuth_variance(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
};

ConnectionsLog_UwbRangingProcess::ConnectionsLog_UwbRangingProcess(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  uwb_ranging_data_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
}
ConnectionsLog_UwbRangingProcess::ConnectionsLog_UwbRangingProcess(const ConnectionsLog_UwbRangingProcess& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      uwb_ranging_data_(from.uwb_ranging_data_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&azimuth_variance_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(azimuth_variance_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
}

inline void ConnectionsLog_UwbRangingProcess::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&azimuth_variance_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(azimuth_variance_));
}

ConnectionsLog_UwbRangingProcess::~ConnectionsLog_UwbRangingProcess() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_UwbRangingProcess::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_UwbRangingProcess::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  uwb_ranging_data_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&azimuth_max_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(azimuth_max_));
  }
  if (cached_has_bits & 0x00000300u) {
    ::memset(&azimuth_ave_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&azimuth_variance_) -
        reinterpret_cast<char*>(&azimuth_ave_)) + sizeof(azimuth_variance_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_UwbRangingProcess::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent uwb_ranging_data = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_uwb_ranging_data(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional int32 number_of_ranging_data = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_number_of_ranging_data(&has_bits);
          number_of_ranging_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 distance_min = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_distance_min(&has_bits);
          distance_min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 distance_max = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_distance_max(&has_bits);
          distance_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 distance_ave = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_distance_ave(&has_bits);
          distance_ave_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 distance_variance = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_distance_variance(&has_bits);
          distance_variance_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 azimuth_min = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_azimuth_min(&has_bits);
          azimuth_min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 azimuth_max = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _Internal::set_has_azimuth_max(&has_bits);
          azimuth_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 azimuth_ave = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          _Internal::set_has_azimuth_ave(&has_bits);
          azimuth_ave_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 azimuth_variance = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          _Internal::set_has_azimuth_variance(&has_bits);
          azimuth_variance_ = ::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* ConnectionsLog_UwbRangingProcess::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent uwb_ranging_data = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_uwb_ranging_data_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_uwb_ranging_data(i), target, stream);
  }

  // optional int32 number_of_ranging_data = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_number_of_ranging_data(), target);
  }

  // optional int32 distance_min = 4;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_distance_min(), target);
  }

  // optional int32 distance_max = 5;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_distance_max(), target);
  }

  // optional int32 distance_ave = 6;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_distance_ave(), target);
  }

  // optional int32 distance_variance = 7;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_distance_variance(), target);
  }

  // optional int32 azimuth_min = 8;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_azimuth_min(), target);
  }

  // optional int32 azimuth_max = 9;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_azimuth_max(), target);
  }

  // optional int32 azimuth_ave = 10;
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(10, this->_internal_azimuth_ave(), target);
  }

  // optional int32 azimuth_variance = 11;
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(11, this->_internal_azimuth_variance(), 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:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  return target;
}

size_t ConnectionsLog_UwbRangingProcess::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  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 .location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent uwb_ranging_data = 2;
  total_size += 1UL * this->_internal_uwb_ranging_data_size();
  for (const auto& msg : this->uwb_ranging_data_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

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

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

    // optional int32 distance_max = 5;
    if (cached_has_bits & 0x00000008u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_distance_max());
    }

    // optional int32 distance_ave = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_distance_ave());
    }

    // optional int32 distance_variance = 7;
    if (cached_has_bits & 0x00000020u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_distance_variance());
    }

    // optional int32 azimuth_min = 8;
    if (cached_has_bits & 0x00000040u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_azimuth_min());
    }

    // optional int32 azimuth_max = 9;
    if (cached_has_bits & 0x00000080u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_azimuth_max());
    }

  }
  if (cached_has_bits & 0x00000300u) {
    // optional int32 azimuth_ave = 10;
    if (cached_has_bits & 0x00000100u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_azimuth_ave());
    }

    // optional int32 azimuth_variance = 11;
    if (cached_has_bits & 0x00000200u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_azimuth_variance());
    }

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

void ConnectionsLog_UwbRangingProcess::MergeFrom(const ConnectionsLog_UwbRangingProcess& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  uwb_ranging_data_.MergeFrom(from.uwb_ranging_data_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000002u) {
      number_of_ranging_data_ = from.number_of_ranging_data_;
    }
    if (cached_has_bits & 0x00000004u) {
      distance_min_ = from.distance_min_;
    }
    if (cached_has_bits & 0x00000008u) {
      distance_max_ = from.distance_max_;
    }
    if (cached_has_bits & 0x00000010u) {
      distance_ave_ = from.distance_ave_;
    }
    if (cached_has_bits & 0x00000020u) {
      distance_variance_ = from.distance_variance_;
    }
    if (cached_has_bits & 0x00000040u) {
      azimuth_min_ = from.azimuth_min_;
    }
    if (cached_has_bits & 0x00000080u) {
      azimuth_max_ = from.azimuth_max_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00000300u) {
    if (cached_has_bits & 0x00000100u) {
      azimuth_ave_ = from.azimuth_ave_;
    }
    if (cached_has_bits & 0x00000200u) {
      azimuth_variance_ = from.azimuth_variance_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_UwbRangingProcess::CopyFrom(const ConnectionsLog_UwbRangingProcess& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_UwbRangingProcess::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.UwbRangingProcess";
}


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

class ConnectionsLog_RawUwbRangingEvent::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_RawUwbRangingEvent>()._has_bits_);
  static void set_has_distance(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_azimuth_angle(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_polar_angle(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

ConnectionsLog_RawUwbRangingEvent::ConnectionsLog_RawUwbRangingEvent(::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:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
}
ConnectionsLog_RawUwbRangingEvent::ConnectionsLog_RawUwbRangingEvent(const ConnectionsLog_RawUwbRangingEvent& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&distance_, &from.distance_,
    static_cast<size_t>(reinterpret_cast<char*>(&polar_angle_) -
    reinterpret_cast<char*>(&distance_)) + sizeof(polar_angle_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
}

inline void ConnectionsLog_RawUwbRangingEvent::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&distance_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&polar_angle_) -
    reinterpret_cast<char*>(&distance_)) + sizeof(polar_angle_));
}

ConnectionsLog_RawUwbRangingEvent::~ConnectionsLog_RawUwbRangingEvent() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_RawUwbRangingEvent::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_RawUwbRangingEvent::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  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) {
    ::memset(&distance_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&polar_angle_) -
        reinterpret_cast<char*>(&distance_)) + sizeof(polar_angle_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_RawUwbRangingEvent::_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 int32 distance = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_distance(&has_bits);
          distance_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 azimuth_angle = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_azimuth_angle(&has_bits);
          azimuth_angle_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 polar_angle = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_polar_angle(&has_bits);
          polar_angle_ = ::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* ConnectionsLog_RawUwbRangingEvent::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int32 distance = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_distance(), target);
  }

  // optional int32 azimuth_angle = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_azimuth_angle(), target);
  }

  // optional int32 polar_angle = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_polar_angle(), 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:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  return target;
}

size_t ConnectionsLog_RawUwbRangingEvent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  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 int32 distance = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_distance());
    }

    // optional int32 azimuth_angle = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_azimuth_angle());
    }

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

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

void ConnectionsLog_RawUwbRangingEvent::MergeFrom(const ConnectionsLog_RawUwbRangingEvent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  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) {
      distance_ = from.distance_;
    }
    if (cached_has_bits & 0x00000002u) {
      azimuth_angle_ = from.azimuth_angle_;
    }
    if (cached_has_bits & 0x00000004u) {
      polar_angle_ = from.polar_angle_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_RawUwbRangingEvent::CopyFrom(const ConnectionsLog_RawUwbRangingEvent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_RawUwbRangingEvent::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.RawUwbRangingEvent";
}


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

class ConnectionsLog_AdvertisingPhase::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_AdvertisingPhase>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata& advertising_metadata(const ConnectionsLog_AdvertisingPhase* msg);
  static void set_has_advertising_metadata(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata&
ConnectionsLog_AdvertisingPhase::_Internal::advertising_metadata(const ConnectionsLog_AdvertisingPhase* msg) {
  return *msg->advertising_metadata_;
}
ConnectionsLog_AdvertisingPhase::ConnectionsLog_AdvertisingPhase(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  medium_(arena),
  received_connection_request_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
}
ConnectionsLog_AdvertisingPhase::ConnectionsLog_AdvertisingPhase(const ConnectionsLog_AdvertisingPhase& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      medium_(from.medium_),
      received_connection_request_(from.received_connection_request_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_advertising_metadata()) {
    advertising_metadata_ = new ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata(*from.advertising_metadata_);
  } else {
    advertising_metadata_ = nullptr;
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
}

inline void ConnectionsLog_AdvertisingPhase::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&advertising_metadata_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&advertising_metadata_)) + sizeof(client_flow_id_));
}

ConnectionsLog_AdvertisingPhase::~ConnectionsLog_AdvertisingPhase() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_AdvertisingPhase::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete advertising_metadata_;
}

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

void ConnectionsLog_AdvertisingPhase::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  medium_.Clear();
  received_connection_request_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(advertising_metadata_ != nullptr);
    advertising_metadata_->Clear();
  }
  if (cached_has_bits & 0x00000006u) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&client_flow_id_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_AdvertisingPhase::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.proto.connections.Medium medium = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          ptr -= 1;
          do {
            ptr += 1;
            uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
            CHK_(ptr);
            if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
              _internal_add_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
            } else {
              ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
            }
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
        } else if (static_cast<uint8_t>(tag) == 18) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_medium(), ptr, ctx, ::location::nearby::proto::connections::Medium_IsValid, &_internal_metadata_, 2);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest received_connection_request = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_received_connection_request(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata advertising_metadata = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_advertising_metadata(), 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* ConnectionsLog_AdvertisingPhase::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // repeated .location.nearby.proto.connections.Medium medium = 2;
  for (int i = 0, n = this->_internal_medium_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        2, this->_internal_medium(i), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest received_connection_request = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_received_connection_request_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_received_connection_request(i), target, stream);
  }

  // optional int64 client_flow_id = 4;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->_internal_client_flow_id(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata advertising_metadata = 5;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        5, _Internal::advertising_metadata(this), 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:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  return target;
}

size_t ConnectionsLog_AdvertisingPhase::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  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 .location.nearby.proto.connections.Medium medium = 2;
  {
    size_t data_size = 0;
    unsigned int count = static_cast<unsigned int>(this->_internal_medium_size());for (unsigned int i = 0; i < count; i++) {
      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
        this->_internal_medium(static_cast<int>(i)));
    }
    total_size += (1UL * count) + data_size;
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest received_connection_request = 3;
  total_size += 1UL * this->_internal_received_connection_request_size();
  for (const auto& msg : this->received_connection_request_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional .location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata advertising_metadata = 5;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *advertising_metadata_);
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional int64 client_flow_id = 4;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_AdvertisingPhase::MergeFrom(const ConnectionsLog_AdvertisingPhase& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  medium_.MergeFrom(from.medium_);
  received_connection_request_.MergeFrom(from.received_connection_request_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_advertising_metadata()->::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata::MergeFrom(from._internal_advertising_metadata());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      client_flow_id_ = from.client_flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_AdvertisingPhase::CopyFrom(const ConnectionsLog_AdvertisingPhase& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_AdvertisingPhase::InternalSwap(ConnectionsLog_AdvertisingPhase* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  medium_.InternalSwap(&other->medium_);
  received_connection_request_.InternalSwap(&other->received_connection_request_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_AdvertisingPhase, client_flow_id_)
      + sizeof(ConnectionsLog_AdvertisingPhase::client_flow_id_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_AdvertisingPhase, advertising_metadata_)>(
          reinterpret_cast<char*>(&advertising_metadata_),
          reinterpret_cast<char*>(&other->advertising_metadata_));
}

std::string ConnectionsLog_AdvertisingPhase::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.AdvertisingPhase";
}


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

class ConnectionsLog_ConnectionRequest::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_ConnectionRequest>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_request_delay_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_local_response(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_remote_response(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

ConnectionsLog_ConnectionRequest::ConnectionsLog_ConnectionRequest(::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:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
}
ConnectionsLog_ConnectionRequest::ConnectionsLog_ConnectionRequest(const ConnectionsLog_ConnectionRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
}

inline void ConnectionsLog_ConnectionRequest::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
}

ConnectionsLog_ConnectionRequest::~ConnectionsLog_ConnectionRequest() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_ConnectionRequest::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_ConnectionRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  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 & 0x0000001fu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&client_flow_id_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_ConnectionRequest::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int64 request_delay_millis = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_request_delay_millis(&has_bits);
          request_delay_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionRequestResponse local_response = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionRequestResponse_IsValid(val))) {
            _internal_set_local_response(static_cast<::location::nearby::proto::connections::ConnectionRequestResponse>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionRequestResponse remote_response = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionRequestResponse_IsValid(val))) {
            _internal_set_remote_response(static_cast<::location::nearby::proto::connections::ConnectionRequestResponse>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* ConnectionsLog_ConnectionRequest::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // optional int64 request_delay_millis = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_request_delay_millis(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionRequestResponse local_response = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->_internal_local_response(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionRequestResponse remote_response = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_remote_response(), target);
  }

  // optional int64 client_flow_id = 5;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->_internal_client_flow_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:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  return target;
}

size_t ConnectionsLog_ConnectionRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  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 & 0x0000001fu) {
    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional int64 request_delay_millis = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_request_delay_millis());
    }

    // optional .location.nearby.proto.connections.ConnectionRequestResponse local_response = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_local_response());
    }

    // optional .location.nearby.proto.connections.ConnectionRequestResponse remote_response = 4;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_remote_response());
    }

    // optional int64 client_flow_id = 5;
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_ConnectionRequest::MergeFrom(const ConnectionsLog_ConnectionRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  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 & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000002u) {
      request_delay_millis_ = from.request_delay_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      local_response_ = from.local_response_;
    }
    if (cached_has_bits & 0x00000008u) {
      remote_response_ = from.remote_response_;
    }
    if (cached_has_bits & 0x00000010u) {
      client_flow_id_ = from.client_flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_ConnectionRequest::CopyFrom(const ConnectionsLog_ConnectionRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_ConnectionRequest::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.ConnectionRequest";
}


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

class ConnectionsLog_ConnectionAttempt::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_ConnectionAttempt>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_direction(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_attempt_result(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_connection_token(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata& connection_attempt_metadata(const ConnectionsLog_ConnectionAttempt* msg);
  static void set_has_connection_attempt_metadata(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata&
ConnectionsLog_ConnectionAttempt::_Internal::connection_attempt_metadata(const ConnectionsLog_ConnectionAttempt* msg) {
  return *msg->connection_attempt_metadata_;
}
ConnectionsLog_ConnectionAttempt::ConnectionsLog_ConnectionAttempt(::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:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
}
ConnectionsLog_ConnectionAttempt::ConnectionsLog_ConnectionAttempt(const ConnectionsLog_ConnectionAttempt& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    connection_token_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_connection_token()) {
    connection_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_connection_token(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_connection_attempt_metadata()) {
    connection_attempt_metadata_ = new ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata(*from.connection_attempt_metadata_);
  } else {
    connection_attempt_metadata_ = nullptr;
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
}

inline void ConnectionsLog_ConnectionAttempt::SharedCtor() {
connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  connection_token_.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*>(&connection_attempt_metadata_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&client_flow_id_) -
    reinterpret_cast<char*>(&connection_attempt_metadata_)) + sizeof(client_flow_id_));
}

ConnectionsLog_ConnectionAttempt::~ConnectionsLog_ConnectionAttempt() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_ConnectionAttempt::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  connection_token_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete connection_attempt_metadata_;
}

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

void ConnectionsLog_ConnectionAttempt::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  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 & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      connection_token_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(connection_attempt_metadata_ != nullptr);
      connection_attempt_metadata_->Clear();
    }
  }
  if (cached_has_bits & 0x000000fcu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&client_flow_id_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(client_flow_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_ConnectionAttempt::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionAttemptType 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(::location::nearby::proto::connections::ConnectionAttemptType_IsValid(val))) {
            _internal_set_type(static_cast<::location::nearby::proto::connections::ConnectionAttemptType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionAttemptDirection_IsValid(val))) {
            _internal_set_direction(static_cast<::location::nearby::proto::connections::ConnectionAttemptDirection>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.Medium medium = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionAttemptResult attempt_result = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionAttemptResult_IsValid(val))) {
            _internal_set_attempt_result(static_cast<::location::nearby::proto::connections::ConnectionAttemptResult>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string connection_token = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_connection_token();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata connection_attempt_metadata = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_connection_attempt_metadata(), 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* ConnectionsLog_ConnectionAttempt::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionAttemptType type = 2;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_type(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 3;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->_internal_direction(), target);
  }

  // optional .location.nearby.proto.connections.Medium medium = 4;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_medium(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionAttemptResult attempt_result = 5;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_attempt_result(), target);
  }

  // optional int64 client_flow_id = 6;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_client_flow_id(), target);
  }

  // optional string connection_token = 7;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        7, this->_internal_connection_token(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata connection_attempt_metadata = 8;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        8, _Internal::connection_attempt_metadata(this), 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:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  return target;
}

size_t ConnectionsLog_ConnectionAttempt::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  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 & 0x000000ffu) {
    // optional string connection_token = 7;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_connection_token());
    }

    // optional .location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata connection_attempt_metadata = 8;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *connection_attempt_metadata_);
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional .location.nearby.proto.connections.ConnectionAttemptType type = 2;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
    }

    // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 3;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_direction());
    }

    // optional .location.nearby.proto.connections.Medium medium = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_medium());
    }

    // optional .location.nearby.proto.connections.ConnectionAttemptResult attempt_result = 5;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_attempt_result());
    }

    // optional int64 client_flow_id = 6;
    if (cached_has_bits & 0x00000080u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_ConnectionAttempt::MergeFrom(const ConnectionsLog_ConnectionAttempt& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  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 & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_connection_token(from._internal_connection_token());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_connection_attempt_metadata()->::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata::MergeFrom(from._internal_connection_attempt_metadata());
    }
    if (cached_has_bits & 0x00000004u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000008u) {
      type_ = from.type_;
    }
    if (cached_has_bits & 0x00000010u) {
      direction_ = from.direction_;
    }
    if (cached_has_bits & 0x00000020u) {
      medium_ = from.medium_;
    }
    if (cached_has_bits & 0x00000040u) {
      attempt_result_ = from.attempt_result_;
    }
    if (cached_has_bits & 0x00000080u) {
      client_flow_id_ = from.client_flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_ConnectionAttempt::CopyFrom(const ConnectionsLog_ConnectionAttempt& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_ConnectionAttempt::InternalSwap(ConnectionsLog_ConnectionAttempt* 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(),
      &connection_token_, lhs_arena,
      &other->connection_token_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_ConnectionAttempt, client_flow_id_)
      + sizeof(ConnectionsLog_ConnectionAttempt::client_flow_id_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_ConnectionAttempt, connection_attempt_metadata_)>(
          reinterpret_cast<char*>(&connection_attempt_metadata_),
          reinterpret_cast<char*>(&other->connection_attempt_metadata_));
}

std::string ConnectionsLog_ConnectionAttempt::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.ConnectionAttempt";
}


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

class ConnectionsLog_EstablishedConnection::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_EstablishedConnection>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_disconnection_reason(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_connection_token(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_safe_disconnection_result(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
};

ConnectionsLog_EstablishedConnection::ConnectionsLog_EstablishedConnection(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  sent_payload_(arena),
  received_payload_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
}
ConnectionsLog_EstablishedConnection::ConnectionsLog_EstablishedConnection(const ConnectionsLog_EstablishedConnection& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      sent_payload_(from.sent_payload_),
      received_payload_(from.received_payload_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    connection_token_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_connection_token()) {
    connection_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_connection_token(), 
      GetArenaForAllocation());
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&safe_disconnection_result_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(safe_disconnection_result_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
}

inline void ConnectionsLog_EstablishedConnection::SharedCtor() {
connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  connection_token_.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*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&safe_disconnection_result_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(safe_disconnection_result_));
}

ConnectionsLog_EstablishedConnection::~ConnectionsLog_EstablishedConnection() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

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

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

void ConnectionsLog_EstablishedConnection::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  sent_payload_.Clear();
  received_payload_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    connection_token_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x0000007eu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&safe_disconnection_result_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(safe_disconnection_result_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_EstablishedConnection::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.Medium medium = 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(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.Payload sent_payload = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_sent_payload(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .location.nearby.analytics.proto.ConnectionsLog.Payload received_payload = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_received_payload(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.DisconnectionReason disconnection_reason = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::DisconnectionReason_IsValid(val))) {
            _internal_set_disconnection_reason(static_cast<::location::nearby::proto::connections::DisconnectionReason>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string connection_token = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_connection_token();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionAttemptType type = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionAttemptType_IsValid(val))) {
            _internal_set_type(static_cast<::location::nearby::proto::connections::ConnectionAttemptType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection.SafeDisconnectionResult safe_disconnection_result = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::analytics::proto::ConnectionsLog_EstablishedConnection_SafeDisconnectionResult_IsValid(val))) {
            _internal_set_safe_disconnection_result(static_cast<::location::nearby::analytics::proto::ConnectionsLog_EstablishedConnection_SafeDisconnectionResult>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
          }
        } 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* ConnectionsLog_EstablishedConnection::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // optional .location.nearby.proto.connections.Medium medium = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_medium(), target);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.Payload sent_payload = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_sent_payload_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_sent_payload(i), target, stream);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.Payload received_payload = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_received_payload_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_received_payload(i), target, stream);
  }

  // optional .location.nearby.proto.connections.DisconnectionReason disconnection_reason = 5;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_disconnection_reason(), target);
  }

  // optional int64 client_flow_id = 6;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_client_flow_id(), target);
  }

  // optional string connection_token = 7;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        7, this->_internal_connection_token(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionAttemptType type = 8;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      8, this->_internal_type(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection.SafeDisconnectionResult safe_disconnection_result = 9;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      9, this->_internal_safe_disconnection_result(), 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:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  return target;
}

size_t ConnectionsLog_EstablishedConnection::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  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 .location.nearby.analytics.proto.ConnectionsLog.Payload sent_payload = 3;
  total_size += 1UL * this->_internal_sent_payload_size();
  for (const auto& msg : this->sent_payload_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .location.nearby.analytics.proto.ConnectionsLog.Payload received_payload = 4;
  total_size += 1UL * this->_internal_received_payload_size();
  for (const auto& msg : this->received_payload_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    // optional string connection_token = 7;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_connection_token());
    }

    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional .location.nearby.proto.connections.Medium medium = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_medium());
    }

    // optional .location.nearby.proto.connections.DisconnectionReason disconnection_reason = 5;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_disconnection_reason());
    }

    // optional int64 client_flow_id = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_id());
    }

    // optional .location.nearby.proto.connections.ConnectionAttemptType type = 8;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
    }

    // optional .location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection.SafeDisconnectionResult safe_disconnection_result = 9;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_safe_disconnection_result());
    }

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

void ConnectionsLog_EstablishedConnection::MergeFrom(const ConnectionsLog_EstablishedConnection& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  sent_payload_.MergeFrom(from.sent_payload_);
  received_payload_.MergeFrom(from.received_payload_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_connection_token(from._internal_connection_token());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      medium_ = from.medium_;
    }
    if (cached_has_bits & 0x00000008u) {
      disconnection_reason_ = from.disconnection_reason_;
    }
    if (cached_has_bits & 0x00000010u) {
      client_flow_id_ = from.client_flow_id_;
    }
    if (cached_has_bits & 0x00000020u) {
      type_ = from.type_;
    }
    if (cached_has_bits & 0x00000040u) {
      safe_disconnection_result_ = from.safe_disconnection_result_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_EstablishedConnection::CopyFrom(const ConnectionsLog_EstablishedConnection& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_EstablishedConnection::InternalSwap(ConnectionsLog_EstablishedConnection* 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]);
  sent_payload_.InternalSwap(&other->sent_payload_);
  received_payload_.InternalSwap(&other->received_payload_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &connection_token_, lhs_arena,
      &other->connection_token_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_EstablishedConnection, safe_disconnection_result_)
      + sizeof(ConnectionsLog_EstablishedConnection::safe_disconnection_result_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_EstablishedConnection, duration_millis_)>(
          reinterpret_cast<char*>(&duration_millis_),
          reinterpret_cast<char*>(&other->duration_millis_));
}

std::string ConnectionsLog_EstablishedConnection::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.EstablishedConnection";
}


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

class ConnectionsLog_Payload::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_Payload>()._has_bits_);
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_total_size_bytes(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_num_bytes_transferred(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_num_chunks(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_status(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_num_successful_auto_resume(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
};

ConnectionsLog_Payload::ConnectionsLog_Payload(::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:location.nearby.analytics.proto.ConnectionsLog.Payload)
}
ConnectionsLog_Payload::ConnectionsLog_Payload(const ConnectionsLog_Payload& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&num_successful_auto_resume_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(num_successful_auto_resume_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.Payload)
}

inline void ConnectionsLog_Payload::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&num_successful_auto_resume_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(num_successful_auto_resume_));
}

ConnectionsLog_Payload::~ConnectionsLog_Payload() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.Payload)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_Payload::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_Payload::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.Payload)
  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 & 0x0000007fu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&num_successful_auto_resume_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(num_successful_auto_resume_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_Payload::_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 int64 duration_millis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.PayloadType 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(::location::nearby::proto::connections::PayloadType_IsValid(val))) {
            _internal_set_type(static_cast<::location::nearby::proto::connections::PayloadType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 total_size_bytes = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_total_size_bytes(&has_bits);
          total_size_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int64 num_bytes_transferred = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_num_bytes_transferred(&has_bits);
          num_bytes_transferred_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 num_chunks = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_num_chunks(&has_bits);
          num_chunks_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.PayloadStatus status = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::PayloadStatus_IsValid(val))) {
            _internal_set_status(static_cast<::location::nearby::proto::connections::PayloadStatus>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int32 num_successful_auto_resume = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_num_successful_auto_resume(&has_bits);
          num_successful_auto_resume_ = ::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* ConnectionsLog_Payload::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.Payload)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 duration_millis = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_duration_millis(), target);
  }

  // optional .location.nearby.proto.connections.PayloadType type = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_type(), target);
  }

  // optional int64 total_size_bytes = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_total_size_bytes(), target);
  }

  // optional int64 num_bytes_transferred = 4;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->_internal_num_bytes_transferred(), target);
  }

  // optional int32 num_chunks = 5;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_num_chunks(), target);
  }

  // optional .location.nearby.proto.connections.PayloadStatus status = 6;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      6, this->_internal_status(), target);
  }

  // optional int32 num_successful_auto_resume = 7;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_num_successful_auto_resume(), 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:location.nearby.analytics.proto.ConnectionsLog.Payload)
  return target;
}

size_t ConnectionsLog_Payload::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.Payload)
  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 & 0x0000007fu) {
    // optional int64 duration_millis = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional int64 total_size_bytes = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_total_size_bytes());
    }

    // optional .location.nearby.proto.connections.PayloadType type = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
    }

    // optional int32 num_chunks = 5;
    if (cached_has_bits & 0x00000008u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_chunks());
    }

    // optional int64 num_bytes_transferred = 4;
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_num_bytes_transferred());
    }

    // optional .location.nearby.proto.connections.PayloadStatus status = 6;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_status());
    }

    // optional int32 num_successful_auto_resume = 7;
    if (cached_has_bits & 0x00000040u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_successful_auto_resume());
    }

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

void ConnectionsLog_Payload::MergeFrom(const ConnectionsLog_Payload& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.Payload)
  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 & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000002u) {
      total_size_bytes_ = from.total_size_bytes_;
    }
    if (cached_has_bits & 0x00000004u) {
      type_ = from.type_;
    }
    if (cached_has_bits & 0x00000008u) {
      num_chunks_ = from.num_chunks_;
    }
    if (cached_has_bits & 0x00000010u) {
      num_bytes_transferred_ = from.num_bytes_transferred_;
    }
    if (cached_has_bits & 0x00000020u) {
      status_ = from.status_;
    }
    if (cached_has_bits & 0x00000040u) {
      num_successful_auto_resume_ = from.num_successful_auto_resume_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_Payload::CopyFrom(const ConnectionsLog_Payload& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.Payload)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_Payload::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.Payload";
}


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

class ConnectionsLog_BandwidthUpgradeAttempt::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_BandwidthUpgradeAttempt>()._has_bits_);
  static void set_has_direction(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_duration_millis(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_from_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_to_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_upgrade_result(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_error_stage(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_client_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_connection_token(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

ConnectionsLog_BandwidthUpgradeAttempt::ConnectionsLog_BandwidthUpgradeAttempt(::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:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
}
ConnectionsLog_BandwidthUpgradeAttempt::ConnectionsLog_BandwidthUpgradeAttempt(const ConnectionsLog_BandwidthUpgradeAttempt& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    connection_token_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_connection_token()) {
    connection_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_connection_token(), 
      GetArenaForAllocation());
  }
  ::memcpy(&duration_millis_, &from.duration_millis_,
    static_cast<size_t>(reinterpret_cast<char*>(&error_stage_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(error_stage_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
}

inline void ConnectionsLog_BandwidthUpgradeAttempt::SharedCtor() {
connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  connection_token_.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*>(&duration_millis_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&error_stage_) -
    reinterpret_cast<char*>(&duration_millis_)) + sizeof(error_stage_));
}

ConnectionsLog_BandwidthUpgradeAttempt::~ConnectionsLog_BandwidthUpgradeAttempt() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

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

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

void ConnectionsLog_BandwidthUpgradeAttempt::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  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) {
    connection_token_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x000000feu) {
    ::memset(&duration_millis_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&error_stage_) -
        reinterpret_cast<char*>(&duration_millis_)) + sizeof(error_stage_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_BandwidthUpgradeAttempt::_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 .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionAttemptDirection_IsValid(val))) {
            _internal_set_direction(static_cast<::location::nearby::proto::connections::ConnectionAttemptDirection>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 duration_millis = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_duration_millis(&has_bits);
          duration_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.Medium from_medium = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_from_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.Medium to_medium = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_to_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.BandwidthUpgradeResult upgrade_result = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::BandwidthUpgradeResult_IsValid(val))) {
            _internal_set_upgrade_result(static_cast<::location::nearby::proto::connections::BandwidthUpgradeResult>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.BandwidthUpgradeErrorStage error_stage = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::BandwidthUpgradeErrorStage_IsValid(val))) {
            _internal_set_error_stage(static_cast<::location::nearby::proto::connections::BandwidthUpgradeErrorStage>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 client_flow_id = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_client_flow_id(&has_bits);
          client_flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string connection_token = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          auto str = _internal_mutable_connection_token();
          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* ConnectionsLog_BandwidthUpgradeAttempt::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_direction(), target);
  }

  // optional int64 duration_millis = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_duration_millis(), target);
  }

  // optional .location.nearby.proto.connections.Medium from_medium = 3;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->_internal_from_medium(), target);
  }

  // optional .location.nearby.proto.connections.Medium to_medium = 4;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_to_medium(), target);
  }

  // optional .location.nearby.proto.connections.BandwidthUpgradeResult upgrade_result = 5;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_upgrade_result(), target);
  }

  // optional .location.nearby.proto.connections.BandwidthUpgradeErrorStage error_stage = 6;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      6, this->_internal_error_stage(), target);
  }

  // optional int64 client_flow_id = 7;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->_internal_client_flow_id(), target);
  }

  // optional string connection_token = 8;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        8, this->_internal_connection_token(), 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:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  return target;
}

size_t ConnectionsLog_BandwidthUpgradeAttempt::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  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 & 0x000000ffu) {
    // optional string connection_token = 8;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_connection_token());
    }

    // optional int64 duration_millis = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_duration_millis());
    }

    // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_direction());
    }

    // optional .location.nearby.proto.connections.Medium from_medium = 3;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_from_medium());
    }

    // optional .location.nearby.proto.connections.Medium to_medium = 4;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_to_medium());
    }

    // optional .location.nearby.proto.connections.BandwidthUpgradeResult upgrade_result = 5;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_upgrade_result());
    }

    // optional int64 client_flow_id = 7;
    if (cached_has_bits & 0x00000040u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_client_flow_id());
    }

    // optional .location.nearby.proto.connections.BandwidthUpgradeErrorStage error_stage = 6;
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_error_stage());
    }

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

void ConnectionsLog_BandwidthUpgradeAttempt::MergeFrom(const ConnectionsLog_BandwidthUpgradeAttempt& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  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 & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_connection_token(from._internal_connection_token());
    }
    if (cached_has_bits & 0x00000002u) {
      duration_millis_ = from.duration_millis_;
    }
    if (cached_has_bits & 0x00000004u) {
      direction_ = from.direction_;
    }
    if (cached_has_bits & 0x00000008u) {
      from_medium_ = from.from_medium_;
    }
    if (cached_has_bits & 0x00000010u) {
      to_medium_ = from.to_medium_;
    }
    if (cached_has_bits & 0x00000020u) {
      upgrade_result_ = from.upgrade_result_;
    }
    if (cached_has_bits & 0x00000040u) {
      client_flow_id_ = from.client_flow_id_;
    }
    if (cached_has_bits & 0x00000080u) {
      error_stage_ = from.error_stage_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_BandwidthUpgradeAttempt::CopyFrom(const ConnectionsLog_BandwidthUpgradeAttempt& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_BandwidthUpgradeAttempt::InternalSwap(ConnectionsLog_BandwidthUpgradeAttempt* 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(),
      &connection_token_, lhs_arena,
      &other->connection_token_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_BandwidthUpgradeAttempt, error_stage_)
      + sizeof(ConnectionsLog_BandwidthUpgradeAttempt::error_stage_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_BandwidthUpgradeAttempt, duration_millis_)>(
          reinterpret_cast<char*>(&duration_millis_),
          reinterpret_cast<char*>(&other->duration_millis_));
}

std::string ConnectionsLog_BandwidthUpgradeAttempt::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.BandwidthUpgradeAttempt";
}


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

class ConnectionsLog_ErrorCode::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_ErrorCode>()._has_bits_);
  static void set_has_direction(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_service_id(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_medium(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_event(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_description(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_flow_id(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_connection_token(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

ConnectionsLog_ErrorCode::ConnectionsLog_ErrorCode(::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:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
}
ConnectionsLog_ErrorCode::ConnectionsLog_ErrorCode(const ConnectionsLog_ErrorCode& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  service_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    service_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_service_id()) {
    service_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_service_id(), 
      GetArenaForAllocation());
  }
  connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    connection_token_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_connection_token()) {
    connection_token_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_connection_token(), 
      GetArenaForAllocation());
  }
  ::memcpy(&direction_, &from.direction_,
    static_cast<size_t>(reinterpret_cast<char*>(&flow_id_) -
    reinterpret_cast<char*>(&direction_)) + sizeof(flow_id_));
  clear_has_ErrorCodeDetail();
  switch (from.ErrorCodeDetail_case()) {
    case kCommonError: {
      _internal_set_common_error(from._internal_common_error());
      break;
    }
    case kStartAdvertisingError: {
      _internal_set_start_advertising_error(from._internal_start_advertising_error());
      break;
    }
    case kStartDiscoveringError: {
      _internal_set_start_discovering_error(from._internal_start_discovering_error());
      break;
    }
    case kStopAdvertisingError: {
      _internal_set_stop_advertising_error(from._internal_stop_advertising_error());
      break;
    }
    case kStopDiscoveringError: {
      _internal_set_stop_discovering_error(from._internal_stop_discovering_error());
      break;
    }
    case kStartListeningIncomingConnectionError: {
      _internal_set_start_listening_incoming_connection_error(from._internal_start_listening_incoming_connection_error());
      break;
    }
    case kStopListeningIncomingConnectionError: {
      _internal_set_stop_listening_incoming_connection_error(from._internal_stop_listening_incoming_connection_error());
      break;
    }
    case kConnectError: {
      _internal_set_connect_error(from._internal_connect_error());
      break;
    }
    case kDisconnectError: {
      _internal_set_disconnect_error(from._internal_disconnect_error());
      break;
    }
    case kSendPayloadError: {
      _internal_set_send_payload_error(from._internal_send_payload_error());
      break;
    }
    case kReceivePayloadError: {
      _internal_set_receive_payload_error(from._internal_receive_payload_error());
      break;
    }
    case kUpgradeError: {
      _internal_set_upgrade_error(from._internal_upgrade_error());
      break;
    }
    case kAcceptConnectionError: {
      _internal_set_accept_connection_error(from._internal_accept_connection_error());
      break;
    }
    case kRejectConnectionError: {
      _internal_set_reject_connection_error(from._internal_reject_connection_error());
      break;
    }
    case ERRORCODEDETAIL_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
}

inline void ConnectionsLog_ErrorCode::SharedCtor() {
service_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  service_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
connection_token_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  connection_token_.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*>(&direction_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&flow_id_) -
    reinterpret_cast<char*>(&direction_)) + sizeof(flow_id_));
clear_has_ErrorCodeDetail();
}

ConnectionsLog_ErrorCode::~ConnectionsLog_ErrorCode() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_ErrorCode::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  service_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  connection_token_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (has_ErrorCodeDetail()) {
    clear_ErrorCodeDetail();
  }
}

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

void ConnectionsLog_ErrorCode::clear_ErrorCodeDetail() {
// @@protoc_insertion_point(one_of_clear_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  switch (ErrorCodeDetail_case()) {
    case kCommonError: {
      // No need to clear
      break;
    }
    case kStartAdvertisingError: {
      // No need to clear
      break;
    }
    case kStartDiscoveringError: {
      // No need to clear
      break;
    }
    case kStopAdvertisingError: {
      // No need to clear
      break;
    }
    case kStopDiscoveringError: {
      // No need to clear
      break;
    }
    case kStartListeningIncomingConnectionError: {
      // No need to clear
      break;
    }
    case kStopListeningIncomingConnectionError: {
      // No need to clear
      break;
    }
    case kConnectError: {
      // No need to clear
      break;
    }
    case kDisconnectError: {
      // No need to clear
      break;
    }
    case kSendPayloadError: {
      // No need to clear
      break;
    }
    case kReceivePayloadError: {
      // No need to clear
      break;
    }
    case kUpgradeError: {
      // No need to clear
      break;
    }
    case kAcceptConnectionError: {
      // No need to clear
      break;
    }
    case kRejectConnectionError: {
      // No need to clear
      break;
    }
    case ERRORCODEDETAIL_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = ERRORCODEDETAIL_NOT_SET;
}


void ConnectionsLog_ErrorCode::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  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 & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      service_id_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      connection_token_.ClearNonDefaultToEmpty();
    }
  }
  if (cached_has_bits & 0x0000007cu) {
    ::memset(&direction_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&flow_id_) -
        reinterpret_cast<char*>(&direction_)) + sizeof(flow_id_));
  }
  clear_ErrorCodeDetail();
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_ErrorCode::_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 .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionAttemptDirection_IsValid(val))) {
            _internal_set_direction(static_cast<::location::nearby::proto::connections::ConnectionAttemptDirection>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional string service_id = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_service_id();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.Medium medium = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::Medium_IsValid(val))) {
            _internal_set_medium(static_cast<::location::nearby::proto::connections::Medium>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.errorcode.proto.Event event = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::Event_IsValid(val))) {
            _internal_set_event(static_cast<::location::nearby::errorcode::proto::Event>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.errorcode.proto.Description description = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::Description_IsValid(val))) {
            _internal_set_description(static_cast<::location::nearby::errorcode::proto::Description>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int64 flow_id = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_flow_id(&has_bits);
          flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.CommonError common_error = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::CommonError_IsValid(val))) {
            _internal_set_common_error(static_cast<::location::nearby::errorcode::proto::CommonError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StartAdvertisingError start_advertising_error = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StartAdvertisingError_IsValid(val))) {
            _internal_set_start_advertising_error(static_cast<::location::nearby::errorcode::proto::StartAdvertisingError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StartDiscoveringError start_discovering_error = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StartDiscoveringError_IsValid(val))) {
            _internal_set_start_discovering_error(static_cast<::location::nearby::errorcode::proto::StartDiscoveringError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StopAdvertisingError stop_advertising_error = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StopAdvertisingError_IsValid(val))) {
            _internal_set_stop_advertising_error(static_cast<::location::nearby::errorcode::proto::StopAdvertisingError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(10, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StopDiscoveringError stop_discovering_error = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StopDiscoveringError_IsValid(val))) {
            _internal_set_stop_discovering_error(static_cast<::location::nearby::errorcode::proto::StopDiscoveringError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StartListeningIncomingConnectionError start_listening_incoming_connection_error = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StartListeningIncomingConnectionError_IsValid(val))) {
            _internal_set_start_listening_incoming_connection_error(static_cast<::location::nearby::errorcode::proto::StartListeningIncomingConnectionError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(12, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.StopListeningIncomingConnectionError stop_listening_incoming_connection_error = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::StopListeningIncomingConnectionError_IsValid(val))) {
            _internal_set_stop_listening_incoming_connection_error(static_cast<::location::nearby::errorcode::proto::StopListeningIncomingConnectionError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(13, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.ConnectError connect_error = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::ConnectError_IsValid(val))) {
            _internal_set_connect_error(static_cast<::location::nearby::errorcode::proto::ConnectError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(14, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.DisconnectError disconnect_error = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::DisconnectError_IsValid(val))) {
            _internal_set_disconnect_error(static_cast<::location::nearby::errorcode::proto::DisconnectError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(15, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional string connection_token = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
          auto str = _internal_mutable_connection_token();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.SendPayloadError send_payload_error = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::SendPayloadError_IsValid(val))) {
            _internal_set_send_payload_error(static_cast<::location::nearby::errorcode::proto::SendPayloadError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(17, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.ReceivePayloadError receive_payload_error = 18;
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::ReceivePayloadError_IsValid(val))) {
            _internal_set_receive_payload_error(static_cast<::location::nearby::errorcode::proto::ReceivePayloadError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(18, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.UpgradeError upgrade_error = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::UpgradeError_IsValid(val))) {
            _internal_set_upgrade_error(static_cast<::location::nearby::errorcode::proto::UpgradeError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(19, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.AcceptConnectionError accept_connection_error = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::AcceptConnectionError_IsValid(val))) {
            _internal_set_accept_connection_error(static_cast<::location::nearby::errorcode::proto::AcceptConnectionError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(20, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // .location.nearby.errorcode.proto.RejectConnectionError reject_connection_error = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::errorcode::proto::RejectConnectionError_IsValid(val))) {
            _internal_set_reject_connection_error(static_cast<::location::nearby::errorcode::proto::RejectConnectionError>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(21, val, mutable_unknown_fields());
          }
        } 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* ConnectionsLog_ErrorCode::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_direction(), target);
  }

  // optional string service_id = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_service_id(), target);
  }

  // optional .location.nearby.proto.connections.Medium medium = 3;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->_internal_medium(), target);
  }

  // optional .location.nearby.errorcode.proto.Event event = 4;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_event(), target);
  }

  // optional .location.nearby.errorcode.proto.Description description = 5;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_description(), target);
  }

  // optional int64 flow_id = 6;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_flow_id(), target);
  }

  switch (ErrorCodeDetail_case()) {
    case kCommonError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        7, this->_internal_common_error(), target);
      break;
    }
    case kStartAdvertisingError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        8, this->_internal_start_advertising_error(), target);
      break;
    }
    case kStartDiscoveringError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        9, this->_internal_start_discovering_error(), target);
      break;
    }
    case kStopAdvertisingError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        10, this->_internal_stop_advertising_error(), target);
      break;
    }
    case kStopDiscoveringError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        11, this->_internal_stop_discovering_error(), target);
      break;
    }
    case kStartListeningIncomingConnectionError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        12, this->_internal_start_listening_incoming_connection_error(), target);
      break;
    }
    case kStopListeningIncomingConnectionError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        13, this->_internal_stop_listening_incoming_connection_error(), target);
      break;
    }
    case kConnectError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        14, this->_internal_connect_error(), target);
      break;
    }
    case kDisconnectError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        15, this->_internal_disconnect_error(), target);
      break;
    }
    default: ;
  }
  // optional string connection_token = 16;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        16, this->_internal_connection_token(), target);
  }

  switch (ErrorCodeDetail_case()) {
    case kSendPayloadError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        17, this->_internal_send_payload_error(), target);
      break;
    }
    case kReceivePayloadError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        18, this->_internal_receive_payload_error(), target);
      break;
    }
    case kUpgradeError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        19, this->_internal_upgrade_error(), target);
      break;
    }
    case kAcceptConnectionError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        20, this->_internal_accept_connection_error(), target);
      break;
    }
    case kRejectConnectionError: {
      target = stream->EnsureSpace(target);
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
        21, this->_internal_reject_connection_error(), target);
      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:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  return target;
}

size_t ConnectionsLog_ErrorCode::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  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 & 0x0000007fu) {
    // optional string service_id = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_service_id());
    }

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

    // optional .location.nearby.proto.connections.ConnectionAttemptDirection direction = 1;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_direction());
    }

    // optional .location.nearby.proto.connections.Medium medium = 3;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_medium());
    }

    // optional .location.nearby.errorcode.proto.Event event = 4;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_event());
    }

    // optional .location.nearby.errorcode.proto.Description description = 5;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_description());
    }

    // optional int64 flow_id = 6;
    if (cached_has_bits & 0x00000040u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_flow_id());
    }

  }
  switch (ErrorCodeDetail_case()) {
    // .location.nearby.errorcode.proto.CommonError common_error = 7;
    case kCommonError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_common_error());
      break;
    }
    // .location.nearby.errorcode.proto.StartAdvertisingError start_advertising_error = 8;
    case kStartAdvertisingError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_start_advertising_error());
      break;
    }
    // .location.nearby.errorcode.proto.StartDiscoveringError start_discovering_error = 9;
    case kStartDiscoveringError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_start_discovering_error());
      break;
    }
    // .location.nearby.errorcode.proto.StopAdvertisingError stop_advertising_error = 10;
    case kStopAdvertisingError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_stop_advertising_error());
      break;
    }
    // .location.nearby.errorcode.proto.StopDiscoveringError stop_discovering_error = 11;
    case kStopDiscoveringError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_stop_discovering_error());
      break;
    }
    // .location.nearby.errorcode.proto.StartListeningIncomingConnectionError start_listening_incoming_connection_error = 12;
    case kStartListeningIncomingConnectionError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_start_listening_incoming_connection_error());
      break;
    }
    // .location.nearby.errorcode.proto.StopListeningIncomingConnectionError stop_listening_incoming_connection_error = 13;
    case kStopListeningIncomingConnectionError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_stop_listening_incoming_connection_error());
      break;
    }
    // .location.nearby.errorcode.proto.ConnectError connect_error = 14;
    case kConnectError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_connect_error());
      break;
    }
    // .location.nearby.errorcode.proto.DisconnectError disconnect_error = 15;
    case kDisconnectError: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_disconnect_error());
      break;
    }
    // .location.nearby.errorcode.proto.SendPayloadError send_payload_error = 17;
    case kSendPayloadError: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_send_payload_error());
      break;
    }
    // .location.nearby.errorcode.proto.ReceivePayloadError receive_payload_error = 18;
    case kReceivePayloadError: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_receive_payload_error());
      break;
    }
    // .location.nearby.errorcode.proto.UpgradeError upgrade_error = 19;
    case kUpgradeError: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_upgrade_error());
      break;
    }
    // .location.nearby.errorcode.proto.AcceptConnectionError accept_connection_error = 20;
    case kAcceptConnectionError: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_accept_connection_error());
      break;
    }
    // .location.nearby.errorcode.proto.RejectConnectionError reject_connection_error = 21;
    case kRejectConnectionError: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_reject_connection_error());
      break;
    }
    case ERRORCODEDETAIL_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 = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

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

void ConnectionsLog_ErrorCode::MergeFrom(const ConnectionsLog_ErrorCode& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  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 & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_service_id(from._internal_service_id());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_connection_token(from._internal_connection_token());
    }
    if (cached_has_bits & 0x00000004u) {
      direction_ = from.direction_;
    }
    if (cached_has_bits & 0x00000008u) {
      medium_ = from.medium_;
    }
    if (cached_has_bits & 0x00000010u) {
      event_ = from.event_;
    }
    if (cached_has_bits & 0x00000020u) {
      description_ = from.description_;
    }
    if (cached_has_bits & 0x00000040u) {
      flow_id_ = from.flow_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  switch (from.ErrorCodeDetail_case()) {
    case kCommonError: {
      _internal_set_common_error(from._internal_common_error());
      break;
    }
    case kStartAdvertisingError: {
      _internal_set_start_advertising_error(from._internal_start_advertising_error());
      break;
    }
    case kStartDiscoveringError: {
      _internal_set_start_discovering_error(from._internal_start_discovering_error());
      break;
    }
    case kStopAdvertisingError: {
      _internal_set_stop_advertising_error(from._internal_stop_advertising_error());
      break;
    }
    case kStopDiscoveringError: {
      _internal_set_stop_discovering_error(from._internal_stop_discovering_error());
      break;
    }
    case kStartListeningIncomingConnectionError: {
      _internal_set_start_listening_incoming_connection_error(from._internal_start_listening_incoming_connection_error());
      break;
    }
    case kStopListeningIncomingConnectionError: {
      _internal_set_stop_listening_incoming_connection_error(from._internal_stop_listening_incoming_connection_error());
      break;
    }
    case kConnectError: {
      _internal_set_connect_error(from._internal_connect_error());
      break;
    }
    case kDisconnectError: {
      _internal_set_disconnect_error(from._internal_disconnect_error());
      break;
    }
    case kSendPayloadError: {
      _internal_set_send_payload_error(from._internal_send_payload_error());
      break;
    }
    case kReceivePayloadError: {
      _internal_set_receive_payload_error(from._internal_receive_payload_error());
      break;
    }
    case kUpgradeError: {
      _internal_set_upgrade_error(from._internal_upgrade_error());
      break;
    }
    case kAcceptConnectionError: {
      _internal_set_accept_connection_error(from._internal_accept_connection_error());
      break;
    }
    case kRejectConnectionError: {
      _internal_set_reject_connection_error(from._internal_reject_connection_error());
      break;
    }
    case ERRORCODEDETAIL_NOT_SET: {
      break;
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_ErrorCode::CopyFrom(const ConnectionsLog_ErrorCode& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.ErrorCode)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_ErrorCode::InternalSwap(ConnectionsLog_ErrorCode* 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(),
      &service_id_, lhs_arena,
      &other->service_id_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &connection_token_, lhs_arena,
      &other->connection_token_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_ErrorCode, flow_id_)
      + sizeof(ConnectionsLog_ErrorCode::flow_id_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_ErrorCode, direction_)>(
          reinterpret_cast<char*>(&direction_),
          reinterpret_cast<char*>(&other->direction_));
  swap(ErrorCodeDetail_, other->ErrorCodeDetail_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
}

std::string ConnectionsLog_ErrorCode::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.ErrorCode";
}


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

class ConnectionsLog_AdvertisingMetadata::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_AdvertisingMetadata>()._has_bits_);
  static void set_has_supports_extended_ble_advertisements(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_connected_ap_frequency(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_supports_nfc_technology(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_multiple_advertisement_supported(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_power_level(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_supports_dual_band(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

ConnectionsLog_AdvertisingMetadata::ConnectionsLog_AdvertisingMetadata(::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:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
}
ConnectionsLog_AdvertisingMetadata::ConnectionsLog_AdvertisingMetadata(const ConnectionsLog_AdvertisingMetadata& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&connected_ap_frequency_, &from.connected_ap_frequency_,
    static_cast<size_t>(reinterpret_cast<char*>(&power_level_) -
    reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(power_level_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
}

inline void ConnectionsLog_AdvertisingMetadata::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&connected_ap_frequency_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&supports_dual_band_) -
    reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(supports_dual_band_));
power_level_ = -1;
}

ConnectionsLog_AdvertisingMetadata::~ConnectionsLog_AdvertisingMetadata() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_AdvertisingMetadata::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_AdvertisingMetadata::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  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 & 0x0000003fu) {
    ::memset(&connected_ap_frequency_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&supports_dual_band_) -
        reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(supports_dual_band_));
    power_level_ = -1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_AdvertisingMetadata::_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 bool supports_extended_ble_advertisements = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_supports_extended_ble_advertisements(&has_bits);
          supports_extended_ble_advertisements_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 connected_ap_frequency = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_connected_ap_frequency(&has_bits);
          connected_ap_frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool supports_nfc_technology = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_supports_nfc_technology(&has_bits);
          supports_nfc_technology_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool multiple_advertisement_supported = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_multiple_advertisement_supported(&has_bits);
          multiple_advertisement_supported_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.PowerLevel power_level = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::PowerLevel_IsValid(val))) {
            _internal_set_power_level(static_cast<::location::nearby::proto::connections::PowerLevel>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional bool supports_dual_band = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_supports_dual_band(&has_bits);
          supports_dual_band_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* ConnectionsLog_AdvertisingMetadata::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional bool supports_extended_ble_advertisements = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_supports_extended_ble_advertisements(), target);
  }

  // optional int32 connected_ap_frequency = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_connected_ap_frequency(), target);
  }

  // optional bool supports_nfc_technology = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_supports_nfc_technology(), target);
  }

  // optional bool multiple_advertisement_supported = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_multiple_advertisement_supported(), target);
  }

  // optional .location.nearby.proto.connections.PowerLevel power_level = 5;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_power_level(), target);
  }

  // optional bool supports_dual_band = 6;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_supports_dual_band(), 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:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  return target;
}

size_t ConnectionsLog_AdvertisingMetadata::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  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 & 0x0000003fu) {
    // optional int32 connected_ap_frequency = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_connected_ap_frequency());
    }

    // optional bool supports_extended_ble_advertisements = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 + 1;
    }

    // optional bool supports_nfc_technology = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 + 1;
    }

    // optional bool multiple_advertisement_supported = 4;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 + 1;
    }

    // optional bool supports_dual_band = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

    // optional .location.nearby.proto.connections.PowerLevel power_level = 5;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_power_level());
    }

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

void ConnectionsLog_AdvertisingMetadata::MergeFrom(const ConnectionsLog_AdvertisingMetadata& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  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 & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      connected_ap_frequency_ = from.connected_ap_frequency_;
    }
    if (cached_has_bits & 0x00000002u) {
      supports_extended_ble_advertisements_ = from.supports_extended_ble_advertisements_;
    }
    if (cached_has_bits & 0x00000004u) {
      supports_nfc_technology_ = from.supports_nfc_technology_;
    }
    if (cached_has_bits & 0x00000008u) {
      multiple_advertisement_supported_ = from.multiple_advertisement_supported_;
    }
    if (cached_has_bits & 0x00000010u) {
      supports_dual_band_ = from.supports_dual_band_;
    }
    if (cached_has_bits & 0x00000020u) {
      power_level_ = from.power_level_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_AdvertisingMetadata::CopyFrom(const ConnectionsLog_AdvertisingMetadata& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_AdvertisingMetadata::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.AdvertisingMetadata";
}


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

class ConnectionsLog_DiscoveryMetadata::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_DiscoveryMetadata>()._has_bits_);
  static void set_has_supports_extended_ble_advertisements(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_connected_ap_frequency(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_supports_nfc_technology(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_power_level(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

ConnectionsLog_DiscoveryMetadata::ConnectionsLog_DiscoveryMetadata(::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:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
}
ConnectionsLog_DiscoveryMetadata::ConnectionsLog_DiscoveryMetadata(const ConnectionsLog_DiscoveryMetadata& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&connected_ap_frequency_, &from.connected_ap_frequency_,
    static_cast<size_t>(reinterpret_cast<char*>(&power_level_) -
    reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(power_level_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
}

inline void ConnectionsLog_DiscoveryMetadata::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&connected_ap_frequency_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&supports_nfc_technology_) -
    reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(supports_nfc_technology_));
power_level_ = -1;
}

ConnectionsLog_DiscoveryMetadata::~ConnectionsLog_DiscoveryMetadata() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_DiscoveryMetadata::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

void ConnectionsLog_DiscoveryMetadata::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  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) {
    ::memset(&connected_ap_frequency_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&supports_nfc_technology_) -
        reinterpret_cast<char*>(&connected_ap_frequency_)) + sizeof(supports_nfc_technology_));
    power_level_ = -1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_DiscoveryMetadata::_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 bool supports_extended_ble_advertisements = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_supports_extended_ble_advertisements(&has_bits);
          supports_extended_ble_advertisements_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 connected_ap_frequency = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_connected_ap_frequency(&has_bits);
          connected_ap_frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool supports_nfc_technology = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_supports_nfc_technology(&has_bits);
          supports_nfc_technology_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.PowerLevel power_level = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::PowerLevel_IsValid(val))) {
            _internal_set_power_level(static_cast<::location::nearby::proto::connections::PowerLevel>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } 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* ConnectionsLog_DiscoveryMetadata::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional bool supports_extended_ble_advertisements = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_supports_extended_ble_advertisements(), target);
  }

  // optional int32 connected_ap_frequency = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_connected_ap_frequency(), target);
  }

  // optional bool supports_nfc_technology = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_supports_nfc_technology(), target);
  }

  // optional .location.nearby.proto.connections.PowerLevel power_level = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_power_level(), 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:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  return target;
}

size_t ConnectionsLog_DiscoveryMetadata::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  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 int32 connected_ap_frequency = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_connected_ap_frequency());
    }

    // optional bool supports_extended_ble_advertisements = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 + 1;
    }

    // optional bool supports_nfc_technology = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 + 1;
    }

    // optional .location.nearby.proto.connections.PowerLevel power_level = 4;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_power_level());
    }

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

void ConnectionsLog_DiscoveryMetadata::MergeFrom(const ConnectionsLog_DiscoveryMetadata& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  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) {
      connected_ap_frequency_ = from.connected_ap_frequency_;
    }
    if (cached_has_bits & 0x00000002u) {
      supports_extended_ble_advertisements_ = from.supports_extended_ble_advertisements_;
    }
    if (cached_has_bits & 0x00000004u) {
      supports_nfc_technology_ = from.supports_nfc_technology_;
    }
    if (cached_has_bits & 0x00000008u) {
      power_level_ = from.power_level_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_DiscoveryMetadata::CopyFrom(const ConnectionsLog_DiscoveryMetadata& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

std::string ConnectionsLog_DiscoveryMetadata::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.DiscoveryMetadata";
}


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

class ConnectionsLog_ConnectionAttemptMetadata::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog_ConnectionAttemptMetadata>()._has_bits_);
  static void set_has_technology(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_band(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_frequency(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_network_operator(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_country_code(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_is_tdls_used(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_try_counts(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_wifi_hotspot_status(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static void set_has_max_tx_speed(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_max_rx_speed(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static void set_has_wifi_channel_width(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_send_buffer_size(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static void set_has_receive_buffer_size(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static void set_has_connected_ap_frequency(HasBits* has_bits) {
    (*has_bits)[0] |= 16384u;
  }
  static void set_has_is_mcc_mode(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
};

ConnectionsLog_ConnectionAttemptMetadata::ConnectionsLog_ConnectionAttemptMetadata(::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:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
}
ConnectionsLog_ConnectionAttemptMetadata::ConnectionsLog_ConnectionAttemptMetadata(const ConnectionsLog_ConnectionAttemptMetadata& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  network_operator_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    network_operator_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_network_operator()) {
    network_operator_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_network_operator(), 
      GetArenaForAllocation());
  }
  country_code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    country_code_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_country_code()) {
    country_code_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_country_code(), 
      GetArenaForAllocation());
  }
  ::memcpy(&technology_, &from.technology_,
    static_cast<size_t>(reinterpret_cast<char*>(&connected_ap_frequency_) -
    reinterpret_cast<char*>(&technology_)) + sizeof(connected_ap_frequency_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
}

inline void ConnectionsLog_ConnectionAttemptMetadata::SharedCtor() {
network_operator_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  network_operator_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
country_code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  country_code_.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*>(&technology_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&connected_ap_frequency_) -
    reinterpret_cast<char*>(&technology_)) + sizeof(connected_ap_frequency_));
}

ConnectionsLog_ConnectionAttemptMetadata::~ConnectionsLog_ConnectionAttemptMetadata() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog_ConnectionAttemptMetadata::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  network_operator_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  country_code_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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

void ConnectionsLog_ConnectionAttemptMetadata::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  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 & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      network_operator_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      country_code_.ClearNonDefaultToEmpty();
    }
  }
  if (cached_has_bits & 0x000000fcu) {
    ::memset(&technology_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&is_tdls_used_) -
        reinterpret_cast<char*>(&technology_)) + sizeof(is_tdls_used_));
  }
  if (cached_has_bits & 0x00007f00u) {
    ::memset(&wifi_hotspot_status_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&connected_ap_frequency_) -
        reinterpret_cast<char*>(&wifi_hotspot_status_)) + sizeof(connected_ap_frequency_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog_ConnectionAttemptMetadata::_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 .location.nearby.proto.connections.ConnectionTechnology technology = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::ConnectionTechnology_IsValid(val))) {
            _internal_set_technology(static_cast<::location::nearby::proto::connections::ConnectionTechnology>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.ConnectionBand band = 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(::location::nearby::proto::connections::ConnectionBand_IsValid(val))) {
            _internal_set_band(static_cast<::location::nearby::proto::connections::ConnectionBand>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int32 frequency = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_frequency(&has_bits);
          frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string network_operator = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_network_operator();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string country_code = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_country_code();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool is_tdls_used = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_is_tdls_used(&has_bits);
          is_tdls_used_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 try_counts = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_try_counts(&has_bits);
          try_counts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool wifi_hotspot_status = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_wifi_hotspot_status(&has_bits);
          wifi_hotspot_status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_tx_speed = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _Internal::set_has_max_tx_speed(&has_bits);
          max_tx_speed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_rx_speed = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          _Internal::set_has_max_rx_speed(&has_bits);
          max_rx_speed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 wifi_channel_width = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          _Internal::set_has_wifi_channel_width(&has_bits);
          wifi_channel_width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 send_buffer_size = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          _Internal::set_has_send_buffer_size(&has_bits);
          send_buffer_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 receive_buffer_size = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
          _Internal::set_has_receive_buffer_size(&has_bits);
          receive_buffer_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 connected_ap_frequency = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
          _Internal::set_has_connected_ap_frequency(&has_bits);
          connected_ap_frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool is_mcc_mode = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
          _Internal::set_has_is_mcc_mode(&has_bits);
          is_mcc_mode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* ConnectionsLog_ConnectionAttemptMetadata::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .location.nearby.proto.connections.ConnectionTechnology technology = 1;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_technology(), target);
  }

  // optional .location.nearby.proto.connections.ConnectionBand band = 2;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_band(), target);
  }

  // optional int32 frequency = 3;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_frequency(), target);
  }

  // optional string network_operator = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        4, this->_internal_network_operator(), target);
  }

  // optional string country_code = 5;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        5, this->_internal_country_code(), target);
  }

  // optional bool is_tdls_used = 6;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_is_tdls_used(), target);
  }

  // optional int32 try_counts = 7;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_try_counts(), target);
  }

  // optional bool wifi_hotspot_status = 8;
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_wifi_hotspot_status(), target);
  }

  // optional int32 max_tx_speed = 9;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_max_tx_speed(), target);
  }

  // optional int32 max_rx_speed = 10;
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(10, this->_internal_max_rx_speed(), target);
  }

  // optional int32 wifi_channel_width = 11;
  if (cached_has_bits & 0x00000800u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(11, this->_internal_wifi_channel_width(), target);
  }

  // optional int32 send_buffer_size = 12;
  if (cached_has_bits & 0x00001000u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(12, this->_internal_send_buffer_size(), target);
  }

  // optional int32 receive_buffer_size = 13;
  if (cached_has_bits & 0x00002000u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(13, this->_internal_receive_buffer_size(), target);
  }

  // optional int32 connected_ap_frequency = 14;
  if (cached_has_bits & 0x00004000u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(14, this->_internal_connected_ap_frequency(), target);
  }

  // optional bool is_mcc_mode = 15;
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(15, this->_internal_is_mcc_mode(), 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:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  return target;
}

size_t ConnectionsLog_ConnectionAttemptMetadata::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  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 & 0x000000ffu) {
    // optional string network_operator = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_network_operator());
    }

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

    // optional .location.nearby.proto.connections.ConnectionTechnology technology = 1;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_technology());
    }

    // optional .location.nearby.proto.connections.ConnectionBand band = 2;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_band());
    }

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

    // optional int32 try_counts = 7;
    if (cached_has_bits & 0x00000020u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_try_counts());
    }

    // optional int32 max_tx_speed = 9;
    if (cached_has_bits & 0x00000040u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_tx_speed());
    }

    // optional bool is_tdls_used = 6;
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 + 1;
    }

  }
  if (cached_has_bits & 0x00007f00u) {
    // optional bool wifi_hotspot_status = 8;
    if (cached_has_bits & 0x00000100u) {
      total_size += 1 + 1;
    }

    // optional bool is_mcc_mode = 15;
    if (cached_has_bits & 0x00000200u) {
      total_size += 1 + 1;
    }

    // optional int32 max_rx_speed = 10;
    if (cached_has_bits & 0x00000400u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_rx_speed());
    }

    // optional int32 wifi_channel_width = 11;
    if (cached_has_bits & 0x00000800u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_wifi_channel_width());
    }

    // optional int32 send_buffer_size = 12;
    if (cached_has_bits & 0x00001000u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_send_buffer_size());
    }

    // optional int32 receive_buffer_size = 13;
    if (cached_has_bits & 0x00002000u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_receive_buffer_size());
    }

    // optional int32 connected_ap_frequency = 14;
    if (cached_has_bits & 0x00004000u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_connected_ap_frequency());
    }

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

void ConnectionsLog_ConnectionAttemptMetadata::MergeFrom(const ConnectionsLog_ConnectionAttemptMetadata& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  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 & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_network_operator(from._internal_network_operator());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_country_code(from._internal_country_code());
    }
    if (cached_has_bits & 0x00000004u) {
      technology_ = from.technology_;
    }
    if (cached_has_bits & 0x00000008u) {
      band_ = from.band_;
    }
    if (cached_has_bits & 0x00000010u) {
      frequency_ = from.frequency_;
    }
    if (cached_has_bits & 0x00000020u) {
      try_counts_ = from.try_counts_;
    }
    if (cached_has_bits & 0x00000040u) {
      max_tx_speed_ = from.max_tx_speed_;
    }
    if (cached_has_bits & 0x00000080u) {
      is_tdls_used_ = from.is_tdls_used_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00007f00u) {
    if (cached_has_bits & 0x00000100u) {
      wifi_hotspot_status_ = from.wifi_hotspot_status_;
    }
    if (cached_has_bits & 0x00000200u) {
      is_mcc_mode_ = from.is_mcc_mode_;
    }
    if (cached_has_bits & 0x00000400u) {
      max_rx_speed_ = from.max_rx_speed_;
    }
    if (cached_has_bits & 0x00000800u) {
      wifi_channel_width_ = from.wifi_channel_width_;
    }
    if (cached_has_bits & 0x00001000u) {
      send_buffer_size_ = from.send_buffer_size_;
    }
    if (cached_has_bits & 0x00002000u) {
      receive_buffer_size_ = from.receive_buffer_size_;
    }
    if (cached_has_bits & 0x00004000u) {
      connected_ap_frequency_ = from.connected_ap_frequency_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog_ConnectionAttemptMetadata::CopyFrom(const ConnectionsLog_ConnectionAttemptMetadata& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog_ConnectionAttemptMetadata::InternalSwap(ConnectionsLog_ConnectionAttemptMetadata* 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(),
      &network_operator_, lhs_arena,
      &other->network_operator_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &country_code_, lhs_arena,
      &other->country_code_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog_ConnectionAttemptMetadata, connected_ap_frequency_)
      + sizeof(ConnectionsLog_ConnectionAttemptMetadata::connected_ap_frequency_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog_ConnectionAttemptMetadata, technology_)>(
          reinterpret_cast<char*>(&technology_),
          reinterpret_cast<char*>(&other->technology_));
}

std::string ConnectionsLog_ConnectionAttemptMetadata::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog.ConnectionAttemptMetadata";
}


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

class ConnectionsLog::_Internal {
 public:
  using HasBits = decltype(std::declval<ConnectionsLog>()._has_bits_);
  static void set_has_event_type(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static const ::location::nearby::analytics::proto::ConnectionsLog_ClientSession& client_session(const ConnectionsLog* msg);
  static void set_has_client_session(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode& error_code(const ConnectionsLog* msg);
  static void set_has_error_code(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_log_source(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_files_migration_phase(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::location::nearby::analytics::proto::ConnectionsLog_ClientSession&
ConnectionsLog::_Internal::client_session(const ConnectionsLog* msg) {
  return *msg->client_session_;
}
const ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode&
ConnectionsLog::_Internal::error_code(const ConnectionsLog* msg) {
  return *msg->error_code_;
}
ConnectionsLog::ConnectionsLog(::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:location.nearby.analytics.proto.ConnectionsLog)
}
ConnectionsLog::ConnectionsLog(const ConnectionsLog& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_version()) {
    version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_version(), 
      GetArenaForAllocation());
  }
  files_migration_phase_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    files_migration_phase_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_files_migration_phase()) {
    files_migration_phase_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_files_migration_phase(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_client_session()) {
    client_session_ = new ::location::nearby::analytics::proto::ConnectionsLog_ClientSession(*from.client_session_);
  } else {
    client_session_ = nullptr;
  }
  if (from._internal_has_error_code()) {
    error_code_ = new ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode(*from.error_code_);
  } else {
    error_code_ = nullptr;
  }
  ::memcpy(&event_type_, &from.event_type_,
    static_cast<size_t>(reinterpret_cast<char*>(&log_source_) -
    reinterpret_cast<char*>(&event_type_)) + sizeof(log_source_));
  // @@protoc_insertion_point(copy_constructor:location.nearby.analytics.proto.ConnectionsLog)
}

inline void ConnectionsLog::SharedCtor() {
version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
files_migration_phase_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  files_migration_phase_.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*>(&client_session_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&log_source_) -
    reinterpret_cast<char*>(&client_session_)) + sizeof(log_source_));
}

ConnectionsLog::~ConnectionsLog() {
  // @@protoc_insertion_point(destructor:location.nearby.analytics.proto.ConnectionsLog)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void ConnectionsLog::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  files_migration_phase_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete client_session_;
  if (this != internal_default_instance()) delete error_code_;
}

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

void ConnectionsLog::Clear() {
// @@protoc_insertion_point(message_clear_start:location.nearby.analytics.proto.ConnectionsLog)
  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) {
      version_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      files_migration_phase_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(client_session_ != nullptr);
      client_session_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(error_code_ != nullptr);
      error_code_->Clear();
    }
  }
  if (cached_has_bits & 0x00000030u) {
    ::memset(&event_type_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&log_source_) -
        reinterpret_cast<char*>(&event_type_)) + sizeof(log_source_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ConnectionsLog::_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 .location.nearby.proto.connections.EventType event_type = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::EventType_IsValid(val))) {
            _internal_set_event_type(static_cast<::location::nearby::proto::connections::EventType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.ClientSession client_session = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_client_session(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string version = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_version();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.analytics.proto.ConnectionsLog.ErrorCode error_code = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_error_code(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .location.nearby.proto.connections.LogSource log_source = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::location::nearby::proto::connections::LogSource_IsValid(val))) {
            _internal_set_log_source(static_cast<::location::nearby::proto::connections::LogSource>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional string files_migration_phase = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_files_migration_phase();
          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* ConnectionsLog::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:location.nearby.analytics.proto.ConnectionsLog)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .location.nearby.proto.connections.EventType event_type = 1;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_event_type(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.ClientSession client_session = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::client_session(this), target, stream);
  }

  // optional string version = 3;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        3, this->_internal_version(), target);
  }

  // optional .location.nearby.analytics.proto.ConnectionsLog.ErrorCode error_code = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        4, _Internal::error_code(this), target, stream);
  }

  // optional .location.nearby.proto.connections.LogSource log_source = 5;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->_internal_log_source(), target);
  }

  // optional string files_migration_phase = 6;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        6, this->_internal_files_migration_phase(), 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:location.nearby.analytics.proto.ConnectionsLog)
  return target;
}

size_t ConnectionsLog::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:location.nearby.analytics.proto.ConnectionsLog)
  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 & 0x0000003fu) {
    // optional string version = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_version());
    }

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

    // optional .location.nearby.analytics.proto.ConnectionsLog.ClientSession client_session = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *client_session_);
    }

    // optional .location.nearby.analytics.proto.ConnectionsLog.ErrorCode error_code = 4;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *error_code_);
    }

    // optional .location.nearby.proto.connections.EventType event_type = 1;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_event_type());
    }

    // optional .location.nearby.proto.connections.LogSource log_source = 5;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_log_source());
    }

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

void ConnectionsLog::MergeFrom(const ConnectionsLog& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:location.nearby.analytics.proto.ConnectionsLog)
  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 & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_version(from._internal_version());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_files_migration_phase(from._internal_files_migration_phase());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_mutable_client_session()->::location::nearby::analytics::proto::ConnectionsLog_ClientSession::MergeFrom(from._internal_client_session());
    }
    if (cached_has_bits & 0x00000008u) {
      _internal_mutable_error_code()->::location::nearby::analytics::proto::ConnectionsLog_ErrorCode::MergeFrom(from._internal_error_code());
    }
    if (cached_has_bits & 0x00000010u) {
      event_type_ = from.event_type_;
    }
    if (cached_has_bits & 0x00000020u) {
      log_source_ = from.log_source_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void ConnectionsLog::CopyFrom(const ConnectionsLog& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:location.nearby.analytics.proto.ConnectionsLog)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void ConnectionsLog::InternalSwap(ConnectionsLog* 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(),
      &version_, lhs_arena,
      &other->version_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &files_migration_phase_, lhs_arena,
      &other->files_migration_phase_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ConnectionsLog, log_source_)
      + sizeof(ConnectionsLog::log_source_)
      - PROTOBUF_FIELD_OFFSET(ConnectionsLog, client_session_)>(
          reinterpret_cast<char*>(&client_session_),
          reinterpret_cast<char*>(&other->client_session_));
}

std::string ConnectionsLog::GetTypeName() const {
  return "location.nearby.analytics.proto.ConnectionsLog";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace proto
}  // namespace analytics
}  // namespace nearby
}  // namespace location
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_ClientSession* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_ClientSession >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_ClientSession >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_StrategySession* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_StrategySession >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_StrategySession >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryPhase* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryPhase >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryPhase >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_DiscoveredEndpoint* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveredEndpoint >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveredEndpoint >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_UwbRangingProcess* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_UwbRangingProcess >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_UwbRangingProcess >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_RawUwbRangingEvent* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_RawUwbRangingEvent >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_RawUwbRangingEvent >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingPhase* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingPhase >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingPhase >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_ConnectionRequest* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttempt* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttempt >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttempt >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_EstablishedConnection* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_EstablishedConnection >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_EstablishedConnection >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_Payload* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_Payload >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_Payload >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_BandwidthUpgradeAttempt* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_BandwidthUpgradeAttempt >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_BandwidthUpgradeAttempt >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_ErrorCode >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_AdvertisingMetadata >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_DiscoveryMetadata >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog_ConnectionAttemptMetadata >(arena);
}
template<> PROTOBUF_NOINLINE ::location::nearby::analytics::proto::ConnectionsLog* Arena::CreateMaybeMessage< ::location::nearby::analytics::proto::ConnectionsLog >(Arena* arena) {
  return Arena::CreateMessageInternal< ::location::nearby::analytics::proto::ConnectionsLog >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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