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

#include "mysqlx_connection.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/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace Mysqlx {
namespace Connection {
PROTOBUF_CONSTEXPR Capability::Capability(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.value_)*/nullptr} {}
struct CapabilityDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CapabilityDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CapabilityDefaultTypeInternal() {}
  union {
    Capability _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CapabilityDefaultTypeInternal _Capability_default_instance_;
PROTOBUF_CONSTEXPR Capabilities::Capabilities(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.capabilities_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct CapabilitiesDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CapabilitiesDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CapabilitiesDefaultTypeInternal() {}
  union {
    Capabilities _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CapabilitiesDefaultTypeInternal _Capabilities_default_instance_;
PROTOBUF_CONSTEXPR CapabilitiesGet::CapabilitiesGet(
    ::_pbi::ConstantInitialized) {}
struct CapabilitiesGetDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CapabilitiesGetDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CapabilitiesGetDefaultTypeInternal() {}
  union {
    CapabilitiesGet _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CapabilitiesGetDefaultTypeInternal _CapabilitiesGet_default_instance_;
PROTOBUF_CONSTEXPR CapabilitiesSet::CapabilitiesSet(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.capabilities_)*/nullptr} {}
struct CapabilitiesSetDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CapabilitiesSetDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CapabilitiesSetDefaultTypeInternal() {}
  union {
    CapabilitiesSet _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CapabilitiesSetDefaultTypeInternal _CapabilitiesSet_default_instance_;
PROTOBUF_CONSTEXPR Close::Close(
    ::_pbi::ConstantInitialized) {}
struct CloseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CloseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CloseDefaultTypeInternal() {}
  union {
    Close _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CloseDefaultTypeInternal _Close_default_instance_;
PROTOBUF_CONSTEXPR Compression::Compression(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.payload_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.uncompressed_size_)*/uint64_t{0u}
  , /*decltype(_impl_.server_messages_)*/0
  , /*decltype(_impl_.client_messages_)*/1} {}
struct CompressionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CompressionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CompressionDefaultTypeInternal() {}
  union {
    Compression _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompressionDefaultTypeInternal _Compression_default_instance_;
}  // namespace Connection
}  // namespace Mysqlx
static ::_pb::Metadata file_level_metadata_mysqlx_5fconnection_2eproto[6];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_mysqlx_5fconnection_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_mysqlx_5fconnection_2eproto = nullptr;

const uint32_t TableStruct_mysqlx_5fconnection_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capability, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capability, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capability, _impl_.name_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capability, _impl_.value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capabilities, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Capabilities, _impl_.capabilities_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::CapabilitiesGet, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::CapabilitiesSet, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::CapabilitiesSet, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::CapabilitiesSet, _impl_.capabilities_),
  0,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Close, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _impl_.uncompressed_size_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _impl_.server_messages_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _impl_.client_messages_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Connection::Compression, _impl_.payload_),
  1,
  2,
  3,
  0,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::Mysqlx::Connection::Capability)},
  { 10, -1, -1, sizeof(::Mysqlx::Connection::Capabilities)},
  { 17, -1, -1, sizeof(::Mysqlx::Connection::CapabilitiesGet)},
  { 23, 30, -1, sizeof(::Mysqlx::Connection::CapabilitiesSet)},
  { 31, -1, -1, sizeof(::Mysqlx::Connection::Close)},
  { 37, 47, -1, sizeof(::Mysqlx::Connection::Compression)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::Mysqlx::Connection::_Capability_default_instance_._instance,
  &::Mysqlx::Connection::_Capabilities_default_instance_._instance,
  &::Mysqlx::Connection::_CapabilitiesGet_default_instance_._instance,
  &::Mysqlx::Connection::_CapabilitiesSet_default_instance_._instance,
  &::Mysqlx::Connection::_Close_default_instance_._instance,
  &::Mysqlx::Connection::_Compression_default_instance_._instance,
};

