/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/encode/src/module.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>



namespace apache {
namespace thrift {
namespace ident {
struct field;
struct list_field;
struct list_field;
struct nested_list_field;
struct int_field;
struct enum_field;
struct foo_field;
struct adapted_field;
struct list_field;
struct list_shared_ptr_field;
struct list_cpp_type_field;
struct set_field;
struct map_field;
struct nested_field;
struct bar_field;
struct adapted_list_field;
} // namespace ident
namespace detail {
#ifndef APACHE_THRIFT_ACCESSOR_field
#define APACHE_THRIFT_ACCESSOR_field
APACHE_THRIFT_DEFINE_ACCESSOR(field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_list_field
#define APACHE_THRIFT_ACCESSOR_list_field
APACHE_THRIFT_DEFINE_ACCESSOR(list_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_list_field
#define APACHE_THRIFT_ACCESSOR_list_field
APACHE_THRIFT_DEFINE_ACCESSOR(list_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_nested_list_field
#define APACHE_THRIFT_ACCESSOR_nested_list_field
APACHE_THRIFT_DEFINE_ACCESSOR(nested_list_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_int_field
#define APACHE_THRIFT_ACCESSOR_int_field
APACHE_THRIFT_DEFINE_ACCESSOR(int_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_enum_field
#define APACHE_THRIFT_ACCESSOR_enum_field
APACHE_THRIFT_DEFINE_ACCESSOR(enum_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_foo_field
#define APACHE_THRIFT_ACCESSOR_foo_field
APACHE_THRIFT_DEFINE_ACCESSOR(foo_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_adapted_field
#define APACHE_THRIFT_ACCESSOR_adapted_field
APACHE_THRIFT_DEFINE_ACCESSOR(adapted_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_list_field
#define APACHE_THRIFT_ACCESSOR_list_field
APACHE_THRIFT_DEFINE_ACCESSOR(list_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_list_shared_ptr_field
#define APACHE_THRIFT_ACCESSOR_list_shared_ptr_field
APACHE_THRIFT_DEFINE_ACCESSOR(list_shared_ptr_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_list_cpp_type_field
#define APACHE_THRIFT_ACCESSOR_list_cpp_type_field
APACHE_THRIFT_DEFINE_ACCESSOR(list_cpp_type_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_set_field
#define APACHE_THRIFT_ACCESSOR_set_field
APACHE_THRIFT_DEFINE_ACCESSOR(set_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_map_field
#define APACHE_THRIFT_ACCESSOR_map_field
APACHE_THRIFT_DEFINE_ACCESSOR(map_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_nested_field
#define APACHE_THRIFT_ACCESSOR_nested_field
APACHE_THRIFT_DEFINE_ACCESSOR(nested_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_bar_field
#define APACHE_THRIFT_ACCESSOR_bar_field
APACHE_THRIFT_DEFINE_ACCESSOR(bar_field);
#endif
#ifndef APACHE_THRIFT_ACCESSOR_adapted_list_field
#define APACHE_THRIFT_ACCESSOR_adapted_list_field
APACHE_THRIFT_DEFINE_ACCESSOR(adapted_list_field);
#endif
} // namespace detail
} // namespace thrift
} // namespace apache

// BEGIN declare_enums
namespace facebook::thrift::test {

/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "Enum", "kind": "enum" } */
enum class Enum {
  first = 1,
  second = 2,
};



} // namespace facebook::thrift::test

namespace std {
template<> struct hash<::facebook::thrift::test::Enum> :
  ::apache::thrift::detail::enum_hash<::facebook::thrift::test::Enum> {};
} // std

namespace apache { namespace thrift {


template <> struct TEnumDataStorage<::facebook::thrift::test::Enum>;

template <> struct TEnumTraits<::facebook::thrift::test::Enum> {
  using type = ::facebook::thrift::test::Enum;

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

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

  template <class ...>
  FOLLY_ERASE static std::string_view typeName() noexcept {
    return "Enum";
  }

  static char const* findName(type value) noexcept {
    std::string_view ret;
    (void)findName(value, &ret);
    return ret.data();
  }
  static constexpr type min() { return type::first; }
  static constexpr type max() { return type::second; }
};


}} // apache::thrift


// END declare_enums
// BEGIN forward_declare
namespace facebook::thrift::test {
class Foo;
class Bar;
class Baz;
class OpEncodeStruct;
} // namespace facebook::thrift::test
// END forward_declare
namespace apache::thrift::detail::annotation {
} // namespace apache::thrift::detail::annotation

namespace apache::thrift::detail::qualifier {
template<>
struct is_cpp_ref_field_optional<::facebook::thrift::test::OpEncodeStruct,::apache::thrift::type::field_id<6>> : std::true_type{};
} // namespace apache::thrift::detail::qualifier

// BEGIN hash_and_equal_to
// END hash_and_equal_to
namespace facebook::thrift::test {
using ::apache::thrift::detail::operator!=;
using ::apache::thrift::detail::operator>;
using ::apache::thrift::detail::operator<=;
using ::apache::thrift::detail::operator>=;


/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "Foo", "kind": "struct" } */
class Foo final  {
 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();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::field
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::i32_t
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 1;

  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 = Foo;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    false;


 public:

  Foo() :
      __fbthrift_field_field() {
  }
  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  Foo(apache::thrift::FragileConstructor, ::std::int32_t field__arg);

  Foo(Foo&&) = default;

  Foo(const Foo&) = default;


  Foo& operator=(Foo&&) = default;

  Foo& operator=(const Foo&) = default;
 private:
  ::std::int32_t __fbthrift_field_field;
 private:
  apache::thrift::detail::isset_bitset<1, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

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

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

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

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

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

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

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

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

  /** Glean { "field": "field" } */
  ::std::int32_t get_field() const {
    return __fbthrift_field_field;
  }

  /** Glean { "field": "field" } */
  [[deprecated("Use `FOO.field() = BAR;` instead of `FOO.set_field(BAR);`")]]
  ::std::int32_t& set_field(::std::int32_t field_) {
    field_ref() = field_;
    return __fbthrift_field_field;
  }

  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<Foo>;
  friend void swap(Foo& a, Foo& b);
};

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

/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "AdaptedFoo", "kind": "typedef" } */
typedef ::apache::thrift::adapt_detail::adapted_t<::apache::thrift::test::TemplatedTestAdapter, ::facebook::thrift::test::Foo> AdaptedFoo;

/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "Bar", "kind": "struct" } */
class Bar final  {
 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();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::list_field
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 1;

  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 = Bar;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    true;


 public:

  Bar();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  Bar(apache::thrift::FragileConstructor, ::std::vector<::facebook::thrift::test::AdaptedFoo> list_field__arg);

  Bar(Bar&&) noexcept;

  Bar(const Bar& src);


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

  ~Bar();

 private:
  ::std::vector<::facebook::thrift::test::AdaptedFoo> __fbthrift_field_list_field;
 private:
  apache::thrift::detail::isset_bitset<1, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field_ref() const& {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field_ref() & {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field() const& {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field() & {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }
  /** Glean { "field": "list_field" } */
  const ::std::vector<::facebook::thrift::test::AdaptedFoo>& get_list_field() const&;
  /** Glean { "field": "list_field" } */
  ::std::vector<::facebook::thrift::test::AdaptedFoo> get_list_field() &&;

  /** Glean { "field": "list_field" } */
  template <typename T_Bar_list_field_struct_setter = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.list_field() = BAR;` instead of `FOO.set_list_field(BAR);`")]]
  ::std::vector<::facebook::thrift::test::AdaptedFoo>& set_list_field(T_Bar_list_field_struct_setter&& list_field_) {
    list_field_ref() = std::forward<T_Bar_list_field_struct_setter>(list_field_);
    return __fbthrift_field_list_field;
  }

  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<Bar>;
  friend void swap(Bar& a, Bar& b);
};

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


/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "Baz", "kind": "struct" } */
class Baz final  {
 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();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::list_field,
    ::apache::thrift::ident::nested_list_field
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::list<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>>
  >;

  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 = Baz;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    true;


 public:

  Baz();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  Baz(apache::thrift::FragileConstructor, ::std::vector<::facebook::thrift::test::AdaptedFoo> list_field__arg, ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>> nested_list_field__arg);

  Baz(Baz&&) noexcept;

  Baz(const Baz& src);


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

  ~Baz();

 private:
  ::std::vector<::facebook::thrift::test::AdaptedFoo> __fbthrift_field_list_field;
 private:
  ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>> __fbthrift_field_nested_list_field;
 private:
  apache::thrift::detail::isset_bitset<2, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field_ref() const& {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field_ref() & {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field() const& {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field() & {
    return {this->__fbthrift_field_list_field, __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(0), __isset.bit(0)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nested_list_field_ref() const& {
    return {this->__fbthrift_field_nested_list_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nested_list_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nested_list_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nested_list_field_ref() & {
    return {this->__fbthrift_field_nested_list_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nested_list_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_nested_list_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nested_list_field() const& {
    return {this->__fbthrift_field_nested_list_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nested_list_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nested_list_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nested_list_field() & {
    return {this->__fbthrift_field_nested_list_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "nested_list_field" } */
  template <typename..., typename T = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nested_list_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_nested_list_field), __isset.at(1), __isset.bit(1)};
  }
  /** Glean { "field": "list_field" } */
  const ::std::vector<::facebook::thrift::test::AdaptedFoo>& get_list_field() const&;
  /** Glean { "field": "list_field" } */
  ::std::vector<::facebook::thrift::test::AdaptedFoo> get_list_field() &&;

  /** Glean { "field": "list_field" } */
  template <typename T_Baz_list_field_struct_setter = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.list_field() = BAR;` instead of `FOO.set_list_field(BAR);`")]]
  ::std::vector<::facebook::thrift::test::AdaptedFoo>& set_list_field(T_Baz_list_field_struct_setter&& list_field_) {
    list_field_ref() = std::forward<T_Baz_list_field_struct_setter>(list_field_);
    return __fbthrift_field_list_field;
  }
  /** Glean { "field": "nested_list_field" } */
  const ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>& get_nested_list_field() const&;
  /** Glean { "field": "nested_list_field" } */
  ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>> get_nested_list_field() &&;

  /** Glean { "field": "nested_list_field" } */
  template <typename T_Baz_nested_list_field_struct_setter = ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  [[deprecated("Use `FOO.nested_list_field() = BAR;` instead of `FOO.set_nested_list_field(BAR);`")]]
  ::std::vector<::std::vector<::facebook::thrift::test::AdaptedFoo>>& set_nested_list_field(T_Baz_nested_list_field_struct_setter&& nested_list_field_) {
    nested_list_field_ref() = std::forward<T_Baz_nested_list_field_struct_setter>(nested_list_field_);
    return __fbthrift_field_nested_list_field;
  }

  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<Baz>;
  friend void swap(Baz& a, Baz& b);
};

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


/** Glean {"file": "thrift/compiler/test/fixtures/encode/src/module.thrift", "name": "OpEncodeStruct", "kind": "struct" } */
class OpEncodeStruct final  {
 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();
  using __fbthrift_reflection_ident_list = folly::tag_t<
    ::apache::thrift::ident::int_field,
    ::apache::thrift::ident::enum_field,
    ::apache::thrift::ident::foo_field,
    ::apache::thrift::ident::adapted_field,
    ::apache::thrift::ident::list_field,
    ::apache::thrift::ident::list_shared_ptr_field,
    ::apache::thrift::ident::list_cpp_type_field,
    ::apache::thrift::ident::set_field,
    ::apache::thrift::ident::map_field,
    ::apache::thrift::ident::nested_field,
    ::apache::thrift::ident::bar_field,
    ::apache::thrift::ident::adapted_list_field
  >;

  static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
  using __fbthrift_reflection_type_tags = folly::tag_t<
    ::apache::thrift::type::i32_t,
    ::apache::thrift::type::enum_t<::facebook::thrift::test::Enum>,
    ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>,
    ::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>,
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>, ::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>,
    ::apache::thrift::type::map<::apache::thrift::type::i32_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>>,
    ::apache::thrift::type::struct_t<::facebook::thrift::test::Bar>,
    ::apache::thrift::type::adapted<::FieldAdapter, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::test::TemplatedTestAdapter, ::apache::thrift::type::struct_t<::facebook::thrift::test::Foo>>>>
  >;

  static constexpr std::size_t __fbthrift_field_size_v = 12;

  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 = OpEncodeStruct;
  static constexpr bool __fbthrift_cpp2_is_union =
    false;
  static constexpr bool __fbthrift_cpp2_uses_op_encode =
    true;


 public:

  OpEncodeStruct();

  // FragileConstructor for use in initialization lists only.
  [[deprecated("This constructor is deprecated")]]
  OpEncodeStruct(apache::thrift::FragileConstructor, ::std::int32_t int_field__arg, ::facebook::thrift::test::Enum enum_field__arg, ::facebook::thrift::test::Foo foo_field__arg, ::facebook::thrift::test::AdaptedFoo adapted_field__arg, ::std::vector<::facebook::thrift::test::AdaptedFoo> list_field__arg, ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>> list_shared_ptr_field__arg, ::std::vector<::facebook::thrift::test::AdaptedFoo> list_cpp_type_field__arg, ::std::set<::facebook::thrift::test::AdaptedFoo> set_field__arg, ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo> map_field__arg, ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>> nested_field__arg, ::facebook::thrift::test::Bar bar_field__arg, ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct> adapted_list_field__arg);

  OpEncodeStruct(OpEncodeStruct&&) noexcept;
  OpEncodeStruct(const OpEncodeStruct& src);


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

  ~OpEncodeStruct();

 private:
  ::std::int32_t __fbthrift_field_int_field;
 private:
  ::facebook::thrift::test::Enum __fbthrift_field_enum_field;
 private:
  ::facebook::thrift::test::Foo __fbthrift_field_foo_field;
 private:
  ::facebook::thrift::test::AdaptedFoo __fbthrift_field_adapted_field;
 private:
  ::std::vector<::facebook::thrift::test::AdaptedFoo> __fbthrift_field_list_field;
 private:
  ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>> __fbthrift_field_list_shared_ptr_field;
 private:
  ::std::vector<::facebook::thrift::test::AdaptedFoo> __fbthrift_field_list_cpp_type_field;
 private:
  ::std::set<::facebook::thrift::test::AdaptedFoo> __fbthrift_field_set_field;
 private:
  ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo> __fbthrift_field_map_field;
 private:
  ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>> __fbthrift_field_nested_field;
 private:
  ::facebook::thrift::test::Bar __fbthrift_field_bar_field;
 private:
  ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct> __fbthrift_field_adapted_list_field;
 private:
  apache::thrift::detail::isset_bitset<11, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;

 public:

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

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

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

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

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

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

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

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

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

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> enum_field_ref() const& {
    return {this->__fbthrift_field_enum_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> enum_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_enum_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> enum_field_ref() & {
    return {this->__fbthrift_field_enum_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> enum_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_enum_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> enum_field() const& {
    return {this->__fbthrift_field_enum_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> enum_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_enum_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> enum_field() & {
    return {this->__fbthrift_field_enum_field, __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "enum_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Enum>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> enum_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_enum_field), __isset.at(1), __isset.bit(1)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> foo_field_ref() const& {
    return {this->__fbthrift_field_foo_field, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> foo_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_foo_field), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> foo_field_ref() & {
    return {this->__fbthrift_field_foo_field, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> foo_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_foo_field), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> foo_field() const& {
    return {this->__fbthrift_field_foo_field, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> foo_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_foo_field), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> foo_field() & {
    return {this->__fbthrift_field_foo_field, __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "foo_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Foo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> foo_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_foo_field), __isset.at(2), __isset.bit(2)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> adapted_field_ref() const& {
    return {this->__fbthrift_field_adapted_field, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> adapted_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_adapted_field), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> adapted_field_ref() & {
    return {this->__fbthrift_field_adapted_field, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> adapted_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_adapted_field), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> adapted_field() const& {
    return {this->__fbthrift_field_adapted_field, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> adapted_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_adapted_field), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> adapted_field() & {
    return {this->__fbthrift_field_adapted_field, __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "adapted_field" } */
  template <typename..., typename T = ::facebook::thrift::test::AdaptedFoo>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> adapted_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_adapted_field), __isset.at(3), __isset.bit(3)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field_ref() const& {
    return {this->__fbthrift_field_list_field, __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field_ref() & {
    return {this->__fbthrift_field_list_field, __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_field() const& {
    return {this->__fbthrift_field_list_field, __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_field), __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_field() & {
    return {this->__fbthrift_field_list_field, __isset.at(4), __isset.bit(4)};
  }

  /** Glean { "field": "list_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_field), __isset.at(4), __isset.bit(4)};
  }
  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE T& list_shared_ptr_field_ref() & {
    return __fbthrift_field_list_shared_ptr_field;
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE const T& list_shared_ptr_field_ref() const& {
    return __fbthrift_field_list_shared_ptr_field;
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE T&& list_shared_ptr_field_ref() && {
    return static_cast<T&&>(__fbthrift_field_list_shared_ptr_field);
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE const T&& list_shared_ptr_field_ref() const&& {
    return static_cast<const T&&>(__fbthrift_field_list_shared_ptr_field);
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE T& list_shared_ptr_field() & {
    return __fbthrift_field_list_shared_ptr_field;
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE const T& list_shared_ptr_field() const& {
    return __fbthrift_field_list_shared_ptr_field;
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE T&& list_shared_ptr_field() && {
    return static_cast<T&&>(__fbthrift_field_list_shared_ptr_field);
  }

  /** Glean { "field": "list_shared_ptr_field" } */
  template <typename ..., typename T = ::std::shared_ptr<const ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE const T&& list_shared_ptr_field() const&& {
    return static_cast<const T&&>(__fbthrift_field_list_shared_ptr_field);
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_cpp_type_field_ref() const& {
    return {this->__fbthrift_field_list_cpp_type_field, __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_cpp_type_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_cpp_type_field), __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_cpp_type_field_ref() & {
    return {this->__fbthrift_field_list_cpp_type_field, __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_cpp_type_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_cpp_type_field), __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> list_cpp_type_field() const& {
    return {this->__fbthrift_field_list_cpp_type_field, __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> list_cpp_type_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_list_cpp_type_field), __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> list_cpp_type_field() & {
    return {this->__fbthrift_field_list_cpp_type_field, __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename..., typename T = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> list_cpp_type_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_list_cpp_type_field), __isset.at(5), __isset.bit(5)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> set_field_ref() const& {
    return {this->__fbthrift_field_set_field, __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> set_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_set_field), __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> set_field_ref() & {
    return {this->__fbthrift_field_set_field, __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> set_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_set_field), __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> set_field() const& {
    return {this->__fbthrift_field_set_field, __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> set_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_set_field), __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> set_field() & {
    return {this->__fbthrift_field_set_field, __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "set_field" } */
  template <typename..., typename T = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> set_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_set_field), __isset.at(6), __isset.bit(6)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> map_field_ref() const& {
    return {this->__fbthrift_field_map_field, __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> map_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_map_field), __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> map_field_ref() & {
    return {this->__fbthrift_field_map_field, __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> map_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_map_field), __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> map_field() const& {
    return {this->__fbthrift_field_map_field, __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> map_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_map_field), __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> map_field() & {
    return {this->__fbthrift_field_map_field, __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "map_field" } */
  template <typename..., typename T = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> map_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_map_field), __isset.at(7), __isset.bit(7)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nested_field_ref() const& {
    return {this->__fbthrift_field_nested_field, __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nested_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nested_field), __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nested_field_ref() & {
    return {this->__fbthrift_field_nested_field, __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nested_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_nested_field), __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> nested_field() const& {
    return {this->__fbthrift_field_nested_field, __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> nested_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_nested_field), __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> nested_field() & {
    return {this->__fbthrift_field_nested_field, __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "nested_field" } */
  template <typename..., typename T = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> nested_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_nested_field), __isset.at(8), __isset.bit(8)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> bar_field_ref() const& {
    return {this->__fbthrift_field_bar_field, __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> bar_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_bar_field), __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> bar_field_ref() & {
    return {this->__fbthrift_field_bar_field, __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> bar_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_bar_field), __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> bar_field() const& {
    return {this->__fbthrift_field_bar_field, __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> bar_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_bar_field), __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> bar_field() & {
    return {this->__fbthrift_field_bar_field, __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "bar_field" } */
  template <typename..., typename T = ::facebook::thrift::test::Bar>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> bar_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_bar_field), __isset.at(9), __isset.bit(9)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> adapted_list_field_ref() const& {
    return {this->__fbthrift_field_adapted_list_field, __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> adapted_list_field_ref() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_adapted_list_field), __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> adapted_list_field_ref() & {
    return {this->__fbthrift_field_adapted_list_field, __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> adapted_list_field_ref() && {
    return {static_cast<T&&>(this->__fbthrift_field_adapted_list_field), __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&> adapted_list_field() const& {
    return {this->__fbthrift_field_adapted_list_field, __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<const T&&> adapted_list_field() const&& {
    return {static_cast<const T&&>(this->__fbthrift_field_adapted_list_field), __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&> adapted_list_field() & {
    return {this->__fbthrift_field_adapted_list_field, __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "adapted_list_field" } */
  template <typename..., typename T = ::apache::thrift::adapt_detail::adapted_field_t<::FieldAdapter, 12, ::std::vector<::facebook::thrift::test::AdaptedFoo>, OpEncodeStruct>>
  FOLLY_ERASE ::apache::thrift::field_ref<T&&> adapted_list_field() && {
    return {static_cast<T&&>(this->__fbthrift_field_adapted_list_field), __isset.at(10), __isset.bit(10)};
  }

  /** Glean { "field": "int_field" } */
  ::std::int32_t get_int_field() const {
    return __fbthrift_field_int_field;
  }

  /** Glean { "field": "int_field" } */
  [[deprecated("Use `FOO.int_field() = BAR;` instead of `FOO.set_int_field(BAR);`")]]
  ::std::int32_t& set_int_field(::std::int32_t int_field_) {
    int_field_ref() = int_field_;
    return __fbthrift_field_int_field;
  }

  /** Glean { "field": "enum_field" } */
  ::facebook::thrift::test::Enum get_enum_field() const {
    return __fbthrift_field_enum_field;
  }

  /** Glean { "field": "enum_field" } */
  [[deprecated("Use `FOO.enum_field() = BAR;` instead of `FOO.set_enum_field(BAR);`")]]
  ::facebook::thrift::test::Enum& set_enum_field(::facebook::thrift::test::Enum enum_field_) {
    enum_field_ref() = enum_field_;
    return __fbthrift_field_enum_field;
  }
  /** Glean { "field": "foo_field" } */
  const ::facebook::thrift::test::Foo& get_foo_field() const&;
  /** Glean { "field": "foo_field" } */
  ::facebook::thrift::test::Foo get_foo_field() &&;

  /** Glean { "field": "foo_field" } */
  template <typename T_OpEncodeStruct_foo_field_struct_setter = ::facebook::thrift::test::Foo>
  [[deprecated("Use `FOO.foo_field() = BAR;` instead of `FOO.set_foo_field(BAR);`")]]
  ::facebook::thrift::test::Foo& set_foo_field(T_OpEncodeStruct_foo_field_struct_setter&& foo_field_) {
    foo_field_ref() = std::forward<T_OpEncodeStruct_foo_field_struct_setter>(foo_field_);
    return __fbthrift_field_foo_field;
  }
  /** Glean { "field": "list_field" } */
  const ::std::vector<::facebook::thrift::test::AdaptedFoo>& get_list_field() const&;
  /** Glean { "field": "list_field" } */
  ::std::vector<::facebook::thrift::test::AdaptedFoo> get_list_field() &&;

  /** Glean { "field": "list_field" } */
  template <typename T_OpEncodeStruct_list_field_struct_setter = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.list_field() = BAR;` instead of `FOO.set_list_field(BAR);`")]]
  ::std::vector<::facebook::thrift::test::AdaptedFoo>& set_list_field(T_OpEncodeStruct_list_field_struct_setter&& list_field_) {
    list_field_ref() = std::forward<T_OpEncodeStruct_list_field_struct_setter>(list_field_);
    return __fbthrift_field_list_field;
  }
  /** Glean { "field": "list_cpp_type_field" } */
  const ::std::vector<::facebook::thrift::test::AdaptedFoo>& get_list_cpp_type_field() const&;
  /** Glean { "field": "list_cpp_type_field" } */
  ::std::vector<::facebook::thrift::test::AdaptedFoo> get_list_cpp_type_field() &&;

  /** Glean { "field": "list_cpp_type_field" } */
  template <typename T_OpEncodeStruct_list_cpp_type_field_struct_setter = ::std::vector<::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.list_cpp_type_field() = BAR;` instead of `FOO.set_list_cpp_type_field(BAR);`")]]
  ::std::vector<::facebook::thrift::test::AdaptedFoo>& set_list_cpp_type_field(T_OpEncodeStruct_list_cpp_type_field_struct_setter&& list_cpp_type_field_) {
    list_cpp_type_field_ref() = std::forward<T_OpEncodeStruct_list_cpp_type_field_struct_setter>(list_cpp_type_field_);
    return __fbthrift_field_list_cpp_type_field;
  }
  /** Glean { "field": "set_field" } */
  const ::std::set<::facebook::thrift::test::AdaptedFoo>& get_set_field() const&;
  /** Glean { "field": "set_field" } */
  ::std::set<::facebook::thrift::test::AdaptedFoo> get_set_field() &&;

  /** Glean { "field": "set_field" } */
  template <typename T_OpEncodeStruct_set_field_struct_setter = ::std::set<::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.set_field() = BAR;` instead of `FOO.set_set_field(BAR);`")]]
  ::std::set<::facebook::thrift::test::AdaptedFoo>& set_set_field(T_OpEncodeStruct_set_field_struct_setter&& set_field_) {
    set_field_ref() = std::forward<T_OpEncodeStruct_set_field_struct_setter>(set_field_);
    return __fbthrift_field_set_field;
  }
  /** Glean { "field": "map_field" } */
  const ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>& get_map_field() const&;
  /** Glean { "field": "map_field" } */
  ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo> get_map_field() &&;

  /** Glean { "field": "map_field" } */
  template <typename T_OpEncodeStruct_map_field_struct_setter = ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>>
  [[deprecated("Use `FOO.map_field() = BAR;` instead of `FOO.set_map_field(BAR);`")]]
  ::std::map<::facebook::thrift::test::AdaptedFoo, ::facebook::thrift::test::AdaptedFoo>& set_map_field(T_OpEncodeStruct_map_field_struct_setter&& map_field_) {
    map_field_ref() = std::forward<T_OpEncodeStruct_map_field_struct_setter>(map_field_);
    return __fbthrift_field_map_field;
  }
  /** Glean { "field": "nested_field" } */
  const ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>& get_nested_field() const&;
  /** Glean { "field": "nested_field" } */
  ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>> get_nested_field() &&;

  /** Glean { "field": "nested_field" } */
  template <typename T_OpEncodeStruct_nested_field_struct_setter = ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>>
  [[deprecated("Use `FOO.nested_field() = BAR;` instead of `FOO.set_nested_field(BAR);`")]]
  ::std::map<::std::int32_t, ::std::vector<::facebook::thrift::test::AdaptedFoo>>& set_nested_field(T_OpEncodeStruct_nested_field_struct_setter&& nested_field_) {
    nested_field_ref() = std::forward<T_OpEncodeStruct_nested_field_struct_setter>(nested_field_);
    return __fbthrift_field_nested_field;
  }
  /** Glean { "field": "bar_field" } */
  const ::facebook::thrift::test::Bar& get_bar_field() const&;
  /** Glean { "field": "bar_field" } */
  ::facebook::thrift::test::Bar get_bar_field() &&;

  /** Glean { "field": "bar_field" } */
  template <typename T_OpEncodeStruct_bar_field_struct_setter = ::facebook::thrift::test::Bar>
  [[deprecated("Use `FOO.bar_field() = BAR;` instead of `FOO.set_bar_field(BAR);`")]]
  ::facebook::thrift::test::Bar& set_bar_field(T_OpEncodeStruct_bar_field_struct_setter&& bar_field_) {
    bar_field_ref() = std::forward<T_OpEncodeStruct_bar_field_struct_setter>(bar_field_);
    return __fbthrift_field_bar_field;
  }

  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<OpEncodeStruct>;
  friend void swap(OpEncodeStruct& a, OpEncodeStruct& b);
};

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


} // namespace facebook::thrift::test
