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

#include "mysqlx_datatypes.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 Datatypes {
PROTOBUF_CONSTEXPR Scalar_String::Scalar_String(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.collation_)*/uint64_t{0u}} {}
struct Scalar_StringDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Scalar_StringDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Scalar_StringDefaultTypeInternal() {}
  union {
    Scalar_String _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Scalar_StringDefaultTypeInternal _Scalar_String_default_instance_;
PROTOBUF_CONSTEXPR Scalar_Octets::Scalar_Octets(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.content_type_)*/0u} {}
struct Scalar_OctetsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Scalar_OctetsDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Scalar_OctetsDefaultTypeInternal() {}
  union {
    Scalar_Octets _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Scalar_OctetsDefaultTypeInternal _Scalar_Octets_default_instance_;
PROTOBUF_CONSTEXPR Scalar::Scalar(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.v_octets_)*/nullptr
  , /*decltype(_impl_.v_string_)*/nullptr
  , /*decltype(_impl_.v_signed_int_)*/int64_t{0}
  , /*decltype(_impl_.v_unsigned_int_)*/uint64_t{0u}
  , /*decltype(_impl_.v_double_)*/0
  , /*decltype(_impl_.v_float_)*/0
  , /*decltype(_impl_.v_bool_)*/false
  , /*decltype(_impl_.type_)*/1} {}
struct ScalarDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ScalarDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ScalarDefaultTypeInternal() {}
  union {
    Scalar _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ScalarDefaultTypeInternal _Scalar_default_instance_;
PROTOBUF_CONSTEXPR Object_ObjectField::Object_ObjectField(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.key_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.value_)*/nullptr} {}
struct Object_ObjectFieldDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Object_ObjectFieldDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Object_ObjectFieldDefaultTypeInternal() {}
  union {
    Object_ObjectField _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Object_ObjectFieldDefaultTypeInternal _Object_ObjectField_default_instance_;
PROTOBUF_CONSTEXPR Object::Object(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.fld_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ObjectDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ObjectDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ObjectDefaultTypeInternal() {}
  union {
    Object _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ObjectDefaultTypeInternal _Object_default_instance_;
PROTOBUF_CONSTEXPR Array::Array(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.value_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ArrayDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ArrayDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ArrayDefaultTypeInternal() {}
  union {
    Array _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ArrayDefaultTypeInternal _Array_default_instance_;
PROTOBUF_CONSTEXPR Any::Any(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.scalar_)*/nullptr
  , /*decltype(_impl_.obj_)*/nullptr
  , /*decltype(_impl_.array_)*/nullptr
  , /*decltype(_impl_.type_)*/1} {}
struct AnyDefaultTypeInternal {
  PROTOBUF_CONSTEXPR AnyDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~AnyDefaultTypeInternal() {}
  union {
    Any _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AnyDefaultTypeInternal _Any_default_instance_;
}  // namespace Datatypes
}  // namespace Mysqlx
static ::_pb::Metadata file_level_metadata_mysqlx_5fdatatypes_2eproto[7];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_mysqlx_5fdatatypes_2eproto[2];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_mysqlx_5fdatatypes_2eproto = nullptr;

const uint32_t TableStruct_mysqlx_5fdatatypes_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_String, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_String, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_String, _impl_.value_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_String, _impl_.collation_),
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_Octets, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_Octets, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_Octets, _impl_.value_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar_Octets, _impl_.content_type_),
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.type_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_signed_int_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_unsigned_int_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_octets_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_double_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_float_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_bool_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Scalar, _impl_.v_string_),
  7,
  2,
  3,
  0,
  4,
  5,
  6,
  1,
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object_ObjectField, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object_ObjectField, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object_ObjectField, _impl_.key_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object_ObjectField, _impl_.value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Object, _impl_.fld_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Array, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Array, _impl_.value_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _impl_.type_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _impl_.scalar_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _impl_.obj_),
  PROTOBUF_FIELD_OFFSET(::Mysqlx::Datatypes::Any, _impl_.array_),
  3,
  0,
  1,
  2,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::Mysqlx::Datatypes::Scalar_String)},
  { 10, 18, -1, sizeof(::Mysqlx::Datatypes::Scalar_Octets)},
  { 20, 34, -1, sizeof(::Mysqlx::Datatypes::Scalar)},
  { 42, 50, -1, sizeof(::Mysqlx::Datatypes::Object_ObjectField)},
  { 52, -1, -1, sizeof(::Mysqlx::Datatypes::Object)},
  { 59, -1, -1, sizeof(::Mysqlx::Datatypes::Array)},
  { 66, 76, -1, sizeof(::Mysqlx::Datatypes::Any)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::Mysqlx::Datatypes::_Scalar_String_default_instance_._instance,
  &::Mysqlx::Datatypes::_Scalar_Octets_default_instance_._instance,
  &::Mysqlx::Datatypes::_Scalar_default_instance_._instance,
  &::Mysqlx::Datatypes::_Object_ObjectField_default_instance_._instance,
  &::Mysqlx::Datatypes::_Object_default_instance_._instance,
  &::Mysqlx::Datatypes::_Array_default_instance_._instance,
  &::Mysqlx::Datatypes::_Any_default_instance_._instance,
};

