/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/basic-structured-annotations/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#include "thrift/compiler/test/fixtures/basic-structured-annotations/gen-cpp2/module_types.h"
#include "thrift/compiler/test/fixtures/basic-structured-annotations/gen-cpp2/module_types.tcc"

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

#include "thrift/compiler/test/fixtures/basic-structured-annotations/gen-cpp2/module_data.h"
[[maybe_unused]] static constexpr std::string_view kModuleName = "module";


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::basic-structured-annotations::MyEnum>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::basic-structured-annotations::MyEnum const*> const TEnumTraits<::test::fixtures::basic-structured-annotations::MyEnum>::values = folly::range(TEnumDataStorage<::test::fixtures::basic-structured-annotations::MyEnum>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::basic-structured-annotations::MyEnum>::names = folly::range(TEnumDataStorage<::test::fixtures::basic-structured-annotations::MyEnum>::names);

bool TEnumTraits<::test::fixtures::basic-structured-annotations::MyEnum>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::basic-structured-annotations::MyEnum>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::runtime_annotation>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::runtime_annotation>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* runtime_annotation::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/runtime_annotation";
}

std::string_view runtime_annotation::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<runtime_annotation>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view runtime_annotation::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<runtime_annotation>::name;
}


runtime_annotation::runtime_annotation(apache::thrift::FragileConstructor) {}


void runtime_annotation::__fbthrift_clear() {
  // clear all fields
}

void runtime_annotation::__fbthrift_clear_terse_fields() {
}

bool runtime_annotation::__fbthrift_is_empty() const {
  return true;
}

bool runtime_annotation::operator==([[maybe_unused]] const runtime_annotation& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool runtime_annotation::operator<([[maybe_unused]] const runtime_annotation& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] runtime_annotation& a, [[maybe_unused]] runtime_annotation& b) {
  using ::std::swap;
}

template void runtime_annotation::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t runtime_annotation::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t runtime_annotation::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t runtime_annotation::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void runtime_annotation::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t runtime_annotation::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t runtime_annotation::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t runtime_annotation::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::structured_annotation_inline>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::structured_annotation_inline>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* structured_annotation_inline::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/structured_annotation_inline";
}

std::string_view structured_annotation_inline::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<structured_annotation_inline>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view structured_annotation_inline::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<structured_annotation_inline>::name;
}

structured_annotation_inline::structured_annotation_inline(const structured_annotation_inline&) = default;
structured_annotation_inline& structured_annotation_inline::operator=(const structured_annotation_inline&) = default;
structured_annotation_inline::structured_annotation_inline() :
    __fbthrift_field_count(),
    __fbthrift_field_name(apache::thrift::StringTraits<std::string>::fromStringLiteral("abacaba")) {
}


structured_annotation_inline::~structured_annotation_inline() {}

structured_annotation_inline::structured_annotation_inline([[maybe_unused]] structured_annotation_inline&& other) noexcept :
    __fbthrift_field_count(std::move(other.__fbthrift_field_count)),
    __fbthrift_field_name(std::move(other.__fbthrift_field_name)),
    __isset(other.__isset) {
}

structured_annotation_inline& structured_annotation_inline::operator=([[maybe_unused]] structured_annotation_inline&& other) noexcept {
    this->__fbthrift_field_count = std::move(other.__fbthrift_field_count);
    this->__fbthrift_field_name = std::move(other.__fbthrift_field_name);
    __isset = other.__isset;
    return *this;
}


structured_annotation_inline::structured_annotation_inline(apache::thrift::FragileConstructor, ::std::int64_t count__arg, ::std::string name__arg) :
    __fbthrift_field_count(std::move(count__arg)),
    __fbthrift_field_name(std::move(name__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
}


void structured_annotation_inline::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_count = ::std::int64_t();
  this->__fbthrift_field_name = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  __isset = {};
}

void structured_annotation_inline::__fbthrift_clear_terse_fields() {
}

bool structured_annotation_inline::__fbthrift_is_empty() const {
  return false;
}