const char descriptor_table_protodef_mysqlx_5fconnection_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\027mysqlx_connection.proto\022\021Mysqlx.Connec"
  "tion\032\026mysqlx_datatypes.proto\032\014mysqlx.pro"
  "to\"@\n\nCapability\022\014\n\004name\030\001 \002(\t\022$\n\005value\030"
  "\002 \002(\0132\025.Mysqlx.Datatypes.Any\"I\n\014Capabili"
  "ties\0223\n\014capabilities\030\001 \003(\0132\035.Mysqlx.Conn"
  "ection.Capability:\004\220\3520\002\"\027\n\017CapabilitiesG"
  "et:\004\210\3520\001\"N\n\017CapabilitiesSet\0225\n\014capabilit"
  "ies\030\001 \002(\0132\037.Mysqlx.Connection.Capabiliti"
  "es:\004\210\3520\002\"\r\n\005Close:\004\210\3520\003\"\257\001\n\013Compression\022"
  "\031\n\021uncompressed_size\030\001 \001(\004\0224\n\017server_mes"
  "sages\030\002 \001(\0162\033.Mysqlx.ServerMessages.Type"
  "\0224\n\017client_messages\030\003 \001(\0162\033.Mysqlx.Clien"
  "tMessages.Type\022\017\n\007payload\030\004 \002(\014:\010\220\3520\023\210\3520"
  ".B\031\n\027com.mysql.cj.x.protobuf"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_mysqlx_5fconnection_2eproto_deps[2] = {
  &::descriptor_table_mysqlx_2eproto,
  &::descriptor_table_mysqlx_5fdatatypes_2eproto,
};
static ::_pbi::once_flag descriptor_table_mysqlx_5fconnection_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_mysqlx_5fconnection_2eproto = {
    false, false, 548, descriptor_table_protodef_mysqlx_5fconnection_2eproto,
    "mysqlx_connection.proto",
    &descriptor_table_mysqlx_5fconnection_2eproto_once, descriptor_table_mysqlx_5fconnection_2eproto_deps, 2, 6,
    schemas, file_default_instances, TableStruct_mysqlx_5fconnection_2eproto::offsets,
    file_level_metadata_mysqlx_5fconnection_2eproto, file_level_enum_descriptors_mysqlx_5fconnection_2eproto,
    file_level_service_descriptors_mysqlx_5fconnection_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_mysqlx_5fconnection_2eproto_getter() {
  return &descriptor_table_mysqlx_5fconnection_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_mysqlx_5fconnection_2eproto(&descriptor_table_mysqlx_5fconnection_2eproto);
namespace Mysqlx {
namespace Connection {

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

class Capability::_Internal {
 public:
  using HasBits = decltype(std::declval<Capability>()._impl_._has_bits_);
  static void set_has_name(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::Mysqlx::Datatypes::Any& value(const Capability* msg);
  static void set_has_value(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
  }
};

const ::Mysqlx::Datatypes::Any&
Capability::_Internal::value(const Capability* msg) {
  return *msg->_impl_.value_;
}
void Capability::clear_value() {
  if (_impl_.value_ != nullptr) _impl_.value_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
Capability::Capability(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.Capability)
}
Capability::Capability(const Capability& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Capability* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.name_){}
    , decltype(_impl_.value_){nullptr}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_name()) {
    _this->_impl_.name_.Set(from._internal_name(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_value()) {
    _this->_impl_.value_ = new ::Mysqlx::Datatypes::Any(*from._impl_.value_);
  }
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.Capability)
}

inline void Capability::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.name_){}
    , decltype(_impl_.value_){nullptr}
  };
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Capability::~Capability() {
  // @@protoc_insertion_point(destructor:Mysqlx.Connection.Capability)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Capability::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.name_.Destroy();
  if (this != internal_default_instance()) delete _impl_.value_;
}

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _impl_.name_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.value_ != nullptr);
      _impl_.value_->Clear();
    }
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Capability::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          #ifndef NDEBUG
          ::_pbi::VerifyUTF8(str, "Mysqlx.Connection.Capability.name");
          #endif  // !NDEBUG
        } else
          goto handle_unusual;
        continue;
      // required .Mysqlx.Datatypes.Any value = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_value(), 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // required string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "Mysqlx.Connection.Capability.name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_name(), target);
  }

  // required .Mysqlx.Datatypes.Any value = 2;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::value(this),
        _Internal::value(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Mysqlx.Connection.Capability)
  return target;
}