const char descriptor_table_protodef_mysqlx_5fdatatypes_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\026mysqlx_datatypes.proto\022\020Mysqlx.Datatyp"
  "es\"\306\003\n\006Scalar\022+\n\004type\030\001 \002(\0162\035.Mysqlx.Dat"
  "atypes.Scalar.Type\022\024\n\014v_signed_int\030\002 \001(\022"
  "\022\026\n\016v_unsigned_int\030\003 \001(\004\0221\n\010v_octets\030\005 \001"
  "(\0132\037.Mysqlx.Datatypes.Scalar.Octets\022\020\n\010v"
  "_double\030\006 \001(\001\022\017\n\007v_float\030\007 \001(\002\022\016\n\006v_bool"
  "\030\010 \001(\010\0221\n\010v_string\030\t \001(\0132\037.Mysqlx.Dataty"
  "pes.Scalar.String\032*\n\006String\022\r\n\005value\030\001 \002"
  "(\014\022\021\n\tcollation\030\002 \001(\004\032-\n\006Octets\022\r\n\005value"
  "\030\001 \002(\014\022\024\n\014content_type\030\002 \001(\r\"m\n\004Type\022\n\n\006"
  "V_SINT\020\001\022\n\n\006V_UINT\020\002\022\n\n\006V_NULL\020\003\022\014\n\010V_OC"
  "TETS\020\004\022\014\n\010V_DOUBLE\020\005\022\013\n\007V_FLOAT\020\006\022\n\n\006V_B"
  "OOL\020\007\022\014\n\010V_STRING\020\010\"}\n\006Object\0221\n\003fld\030\001 \003"
  "(\0132$.Mysqlx.Datatypes.Object.ObjectField"
  "\032@\n\013ObjectField\022\013\n\003key\030\001 \002(\t\022$\n\005value\030\002 "
  "\002(\0132\025.Mysqlx.Datatypes.Any\"-\n\005Array\022$\n\005v"
  "alue\030\001 \003(\0132\025.Mysqlx.Datatypes.Any\"\323\001\n\003An"
  "y\022(\n\004type\030\001 \002(\0162\032.Mysqlx.Datatypes.Any.T"
  "ype\022(\n\006scalar\030\002 \001(\0132\030.Mysqlx.Datatypes.S"
  "calar\022%\n\003obj\030\003 \001(\0132\030.Mysqlx.Datatypes.Ob"
  "ject\022&\n\005array\030\004 \001(\0132\027.Mysqlx.Datatypes.A"
  "rray\")\n\004Type\022\n\n\006SCALAR\020\001\022\n\n\006OBJECT\020\002\022\t\n\005"
  "ARRAY\020\003B\031\n\027com.mysql.cj.x.protobuf"
  ;