bool structured_annotation_inline::operator==([[maybe_unused]] const structured_annotation_inline& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool structured_annotation_inline::operator<([[maybe_unused]] const structured_annotation_inline& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] structured_annotation_inline& a, [[maybe_unused]] structured_annotation_inline& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_count, b.__fbthrift_field_count);
  swap(a.__fbthrift_field_name, b.__fbthrift_field_name);
  swap(a.__isset, b.__isset);
}

template void structured_annotation_inline::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t structured_annotation_inline::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t structured_annotation_inline::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t structured_annotation_inline::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void structured_annotation_inline::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t structured_annotation_inline::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t structured_annotation_inline::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t structured_annotation_inline::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::structured_annotation_with_default>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::structured_annotation_with_default>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* structured_annotation_with_default::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/structured_annotation_with_default";
}

std::string_view structured_annotation_with_default::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<structured_annotation_with_default>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view structured_annotation_with_default::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<structured_annotation_with_default>::name;
}

structured_annotation_with_default::structured_annotation_with_default(const structured_annotation_with_default&) = default;
structured_annotation_with_default& structured_annotation_with_default::operator=(const structured_annotation_with_default&) = default;
structured_annotation_with_default::structured_annotation_with_default() :
    __fbthrift_field_name(apache::thrift::StringTraits<std::string>::fromStringLiteral("abacabadabacaba")) {
}


structured_annotation_with_default::~structured_annotation_with_default() {}

structured_annotation_with_default::structured_annotation_with_default([[maybe_unused]] structured_annotation_with_default&& other) noexcept :
    __fbthrift_field_name(std::move(other.__fbthrift_field_name)),
    __isset(other.__isset) {
}

structured_annotation_with_default& structured_annotation_with_default::operator=([[maybe_unused]] structured_annotation_with_default&& other) noexcept {
    this->__fbthrift_field_name = std::move(other.__fbthrift_field_name);
    __isset = other.__isset;
    return *this;
}


structured_annotation_with_default::structured_annotation_with_default(apache::thrift::FragileConstructor, ::std::string name__arg) :
    __fbthrift_field_name(std::move(name__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
}


void structured_annotation_with_default::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_name = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  __isset = {};
}

void structured_annotation_with_default::__fbthrift_clear_terse_fields() {
}

bool structured_annotation_with_default::__fbthrift_is_empty() const {
  return false;
}

bool structured_annotation_with_default::operator==([[maybe_unused]] const structured_annotation_with_default& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool structured_annotation_with_default::operator<([[maybe_unused]] const structured_annotation_with_default& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] structured_annotation_with_default& a, [[maybe_unused]] structured_annotation_with_default& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_name, b.__fbthrift_field_name);
  swap(a.__isset, b.__isset);
}

template void structured_annotation_with_default::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t structured_annotation_with_default::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t structured_annotation_with_default::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t structured_annotation_with_default::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void structured_annotation_with_default::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t structured_annotation_with_default::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t structured_annotation_with_default::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t structured_annotation_with_default::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::structured_annotation_recursive>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::structured_annotation_recursive>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* structured_annotation_recursive::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/structured_annotation_recursive";
}

std::string_view structured_annotation_recursive::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<structured_annotation_recursive>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view structured_annotation_recursive::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<structured_annotation_recursive>::name;
}

structured_annotation_recursive::structured_annotation_recursive(const structured_annotation_recursive& srcObj) :
    __fbthrift_field_name(srcObj.__fbthrift_field_name),
    __fbthrift_field_recurse(::apache::thrift::detail::st::copy_field<
          ::apache::thrift::type_class::structure>(srcObj.__fbthrift_field_recurse)),
    __fbthrift_field_forward(srcObj.__fbthrift_field_forward),
    __isset(srcObj.__isset) {
}

static void __fbthrift_swap(structured_annotation_recursive& lhs, structured_annotation_recursive& rhs) { swap(lhs, rhs); }
structured_annotation_recursive& structured_annotation_recursive::operator=(const structured_annotation_recursive& other) {
  structured_annotation_recursive tmp(other);
  __fbthrift_swap(*this, tmp);
  return *this;
}

structured_annotation_recursive::structured_annotation_recursive() {
}


structured_annotation_recursive::~structured_annotation_recursive() {}