size_t Capability::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:Mysqlx.Connection.Capability)
  size_t total_size = 0;

  if (_internal_has_name()) {
    // required string name = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }

  if (_internal_has_value()) {
    // required .Mysqlx.Datatypes.Any value = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.value_);
  }

  return total_size;
}
size_t Capability::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Connection.Capability)
  size_t total_size = 0;

  if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required string name = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());

    // required .Mysqlx.Datatypes.Any value = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.value_);

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Capability::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Capability::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Capability::GetClassData() const { return &_class_data_; }


void Capability::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Capability*>(&to_msg);
  auto& from = static_cast<const Capability&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Connection.Capability)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_set_name(from._internal_name());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_value()->::Mysqlx::Datatypes::Any::MergeFrom(
          from._internal_value());
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool Capability::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
  if (_internal_has_value()) {
    if (!_impl_.value_->IsInitialized()) return false;
  }
  return true;
}

void Capability::InternalSwap(Capability* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.name_, lhs_arena,
      &other->_impl_.name_, rhs_arena
  );
  swap(_impl_.value_, other->_impl_.value_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Capability::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[0]);
}

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

class Capabilities::_Internal {
 public:
};

Capabilities::Capabilities(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.Capabilities)
}
Capabilities::Capabilities(const Capabilities& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Capabilities* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.capabilities_){from._impl_.capabilities_}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.Capabilities)
}

inline void Capabilities::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.capabilities_){arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

Capabilities::~Capabilities() {
  // @@protoc_insertion_point(destructor:Mysqlx.Connection.Capabilities)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Capabilities::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.capabilities_.~RepeatedPtrField();
}

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

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

  _impl_.capabilities_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Capabilities::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .Mysqlx.Connection.Capability capabilities = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_capabilities(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // repeated .Mysqlx.Connection.Capability capabilities = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_capabilities_size()); i < n; i++) {
    const auto& repfield = this->_internal_capabilities(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Mysqlx.Connection.Capabilities)
  return target;
}

size_t Capabilities::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Connection.Capabilities)
  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 .Mysqlx.Connection.Capability capabilities = 1;
  total_size += 1UL * this->_internal_capabilities_size();
  for (const auto& msg : this->_impl_.capabilities_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Capabilities::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Capabilities::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Capabilities::GetClassData() const { return &_class_data_; }


void Capabilities::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Capabilities*>(&to_msg);
  auto& from = static_cast<const Capabilities&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Connection.Capabilities)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.capabilities_.MergeFrom(from._impl_.capabilities_);
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool Capabilities::IsInitialized() const {
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.capabilities_))
    return false;
  return true;
}

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

::PROTOBUF_NAMESPACE_ID::Metadata Capabilities::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[1]);
}

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

class CapabilitiesGet::_Internal {
 public:
};

CapabilitiesGet::CapabilitiesGet(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) {
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.CapabilitiesGet)
}
CapabilitiesGet::CapabilitiesGet(const CapabilitiesGet& from)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
  CapabilitiesGet* const _this = this; (void)_this;
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.CapabilitiesGet)
}





const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CapabilitiesGet::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CapabilitiesGet::GetClassData() const { return &_class_data_; }







::PROTOBUF_NAMESPACE_ID::Metadata CapabilitiesGet::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[2]);
}

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