static ::_pbi::once_flag descriptor_table_mysqlx_5fdatatypes_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_mysqlx_5fdatatypes_2eproto = {
    false, false, 914, descriptor_table_protodef_mysqlx_5fdatatypes_2eproto,
    "mysqlx_datatypes.proto",
    &descriptor_table_mysqlx_5fdatatypes_2eproto_once, nullptr, 0, 7,
    schemas, file_default_instances, TableStruct_mysqlx_5fdatatypes_2eproto::offsets,
    file_level_metadata_mysqlx_5fdatatypes_2eproto, file_level_enum_descriptors_mysqlx_5fdatatypes_2eproto,
    file_level_service_descriptors_mysqlx_5fdatatypes_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_mysqlx_5fdatatypes_2eproto_getter() {
  return &descriptor_table_mysqlx_5fdatatypes_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_mysqlx_5fdatatypes_2eproto(&descriptor_table_mysqlx_5fdatatypes_2eproto);
namespace Mysqlx {
namespace Datatypes {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Scalar_Type_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_mysqlx_5fdatatypes_2eproto);
  return file_level_enum_descriptors_mysqlx_5fdatatypes_2eproto[0];
}
bool Scalar_Type_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr Scalar_Type Scalar::V_SINT;
constexpr Scalar_Type Scalar::V_UINT;
constexpr Scalar_Type Scalar::V_NULL;
constexpr Scalar_Type Scalar::V_OCTETS;
constexpr Scalar_Type Scalar::V_DOUBLE;
constexpr Scalar_Type Scalar::V_FLOAT;
constexpr Scalar_Type Scalar::V_BOOL;
constexpr Scalar_Type Scalar::V_STRING;
constexpr Scalar_Type Scalar::Type_MIN;
constexpr Scalar_Type Scalar::Type_MAX;
constexpr int Scalar::Type_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Any_Type_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_mysqlx_5fdatatypes_2eproto);
  return file_level_enum_descriptors_mysqlx_5fdatatypes_2eproto[1];
}
bool Any_Type_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr Any_Type Any::SCALAR;
constexpr Any_Type Any::OBJECT;
constexpr Any_Type Any::ARRAY;
constexpr Any_Type Any::Type_MIN;
constexpr Any_Type Any::Type_MAX;
constexpr int Any::Type_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class Scalar_String::_Internal {
 public:
  using HasBits = decltype(std::declval<Scalar_String>()._impl_._has_bits_);
  static void set_has_value(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_collation(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

Scalar_String::Scalar_String(::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.Datatypes.Scalar.String)
}
Scalar_String::Scalar_String(const Scalar_String& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Scalar_String* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.value_){}
    , decltype(_impl_.collation_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_value()) {
    _this->_impl_.value_.Set(from._internal_value(), 
      _this->GetArenaForAllocation());
  }
  _this->_impl_.collation_ = from._impl_.collation_;
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Datatypes.Scalar.String)
}

inline void Scalar_String::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_.value_){}
    , decltype(_impl_.collation_){uint64_t{0u}}
  };
  _impl_.value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

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

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

void Scalar_String::Clear() {
// @@protoc_insertion_point(message_clear_start:Mysqlx.Datatypes.Scalar.String)
  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_.value_.ClearNonDefaultToEmpty();
  }
  _impl_.collation_ = uint64_t{0u};
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Scalar_String::_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 bytes value = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_value();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional uint64 collation = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_collation(&has_bits);
          _impl_.collation_ = ::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<::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* Scalar_String::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Scalar.String)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // required bytes value = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_value(), target);
  }

  // optional uint64 collation = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_collation(), 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.Datatypes.Scalar.String)
  return target;
}

size_t Scalar_String::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Datatypes.Scalar.String)
  size_t total_size = 0;

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

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

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

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