structured_annotation_recursive::structured_annotation_recursive([[maybe_unused]] structured_annotation_recursive&& other) noexcept :
    __fbthrift_field_name(std::move(other.__fbthrift_field_name)),
    __fbthrift_field_recurse(std::move(other.__fbthrift_field_recurse)),
    __fbthrift_field_forward(std::move(other.__fbthrift_field_forward)),
    __isset(other.__isset) {
}

structured_annotation_recursive& structured_annotation_recursive::operator=([[maybe_unused]] structured_annotation_recursive&& other) noexcept {
    this->__fbthrift_field_name = std::move(other.__fbthrift_field_name);
    this->__fbthrift_field_recurse = std::move(other.__fbthrift_field_recurse);
    this->__fbthrift_field_forward = std::move(other.__fbthrift_field_forward);
    __isset = other.__isset;
    return *this;
}


structured_annotation_recursive::structured_annotation_recursive(apache::thrift::FragileConstructor, ::std::string name__arg, ::std::unique_ptr<::test::fixtures::basic-structured-annotations::structured_annotation_recursive> recurse__arg, ::test::fixtures::basic-structured-annotations::structured_annotation_forward forward__arg) :
    __fbthrift_field_name(std::move(name__arg)),
    __fbthrift_field_recurse(std::move(recurse__arg)),
    __fbthrift_field_forward(std::move(forward__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
}


void structured_annotation_recursive::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_name = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_recurse.reset();
  ::apache::thrift::clear(this->__fbthrift_field_forward);
  __isset = {};
}

void structured_annotation_recursive::__fbthrift_clear_terse_fields() {
}

bool structured_annotation_recursive::__fbthrift_is_empty() const {
  return false;
}

bool structured_annotation_recursive::operator==([[maybe_unused]] const structured_annotation_recursive& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool structured_annotation_recursive::operator<([[maybe_unused]] const structured_annotation_recursive& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}

const ::test::fixtures::basic-structured-annotations::structured_annotation_forward& structured_annotation_recursive::get_forward() const& {
  return __fbthrift_field_forward;
}

::test::fixtures::basic-structured-annotations::structured_annotation_forward structured_annotation_recursive::get_forward() && {
  return std::move(__fbthrift_field_forward);
}


void swap([[maybe_unused]] structured_annotation_recursive& a, [[maybe_unused]] structured_annotation_recursive& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_name, b.__fbthrift_field_name);
  swap(a.__fbthrift_field_recurse, b.__fbthrift_field_recurse);
  swap(a.__fbthrift_field_forward, b.__fbthrift_field_forward);
  swap(a.__isset, b.__isset);
}

template void structured_annotation_recursive::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t structured_annotation_recursive::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t structured_annotation_recursive::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t structured_annotation_recursive::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void structured_annotation_recursive::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t structured_annotation_recursive::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t structured_annotation_recursive::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t structured_annotation_recursive::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        structured_annotation_recursive,
        ::apache::thrift::type_class::structure,
        ::test::fixtures::basic-structured-annotations::structured_annotation_recursive>,
    "inconsistent use of json option");
static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        structured_annotation_recursive,
        ::apache::thrift::type_class::structure,
        ::test::fixtures::basic-structured-annotations::structured_annotation_forward>,
    "inconsistent use of json option");

} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::structured_annotation_forward>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::structured_annotation_forward>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* structured_annotation_forward::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/structured_annotation_forward";
}

std::string_view structured_annotation_forward::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<structured_annotation_forward>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view structured_annotation_forward::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<structured_annotation_forward>::name;
}


structured_annotation_forward::structured_annotation_forward(apache::thrift::FragileConstructor, ::std::int64_t count__arg) :
    __fbthrift_field_count(std::move(count__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
}


void structured_annotation_forward::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_count = ::std::int64_t();
  __isset = {};
}

void structured_annotation_forward::__fbthrift_clear_terse_fields() {
}

bool structured_annotation_forward::__fbthrift_is_empty() const {
  return false;
}

bool structured_annotation_forward::operator==([[maybe_unused]] const structured_annotation_forward& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool structured_annotation_forward::operator<([[maybe_unused]] const structured_annotation_forward& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] structured_annotation_forward& a, [[maybe_unused]] structured_annotation_forward& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_count, b.__fbthrift_field_count);
  swap(a.__isset, b.__isset);
}