class CapabilitiesSet::_Internal {
 public:
  using HasBits = decltype(std::declval<CapabilitiesSet>()._impl_._has_bits_);
  static const ::Mysqlx::Connection::Capabilities& capabilities(const CapabilitiesSet* msg);
  static void set_has_capabilities(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

const ::Mysqlx::Connection::Capabilities&
CapabilitiesSet::_Internal::capabilities(const CapabilitiesSet* msg) {
  return *msg->_impl_.capabilities_;
}
CapabilitiesSet::CapabilitiesSet(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.CapabilitiesSet)
}
CapabilitiesSet::CapabilitiesSet(const CapabilitiesSet& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  CapabilitiesSet* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.capabilities_){nullptr}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_capabilities()) {
    _this->_impl_.capabilities_ = new ::Mysqlx::Connection::Capabilities(*from._impl_.capabilities_);
  }
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.CapabilitiesSet)
}

inline void CapabilitiesSet::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.capabilities_){nullptr}
  };
}

CapabilitiesSet::~CapabilitiesSet() {
  // @@protoc_insertion_point(destructor:Mysqlx.Connection.CapabilitiesSet)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void CapabilitiesSet::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.capabilities_;
}

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(_impl_.capabilities_ != nullptr);
    _impl_.capabilities_->Clear();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* CapabilitiesSet::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required .Mysqlx.Connection.Capabilities capabilities = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_capabilities(), 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // required .Mysqlx.Connection.Capabilities capabilities = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::capabilities(this),
        _Internal::capabilities(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Mysqlx.Connection.CapabilitiesSet)
  return target;
}

size_t CapabilitiesSet::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Connection.CapabilitiesSet)
  size_t total_size = 0;

  // required .Mysqlx.Connection.Capabilities capabilities = 1;
  if (_internal_has_capabilities()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.capabilities_);
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CapabilitiesSet::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    CapabilitiesSet::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CapabilitiesSet::GetClassData() const { return &_class_data_; }


void CapabilitiesSet::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<CapabilitiesSet*>(&to_msg);
  auto& from = static_cast<const CapabilitiesSet&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Connection.CapabilitiesSet)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_capabilities()) {
    _this->_internal_mutable_capabilities()->::Mysqlx::Connection::Capabilities::MergeFrom(
        from._internal_capabilities());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool CapabilitiesSet::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
  if (_internal_has_capabilities()) {
    if (!_impl_.capabilities_->IsInitialized()) return false;
  }
  return true;
}

void CapabilitiesSet::InternalSwap(CapabilitiesSet* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.capabilities_, other->_impl_.capabilities_);
}

::PROTOBUF_NAMESPACE_ID::Metadata CapabilitiesSet::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[3]);
}

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

class Close::_Internal {
 public:
};

Close::Close(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) {
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.Close)
}
Close::Close(const Close& from)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
  Close* const _this = this; (void)_this;
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.Close)
}





const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Close::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Close::GetClassData() const { return &_class_data_; }







::PROTOBUF_NAMESPACE_ID::Metadata Close::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[4]);
}

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