void Scalar_String::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Scalar_String*>(&to_msg);
  auto& from = static_cast<const Scalar_String&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Datatypes.Scalar.String)
  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_value(from._internal_value());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.collation_ = from._impl_.collation_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Scalar_String::CopyFrom(const Scalar_String& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Mysqlx.Datatypes.Scalar.String)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void Scalar_String::InternalSwap(Scalar_String* 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_.value_, lhs_arena,
      &other->_impl_.value_, rhs_arena
  );
  swap(_impl_.collation_, other->_impl_.collation_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Scalar_String::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[0]);
}

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

class Scalar_Octets::_Internal {
 public:
  using HasBits = decltype(std::declval<Scalar_Octets>()._impl_._has_bits_);
  static void set_has_value(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_content_type(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

Scalar_Octets::Scalar_Octets(::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.Datatypes.Scalar.Octets)
}
Scalar_Octets::Scalar_Octets(const Scalar_Octets& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Scalar_Octets* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.value_){}
    , decltype(_impl_.content_type_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_value()) {
    _this->_impl_.value_.Set(from._internal_value(), 
      _this->GetArenaForAllocation());
  }
  _this->_impl_.content_type_ = from._impl_.content_type_;
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Datatypes.Scalar.Octets)
}

inline void Scalar_Octets::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_.value_){}
    , decltype(_impl_.content_type_){0u}
  };
  _impl_.value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

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

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

void Scalar_Octets::Clear() {
// @@protoc_insertion_point(message_clear_start:Mysqlx.Datatypes.Scalar.Octets)
  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_.value_.ClearNonDefaultToEmpty();
  }
  _impl_.content_type_ = 0u;
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Scalar_Octets::_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 bytes value = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_value();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional uint32 content_type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_content_type(&has_bits);
          _impl_.content_type_ = ::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<::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* Scalar_Octets::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Scalar.Octets)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // required bytes value = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_value(), target);
  }

  // optional uint32 content_type = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_content_type(), 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.Datatypes.Scalar.Octets)
  return target;
}

size_t Scalar_Octets::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Datatypes.Scalar.Octets)
  size_t total_size = 0;

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

  // optional uint32 content_type = 2;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000002u) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_content_type());
  }

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

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


void Scalar_Octets::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Scalar_Octets*>(&to_msg);
  auto& from = static_cast<const Scalar_Octets&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Datatypes.Scalar.Octets)
  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_value(from._internal_value());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.content_type_ = from._impl_.content_type_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Scalar_Octets::CopyFrom(const Scalar_Octets& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Mysqlx.Datatypes.Scalar.Octets)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void Scalar_Octets::InternalSwap(Scalar_Octets* 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_.value_, lhs_arena,
      &other->_impl_.value_, rhs_arena
  );
  swap(_impl_.content_type_, other->_impl_.content_type_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Scalar_Octets::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[1]);
}

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

class Scalar::_Internal {
 public:
  using HasBits = decltype(std::declval<Scalar>()._impl_._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_v_signed_int(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_v_unsigned_int(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::Mysqlx::Datatypes::Scalar_Octets& v_octets(const Scalar* msg);
  static void set_has_v_octets(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_v_double(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_v_float(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_v_bool(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static const ::Mysqlx::Datatypes::Scalar_String& v_string(const Scalar* msg);
  static void set_has_v_string(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000080) ^ 0x00000080) != 0;
  }
};

const ::Mysqlx::Datatypes::Scalar_Octets&
Scalar::_Internal::v_octets(const Scalar* msg) {
  return *msg->_impl_.v_octets_;
}
const ::Mysqlx::Datatypes::Scalar_String&
Scalar::_Internal::v_string(const Scalar* msg) {
  return *msg->_impl_.v_string_;
}
Scalar::Scalar(::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.Datatypes.Scalar)
}
Scalar::Scalar(const Scalar& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Scalar* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.v_octets_){nullptr}
    , decltype(_impl_.v_string_){nullptr}
    , decltype(_impl_.v_signed_int_){}
    , decltype(_impl_.v_unsigned_int_){}
    , decltype(_impl_.v_double_){}
    , decltype(_impl_.v_float_){}
    , decltype(_impl_.v_bool_){}
    , decltype(_impl_.type_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_v_octets()) {
    _this->_impl_.v_octets_ = new ::Mysqlx::Datatypes::Scalar_Octets(*from._impl_.v_octets_);
  }
  if (from._internal_has_v_string()) {
    _this->_impl_.v_string_ = new ::Mysqlx::Datatypes::Scalar_String(*from._impl_.v_string_);
  }
  ::memcpy(&_impl_.v_signed_int_, &from._impl_.v_signed_int_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.type_) -
    reinterpret_cast<char*>(&_impl_.v_signed_int_)) + sizeof(_impl_.type_));
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Datatypes.Scalar)
}