template void structured_annotation_forward::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t structured_annotation_forward::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t structured_annotation_forward::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t structured_annotation_forward::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void structured_annotation_forward::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t structured_annotation_forward::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t structured_annotation_forward::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t structured_annotation_forward::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::structured_annotation_nested>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::structured_annotation_nested>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* structured_annotation_nested::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/structured_annotation_nested";
}

std::string_view structured_annotation_nested::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<structured_annotation_nested>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view structured_annotation_nested::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<structured_annotation_nested>::name;
}

structured_annotation_nested::structured_annotation_nested(const structured_annotation_nested&) = default;
structured_annotation_nested& structured_annotation_nested::operator=(const structured_annotation_nested&) = default;
structured_annotation_nested::structured_annotation_nested() {
}


structured_annotation_nested::~structured_annotation_nested() {}

structured_annotation_nested::structured_annotation_nested([[maybe_unused]] structured_annotation_nested&& other) noexcept :
    __fbthrift_field_name(std::move(other.__fbthrift_field_name)),
    __fbthrift_field_nest(std::move(other.__fbthrift_field_nest)),
    __isset(other.__isset) {
}

structured_annotation_nested& structured_annotation_nested::operator=([[maybe_unused]] structured_annotation_nested&& other) noexcept {
    this->__fbthrift_field_name = std::move(other.__fbthrift_field_name);
    this->__fbthrift_field_nest = std::move(other.__fbthrift_field_nest);
    __isset = other.__isset;
    return *this;
}


structured_annotation_nested::structured_annotation_nested(apache::thrift::FragileConstructor, ::std::string name__arg, ::test::fixtures::basic-structured-annotations::structured_annotation_with_default nest__arg) :
    __fbthrift_field_name(std::move(name__arg)),
    __fbthrift_field_nest(std::move(nest__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
}


void structured_annotation_nested::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_name = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  ::apache::thrift::clear(this->__fbthrift_field_nest);
  __isset = {};
}

void structured_annotation_nested::__fbthrift_clear_terse_fields() {
}

bool structured_annotation_nested::__fbthrift_is_empty() const {
  return false;
}

bool structured_annotation_nested::operator==([[maybe_unused]] const structured_annotation_nested& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool structured_annotation_nested::operator<([[maybe_unused]] const structured_annotation_nested& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}

const ::test::fixtures::basic-structured-annotations::structured_annotation_with_default& structured_annotation_nested::get_nest() const& {
  return __fbthrift_field_nest;
}

::test::fixtures::basic-structured-annotations::structured_annotation_with_default structured_annotation_nested::get_nest() && {
  return std::move(__fbthrift_field_nest);
}


void swap([[maybe_unused]] structured_annotation_nested& a, [[maybe_unused]] structured_annotation_nested& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_name, b.__fbthrift_field_name);
  swap(a.__fbthrift_field_nest, b.__fbthrift_field_nest);
  swap(a.__isset, b.__isset);
}

template void structured_annotation_nested::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t structured_annotation_nested::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t structured_annotation_nested::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t structured_annotation_nested::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void structured_annotation_nested::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t structured_annotation_nested::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t structured_annotation_nested::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t structured_annotation_nested::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;

static_assert(
    ::apache::thrift::detail::st::gen_check_json<
        structured_annotation_nested,
        ::apache::thrift::type_class::structure,
        ::test::fixtures::basic-structured-annotations::structured_annotation_with_default>,
    "inconsistent use of json option");

} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::MyStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::MyStruct>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* MyStruct::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/MyStruct";
}

std::string_view MyStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyStruct>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view MyStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyStruct>::name;
}

MyStruct::MyStruct(const MyStruct&) = default;
MyStruct& MyStruct::operator=(const MyStruct&) = default;
MyStruct::MyStruct() :
    __fbthrift_field_annotated_field(),
    __fbthrift_field_annotated_nested() {
}


MyStruct::~MyStruct() {}

MyStruct::MyStruct([[maybe_unused]] MyStruct&& other) noexcept :
    __fbthrift_field_annotated_field(std::move(other.__fbthrift_field_annotated_field)),
    __fbthrift_field_annotated_type(std::move(other.__fbthrift_field_annotated_type)),
    __fbthrift_field_annotated_recursive(std::move(other.__fbthrift_field_annotated_recursive)),
    __fbthrift_field_annotated_nested(std::move(other.__fbthrift_field_annotated_nested)),
    __isset(other.__isset) {
}