class Compression::_Internal {
 public:
  using HasBits = decltype(std::declval<Compression>()._impl_._has_bits_);
  static void set_has_uncompressed_size(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_server_messages(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_client_messages(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_payload(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

Compression::Compression(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:Mysqlx.Connection.Compression)
}
Compression::Compression(const Compression& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Compression* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.payload_){}
    , decltype(_impl_.uncompressed_size_){}
    , decltype(_impl_.server_messages_){}
    , decltype(_impl_.client_messages_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.payload_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.payload_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_payload()) {
    _this->_impl_.payload_.Set(from._internal_payload(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.uncompressed_size_, &from._impl_.uncompressed_size_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.client_messages_) -
    reinterpret_cast<char*>(&_impl_.uncompressed_size_)) + sizeof(_impl_.client_messages_));
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Connection.Compression)
}

inline void Compression::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.payload_){}
    , decltype(_impl_.uncompressed_size_){uint64_t{0u}}
    , decltype(_impl_.server_messages_){0}
    , decltype(_impl_.client_messages_){1}
  };
  _impl_.payload_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.payload_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Compression::~Compression() {
  // @@protoc_insertion_point(destructor:Mysqlx.Connection.Compression)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Compression::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.payload_.Destroy();
}

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

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

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    _impl_.payload_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x0000000eu) {
    ::memset(&_impl_.uncompressed_size_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.server_messages_) -
        reinterpret_cast<char*>(&_impl_.uncompressed_size_)) + sizeof(_impl_.server_messages_));
    _impl_.client_messages_ = 1;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Compression::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional uint64 uncompressed_size = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_uncompressed_size(&has_bits);
          _impl_.uncompressed_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.ServerMessages.Type server_messages = 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(::Mysqlx::ServerMessages_Type_IsValid(val))) {
            _internal_set_server_messages(static_cast<::Mysqlx::ServerMessages_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.ClientMessages.Type client_messages = 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(::Mysqlx::ClientMessages_Type_IsValid(val))) {
            _internal_set_client_messages(static_cast<::Mysqlx::ClientMessages_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // required bytes payload = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_payload();
          ptr = ::_pbi::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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // optional uint64 uncompressed_size = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_uncompressed_size(), target);
  }

  // optional .Mysqlx.ServerMessages.Type server_messages = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      2, this->_internal_server_messages(), target);
  }

  // optional .Mysqlx.ClientMessages.Type client_messages = 3;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      3, this->_internal_client_messages(), target);
  }

  // required bytes payload = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_payload(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Mysqlx.Connection.Compression)
  return target;
}

size_t Compression::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Connection.Compression)
  size_t total_size = 0;

  // required bytes payload = 4;
  if (_internal_has_payload()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_payload());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000eu) {
    // optional uint64 uncompressed_size = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_uncompressed_size());
    }

    // optional .Mysqlx.ServerMessages.Type server_messages = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_server_messages());
    }

    // optional .Mysqlx.ClientMessages.Type client_messages = 3;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_client_messages());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Compression::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Compression::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Compression::GetClassData() const { return &_class_data_; }


void Compression::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Compression*>(&to_msg);
  auto& from = static_cast<const Compression&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Connection.Compression)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_set_payload(from._internal_payload());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.uncompressed_size_ = from._impl_.uncompressed_size_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.server_messages_ = from._impl_.server_messages_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.client_messages_ = from._impl_.client_messages_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool Compression::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
  return true;
}

void Compression::InternalSwap(Compression* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.payload_, lhs_arena,
      &other->_impl_.payload_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Compression, _impl_.server_messages_)
      + sizeof(Compression::_impl_.server_messages_)
      - PROTOBUF_FIELD_OFFSET(Compression, _impl_.uncompressed_size_)>(
          reinterpret_cast<char*>(&_impl_.uncompressed_size_),
          reinterpret_cast<char*>(&other->_impl_.uncompressed_size_));
  swap(_impl_.client_messages_, other->_impl_.client_messages_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Compression::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fconnection_2eproto_getter, &descriptor_table_mysqlx_5fconnection_2eproto_once,
      file_level_metadata_mysqlx_5fconnection_2eproto[5]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace Connection
}  // namespace Mysqlx
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::Capability*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::Capability >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::Capability >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::Capabilities*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::Capabilities >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::Capabilities >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::CapabilitiesGet*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::CapabilitiesGet >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::CapabilitiesGet >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::CapabilitiesSet*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::CapabilitiesSet >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::CapabilitiesSet >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::Close*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::Close >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::Close >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Connection::Compression*
Arena::CreateMaybeMessage< ::Mysqlx::Connection::Compression >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Connection::Compression >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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