inline void Scalar::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_.v_octets_){nullptr}
    , decltype(_impl_.v_string_){nullptr}
    , decltype(_impl_.v_signed_int_){int64_t{0}}
    , decltype(_impl_.v_unsigned_int_){uint64_t{0u}}
    , decltype(_impl_.v_double_){0}
    , decltype(_impl_.v_float_){0}
    , decltype(_impl_.v_bool_){false}
    , decltype(_impl_.type_){1}
  };
}

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

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

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

void Scalar::Clear() {
// @@protoc_insertion_point(message_clear_start:Mysqlx.Datatypes.Scalar)
  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) {
      GOOGLE_DCHECK(_impl_.v_octets_ != nullptr);
      _impl_.v_octets_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.v_string_ != nullptr);
      _impl_.v_string_->Clear();
    }
  }
  if (cached_has_bits & 0x000000fcu) {
    ::memset(&_impl_.v_signed_int_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.v_bool_) -
        reinterpret_cast<char*>(&_impl_.v_signed_int_)) + sizeof(_impl_.v_bool_));
    _impl_.type_ = 1;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Scalar::_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.Datatypes.Scalar.Type 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(::Mysqlx::Datatypes::Scalar_Type_IsValid(val))) {
            _internal_set_type(static_cast<::Mysqlx::Datatypes::Scalar_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional sint64 v_signed_int = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_v_signed_int(&has_bits);
          _impl_.v_signed_int_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional uint64 v_unsigned_int = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_v_unsigned_int(&has_bits);
          _impl_.v_unsigned_int_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.Datatypes.Scalar.Octets v_octets = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_v_octets(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional double v_double = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 49)) {
          _Internal::set_has_v_double(&has_bits);
          _impl_.v_double_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // optional float v_float = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
          _Internal::set_has_v_float(&has_bits);
          _impl_.v_float_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional bool v_bool = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_v_bool(&has_bits);
          _impl_.v_bool_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.Datatypes.Scalar.String v_string = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_v_string(), 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* Scalar::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Scalar)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // required .Mysqlx.Datatypes.Scalar.Type type = 1;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      1, this->_internal_type(), target);
  }

  // optional sint64 v_signed_int = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteSInt64ToArray(2, this->_internal_v_signed_int(), target);
  }

  // optional uint64 v_unsigned_int = 3;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_v_unsigned_int(), target);
  }

  // optional .Mysqlx.Datatypes.Scalar.Octets v_octets = 5;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, _Internal::v_octets(this),
        _Internal::v_octets(this).GetCachedSize(), target, stream);
  }

  // optional double v_double = 6;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(6, this->_internal_v_double(), target);
  }

  // optional float v_float = 7;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(7, this->_internal_v_float(), target);
  }

  // optional bool v_bool = 8;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_v_bool(), target);
  }

  // optional .Mysqlx.Datatypes.Scalar.String v_string = 9;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::v_string(this),
        _Internal::v_string(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.Datatypes.Scalar)
  return target;
}

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

  // required .Mysqlx.Datatypes.Scalar.Type type = 1;
  if (_internal_has_type()) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
  }
  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 & 0x0000007fu) {
    // optional .Mysqlx.Datatypes.Scalar.Octets v_octets = 5;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.v_octets_);
    }

    // optional .Mysqlx.Datatypes.Scalar.String v_string = 9;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.v_string_);
    }

    // optional sint64 v_signed_int = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += ::_pbi::WireFormatLite::SInt64SizePlusOne(this->_internal_v_signed_int());
    }

    // optional uint64 v_unsigned_int = 3;
    if (cached_has_bits & 0x00000008u) {
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_v_unsigned_int());
    }

    // optional double v_double = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 8;
    }

    // optional float v_float = 7;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 + 4;
    }

    // optional bool v_bool = 8;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 + 1;
    }

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

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