MyStruct& MyStruct::operator=([[maybe_unused]] MyStruct&& other) noexcept {
    this->__fbthrift_field_annotated_field = std::move(other.__fbthrift_field_annotated_field);
    this->__fbthrift_field_annotated_type = std::move(other.__fbthrift_field_annotated_type);
    this->__fbthrift_field_annotated_recursive = std::move(other.__fbthrift_field_annotated_recursive);
    this->__fbthrift_field_annotated_nested = std::move(other.__fbthrift_field_annotated_nested);
    __isset = other.__isset;
    return *this;
}


MyStruct::MyStruct(apache::thrift::FragileConstructor, ::std::int64_t annotated_field__arg, ::test::fixtures::basic-structured-annotations::annotated_inline_string annotated_type__arg, ::std::string annotated_recursive__arg, ::std::int64_t annotated_nested__arg) :
    __fbthrift_field_annotated_field(std::move(annotated_field__arg)),
    __fbthrift_field_annotated_type(std::move(annotated_type__arg)),
    __fbthrift_field_annotated_recursive(std::move(annotated_recursive__arg)),
    __fbthrift_field_annotated_nested(std::move(annotated_nested__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
  __isset.set(folly::index_constant<2>(), true);
  __isset.set(folly::index_constant<3>(), true);
}


void MyStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_annotated_field = ::std::int64_t();
  this->__fbthrift_field_annotated_type = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_annotated_recursive = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  this->__fbthrift_field_annotated_nested = ::std::int64_t();
  __isset = {};
}

void MyStruct::__fbthrift_clear_terse_fields() {
}

bool MyStruct::__fbthrift_is_empty() const {
  return false;
}

bool MyStruct::operator==([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool MyStruct::operator<([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] MyStruct& a, [[maybe_unused]] MyStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_annotated_field, b.__fbthrift_field_annotated_field);
  swap(a.__fbthrift_field_annotated_type, b.__fbthrift_field_annotated_type);
  swap(a.__fbthrift_field_annotated_recursive, b.__fbthrift_field_annotated_recursive);
  swap(a.__fbthrift_field_annotated_nested, b.__fbthrift_field_annotated_nested);
  swap(a.__isset, b.__isset);
}

template void MyStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::MyException>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::MyException>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::basic-structured-annotations {

const char* MyException::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/MyException";
}

std::string_view MyException::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyException>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view MyException::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyException>::name;
}

MyException::MyException(const MyException&) = default;
MyException& MyException::operator=(const MyException&) = default;
MyException::MyException() {
}


MyException::~MyException() {}

MyException::MyException([[maybe_unused]] MyException&& other) noexcept :
    __fbthrift_field_context(std::move(other.__fbthrift_field_context)),
    __isset(other.__isset) {
}

MyException& MyException::operator=([[maybe_unused]] MyException&& other) noexcept {
    this->__fbthrift_field_context = std::move(other.__fbthrift_field_context);
    __isset = other.__isset;
    return *this;
}


MyException::MyException(apache::thrift::FragileConstructor, ::std::string context__arg) :
    __fbthrift_field_context(std::move(context__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
}


void MyException::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_context = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
  __isset = {};
}

void MyException::__fbthrift_clear_terse_fields() {
}

bool MyException::__fbthrift_is_empty() const {
  return false;
}

bool MyException::operator==([[maybe_unused]] const MyException& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool MyException::operator<([[maybe_unused]] const MyException& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] MyException& a, [[maybe_unused]] MyException& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_context, b.__fbthrift_field_context);
  swap(a.__isset, b.__isset);
}

