/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#pragma once

#include <thrift/lib/cpp2/gen/module_types_h.h>


#include "thrift/lib/thrift/gen-cpp2/standard_types.h"
#include "thrift/lib/thrift/detail/protocol.h"
#include "folly/container/F14Map.h"
#include "folly/container/F14Set.h"

namespace apache {
namespace thrift {
namespace ident {
struct type;
struct members;
struct boolValue;
struct byteValue;
struct i16Value;
struct i32Value;
struct i64Value;
struct floatValue;
struct doubleValue;
struct stringValue;
struct binaryValue;
struct objectValue;
struct listValue;
struct setValue;
struct mapValue;
} // namespace ident
namespace detail {
#ifndef APACHE_THRIFT_ACCESSOR_type
#define APACHE_THRIFT_ACCESSOR_type
APACHE_THRIFT_DEFINE_ACCESSOR(type);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_members
#define APACHE_THRIFT_ACCESSOR_members
APACHE_THRIFT_DEFINE_ACCESSOR(members);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_boolValue
#define APACHE_THRIFT_ACCESSOR_boolValue
APACHE_THRIFT_DEFINE_ACCESSOR(boolValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_byteValue
#define APACHE_THRIFT_ACCESSOR_byteValue
APACHE_THRIFT_DEFINE_ACCESSOR(byteValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_i16Value
#define APACHE_THRIFT_ACCESSOR_i16Value
APACHE_THRIFT_DEFINE_ACCESSOR(i16Value);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_i32Value
#define APACHE_THRIFT_ACCESSOR_i32Value
APACHE_THRIFT_DEFINE_ACCESSOR(i32Value);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_i64Value
#define APACHE_THRIFT_ACCESSOR_i64Value
APACHE_THRIFT_DEFINE_ACCESSOR(i64Value);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_floatValue
#define APACHE_THRIFT_ACCESSOR_floatValue
APACHE_THRIFT_DEFINE_ACCESSOR(floatValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_doubleValue
#define APACHE_THRIFT_ACCESSOR_doubleValue
APACHE_THRIFT_DEFINE_ACCESSOR(doubleValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_stringValue
#define APACHE_THRIFT_ACCESSOR_stringValue
APACHE_THRIFT_DEFINE_ACCESSOR(stringValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_binaryValue
#define APACHE_THRIFT_ACCESSOR_binaryValue
APACHE_THRIFT_DEFINE_ACCESSOR(binaryValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_objectValue
#define APACHE_THRIFT_ACCESSOR_objectValue
APACHE_THRIFT_DEFINE_ACCESSOR(objectValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_listValue
#define APACHE_THRIFT_ACCESSOR_listValue
APACHE_THRIFT_DEFINE_ACCESSOR(listValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_setValue
#define APACHE_THRIFT_ACCESSOR_setValue
APACHE_THRIFT_DEFINE_ACCESSOR(setValue);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_mapValue
#define APACHE_THRIFT_ACCESSOR_mapValue
APACHE_THRIFT_DEFINE_ACCESSOR(mapValue);
#endif
} // namespace detail
} // namespace thrift
} // namespace apache

// BEGIN declare_enums

// END declare_enums
// BEGIN forward_declare
namespace apache::thrift::protocol::detail {
namespace detail {
class Object;
} // namespace detail
namespace detail {
class Value;
} // namespace detail
} // namespace apache::thrift::protocol::detail
// END forward_declare
namespace apache::thrift::detail::annotation {
} // namespace apache::thrift::detail::annotation

namespace apache::thrift::detail::qualifier {
} // namespace apache::thrift::detail::qualifier

// BEGIN hash_and_equal_to
// END hash_and_equal_to
namespace apache::thrift::protocol::detail {
using Object = ::apache::thrift::protocol::detail::ObjectWrapper<::apache::thrift::protocol::detail::detail::Object>;
using Value = ::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>;
using ::apache::thrift::detail::operator!=;
using ::apache::thrift::detail::operator>;
using ::apache::thrift::detail::operator<=;
using ::apache::thrift::detail::operator>=;

/** Glean {"file": "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift", "name": "Float", "kind": "typedef" } */
typedef float Float;
/** Glean {"file": "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift", "name": "Double", "kind": "typedef" } */
typedef double Double;

namespace detail {
/** Glean {"file": "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift", "name": "Object", "kind": "struct" } */
class Object  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static const char* __fbthrift_thrift_uri();
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  template <class ...>
  FOLLY_ERASE static constexpr std::string_view __fbthrift_get_module_name() noexcept {
    return "protocol_detail";
  }
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::type,
    ::apache::thrift::ident::members
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::string_t,
    ::apache::thrift::type::cpp_type<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 2;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_clear_terse_fields();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = Object;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    true;


 public:

  Object();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  Object(apache::thrift::FragileConstructor, ::std::string type__arg, ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>> members__arg);

  Object(Object&&) noexcept;
  Object(const Object& src);


  Object& operator=(Object&&) noexcept;
  Object& operator=(const Object& src);

  virtual ~Object() ;

 private:
  ::std::string __fbthrift_field_type;
 private:
  ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>> __fbthrift_field_members;
 private:
  apache::thrift::detail::isset_bitset<1, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

  bool operator==(const Object&) const;
  bool operator<(const Object&) const;

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> type_ref() const& {
    return {this->__fbthrift_field_type, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> type_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_type), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> type_ref() & {
    return {this->__fbthrift_field_type, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> type_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_type), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> type() const& {
    return {this->__fbthrift_field_type, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> type() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_type), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> type() & {
    return {this->__fbthrift_field_type, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "type" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> type() && {
    return {static_cast<T&&>(this->__fbthrift_field_type), __isset.at(0), __isset.bit(0)};
  }
  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE T& members_ref() & {
    return __fbthrift_field_members;
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE const T& members_ref() const& {
    return __fbthrift_field_members;
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE T&& members_ref() && {
    return static_cast<T&&>(__fbthrift_field_members);
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE const T&& members_ref() const&& {
    return static_cast<const T&&>(__fbthrift_field_members);
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE T& members() & {
    return __fbthrift_field_members;
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE const T& members() const& {
    return __fbthrift_field_members;
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE T&& members() && {
    return static_cast<T&&>(__fbthrift_field_members);
  }

  /** Glean { "field": "members" } */
  template <typename ..., typename T = ::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE const T&& members() const&& {
    return static_cast<const T&&>(__fbthrift_field_members);
  }

  /** Glean { "field": "type" } */
  [[deprecated("Use `FOO.type().value();` instead of `FOO.get_type();`")]]
  const ::std::string& get_type() const& {
    return __fbthrift_field_type;
  }

  /** Glean { "field": "type" } */
  [[deprecated("Use `FOO.type().value();` instead of `FOO.get_type();`")]]
  ::std::string get_type() && {
    return static_cast<::std::string&&>(__fbthrift_field_type);
  }

  /** Glean { "field": "type" } */
  template <typename T_Object_type_struct_setter = ::std::string>
  [[deprecated("Use `FOO.type() = BAR;` instead of `FOO.set_type(BAR);`")]]
  ::std::string& set_type(T_Object_type_struct_setter&& type_) {
    type_ref() = std::forward<T_Object_type_struct_setter>(type_);
    return __fbthrift_field_type;
  }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<Object>;
  friend void swap(Object& a, Object& b);
};

template <class Protocol_>
unsigned long Object::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}
} // namespace detail


namespace detail {
/** Glean {"file": "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol_detail.thrift", "name": "Value", "kind": "union" } */
class Value  {
 private:
  friend struct ::apache::thrift::detail::st::struct_private_access;
  template<class> friend struct ::apache::thrift::detail::invoke_reffer;

  //  used by a static_assert in the corresponding source
  static constexpr bool __fbthrift_cpp2_gen_json = false;
  static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
  static const char* __fbthrift_thrift_uri();
  static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
  static std::string_view __fbthrift_get_class_name();
  template <class ...>
  FOLLY_ERASE static constexpr std::string_view __fbthrift_get_module_name() noexcept {
    return "protocol_detail";
  }
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::boolValue,
    ::apache::thrift::ident::byteValue,
    ::apache::thrift::ident::i16Value,
    ::apache::thrift::ident::i32Value,
    ::apache::thrift::ident::i64Value,
    ::apache::thrift::ident::floatValue,
    ::apache::thrift::ident::doubleValue,
    ::apache::thrift::ident::stringValue,
    ::apache::thrift::ident::binaryValue,
    ::apache::thrift::ident::objectValue,
    ::apache::thrift::ident::listValue,
    ::apache::thrift::ident::setValue,
    ::apache::thrift::ident::mapValue
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4,5,6,7,8,9,11,14,15,16};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::bool_t,
    ::apache::thrift::type::byte_t,
    ::apache::thrift::type::i16_t,
    ::apache::thrift::type::i32_t,
    ::apache::thrift::type::i64_t,
    ::apache::thrift::type::float_t,
    ::apache::thrift::type::double_t,
    ::apache::thrift::type::binary_t,
    ::apache::thrift::type::cpp_type<folly::IOBuf, ::apache::thrift::type::binary_t>,
    ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ObjectAdapter, ::apache::thrift::type::struct_t<::apache::thrift::protocol::detail::detail::Object>>,
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>,
    ::apache::thrift::type::cpp_type<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>,
    ::apache::thrift::type::cpp_type<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 13;

  template<class T>
  using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;

  template<class T>
  using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;

  template<class T>
  using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;

  template<class T> using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
    ::apache::thrift::detail::getFieldOrdinal<T,
                                              __fbthrift_reflection_ident_list,
                                              __fbthrift_reflection_type_tags>(
      __fbthrift_reflection_field_id_list
    )
  >;
  void __fbthrift_clear();
  void __fbthrift_destruct();
  bool __fbthrift_is_empty() const;

 public:
  using __fbthrift_cpp2_type = Value;
  static constexpr bool __fbthrift_cpp2_is_union =
    true;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    true;


 public:
  enum class Type : int {
    __EMPTY__ = 0,
    boolValue = 1,
    byteValue = 2,
    i16Value = 3,
    i32Value = 4,
    i64Value = 5,
    floatValue = 6,
    doubleValue = 7,
    stringValue = 8,
    binaryValue = 9,
    objectValue = 11,
    listValue = 14,
    setValue = 15,
    mapValue = 16,
  } ;

  Value()
      : type_(folly::to_underlying(Type::__EMPTY__)) {}

  Value(Value&& rhs) noexcept
      : type_(folly::to_underlying(Type::__EMPTY__)) {
    if (this == &rhs) { return; }
    switch (rhs.getType()) {
      case Type::__EMPTY__:
      {
        return;
      }
      case Type::boolValue:
      {
        set_boolValue(std::move(rhs.value_.boolValue));
        break;
      }
      case Type::byteValue:
      {
        set_byteValue(std::move(rhs.value_.byteValue));
        break;
      }
      case Type::i16Value:
      {
        set_i16Value(std::move(rhs.value_.i16Value));
        break;
      }
      case Type::i32Value:
      {
        set_i32Value(std::move(rhs.value_.i32Value));
        break;
      }
      case Type::i64Value:
      {
        set_i64Value(std::move(rhs.value_.i64Value));
        break;
      }
      case Type::floatValue:
      {
        set_floatValue(std::move(rhs.value_.floatValue));
        break;
      }
      case Type::doubleValue:
      {
        set_doubleValue(std::move(rhs.value_.doubleValue));
        break;
      }
      case Type::stringValue:
      {
        set_stringValue(std::move(rhs.value_.stringValue));
        break;
      }
      case Type::binaryValue:
      {
        set_binaryValue(std::move(rhs.value_.binaryValue));
        break;
      }
      case Type::objectValue:
      {
        set_objectValue(std::move(rhs.value_.objectValue));
        break;
      }
      case Type::listValue:
      {
        set_listValue(std::move(rhs.value_.listValue));
        break;
      }
      case Type::setValue:
      {
        set_setValue(std::move(*rhs.value_.setValue));
        break;
      }
      case Type::mapValue:
      {
        set_mapValue(std::move(*rhs.value_.mapValue));
        break;
      }
      default:
      {
        assert(false);
        break;
      }
    }
    apache::thrift::clear(rhs);
  }

  Value(const Value& rhs);

  Value& operator=(Value&& rhs) noexcept {
    if (this == &rhs) { return *this; }
    switch (rhs.getType()) {
      case Type::__EMPTY__:
      {
        __fbthrift_clear();
        return *this;
      }
      case Type::boolValue:
      {
        set_boolValue(std::move(rhs.value_.boolValue));
        break;
      }
      case Type::byteValue:
      {
        set_byteValue(std::move(rhs.value_.byteValue));
        break;
      }
      case Type::i16Value:
      {
        set_i16Value(std::move(rhs.value_.i16Value));
        break;
      }
      case Type::i32Value:
      {
        set_i32Value(std::move(rhs.value_.i32Value));
        break;
      }
      case Type::i64Value:
      {
        set_i64Value(std::move(rhs.value_.i64Value));
        break;
      }
      case Type::floatValue:
      {
        set_floatValue(std::move(rhs.value_.floatValue));
        break;
      }
      case Type::doubleValue:
      {
        set_doubleValue(std::move(rhs.value_.doubleValue));
        break;
      }
      case Type::stringValue:
      {
        set_stringValue(std::move(rhs.value_.stringValue));
        break;
      }
      case Type::binaryValue:
      {
        set_binaryValue(std::move(rhs.value_.binaryValue));
        break;
      }
      case Type::objectValue:
      {
        set_objectValue(std::move(rhs.value_.objectValue));
        break;
      }
      case Type::listValue:
      {
        set_listValue(std::move(rhs.value_.listValue));
        break;
      }
      case Type::setValue:
      {
        set_setValue(std::move(*rhs.value_.setValue));
        break;
      }
      case Type::mapValue:
      {
        set_mapValue(std::move(*rhs.value_.mapValue));
        break;
      }
      default:
      {
        assert(false);
        __fbthrift_clear();
      }
    }
    apache::thrift::clear(rhs);
    return *this;
  }

  Value& operator=(const Value& rhs);

  virtual ~Value();

  union storage_type {
    bool boolValue;
    ::std::int8_t byteValue;
    ::std::int16_t i16Value;
    ::std::int32_t i32Value;
    ::std::int64_t i64Value;
    ::apache::thrift::protocol::detail::Float floatValue;
    ::apache::thrift::protocol::detail::Double doubleValue;
    ::std::string stringValue;
    ::apache::thrift::type::ByteBuffer binaryValue;
    ::apache::thrift::protocol::detail::Object objectValue;
    ::std::vector<::apache::thrift::protocol::detail::Value> listValue;
    ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>> setValue;
    ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>> mapValue;

    storage_type() {}
    ~storage_type() {}
  } ;

  bool operator==(const Value&) const;
  bool operator<(const Value&) const;

  /** Glean { "field": "boolValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  bool& set_boolValue(bool t = bool()) {
    using T0 = bool;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::boolValue);
    ::new (std::addressof(value_.boolValue)) T(t);
    return value_.boolValue;
  }


  /** Glean { "field": "byteValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::int8_t& set_byteValue(::std::int8_t t = ::std::int8_t()) {
    using T0 = ::std::int8_t;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::byteValue);
    ::new (std::addressof(value_.byteValue)) T(t);
    return value_.byteValue;
  }


  /** Glean { "field": "i16Value" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::int16_t& set_i16Value(::std::int16_t t = ::std::int16_t()) {
    using T0 = ::std::int16_t;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::i16Value);
    ::new (std::addressof(value_.i16Value)) T(t);
    return value_.i16Value;
  }


  /** Glean { "field": "i32Value" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::int32_t& set_i32Value(::std::int32_t t = ::std::int32_t()) {
    using T0 = ::std::int32_t;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::i32Value);
    ::new (std::addressof(value_.i32Value)) T(t);
    return value_.i32Value;
  }


  /** Glean { "field": "i64Value" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::int64_t& set_i64Value(::std::int64_t t = ::std::int64_t()) {
    using T0 = ::std::int64_t;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::i64Value);
    ::new (std::addressof(value_.i64Value)) T(t);
    return value_.i64Value;
  }


  /** Glean { "field": "floatValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::protocol::detail::Float& set_floatValue(::apache::thrift::protocol::detail::Float t = ::apache::thrift::protocol::detail::Float()) {
    using T0 = ::apache::thrift::protocol::detail::Float;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::floatValue);
    ::new (std::addressof(value_.floatValue)) T(t);
    return value_.floatValue;
  }


  /** Glean { "field": "doubleValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::protocol::detail::Double& set_doubleValue(::apache::thrift::protocol::detail::Double t = ::apache::thrift::protocol::detail::Double()) {
    using T0 = ::apache::thrift::protocol::detail::Double;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::doubleValue);
    ::new (std::addressof(value_.doubleValue)) T(t);
    return value_.doubleValue;
  }


  /** Glean { "field": "stringValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::string& set_stringValue(::std::string const &t) {
    using T0 = ::std::string;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::stringValue);
    ::new (std::addressof(value_.stringValue)) T(t);
    return value_.stringValue;
  }

  /** Glean { "field": "stringValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::string& set_stringValue(::std::string&& t) {
    using T0 = ::std::string;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::stringValue);
    ::new (std::addressof(value_.stringValue)) T(std::move(t));
    return value_.stringValue;
  }

  /** Glean { "field": "stringValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::std::string, T...>> ::std::string& set_stringValue(T&&... t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::stringValue);
    ::new (std::addressof(value_.stringValue)) ::std::string(std::forward<T>(t)...);
    return value_.stringValue;
  }


  /** Glean { "field": "binaryValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::type::ByteBuffer& set_binaryValue(::apache::thrift::type::ByteBuffer const &t) {
    using T0 = ::apache::thrift::type::ByteBuffer;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::binaryValue);
    ::new (std::addressof(value_.binaryValue)) T(t);
    return value_.binaryValue;
  }

  /** Glean { "field": "binaryValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::type::ByteBuffer& set_binaryValue(::apache::thrift::type::ByteBuffer&& t) {
    using T0 = ::apache::thrift::type::ByteBuffer;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::binaryValue);
    ::new (std::addressof(value_.binaryValue)) T(std::move(t));
    return value_.binaryValue;
  }

  /** Glean { "field": "binaryValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::apache::thrift::type::ByteBuffer, T...>> ::apache::thrift::type::ByteBuffer& set_binaryValue(T&&... t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::binaryValue);
    ::new (std::addressof(value_.binaryValue)) ::apache::thrift::type::ByteBuffer(std::forward<T>(t)...);
    return value_.binaryValue;
  }


  /** Glean { "field": "objectValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::protocol::detail::Object& set_objectValue(::apache::thrift::protocol::detail::Object const &t) {
    using T0 = ::apache::thrift::protocol::detail::Object;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::objectValue);
    ::new (std::addressof(value_.objectValue)) T(t);
    return value_.objectValue;
  }

  /** Glean { "field": "objectValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::apache::thrift::protocol::detail::Object& set_objectValue(::apache::thrift::protocol::detail::Object&& t) {
    using T0 = ::apache::thrift::protocol::detail::Object;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::objectValue);
    ::new (std::addressof(value_.objectValue)) T(std::move(t));
    return value_.objectValue;
  }

  /** Glean { "field": "objectValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::apache::thrift::protocol::detail::Object, T...>> ::apache::thrift::protocol::detail::Object& set_objectValue(T&&... t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::objectValue);
    ::new (std::addressof(value_.objectValue)) ::apache::thrift::protocol::detail::Object(std::forward<T>(t)...);
    return value_.objectValue;
  }

  /** Glean { "field": "listValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::vector<::apache::thrift::protocol::detail::Value>& set_listValue(::std::vector<::apache::thrift::protocol::detail::Value> const &t) {
    using T0 = ::std::vector<::apache::thrift::protocol::detail::Value>;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::listValue);
    ::new (std::addressof(value_.listValue)) T(t);
    return value_.listValue;
  }

  /** Glean { "field": "listValue" } */
  template <typename... A, std::enable_if_t<!sizeof...(A), int> = 0>
  ::std::vector<::apache::thrift::protocol::detail::Value>& set_listValue(::std::vector<::apache::thrift::protocol::detail::Value>&& t) {
    using T0 = ::std::vector<::apache::thrift::protocol::detail::Value>;
    using T = folly::type_t<T0, A...>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::listValue);
    ::new (std::addressof(value_.listValue)) T(std::move(t));
    return value_.listValue;
  }

  /** Glean { "field": "listValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::std::vector<::apache::thrift::protocol::detail::Value>, T...>> ::std::vector<::apache::thrift::protocol::detail::Value>& set_listValue(T&&... t) {
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::listValue);
    ::new (std::addressof(value_.listValue)) ::std::vector<::apache::thrift::protocol::detail::Value>(std::forward<T>(t)...);
    return value_.listValue;
  }
  ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>& set_setValue(::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>> t);
  ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>& set_setValue(::folly::F14FastSet<::apache::thrift::protocol::detail::Value> const &t);
  ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>& set_setValue(::folly::F14FastSet<::apache::thrift::protocol::detail::Value>&& t);
  /** Glean { "field": "setValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, T...>> ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>& set_setValue(T&&... t) {
    // defer resolution of ref_ in case ref_::element_type would here be incomplete
    using ref_ = folly::conditional_t<(sizeof...(T) < size_t(-1)), ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>, void>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::setValue);
    ::new (std::addressof(value_.setValue)) ref_(new typename ref_::element_type(std::forward<T>(t)...));
    return value_.setValue;
  }
  ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>& set_mapValue(::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>> t);
  ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>& set_mapValue(::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value> const &t);
  ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>& set_mapValue(::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>&& t);
  /** Glean { "field": "mapValue" } */
  template<typename... T, typename = ::apache::thrift::safe_overload_t<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, T...>> ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>& set_mapValue(T&&... t) {
    // defer resolution of ref_ in case ref_::element_type would here be incomplete
    using ref_ = folly::conditional_t<(sizeof...(T) < size_t(-1)), ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>, void>;
    __fbthrift_clear();
    type_ = folly::to_underlying(Type::mapValue);
    ::new (std::addressof(value_.mapValue)) ref_(new typename ref_::element_type(std::forward<T>(t)...));
    return value_.mapValue;
  }

  bool const& get_boolValue() const {
    if (getType() != Type::boolValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.boolValue;
  }

  ::std::int8_t const& get_byteValue() const {
    if (getType() != Type::byteValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.byteValue;
  }

  ::std::int16_t const& get_i16Value() const {
    if (getType() != Type::i16Value) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.i16Value;
  }

  ::std::int32_t const& get_i32Value() const {
    if (getType() != Type::i32Value) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.i32Value;
  }

  ::std::int64_t const& get_i64Value() const {
    if (getType() != Type::i64Value) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.i64Value;
  }

  ::apache::thrift::protocol::detail::Float const& get_floatValue() const {
    if (getType() != Type::floatValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.floatValue;
  }

  ::apache::thrift::protocol::detail::Double const& get_doubleValue() const {
    if (getType() != Type::doubleValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.doubleValue;
  }

  ::std::string const& get_stringValue() const {
    if (getType() != Type::stringValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.stringValue;
  }

  ::apache::thrift::type::ByteBuffer const& get_binaryValue() const {
    if (getType() != Type::binaryValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.binaryValue;
  }

  ::apache::thrift::protocol::detail::Object const& get_objectValue() const {
    if (getType() != Type::objectValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.objectValue;
  }

  ::std::vector<::apache::thrift::protocol::detail::Value> const& get_listValue() const {
    if (getType() != Type::listValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.listValue;
  }

  ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>> const& get_setValue() const {
    if (getType() != Type::setValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.setValue;
  }

  ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>> const& get_mapValue() const {
    if (getType() != Type::mapValue) {
      ::apache::thrift::detail::throw_on_bad_union_field_access();
    }
    return value_.mapValue;
  }

  bool& mutable_boolValue() {
    assert(getType() == Type::boolValue);
    return value_.boolValue;
  }

  ::std::int8_t& mutable_byteValue() {
    assert(getType() == Type::byteValue);
    return value_.byteValue;
  }

  ::std::int16_t& mutable_i16Value() {
    assert(getType() == Type::i16Value);
    return value_.i16Value;
  }

  ::std::int32_t& mutable_i32Value() {
    assert(getType() == Type::i32Value);
    return value_.i32Value;
  }

  ::std::int64_t& mutable_i64Value() {
    assert(getType() == Type::i64Value);
    return value_.i64Value;
  }

  ::apache::thrift::protocol::detail::Float& mutable_floatValue() {
    assert(getType() == Type::floatValue);
    return value_.floatValue;
  }

  ::apache::thrift::protocol::detail::Double& mutable_doubleValue() {
    assert(getType() == Type::doubleValue);
    return value_.doubleValue;
  }

  ::std::string& mutable_stringValue() {
    assert(getType() == Type::stringValue);
    return value_.stringValue;
  }

  ::apache::thrift::type::ByteBuffer& mutable_binaryValue() {
    assert(getType() == Type::binaryValue);
    return value_.binaryValue;
  }

  ::apache::thrift::protocol::detail::Object& mutable_objectValue() {
    assert(getType() == Type::objectValue);
    return value_.objectValue;
  }

  ::std::vector<::apache::thrift::protocol::detail::Value>& mutable_listValue() {
    assert(getType() == Type::listValue);
    return value_.listValue;
  }

  ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>& mutable_setValue() {
    assert(getType() == Type::setValue);
    return value_.setValue;
  }

  ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>& mutable_mapValue() {
    assert(getType() == Type::mapValue);
    return value_.mapValue;
  }

  template <typename..., typename T = bool>
  T move_boolValue() {
    assert(getType() == Type::boolValue);
    return std::move(value_.boolValue);
  }

  template <typename..., typename T = ::std::int8_t>
  T move_byteValue() {
    assert(getType() == Type::byteValue);
    return std::move(value_.byteValue);
  }

  template <typename..., typename T = ::std::int16_t>
  T move_i16Value() {
    assert(getType() == Type::i16Value);
    return std::move(value_.i16Value);
  }

  template <typename..., typename T = ::std::int32_t>
  T move_i32Value() {
    assert(getType() == Type::i32Value);
    return std::move(value_.i32Value);
  }

  template <typename..., typename T = ::std::int64_t>
  T move_i64Value() {
    assert(getType() == Type::i64Value);
    return std::move(value_.i64Value);
  }

  template <typename..., typename T = ::apache::thrift::protocol::detail::Float>
  T move_floatValue() {
    assert(getType() == Type::floatValue);
    return std::move(value_.floatValue);
  }

  template <typename..., typename T = ::apache::thrift::protocol::detail::Double>
  T move_doubleValue() {
    assert(getType() == Type::doubleValue);
    return std::move(value_.doubleValue);
  }

  template <typename..., typename T = ::std::string>
  T move_stringValue() {
    assert(getType() == Type::stringValue);
    return std::move(value_.stringValue);
  }

  template <typename..., typename T = ::apache::thrift::type::ByteBuffer>
  T move_binaryValue() {
    assert(getType() == Type::binaryValue);
    return std::move(value_.binaryValue);
  }

  template <typename..., typename T = ::apache::thrift::protocol::detail::Object>
  T move_objectValue() {
    assert(getType() == Type::objectValue);
    return std::move(value_.objectValue);
  }

  template <typename..., typename T = ::std::vector<::apache::thrift::protocol::detail::Value>>
  T move_listValue() {
    assert(getType() == Type::listValue);
    return std::move(value_.listValue);
  }

  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>
  T move_setValue() {
    assert(getType() == Type::setValue);
    return std::move(value_.setValue);
  }

  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>
  T move_mapValue() {
    assert(getType() == Type::mapValue);
    return std::move(value_.mapValue);
  }

  /** Glean { "field": "boolValue" } */
  template <typename..., typename T = bool>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> boolValue_ref() const& {
    return {value_.boolValue, type_, folly::to_underlying(Type::boolValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "boolValue" } */
  template <typename..., typename T = bool>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> boolValue_ref() const&& {
    return {std::move(value_.boolValue), type_, folly::to_underlying(Type::boolValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "boolValue" } */
  template <typename..., typename T = bool>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> boolValue_ref() & {
    return {value_.boolValue, type_, folly::to_underlying(Type::boolValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "boolValue" } */
  template <typename..., typename T = bool>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> boolValue_ref() && {
    return {std::move(value_.boolValue), type_, folly::to_underlying(Type::boolValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "byteValue" } */
  template <typename..., typename T = ::std::int8_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> byteValue_ref() const& {
    return {value_.byteValue, type_, folly::to_underlying(Type::byteValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "byteValue" } */
  template <typename..., typename T = ::std::int8_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> byteValue_ref() const&& {
    return {std::move(value_.byteValue), type_, folly::to_underlying(Type::byteValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "byteValue" } */
  template <typename..., typename T = ::std::int8_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> byteValue_ref() & {
    return {value_.byteValue, type_, folly::to_underlying(Type::byteValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "byteValue" } */
  template <typename..., typename T = ::std::int8_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> byteValue_ref() && {
    return {std::move(value_.byteValue), type_, folly::to_underlying(Type::byteValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "i16Value" } */
  template <typename..., typename T = ::std::int16_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> i16Value_ref() const& {
    return {value_.i16Value, type_, folly::to_underlying(Type::i16Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i16Value" } */
  template <typename..., typename T = ::std::int16_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> i16Value_ref() const&& {
    return {std::move(value_.i16Value), type_, folly::to_underlying(Type::i16Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i16Value" } */
  template <typename..., typename T = ::std::int16_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> i16Value_ref() & {
    return {value_.i16Value, type_, folly::to_underlying(Type::i16Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i16Value" } */
  template <typename..., typename T = ::std::int16_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> i16Value_ref() && {
    return {std::move(value_.i16Value), type_, folly::to_underlying(Type::i16Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "i32Value" } */
  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> i32Value_ref() const& {
    return {value_.i32Value, type_, folly::to_underlying(Type::i32Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i32Value" } */
  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> i32Value_ref() const&& {
    return {std::move(value_.i32Value), type_, folly::to_underlying(Type::i32Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i32Value" } */
  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> i32Value_ref() & {
    return {value_.i32Value, type_, folly::to_underlying(Type::i32Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i32Value" } */
  template <typename..., typename T = ::std::int32_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> i32Value_ref() && {
    return {std::move(value_.i32Value), type_, folly::to_underlying(Type::i32Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "i64Value" } */
  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> i64Value_ref() const& {
    return {value_.i64Value, type_, folly::to_underlying(Type::i64Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i64Value" } */
  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> i64Value_ref() const&& {
    return {std::move(value_.i64Value), type_, folly::to_underlying(Type::i64Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i64Value" } */
  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> i64Value_ref() & {
    return {value_.i64Value, type_, folly::to_underlying(Type::i64Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "i64Value" } */
  template <typename..., typename T = ::std::int64_t>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> i64Value_ref() && {
    return {std::move(value_.i64Value), type_, folly::to_underlying(Type::i64Value), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "floatValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Float>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> floatValue_ref() const& {
    return {value_.floatValue, type_, folly::to_underlying(Type::floatValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "floatValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Float>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> floatValue_ref() const&& {
    return {std::move(value_.floatValue), type_, folly::to_underlying(Type::floatValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "floatValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Float>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> floatValue_ref() & {
    return {value_.floatValue, type_, folly::to_underlying(Type::floatValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "floatValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Float>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> floatValue_ref() && {
    return {std::move(value_.floatValue), type_, folly::to_underlying(Type::floatValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "doubleValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Double>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> doubleValue_ref() const& {
    return {value_.doubleValue, type_, folly::to_underlying(Type::doubleValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "doubleValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Double>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> doubleValue_ref() const&& {
    return {std::move(value_.doubleValue), type_, folly::to_underlying(Type::doubleValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "doubleValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Double>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> doubleValue_ref() & {
    return {value_.doubleValue, type_, folly::to_underlying(Type::doubleValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "doubleValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Double>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> doubleValue_ref() && {
    return {std::move(value_.doubleValue), type_, folly::to_underlying(Type::doubleValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "stringValue" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> stringValue_ref() const& {
    return {value_.stringValue, type_, folly::to_underlying(Type::stringValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "stringValue" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> stringValue_ref() const&& {
    return {std::move(value_.stringValue), type_, folly::to_underlying(Type::stringValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "stringValue" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> stringValue_ref() & {
    return {value_.stringValue, type_, folly::to_underlying(Type::stringValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "stringValue" } */
  template <typename..., typename T = ::std::string>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> stringValue_ref() && {
    return {std::move(value_.stringValue), type_, folly::to_underlying(Type::stringValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "binaryValue" } */
  template <typename..., typename T = ::apache::thrift::type::ByteBuffer>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> binaryValue_ref() const& {
    return {value_.binaryValue, type_, folly::to_underlying(Type::binaryValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "binaryValue" } */
  template <typename..., typename T = ::apache::thrift::type::ByteBuffer>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> binaryValue_ref() const&& {
    return {std::move(value_.binaryValue), type_, folly::to_underlying(Type::binaryValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "binaryValue" } */
  template <typename..., typename T = ::apache::thrift::type::ByteBuffer>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> binaryValue_ref() & {
    return {value_.binaryValue, type_, folly::to_underlying(Type::binaryValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "binaryValue" } */
  template <typename..., typename T = ::apache::thrift::type::ByteBuffer>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> binaryValue_ref() && {
    return {std::move(value_.binaryValue), type_, folly::to_underlying(Type::binaryValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "objectValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Object>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> objectValue_ref() const& {
    return {value_.objectValue, type_, folly::to_underlying(Type::objectValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "objectValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Object>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> objectValue_ref() const&& {
    return {std::move(value_.objectValue), type_, folly::to_underlying(Type::objectValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "objectValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Object>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> objectValue_ref() & {
    return {value_.objectValue, type_, folly::to_underlying(Type::objectValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "objectValue" } */
  template <typename..., typename T = ::apache::thrift::protocol::detail::Object>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> objectValue_ref() && {
    return {std::move(value_.objectValue), type_, folly::to_underlying(Type::objectValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "listValue" } */
  template <typename..., typename T = ::std::vector<::apache::thrift::protocol::detail::Value>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> listValue_ref() const& {
    return {value_.listValue, type_, folly::to_underlying(Type::listValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "listValue" } */
  template <typename..., typename T = ::std::vector<::apache::thrift::protocol::detail::Value>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> listValue_ref() const&& {
    return {std::move(value_.listValue), type_, folly::to_underlying(Type::listValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "listValue" } */
  template <typename..., typename T = ::std::vector<::apache::thrift::protocol::detail::Value>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> listValue_ref() & {
    return {value_.listValue, type_, folly::to_underlying(Type::listValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "listValue" } */
  template <typename..., typename T = ::std::vector<::apache::thrift::protocol::detail::Value>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> listValue_ref() && {
    return {std::move(value_.listValue), type_, folly::to_underlying(Type::listValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "setValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> setValue_ref() const& {
    return {value_.setValue, type_, folly::to_underlying(Type::setValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "setValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> setValue_ref() const&& {
    return {std::move(value_.setValue), type_, folly::to_underlying(Type::setValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "setValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> setValue_ref() & {
    return {value_.setValue, type_, folly::to_underlying(Type::setValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "setValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> setValue_ref() && {
    return {std::move(value_.setValue), type_, folly::to_underlying(Type::setValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  /** Glean { "field": "mapValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&> mapValue_ref() const& {
    return {value_.mapValue, type_, folly::to_underlying(Type::mapValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "mapValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<const T&&> mapValue_ref() const&& {
    return {std::move(value_.mapValue), type_, folly::to_underlying(Type::mapValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "mapValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&> mapValue_ref() & {
    return {value_.mapValue, type_, folly::to_underlying(Type::mapValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }

  /** Glean { "field": "mapValue" } */
  template <typename..., typename T = ::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>
  FOLLY_ERASE ::apache::thrift::union_field_ref<T&&> mapValue_ref() && {
    return {std::move(value_.mapValue), type_, folly::to_underlying(Type::mapValue), this, ::apache::thrift::detail::union_field_ref_owner_vtable_for<decltype(*this)>};
  }
  Type getType() const { return static_cast<Type>(type_); }

  template <class Protocol_>
  unsigned long read(Protocol_* iprot);
  template <class Protocol_>
  uint32_t serializedSize(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t serializedSizeZC(Protocol_ const* prot_) const;
  template <class Protocol_>
  uint32_t write(Protocol_* prot_) const;
 protected:
  storage_type value_;
  std::underlying_type_t<Type> type_;

 private:
  template <class Protocol_>
  void readNoXfer(Protocol_* iprot);

  friend class ::apache::thrift::Cpp2Ops<Value>;
  friend void swap(Value& a, Value& b);
};

template <class Protocol_>
unsigned long Value::read(Protocol_* iprot) {
  auto _xferStart = iprot->getCursorPosition();
  readNoXfer(iprot);
  return iprot->getCursorPosition() - _xferStart;
}
} // namespace detail


} // namespace apache::thrift::protocol::detail

namespace apache { namespace thrift {

template <> struct TEnumDataStorage<::apache::thrift::protocol::detail::detail::Value::Type>;

template <> struct TEnumTraits<::apache::thrift::protocol::detail::detail::Value::Type> {
  using type = ::apache::thrift::protocol::detail::detail::Value::Type;

  static constexpr std::size_t const size = 13;
  static folly::Range<type const*> const values;
  static folly::Range<std::string_view const*> const names;

  static bool findName(type value, std::string_view* out) noexcept;
  static bool findValue(std::string_view name, type* out) noexcept;

  static char const* findName(type value) noexcept {
    std::string_view ret;
    (void)findName(value, &ret);
    return ret.data();
  }
};
}} // apache::thrift