void Scalar::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Scalar*>(&to_msg);
  auto& from = static_cast<const Scalar&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Datatypes.Scalar)
  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 & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_v_octets()->::Mysqlx::Datatypes::Scalar_Octets::MergeFrom(
          from._internal_v_octets());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_v_string()->::Mysqlx::Datatypes::Scalar_String::MergeFrom(
          from._internal_v_string());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.v_signed_int_ = from._impl_.v_signed_int_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.v_unsigned_int_ = from._impl_.v_unsigned_int_;
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_impl_.v_double_ = from._impl_.v_double_;
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_impl_.v_float_ = from._impl_.v_float_;
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_impl_.v_bool_ = from._impl_.v_bool_;
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_impl_.type_ = from._impl_.type_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool Scalar::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
  if (_internal_has_v_octets()) {
    if (!_impl_.v_octets_->IsInitialized()) return false;
  }
  if (_internal_has_v_string()) {
    if (!_impl_.v_string_->IsInitialized()) return false;
  }
  return true;
}

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

::PROTOBUF_NAMESPACE_ID::Metadata Scalar::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[2]);
}

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

class Object_ObjectField::_Internal {
 public:
  using HasBits = decltype(std::declval<Object_ObjectField>()._impl_._has_bits_);
  static void set_has_key(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::Mysqlx::Datatypes::Any& value(const Object_ObjectField* 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&
Object_ObjectField::_Internal::value(const Object_ObjectField* msg) {
  return *msg->_impl_.value_;
}
Object_ObjectField::Object_ObjectField(::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.Datatypes.Object.ObjectField)
}
Object_ObjectField::Object_ObjectField(const Object_ObjectField& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Object_ObjectField* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.key_){}
    , decltype(_impl_.value_){nullptr}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.key_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.key_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_key()) {
    _this->_impl_.key_.Set(from._internal_key(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_value()) {
    _this->_impl_.value_ = new ::Mysqlx::Datatypes::Any(*from._impl_.value_);
  }
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Datatypes.Object.ObjectField)
}

inline void Object_ObjectField::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_.key_){}
    , decltype(_impl_.value_){nullptr}
  };
  _impl_.key_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.key_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

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

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

void Object_ObjectField::Clear() {
// @@protoc_insertion_point(message_clear_start:Mysqlx.Datatypes.Object.ObjectField)
  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_.key_.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* Object_ObjectField::_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 key = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_key();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          #ifndef NDEBUG
          ::_pbi::VerifyUTF8(str, "Mysqlx.Datatypes.Object.ObjectField.key");
          #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* Object_ObjectField::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Object.ObjectField)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // required string key = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "Mysqlx.Datatypes.Object.ObjectField.key");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_key(), 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.Datatypes.Object.ObjectField)
  return target;
}

size_t Object_ObjectField::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:Mysqlx.Datatypes.Object.ObjectField)
  size_t total_size = 0;

  if (_internal_has_key()) {
    // required string key = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_key());
  }

  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 Object_ObjectField::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Datatypes.Object.ObjectField)
  size_t total_size = 0;

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

    // 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 Object_ObjectField::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Object_ObjectField::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Object_ObjectField::GetClassData() const { return &_class_data_; }