template void MyException::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyException::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyException::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyException::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyException::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyException::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyException::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyException::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::basic-structured-annotations::MyUnion>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::basic-structured-annotations::MyUnion>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace apache { namespace thrift {

folly::Range<::test::fixtures::basic-structured-annotations::MyUnion::Type const*> const TEnumTraits<::test::fixtures::basic-structured-annotations::MyUnion::Type>::values = folly::range(TEnumDataStorage<::test::fixtures::basic-structured-annotations::MyUnion::Type>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::basic-structured-annotations::MyUnion::Type>::names = folly::range(TEnumDataStorage<::test::fixtures::basic-structured-annotations::MyUnion::Type>::names);

bool TEnumTraits<::test::fixtures::basic-structured-annotations::MyUnion::Type>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::basic-structured-annotations::MyUnion::Type>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}
}} // apache::thrift
namespace test::fixtures::basic-structured-annotations {

const char* MyUnion::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/basic-structured-annotations/MyUnion";
}

std::string_view MyUnion::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyUnion>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view MyUnion::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyUnion>::name;
}

void MyUnion::__fbthrift_destruct() {
  switch(getType()) {
    case Type::__EMPTY__:
      break;
    case Type::first:
      ::std::destroy_at(::std::addressof(value_.first));
      break;
    case Type::second:
      ::std::destroy_at(::std::addressof(value_.second));
      break;
    default:
      assert(false);
      break;
  }
}

void MyUnion::__fbthrift_clear() {
  __fbthrift_destruct();
  type_ = folly::to_underlying(Type::__EMPTY__);
}

  MyUnion::~MyUnion() {
    __fbthrift_destruct();
  }

bool MyUnion::__fbthrift_is_empty() const {
  return getType() == Type::__EMPTY__;
}
  MyUnion::MyUnion(const MyUnion& rhs)
      : type_(folly::to_underlying(Type::__EMPTY__)) {
    switch (rhs.getType()) {
      case Type::__EMPTY__:
        return;
      case Type::first:
        set_first(rhs.value_.first);
        break;
      case Type::second:
        set_second(rhs.value_.second);
        break;
      default:
        assert(false);
    }
  }

    MyUnion&MyUnion::operator=(const MyUnion& rhs) {
    if (this == &rhs) { return *this; }
    switch (rhs.getType()) {
      case Type::__EMPTY__:
        __fbthrift_clear();
        return *this;
      case Type::first:
        set_first(rhs.value_.first);
        break;
      case Type::second:
        set_second(rhs.value_.second);
        break;
      default:
        __fbthrift_clear();
        assert(false);
    }
    return *this;
  }


bool MyUnion::operator==(const MyUnion& rhs) const {
  return ::apache::thrift::op::detail::UnionEquality{}(*this, rhs);
}

bool MyUnion::operator<([[maybe_unused]] const MyUnion& rhs) const {
  return ::apache::thrift::op::detail::UnionLessThan{}(*this, rhs);
}

void swap(MyUnion& a, MyUnion& b) {
  MyUnion temp(std::move(a));
  a = std::move(b);
  b = std::move(temp);
}

template void MyUnion::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyUnion::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyUnion::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyUnion::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyUnion::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyUnion::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyUnion::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyUnion::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::basic-structured-annotations

namespace test::fixtures::basic-structured-annotations { namespace {
[[maybe_unused]] FOLLY_ERASE void validateAdapters() {
}
}} // namespace test::fixtures::basic-structured-annotations
namespace apache::thrift::detail::annotation {
template<> const std::vector<std::any>& field_annotation_values<::test::fixtures::basic-structured-annotations::MyStruct>(FieldId id) {
  switch (static_cast<int16_t>(id)) {
  case 1: {
    static const folly::Indestructible<std::vector<std::any>> ret = [] {
      std::vector<std::any> values;
      values.emplace_back(::apache::thrift::detail::make_structured_constant<::test::fixtures::basic-structured-annotations::runtime_annotation>());
      return values;
    }();
    return *ret;
  }
  case 2: {
    static const folly::Indestructible<std::vector<std::any>> ret = [] {
      std::vector<std::any> values;
      return values;
    }();
    return *ret;
  }
  case 3: {
    static const folly::Indestructible<std::vector<std::any>> ret = [] {
      std::vector<std::any> values;
      return values;
    }();
    return *ret;
  }
  case 4: {
    static const folly::Indestructible<std::vector<std::any>> ret = [] {
      std::vector<std::any> values;
      return values;
    }();
    return *ret;
  }
  };

  folly::assume_unreachable();
}
}