void Object_ObjectField::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Object_ObjectField*>(&to_msg);
  auto& from = static_cast<const Object_ObjectField&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Datatypes.Object.ObjectField)
  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_key(from._internal_key());
    }
    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 Object_ObjectField::CopyFrom(const Object_ObjectField& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Mysqlx.Datatypes.Object.ObjectField)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void Object_ObjectField::InternalSwap(Object_ObjectField* 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_.key_, lhs_arena,
      &other->_impl_.key_, rhs_arena
  );
  swap(_impl_.value_, other->_impl_.value_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Object_ObjectField::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[3]);
}

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

class Object::_Internal {
 public:
};

Object::Object(::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.Datatypes.Object)
}
Object::Object(const Object& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Object* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.fld_){from._impl_.fld_}
    , /*decltype(_impl_._cached_size_)*/{}};

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

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

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

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

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

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

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

const char* Object::_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.Datatypes.Object.ObjectField fld = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_fld(), 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* Object::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Object)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .Mysqlx.Datatypes.Object.ObjectField fld = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_fld_size()); i < n; i++) {
    const auto& repfield = this->_internal_fld(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.Datatypes.Object)
  return target;
}

size_t Object::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Datatypes.Object)
  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.Datatypes.Object.ObjectField fld = 1;
  total_size += 1UL * this->_internal_fld_size();
  for (const auto& msg : this->_impl_.fld_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

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


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

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

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata Object::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[4]);
}

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

class Array::_Internal {
 public:
};

Array::Array(::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.Datatypes.Array)
}
Array::Array(const Array& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Array* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.value_){from._impl_.value_}
    , /*decltype(_impl_._cached_size_)*/{}};

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

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

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

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

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

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

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

const char* Array::_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.Datatypes.Any value = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_value(), 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* Array::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Array)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .Mysqlx.Datatypes.Any value = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_value_size()); i < n; i++) {
    const auto& repfield = this->_internal_value(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.Datatypes.Array)
  return target;
}

size_t Array::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Mysqlx.Datatypes.Array)
  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.Datatypes.Any value = 1;
  total_size += 1UL * this->_internal_value_size();
  for (const auto& msg : this->_impl_.value_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

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


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

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

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata Array::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[5]);
}

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

class Any::_Internal {
 public:
  using HasBits = decltype(std::declval<Any>()._impl_._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::Mysqlx::Datatypes::Scalar& scalar(const Any* msg);
  static void set_has_scalar(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::Mysqlx::Datatypes::Object& obj(const Any* msg);
  static void set_has_obj(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::Mysqlx::Datatypes::Array& array(const Any* msg);
  static void set_has_array(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000008) ^ 0x00000008) != 0;
  }
};

const ::Mysqlx::Datatypes::Scalar&
Any::_Internal::scalar(const Any* msg) {
  return *msg->_impl_.scalar_;
}
const ::Mysqlx::Datatypes::Object&
Any::_Internal::obj(const Any* msg) {
  return *msg->_impl_.obj_;
}
const ::Mysqlx::Datatypes::Array&
Any::_Internal::array(const Any* msg) {
  return *msg->_impl_.array_;
}
Any::Any(::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.Datatypes.Any)
}
Any::Any(const Any& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Any* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.scalar_){nullptr}
    , decltype(_impl_.obj_){nullptr}
    , decltype(_impl_.array_){nullptr}
    , decltype(_impl_.type_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_scalar()) {
    _this->_impl_.scalar_ = new ::Mysqlx::Datatypes::Scalar(*from._impl_.scalar_);
  }
  if (from._internal_has_obj()) {
    _this->_impl_.obj_ = new ::Mysqlx::Datatypes::Object(*from._impl_.obj_);
  }
  if (from._internal_has_array()) {
    _this->_impl_.array_ = new ::Mysqlx::Datatypes::Array(*from._impl_.array_);
  }
  _this->_impl_.type_ = from._impl_.type_;
  // @@protoc_insertion_point(copy_constructor:Mysqlx.Datatypes.Any)
}

inline void Any::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_.scalar_){nullptr}
    , decltype(_impl_.obj_){nullptr}
    , decltype(_impl_.array_){nullptr}
    , decltype(_impl_.type_){1}
  };
}

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

inline void Any::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.scalar_;
  if (this != internal_default_instance()) delete _impl_.obj_;
  if (this != internal_default_instance()) delete _impl_.array_;
}

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

void Any::Clear() {
// @@protoc_insertion_point(message_clear_start:Mysqlx.Datatypes.Any)
  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 & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(_impl_.scalar_ != nullptr);
      _impl_.scalar_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.obj_ != nullptr);
      _impl_.obj_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(_impl_.array_ != nullptr);
      _impl_.array_->Clear();
    }
    _impl_.type_ = 1;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Any::_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.Datatypes.Any.Type 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(::Mysqlx::Datatypes::Any_Type_IsValid(val))) {
            _internal_set_type(static_cast<::Mysqlx::Datatypes::Any_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.Datatypes.Scalar scalar = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_scalar(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.Datatypes.Object obj = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_obj(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .Mysqlx.Datatypes.Array array = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_array(), 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* Any::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Mysqlx.Datatypes.Any)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // required .Mysqlx.Datatypes.Any.Type type = 1;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      1, this->_internal_type(), target);
  }

  // optional .Mysqlx.Datatypes.Scalar scalar = 2;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::scalar(this),
        _Internal::scalar(this).GetCachedSize(), target, stream);
  }

  // optional .Mysqlx.Datatypes.Object obj = 3;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::obj(this),
        _Internal::obj(this).GetCachedSize(), target, stream);
  }

  // optional .Mysqlx.Datatypes.Array array = 4;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::array(this),
        _Internal::array(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.Datatypes.Any)
  return target;
}

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

  // required .Mysqlx.Datatypes.Any.Type type = 1;
  if (_internal_has_type()) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
  }
  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 & 0x00000007u) {
    // optional .Mysqlx.Datatypes.Scalar scalar = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.scalar_);
    }

    // optional .Mysqlx.Datatypes.Object obj = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.obj_);
    }

    // optional .Mysqlx.Datatypes.Array array = 4;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.array_);
    }

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

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


void Any::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Any*>(&to_msg);
  auto& from = static_cast<const Any&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:Mysqlx.Datatypes.Any)
  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_mutable_scalar()->::Mysqlx::Datatypes::Scalar::MergeFrom(
          from._internal_scalar());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_obj()->::Mysqlx::Datatypes::Object::MergeFrom(
          from._internal_obj());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_array()->::Mysqlx::Datatypes::Array::MergeFrom(
          from._internal_array());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.type_ = from._impl_.type_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

bool Any::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
  if (_internal_has_scalar()) {
    if (!_impl_.scalar_->IsInitialized()) return false;
  }
  if (_internal_has_obj()) {
    if (!_impl_.obj_->IsInitialized()) return false;
  }
  if (_internal_has_array()) {
    if (!_impl_.array_->IsInitialized()) return false;
  }
  return true;
}

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

::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_mysqlx_5fdatatypes_2eproto_getter, &descriptor_table_mysqlx_5fdatatypes_2eproto_once,
      file_level_metadata_mysqlx_5fdatatypes_2eproto[6]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace Datatypes
}  // namespace Mysqlx
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Scalar_String*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Scalar_String >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Scalar_String >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Scalar_Octets*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Scalar_Octets >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Scalar_Octets >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Scalar*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Scalar >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Scalar >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Object_ObjectField*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Object_ObjectField >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Object_ObjectField >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Object*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Object >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Object >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Array*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Array >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Array >(arena);
}
template<> PROTOBUF_NOINLINE ::Mysqlx::Datatypes::Any*
Arena::CreateMaybeMessage< ::Mysqlx::Datatypes::Any >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Mysqlx::Datatypes::Any >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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