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


/**
 * This header file includes the tcc files of the corresponding header file
 * and the header files of its dependent types. Include this header file
 * only when you need to use custom protocols (e.g. DebugProtocol,
 * VirtualProtocol) to read/write thrift structs.
 */

#include "thrift/lib/thrift/gen-cpp2/schema_types.tcc"

#include "thrift/lib/thrift/gen-cpp2/id_types_custom_protocol.h"
#include "thrift/lib/thrift/gen-cpp2/standard_types_custom_protocol.h"
#include "thrift/lib/thrift/gen-cpp2/protocol_types_custom_protocol.h"
#include "thrift/lib/thrift/gen-cpp2/type_types_custom_protocol.h"


namespace apache {
namespace thrift {
namespace detail {

template <>
struct TccStructTraits<::apache::thrift::type::Annotation> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::StructuredAnnotation> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::DecodedUri> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::DefinitionAttrs> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::SourceRange> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::DocBlock> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::InterfaceRef> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::EnumValue> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Enum> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Field> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Struct> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Union> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Exception> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Paramlist> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Stream> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Sink> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Interaction> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::ReturnType> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Function> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Service> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Const> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Typedef> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Definition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Program> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::Schema> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::SourceInfo> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::IdentifierRef> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::IncludeRef> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};

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

namespace apache::thrift::type {

template <class Protocol_>
void Annotation::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*iprot, this->__fbthrift_field_fields);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Annotation>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Annotation::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Annotation");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Annotation::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Annotation");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Annotation::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Annotation");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 1, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void StructuredAnnotation::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_type:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, this->__fbthrift_field_type, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*iprot, this->__fbthrift_field_fields);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<StructuredAnnotation>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_type;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t StructuredAnnotation::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("StructuredAnnotation");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t StructuredAnnotation::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("StructuredAnnotation");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t StructuredAnnotation::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("StructuredAnnotation");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_type))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "type", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 2, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void DecodedUri::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_scheme:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_scheme, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_domain:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_domain = ::std::vector<::std::string>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::readWithContext(*iprot, this->__fbthrift_field_domain, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          4,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_path:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_path = ::std::vector<::std::string>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::readWithContext(*iprot, this->__fbthrift_field_path, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_query:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_query = ::std::map<::std::string, ::std::string>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::readWithContext(*iprot, this->__fbthrift_field_query, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          6,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_fragment:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_fragment, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          6,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<DecodedUri>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_scheme;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_domain;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_path;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_query;
      } else {
        goto _skip;
      }
    }
    case 6:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_fragment;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t DecodedUri::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DecodedUri");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_scheme))) {
    xfer += prot_->serializedFieldSize("scheme", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_scheme);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_domain))) {
    xfer += prot_->serializedFieldSize("domain", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_domain);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_path))) {
    xfer += prot_->serializedFieldSize("path", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_path);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_query))) {
    xfer += prot_->serializedFieldSize("query", apache::thrift::protocol::T_MAP, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_query);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fragment))) {
    xfer += prot_->serializedFieldSize("fragment", apache::thrift::protocol::T_STRING, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_fragment);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DecodedUri::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DecodedUri");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_scheme))) {
    xfer += prot_->serializedFieldSize("scheme", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_scheme);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_domain))) {
    xfer += prot_->serializedFieldSize("domain", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_domain);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_path))) {
    xfer += prot_->serializedFieldSize("path", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_path);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_query))) {
    xfer += prot_->serializedFieldSize("query", apache::thrift::protocol::T_MAP, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_query);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fragment))) {
    xfer += prot_->serializedFieldSize("fragment", apache::thrift::protocol::T_STRING, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_fragment);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DecodedUri::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("DecodedUri");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_scheme))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "scheme", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_scheme);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_domain))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "domain", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::write(*prot_, this->__fbthrift_field_domain);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::string_t>>(this->__fbthrift_field_path))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "path", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>>::write(*prot_, this->__fbthrift_field_path);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_query))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 5, kPrevFieldId>(*prot_, "query", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::write(*prot_, this->__fbthrift_field_query);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fragment))) {
    constexpr int16_t kPrevFieldId = 5;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 6, kPrevFieldId>(*prot_, "fragment", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_fragment);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void DefinitionAttrs::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_name:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_name, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_uri:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_uri, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_SET))) {
    goto _advance_failure;
  }
_readField_structuredAnnotations:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*iprot, this->__fbthrift_field_structuredAnnotations);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          8,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = ::std::map<::std::string, ::apache::thrift::type::Annotation>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::std::string, ::apache::thrift::type::Annotation>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          8,
          9,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotationsByKey:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotationsByKey = ::std::map<::apache::thrift::type::DefinitionKey, ::apache::thrift::type::Annotation>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::binary, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type::DefinitionKey, ::apache::thrift::type::Annotation>>::readWithContext(*iprot, this->__fbthrift_field_annotationsByKey, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          9,
          4,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_unstructuredAnnotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_unstructuredAnnotations = ::std::map<::std::string, ::std::string>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::readWithContext(*iprot, this->__fbthrift_field_unstructuredAnnotations, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          6,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_docs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DocBlock>::readWithContext(*iprot, this->__fbthrift_field_docs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          6,
          7,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_sourceRange:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::readWithContext(*iprot, this->__fbthrift_field_sourceRange, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          7,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<DefinitionAttrs>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_name;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_uri;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_SET))) {
        goto _readField_structuredAnnotations;
      } else {
        goto _skip;
      }
    }
    case 8:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotations;
      } else {
        goto _skip;
      }
    }
    case 9:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotationsByKey;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_unstructuredAnnotations;
      } else {
        goto _skip;
      }
    }
    case 6:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_docs;
      } else {
        goto _skip;
      }
    }
    case 7:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_sourceRange;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t DefinitionAttrs::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DefinitionAttrs");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_name);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_uri);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_structuredAnnotations))) {
    xfer += prot_->serializedFieldSize("structuredAnnotations", apache::thrift::protocol::T_SET, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_structuredAnnotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::std::string, ::apache::thrift::type::Annotation>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotationsByKey))) {
    xfer += prot_->serializedFieldSize("annotationsByKey", apache::thrift::protocol::T_MAP, 9);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::binary, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type::DefinitionKey, ::apache::thrift::type::Annotation>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotationsByKey);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_unstructuredAnnotations))) {
    xfer += prot_->serializedFieldSize("unstructuredAnnotations", apache::thrift::protocol::T_MAP, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_unstructuredAnnotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DocBlock>>(this->__fbthrift_field_docs))) {
    xfer += prot_->serializedFieldSize("docs", apache::thrift::protocol::T_STRUCT, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DocBlock>::serializedSize<false>(*prot_, this->__fbthrift_field_docs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    xfer += prot_->serializedFieldSize("sourceRange", apache::thrift::protocol::T_STRUCT, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<false>(*prot_, this->__fbthrift_field_sourceRange);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DefinitionAttrs::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DefinitionAttrs");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_name);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_uri);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_structuredAnnotations))) {
    xfer += prot_->serializedFieldSize("structuredAnnotations", apache::thrift::protocol::T_SET, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_structuredAnnotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::std::string, ::apache::thrift::type::Annotation>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotationsByKey))) {
    xfer += prot_->serializedFieldSize("annotationsByKey", apache::thrift::protocol::T_MAP, 9);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::binary, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type::DefinitionKey, ::apache::thrift::type::Annotation>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotationsByKey);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_unstructuredAnnotations))) {
    xfer += prot_->serializedFieldSize("unstructuredAnnotations", apache::thrift::protocol::T_MAP, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_unstructuredAnnotations);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DocBlock>>(this->__fbthrift_field_docs))) {
    xfer += prot_->serializedFieldSize("docs", apache::thrift::protocol::T_STRUCT, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DocBlock>::serializedSize<true>(*prot_, this->__fbthrift_field_docs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    xfer += prot_->serializedFieldSize("sourceRange", apache::thrift::protocol::T_STRUCT, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<true>(*prot_, this->__fbthrift_field_sourceRange);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DefinitionAttrs::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("DefinitionAttrs");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "name", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_name);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_uri))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 2, kPrevFieldId>(*prot_, "uri", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_uri);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_structuredAnnotations))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_SET, 3, kPrevFieldId>(*prot_, "structuredAnnotations", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_structuredAnnotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 8, kPrevFieldId>(*prot_, "annotations", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::std::string, ::apache::thrift::type::Annotation>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::Annotation>>>(this->__fbthrift_field_annotationsByKey))) {
    constexpr int16_t kPrevFieldId = 8;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 9, kPrevFieldId>(*prot_, "annotationsByKey", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::binary, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type::DefinitionKey, ::apache::thrift::type::Annotation>>::write(*prot_, this->__fbthrift_field_annotationsByKey);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_unstructuredAnnotations))) {
    constexpr int16_t kPrevFieldId = 9;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 4, kPrevFieldId>(*prot_, "unstructuredAnnotations", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::write(*prot_, this->__fbthrift_field_unstructuredAnnotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DocBlock>>(this->__fbthrift_field_docs))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 6, kPrevFieldId>(*prot_, "docs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DocBlock>::write(*prot_, this->__fbthrift_field_docs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    constexpr int16_t kPrevFieldId = 6;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 7, kPrevFieldId>(*prot_, "sourceRange", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::write(*prot_, this->__fbthrift_field_sourceRange);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SourceRange::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_I64))) {
    goto _advance_failure;
  }
_readField_programId:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*iprot, this->__fbthrift_field_programId);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_beginLine:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_beginLine, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_beginColumn:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_beginColumn, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_endLine:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_endLine, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_endColumn:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_endColumn, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<SourceRange>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64))) {
        goto _readField_programId;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_beginLine;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_beginColumn;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_endLine;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_endColumn;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SourceRange::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SourceRange");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_programId))) {
    xfer += prot_->serializedFieldSize("programId", apache::thrift::protocol::T_I64, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_programId);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginLine))) {
    xfer += prot_->serializedFieldSize("beginLine", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_beginLine);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginColumn))) {
    xfer += prot_->serializedFieldSize("beginColumn", apache::thrift::protocol::T_I32, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_beginColumn);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endLine))) {
    xfer += prot_->serializedFieldSize("endLine", apache::thrift::protocol::T_I32, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_endLine);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endColumn))) {
    xfer += prot_->serializedFieldSize("endColumn", apache::thrift::protocol::T_I32, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_endColumn);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SourceRange::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SourceRange");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_programId))) {
    xfer += prot_->serializedFieldSize("programId", apache::thrift::protocol::T_I64, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_programId);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginLine))) {
    xfer += prot_->serializedFieldSize("beginLine", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_beginLine);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginColumn))) {
    xfer += prot_->serializedFieldSize("beginColumn", apache::thrift::protocol::T_I32, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_beginColumn);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endLine))) {
    xfer += prot_->serializedFieldSize("endLine", apache::thrift::protocol::T_I32, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_endLine);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endColumn))) {
    xfer += prot_->serializedFieldSize("endColumn", apache::thrift::protocol::T_I32, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_endColumn);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SourceRange::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SourceRange");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_programId))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 1, kPrevFieldId>(*prot_, "programId", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_programId);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginLine))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "beginLine", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_beginLine);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_beginColumn))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 3, kPrevFieldId>(*prot_, "beginColumn", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_beginColumn);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endLine))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 4, kPrevFieldId>(*prot_, "endLine", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_endLine);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_endColumn))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 5, kPrevFieldId>(*prot_, "endColumn", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_endColumn);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void DocBlock::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_contents:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_contents, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_sourceRange:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::readWithContext(*iprot, this->__fbthrift_field_sourceRange, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<DocBlock>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_contents;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_sourceRange;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t DocBlock::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DocBlock");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_contents))) {
    xfer += prot_->serializedFieldSize("contents", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_contents);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    xfer += prot_->serializedFieldSize("sourceRange", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<false>(*prot_, this->__fbthrift_field_sourceRange);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DocBlock::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("DocBlock");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_contents))) {
    xfer += prot_->serializedFieldSize("contents", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_contents);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    xfer += prot_->serializedFieldSize("sourceRange", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<true>(*prot_, this->__fbthrift_field_sourceRange);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t DocBlock::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("DocBlock");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_contents))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "contents", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_contents);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_sourceRange))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "sourceRange", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::write(*prot_, this->__fbthrift_field_sourceRange);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void InterfaceRef::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_uri:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, this->__fbthrift_field_uri, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<InterfaceRef>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_uri;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t InterfaceRef::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("InterfaceRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, this->__fbthrift_field_uri);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t InterfaceRef::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("InterfaceRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, this->__fbthrift_field_uri);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t InterfaceRef::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("InterfaceRef");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "uri", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, this->__fbthrift_field_uri);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void EnumValue::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_value:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_value, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<EnumValue>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_value;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t EnumValue::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("EnumValue");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_value))) {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t EnumValue::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("EnumValue");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_value))) {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t EnumValue::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("EnumValue");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::i32_t>(this->__fbthrift_field_value))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "value", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_value);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Enum::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_values:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_values = ::std::vector<::apache::thrift::type::EnumValue>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type::EnumValue>>::readWithContext(*iprot, this->__fbthrift_field_values, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Enum>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_values;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Enum::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Enum");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::EnumValue>>>(this->__fbthrift_field_values))) {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type::EnumValue>>::serializedSize<false>(*prot_, this->__fbthrift_field_values);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Enum::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Enum");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::EnumValue>>>(this->__fbthrift_field_values))) {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type::EnumValue>>::serializedSize<true>(*prot_, this->__fbthrift_field_values);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Enum::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Enum");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::EnumValue>>>(this->__fbthrift_field_values))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "values", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type::EnumValue>>::write(*prot_, this->__fbthrift_field_values);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Field::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_I16))) {
    goto _advance_failure;
  }
_readField_id:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(*iprot, this->__fbthrift_field_id);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_qualifier:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FieldQualifier>::readWithContext(*iprot, this->__fbthrift_field_qualifier, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_type:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_type);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_I64))) {
    goto _advance_failure;
  }
_readField_customDefault:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*iprot, this->__fbthrift_field_customDefault);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Field>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I16))) {
        goto _readField_id;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_qualifier;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_type;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64))) {
        goto _readField_customDefault;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Field::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Field");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(this->__fbthrift_field_id))) {
    xfer += prot_->serializedFieldSize("id", apache::thrift::protocol::T_I16, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(*prot_, this->__fbthrift_field_id);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FieldQualifier>>(this->__fbthrift_field_qualifier))) {
    xfer += prot_->serializedFieldSize("qualifier", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FieldQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_qualifier);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_customDefault))) {
    xfer += prot_->serializedFieldSize("customDefault", apache::thrift::protocol::T_I64, 5);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_customDefault);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Field::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Field");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(this->__fbthrift_field_id))) {
    xfer += prot_->serializedFieldSize("id", apache::thrift::protocol::T_I16, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(*prot_, this->__fbthrift_field_id);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FieldQualifier>>(this->__fbthrift_field_qualifier))) {
    xfer += prot_->serializedFieldSize("qualifier", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FieldQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_qualifier);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_customDefault))) {
    xfer += prot_->serializedFieldSize("customDefault", apache::thrift::protocol::T_I64, 5);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_customDefault);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Field::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Field");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(this->__fbthrift_field_id))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I16, 1, kPrevFieldId>(*prot_, "id", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>>(*prot_, this->__fbthrift_field_id);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FieldQualifier>>(this->__fbthrift_field_qualifier))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "qualifier", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FieldQualifier>::write(*prot_, this->__fbthrift_field_qualifier);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "type", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 4, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_customDefault))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 5, kPrevFieldId>(*prot_, "customDefault", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_customDefault);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Struct::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::apache::thrift::type::Fields();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Struct>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Struct::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Struct");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Struct::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Struct");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Struct::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Struct");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Union::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::apache::thrift::type::Fields();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Union>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Union::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Union");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Union::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Union");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Union::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Union");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Exception::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::apache::thrift::type::Fields();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_safety:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorSafety>::readWithContext(*iprot, this->__fbthrift_field_safety, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_kind:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorKind>::readWithContext(*iprot, this->__fbthrift_field_kind, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_blame:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorBlame>::readWithContext(*iprot, this->__fbthrift_field_blame, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Exception>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_safety;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_kind;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_blame;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Exception::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Exception");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorSafety>>(this->__fbthrift_field_safety))) {
    xfer += prot_->serializedFieldSize("safety", apache::thrift::protocol::T_I32, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorSafety>::serializedSize<false>(*prot_, this->__fbthrift_field_safety);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorKind>>(this->__fbthrift_field_kind))) {
    xfer += prot_->serializedFieldSize("kind", apache::thrift::protocol::T_I32, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorKind>::serializedSize<false>(*prot_, this->__fbthrift_field_kind);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorBlame>>(this->__fbthrift_field_blame))) {
    xfer += prot_->serializedFieldSize("blame", apache::thrift::protocol::T_I32, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorBlame>::serializedSize<false>(*prot_, this->__fbthrift_field_blame);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Exception::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Exception");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorSafety>>(this->__fbthrift_field_safety))) {
    xfer += prot_->serializedFieldSize("safety", apache::thrift::protocol::T_I32, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorSafety>::serializedSize<false>(*prot_, this->__fbthrift_field_safety);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorKind>>(this->__fbthrift_field_kind))) {
    xfer += prot_->serializedFieldSize("kind", apache::thrift::protocol::T_I32, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorKind>::serializedSize<false>(*prot_, this->__fbthrift_field_kind);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorBlame>>(this->__fbthrift_field_blame))) {
    xfer += prot_->serializedFieldSize("blame", apache::thrift::protocol::T_I32, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorBlame>::serializedSize<false>(*prot_, this->__fbthrift_field_blame);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Exception::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Exception");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorSafety>>(this->__fbthrift_field_safety))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 3, kPrevFieldId>(*prot_, "safety", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorSafety>::write(*prot_, this->__fbthrift_field_safety);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorKind>>(this->__fbthrift_field_kind))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 4, kPrevFieldId>(*prot_, "kind", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorKind>::write(*prot_, this->__fbthrift_field_kind);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::ErrorBlame>>(this->__fbthrift_field_blame))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 5, kPrevFieldId>(*prot_, "blame", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::ErrorBlame>::write(*prot_, this->__fbthrift_field_blame);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Paramlist::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::apache::thrift::type::Fields();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Paramlist>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_fields;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Paramlist::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Paramlist");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Paramlist::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Paramlist");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_LIST, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Paramlist::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Paramlist");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "fields", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Fields>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Stream::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_payload:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_payload);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_exceptions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_exceptions = ::apache::thrift::type::Exceptions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::readWithContext(*iprot, this->__fbthrift_field_exceptions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Stream>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_payload;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_exceptions;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Stream::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Stream");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    xfer += prot_->serializedFieldSize("payload", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    xfer += prot_->serializedFieldSize("exceptions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<false>(*prot_, this->__fbthrift_field_exceptions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Stream::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Stream");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    xfer += prot_->serializedFieldSize("payload", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    xfer += prot_->serializedFieldSize("exceptions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<true>(*prot_, this->__fbthrift_field_exceptions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Stream::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Stream");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "payload", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "exceptions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::write(*prot_, this->__fbthrift_field_exceptions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Sink::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_payload:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_payload);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_clientExceptions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_clientExceptions = ::apache::thrift::type::Exceptions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::readWithContext(*iprot, this->__fbthrift_field_clientExceptions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_finalResponse:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_finalResponse);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_serverExceptions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_serverExceptions = ::apache::thrift::type::Exceptions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::readWithContext(*iprot, this->__fbthrift_field_serverExceptions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Sink>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_payload;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_clientExceptions;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_finalResponse;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_serverExceptions;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Sink::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Sink");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    xfer += prot_->serializedFieldSize("payload", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_clientExceptions))) {
    xfer += prot_->serializedFieldSize("clientExceptions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<false>(*prot_, this->__fbthrift_field_clientExceptions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_finalResponse))) {
    xfer += prot_->serializedFieldSize("finalResponse", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_finalResponse);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_serverExceptions))) {
    xfer += prot_->serializedFieldSize("serverExceptions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<false>(*prot_, this->__fbthrift_field_serverExceptions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Sink::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Sink");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    xfer += prot_->serializedFieldSize("payload", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_clientExceptions))) {
    xfer += prot_->serializedFieldSize("clientExceptions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<true>(*prot_, this->__fbthrift_field_clientExceptions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_finalResponse))) {
    xfer += prot_->serializedFieldSize("finalResponse", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_finalResponse);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_serverExceptions))) {
    xfer += prot_->serializedFieldSize("serverExceptions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<true>(*prot_, this->__fbthrift_field_serverExceptions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Sink::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Sink");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_payload))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "payload", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_payload);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_clientExceptions))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "clientExceptions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::write(*prot_, this->__fbthrift_field_clientExceptions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_finalResponse))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "finalResponse", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_finalResponse);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_serverExceptions))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "serverExceptions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::write(*prot_, this->__fbthrift_field_serverExceptions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Interaction::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_functions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_functions = ::apache::thrift::type::Functions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::readWithContext(*iprot, this->__fbthrift_field_functions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Interaction>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_functions;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Interaction::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Interaction");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    xfer += prot_->serializedFieldSize("functions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::serializedSize<false>(*prot_, this->__fbthrift_field_functions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Interaction::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Interaction");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    xfer += prot_->serializedFieldSize("functions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::serializedSize<true>(*prot_, this->__fbthrift_field_functions);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Interaction::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Interaction");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "functions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::write(*prot_, this->__fbthrift_field_functions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void ReturnType::readNoXfer(Protocol_* iprot) {
  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  _readState.fieldId = 0;

  _readState.readStructBegin(iprot);

  _readState.readFieldBegin(iprot);
  if (_readState.atStop()) {
    apache::thrift::clear(*this);
  } else {
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<ReturnType>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->thriftType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, value_.thriftType);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->streamType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Stream>::readWithContext(*iprot, value_.streamType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->sinkType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Sink>::readWithContext(*iprot, value_.sinkType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64)) {
          this->interactionType_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>(*iprot, value_.interactionType);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      default:
      {
        _readState.skip(iprot);
        break;
      }
    }
    _readState.readFieldEnd(iprot);
    _readState.readFieldBegin(iprot);
    if (UNLIKELY(!_readState.atStop())) {
      using apache::thrift::protocol::TProtocolException;
      TProtocolException::throwUnionMissingStop();
    }
  }
  _readState.readStructEnd(iprot);
}
template <class Protocol_>
uint32_t ReturnType::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("ReturnType");
  switch(this->getType()) {
    case ReturnType::Type::thriftType:
    {
      xfer += prot_->serializedFieldSize("thriftType", apache::thrift::protocol::T_STRUCT, 1);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, value_.thriftType);
      break;
    }
    case ReturnType::Type::streamType:
    {
      xfer += prot_->serializedFieldSize("streamType", apache::thrift::protocol::T_STRUCT, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Stream>::serializedSize<false>(*prot_, value_.streamType);
      break;
    }
    case ReturnType::Type::sinkType:
    {
      xfer += prot_->serializedFieldSize("sinkType", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Sink>::serializedSize<false>(*prot_, value_.sinkType);
      break;
    }
    case ReturnType::Type::interactionType:
    {
      xfer += prot_->serializedFieldSize("interactionType", apache::thrift::protocol::T_I64, 4);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>(*prot_, value_.interactionType);
      break;
    }
    case ReturnType::Type::__EMPTY__:
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t ReturnType::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("ReturnType");
  switch(this->getType()) {
    case ReturnType::Type::thriftType:
    {
      xfer += prot_->serializedFieldSize("thriftType", apache::thrift::protocol::T_STRUCT, 1);
      xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, value_.thriftType);
      break;
    }
    case ReturnType::Type::streamType:
    {
      xfer += prot_->serializedFieldSize("streamType", apache::thrift::protocol::T_STRUCT, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Stream>::serializedSize<true>(*prot_, value_.streamType);
      break;
    }
    case ReturnType::Type::sinkType:
    {
      xfer += prot_->serializedFieldSize("sinkType", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Sink>::serializedSize<true>(*prot_, value_.sinkType);
      break;
    }
    case ReturnType::Type::interactionType:
    {
      xfer += prot_->serializedFieldSize("interactionType", apache::thrift::protocol::T_I64, 4);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>(*prot_, value_.interactionType);
      break;
    }
    case ReturnType::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t ReturnType::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("ReturnType");
  switch(this->getType()) {
    case ReturnType::Type::thriftType:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "thriftType", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, value_.thriftType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case ReturnType::Type::streamType:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "streamType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Stream>::write(*prot_, value_.streamType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case ReturnType::Type::sinkType:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "sinkType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Sink>::write(*prot_, value_.sinkType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case ReturnType::Type::interactionType:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 4, kPrevFieldId>(*prot_, "interactionType", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>(*prot_, value_.interactionType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case ReturnType::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Function::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_qualifier:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FunctionQualifier>::readWithContext(*iprot, this->__fbthrift_field_qualifier, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_returnTypes:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_returnTypes = ::apache::thrift::type::ReturnTypes();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::apache::thrift::type::ReturnTypes>::readWithContext(*iprot, this->__fbthrift_field_returnTypes, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_paramlist:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Paramlist>::readWithContext(*iprot, this->__fbthrift_field_paramlist, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_exceptions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_exceptions = ::apache::thrift::type::Exceptions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::readWithContext(*iprot, this->__fbthrift_field_exceptions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          6,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_returnType:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_returnType);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          6,
          7,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_streamOrSink:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::ReturnType>::readWithContext(*iprot, this->__fbthrift_field_streamOrSink, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          7,
          8,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_interactionType:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::readWithContext(*iprot, this->__fbthrift_field_interactionType, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          8,
          9,
          apache::thrift::protocol::T_BOOL))) {
    goto _advance_failure;
  }
_readField_isPerforms:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::readWithContext(*iprot, this->__fbthrift_field_isPerforms, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          9,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Function>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_qualifier;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_returnTypes;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_paramlist;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_exceptions;
      } else {
        goto _skip;
      }
    }
    case 6:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_returnType;
      } else {
        goto _skip;
      }
    }
    case 7:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_streamOrSink;
      } else {
        goto _skip;
      }
    }
    case 8:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_interactionType;
      } else {
        goto _skip;
      }
    }
    case 9:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BOOL))) {
        goto _readField_isPerforms;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Function::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Function");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FunctionQualifier>>(this->__fbthrift_field_qualifier))) {
    xfer += prot_->serializedFieldSize("qualifier", apache::thrift::protocol::T_I32, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FunctionQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_qualifier);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>>(this->__fbthrift_field_returnTypes))) {
    xfer += prot_->serializedFieldSize("returnTypes", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::apache::thrift::type::ReturnTypes>::serializedSize<false>(*prot_, this->__fbthrift_field_returnTypes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::Paramlist>>(this->__fbthrift_field_paramlist))) {
    xfer += prot_->serializedFieldSize("paramlist", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Paramlist>::serializedSize<false>(*prot_, this->__fbthrift_field_paramlist);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    xfer += prot_->serializedFieldSize("exceptions", apache::thrift::protocol::T_LIST, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<false>(*prot_, this->__fbthrift_field_exceptions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_returnType))) {
    xfer += prot_->serializedFieldSize("returnType", apache::thrift::protocol::T_STRUCT, 6);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_returnType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>(this->__fbthrift_field_streamOrSink))) {
    xfer += prot_->serializedFieldSize("streamOrSink", apache::thrift::protocol::T_STRUCT, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::ReturnType>::serializedSize<false>(*prot_, this->__fbthrift_field_streamOrSink);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_interactionType))) {
    xfer += prot_->serializedFieldSize("interactionType", apache::thrift::protocol::T_STRUCT, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::serializedSize<false>(*prot_, this->__fbthrift_field_interactionType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isPerforms))) {
    xfer += prot_->serializedFieldSize("isPerforms", apache::thrift::protocol::T_BOOL, 9);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isPerforms);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Function::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Function");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FunctionQualifier>>(this->__fbthrift_field_qualifier))) {
    xfer += prot_->serializedFieldSize("qualifier", apache::thrift::protocol::T_I32, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FunctionQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_qualifier);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>>(this->__fbthrift_field_returnTypes))) {
    xfer += prot_->serializedFieldSize("returnTypes", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::apache::thrift::type::ReturnTypes>::serializedSize<true>(*prot_, this->__fbthrift_field_returnTypes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::Paramlist>>(this->__fbthrift_field_paramlist))) {
    xfer += prot_->serializedFieldSize("paramlist", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Paramlist>::serializedSize<true>(*prot_, this->__fbthrift_field_paramlist);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    xfer += prot_->serializedFieldSize("exceptions", apache::thrift::protocol::T_LIST, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::serializedSize<true>(*prot_, this->__fbthrift_field_exceptions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_returnType))) {
    xfer += prot_->serializedFieldSize("returnType", apache::thrift::protocol::T_STRUCT, 6);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_returnType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>(this->__fbthrift_field_streamOrSink))) {
    xfer += prot_->serializedFieldSize("streamOrSink", apache::thrift::protocol::T_STRUCT, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::ReturnType>::serializedSize<true>(*prot_, this->__fbthrift_field_streamOrSink);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_interactionType))) {
    xfer += prot_->serializedFieldSize("interactionType", apache::thrift::protocol::T_STRUCT, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::serializedSize<true>(*prot_, this->__fbthrift_field_interactionType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isPerforms))) {
    xfer += prot_->serializedFieldSize("isPerforms", apache::thrift::protocol::T_BOOL, 9);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isPerforms);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Function::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Function");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type::FunctionQualifier>>(this->__fbthrift_field_qualifier))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 1, kPrevFieldId>(*prot_, "qualifier", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::FunctionQualifier>::write(*prot_, this->__fbthrift_field_qualifier);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>>(this->__fbthrift_field_returnTypes))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "returnTypes", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::apache::thrift::type::ReturnTypes>::write(*prot_, this->__fbthrift_field_returnTypes);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::Paramlist>>(this->__fbthrift_field_paramlist))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 4, kPrevFieldId>(*prot_, "paramlist", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Paramlist>::write(*prot_, this->__fbthrift_field_paramlist);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Field>>>(this->__fbthrift_field_exceptions))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 5, kPrevFieldId>(*prot_, "exceptions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Exceptions>::write(*prot_, this->__fbthrift_field_exceptions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_returnType))) {
    constexpr int16_t kPrevFieldId = 5;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 6, kPrevFieldId>(*prot_, "returnType", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_returnType);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::ReturnType>>(this->__fbthrift_field_streamOrSink))) {
    constexpr int16_t kPrevFieldId = 6;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 7, kPrevFieldId>(*prot_, "streamOrSink", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::ReturnType>::write(*prot_, this->__fbthrift_field_streamOrSink);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_interactionType))) {
    constexpr int16_t kPrevFieldId = 7;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 8, kPrevFieldId>(*prot_, "interactionType", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::write(*prot_, this->__fbthrift_field_interactionType);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isPerforms))) {
    constexpr int16_t kPrevFieldId = 8;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BOOL, 9, kPrevFieldId>(*prot_, "isPerforms", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::write(*prot_, this->__fbthrift_field_isPerforms);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Service::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_functions:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_functions = ::apache::thrift::type::Functions();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::readWithContext(*iprot, this->__fbthrift_field_functions, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_baseService:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::readWithContext(*iprot, this->__fbthrift_field_baseService, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Service>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_functions;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_baseService;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Service::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Service");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    xfer += prot_->serializedFieldSize("functions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::serializedSize<false>(*prot_, this->__fbthrift_field_functions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_baseService))) {
    xfer += prot_->serializedFieldSize("baseService", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::serializedSize<false>(*prot_, this->__fbthrift_field_baseService);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Service::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Service");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    xfer += prot_->serializedFieldSize("functions", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::serializedSize<true>(*prot_, this->__fbthrift_field_functions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_baseService))) {
    xfer += prot_->serializedFieldSize("baseService", apache::thrift::protocol::T_STRUCT, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::serializedSize<true>(*prot_, this->__fbthrift_field_baseService);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Service::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Service");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Function>>>(this->__fbthrift_field_functions))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "functions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::apache::thrift::type::Functions>::write(*prot_, this->__fbthrift_field_functions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::InterfaceRef>>(this->__fbthrift_field_baseService))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "baseService", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::InterfaceRef>::write(*prot_, this->__fbthrift_field_baseService);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Const::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_type:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_type);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_I64))) {
    goto _advance_failure;
  }
_readField_value:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*iprot, this->__fbthrift_field_value);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Const>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_type;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64))) {
        goto _readField_value;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Const::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Const");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_value))) {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_I64, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Const::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Const");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_value))) {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_I64, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Const::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Const");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "type", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_value))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 3, kPrevFieldId>(*prot_, "value", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_value);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Typedef::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_type:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*iprot, this->__fbthrift_field_type);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Typedef>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_type;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Typedef::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Typedef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Typedef::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Typedef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Typedef::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Typedef");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(this->__fbthrift_field_type))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "type", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Type>, ::apache::thrift::type::struct_t<::apache::thrift::type::TypeStruct>>>(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Definition::readNoXfer(Protocol_* iprot) {
  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  _readState.fieldId = 0;

  _readState.readStructBegin(iprot);

  _readState.readFieldBegin(iprot);
  if (_readState.atStop()) {
    apache::thrift::clear(*this);
  } else {
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Definition>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->structDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Struct>::readWithContext(*iprot, value_.structDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->unionDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Union>::readWithContext(*iprot, value_.unionDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->exceptionDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Exception>::readWithContext(*iprot, value_.exceptionDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->enumDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Enum>::readWithContext(*iprot, value_.enumDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 5:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->typedefDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Typedef>::readWithContext(*iprot, value_.typedefDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 6:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->constDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Const>::readWithContext(*iprot, value_.constDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 7:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->serviceDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Service>::readWithContext(*iprot, value_.serviceDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 8:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->interactionDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Interaction>::readWithContext(*iprot, value_.interactionDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      default:
      {
        _readState.skip(iprot);
        break;
      }
    }
    _readState.readFieldEnd(iprot);
    _readState.readFieldBegin(iprot);
    if (UNLIKELY(!_readState.atStop())) {
      using apache::thrift::protocol::TProtocolException;
      TProtocolException::throwUnionMissingStop();
    }
  }
  _readState.readStructEnd(iprot);
}
template <class Protocol_>
uint32_t Definition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Definition");
  switch(this->getType()) {
    case Definition::Type::structDef:
    {
      xfer += prot_->serializedFieldSize("structDef", apache::thrift::protocol::T_STRUCT, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Struct>::serializedSize<false>(*prot_, value_.structDef);
      break;
    }
    case Definition::Type::unionDef:
    {
      xfer += prot_->serializedFieldSize("unionDef", apache::thrift::protocol::T_STRUCT, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Union>::serializedSize<false>(*prot_, value_.unionDef);
      break;
    }
    case Definition::Type::exceptionDef:
    {
      xfer += prot_->serializedFieldSize("exceptionDef", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Exception>::serializedSize<false>(*prot_, value_.exceptionDef);
      break;
    }
    case Definition::Type::enumDef:
    {
      xfer += prot_->serializedFieldSize("enumDef", apache::thrift::protocol::T_STRUCT, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Enum>::serializedSize<false>(*prot_, value_.enumDef);
      break;
    }
    case Definition::Type::typedefDef:
    {
      xfer += prot_->serializedFieldSize("typedefDef", apache::thrift::protocol::T_STRUCT, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Typedef>::serializedSize<false>(*prot_, value_.typedefDef);
      break;
    }
    case Definition::Type::constDef:
    {
      xfer += prot_->serializedFieldSize("constDef", apache::thrift::protocol::T_STRUCT, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Const>::serializedSize<false>(*prot_, value_.constDef);
      break;
    }
    case Definition::Type::serviceDef:
    {
      xfer += prot_->serializedFieldSize("serviceDef", apache::thrift::protocol::T_STRUCT, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Service>::serializedSize<false>(*prot_, value_.serviceDef);
      break;
    }
    case Definition::Type::interactionDef:
    {
      xfer += prot_->serializedFieldSize("interactionDef", apache::thrift::protocol::T_STRUCT, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Interaction>::serializedSize<false>(*prot_, value_.interactionDef);
      break;
    }
    case Definition::Type::__EMPTY__:
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Definition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Definition");
  switch(this->getType()) {
    case Definition::Type::structDef:
    {
      xfer += prot_->serializedFieldSize("structDef", apache::thrift::protocol::T_STRUCT, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Struct>::serializedSize<true>(*prot_, value_.structDef);
      break;
    }
    case Definition::Type::unionDef:
    {
      xfer += prot_->serializedFieldSize("unionDef", apache::thrift::protocol::T_STRUCT, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Union>::serializedSize<true>(*prot_, value_.unionDef);
      break;
    }
    case Definition::Type::exceptionDef:
    {
      xfer += prot_->serializedFieldSize("exceptionDef", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Exception>::serializedSize<true>(*prot_, value_.exceptionDef);
      break;
    }
    case Definition::Type::enumDef:
    {
      xfer += prot_->serializedFieldSize("enumDef", apache::thrift::protocol::T_STRUCT, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Enum>::serializedSize<true>(*prot_, value_.enumDef);
      break;
    }
    case Definition::Type::typedefDef:
    {
      xfer += prot_->serializedFieldSize("typedefDef", apache::thrift::protocol::T_STRUCT, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Typedef>::serializedSize<true>(*prot_, value_.typedefDef);
      break;
    }
    case Definition::Type::constDef:
    {
      xfer += prot_->serializedFieldSize("constDef", apache::thrift::protocol::T_STRUCT, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Const>::serializedSize<true>(*prot_, value_.constDef);
      break;
    }
    case Definition::Type::serviceDef:
    {
      xfer += prot_->serializedFieldSize("serviceDef", apache::thrift::protocol::T_STRUCT, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Service>::serializedSize<true>(*prot_, value_.serviceDef);
      break;
    }
    case Definition::Type::interactionDef:
    {
      xfer += prot_->serializedFieldSize("interactionDef", apache::thrift::protocol::T_STRUCT, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Interaction>::serializedSize<true>(*prot_, value_.interactionDef);
      break;
    }
    case Definition::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Definition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Definition");
  switch(this->getType()) {
    case Definition::Type::structDef:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "structDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Struct>::write(*prot_, value_.structDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::unionDef:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "unionDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Union>::write(*prot_, value_.unionDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::exceptionDef:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "exceptionDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Exception>::write(*prot_, value_.exceptionDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::enumDef:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 4, kPrevFieldId>(*prot_, "enumDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Enum>::write(*prot_, value_.enumDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::typedefDef:
    {
      constexpr int16_t kPrevFieldId = 4;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 5, kPrevFieldId>(*prot_, "typedefDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Typedef>::write(*prot_, value_.typedefDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::constDef:
    {
      constexpr int16_t kPrevFieldId = 5;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 6, kPrevFieldId>(*prot_, "constDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Const>::write(*prot_, value_.constDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::serviceDef:
    {
      constexpr int16_t kPrevFieldId = 6;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 7, kPrevFieldId>(*prot_, "serviceDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Service>::write(*prot_, value_.serviceDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::interactionDef:
    {
      constexpr int16_t kPrevFieldId = 7;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 8, kPrevFieldId>(*prot_, "interactionDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::Interaction>::write(*prot_, value_.interactionDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Definition::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Program::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_attrs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::readWithContext(*iprot, this->__fbthrift_field_attrs, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I64))) {
    goto _advance_failure;
  }
_readField_id:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*iprot, this->__fbthrift_field_id);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_includes:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(*iprot, this->__fbthrift_field_includes);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_definitions:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(*iprot, this->__fbthrift_field_definitions);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          8,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_definitionKeys:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_definitionKeys = ::std::vector<::apache::thrift::type::DefinitionKey>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::apache::thrift::type::DefinitionKey>>::readWithContext(*iprot, this->__fbthrift_field_definitionKeys, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          8,
          5,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_path:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_path, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          6,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_languageIncludes:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_languageIncludes = ::std::map<::std::string, ::std::vector<::std::string>>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>>, ::std::map<::std::string, ::std::vector<::std::string>>>::readWithContext(*iprot, this->__fbthrift_field_languageIncludes, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          6,
          7,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_namespaces:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_namespaces = ::std::map<::std::string, ::std::string>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::readWithContext(*iprot, this->__fbthrift_field_namespaces, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          7,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Program>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_attrs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64))) {
        goto _readField_id;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_includes;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_definitions;
      } else {
        goto _skip;
      }
    }
    case 8:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_definitionKeys;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_path;
      } else {
        goto _skip;
      }
    }
    case 6:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_languageIncludes;
      } else {
        goto _skip;
      }
    }
    case 7:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_namespaces;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Program::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Program");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<false>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_id))) {
    xfer += prot_->serializedFieldSize("id", apache::thrift::protocol::T_I64, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_id);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_includes))) {
    xfer += prot_->serializedFieldSize("includes", apache::thrift::protocol::T_LIST, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_includes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_definitions))) {
    xfer += prot_->serializedFieldSize("definitions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_definitions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>>>(this->__fbthrift_field_definitionKeys))) {
    xfer += prot_->serializedFieldSize("definitionKeys", apache::thrift::protocol::T_LIST, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::apache::thrift::type::DefinitionKey>>::serializedSize<false>(*prot_, this->__fbthrift_field_definitionKeys);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_path))) {
    xfer += prot_->serializedFieldSize("path", apache::thrift::protocol::T_STRING, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_path);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::string_t>>>(this->__fbthrift_field_languageIncludes))) {
    xfer += prot_->serializedFieldSize("languageIncludes", apache::thrift::protocol::T_MAP, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>>, ::std::map<::std::string, ::std::vector<::std::string>>>::serializedSize<false>(*prot_, this->__fbthrift_field_languageIncludes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_namespaces))) {
    xfer += prot_->serializedFieldSize("namespaces", apache::thrift::protocol::T_MAP, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_namespaces);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Program::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Program");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    xfer += prot_->serializedFieldSize("attrs", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::serializedSize<true>(*prot_, this->__fbthrift_field_attrs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_id))) {
    xfer += prot_->serializedFieldSize("id", apache::thrift::protocol::T_I64, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_id);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_includes))) {
    xfer += prot_->serializedFieldSize("includes", apache::thrift::protocol::T_LIST, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_includes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_definitions))) {
    xfer += prot_->serializedFieldSize("definitions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_definitions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>>>(this->__fbthrift_field_definitionKeys))) {
    xfer += prot_->serializedFieldSize("definitionKeys", apache::thrift::protocol::T_LIST, 8);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::apache::thrift::type::DefinitionKey>>::serializedSize<true>(*prot_, this->__fbthrift_field_definitionKeys);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_path))) {
    xfer += prot_->serializedFieldSize("path", apache::thrift::protocol::T_STRING, 5);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_path);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::string_t>>>(this->__fbthrift_field_languageIncludes))) {
    xfer += prot_->serializedFieldSize("languageIncludes", apache::thrift::protocol::T_MAP, 6);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>>, ::std::map<::std::string, ::std::vector<::std::string>>>::serializedSize<false>(*prot_, this->__fbthrift_field_languageIncludes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_namespaces))) {
    xfer += prot_->serializedFieldSize("namespaces", apache::thrift::protocol::T_MAP, 7);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::serializedSize<false>(*prot_, this->__fbthrift_field_namespaces);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Program::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Program");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::DefinitionAttrs>>(this->__fbthrift_field_attrs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "attrs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::DefinitionAttrs>::write(*prot_, this->__fbthrift_field_attrs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_id))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 2, kPrevFieldId>(*prot_, "id", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_id);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_includes))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "includes", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_includes);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_definitions))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "definitions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::DefinitionId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_definitions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>>>(this->__fbthrift_field_definitionKeys))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 8, kPrevFieldId>(*prot_, "definitionKeys", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::apache::thrift::type::DefinitionKey>>::write(*prot_, this->__fbthrift_field_definitionKeys);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_path))) {
    constexpr int16_t kPrevFieldId = 8;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 5, kPrevFieldId>(*prot_, "path", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_path);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::string_t>>>(this->__fbthrift_field_languageIncludes))) {
    constexpr int16_t kPrevFieldId = 5;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 6, kPrevFieldId>(*prot_, "languageIncludes", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>>, ::std::map<::std::string, ::std::vector<::std::string>>>::write(*prot_, this->__fbthrift_field_languageIncludes);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::string_t>>(this->__fbthrift_field_namespaces))) {
    constexpr int16_t kPrevFieldId = 6;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 7, kPrevFieldId>(*prot_, "namespaces", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>>::write(*prot_, this->__fbthrift_field_namespaces);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void Schema::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_programs:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(*iprot, this->__fbthrift_field_programs);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_values:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*iprot, this->__fbthrift_field_values);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_valuesMap:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*iprot, this->__fbthrift_field_valuesMap);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_definitions:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*iprot, this->__fbthrift_field_definitions);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          8,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_definitionsMap:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*iprot, this->__fbthrift_field_definitionsMap);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          8,
          5,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_sources:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(*iprot, this->__fbthrift_field_sources);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          5,
          6,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_identifierSourceRanges:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(*iprot, this->__fbthrift_field_identifierSourceRanges);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          6,
          7,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_includeSourceRanges:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(*iprot, this->__fbthrift_field_includeSourceRanges);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          7,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Schema>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_programs;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_values;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_valuesMap;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_definitions;
      } else {
        goto _skip;
      }
    }
    case 8:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_definitionsMap;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_sources;
      } else {
        goto _skip;
      }
    }
    case 6:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_identifierSourceRanges;
      } else {
        goto _skip;
      }
    }
    case 7:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) {
        goto _readField_includeSourceRanges;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t Schema::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Schema");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(this->__fbthrift_field_programs))) {
    xfer += prot_->serializedFieldSize("programs", apache::thrift::protocol::T_LIST, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(*prot_, this->__fbthrift_field_programs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_values))) {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_values);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_valuesMap))) {
    xfer += prot_->serializedFieldSize("valuesMap", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_valuesMap);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitions))) {
    xfer += prot_->serializedFieldSize("definitions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitionsMap))) {
    xfer += prot_->serializedFieldSize("definitionsMap", apache::thrift::protocol::T_MAP, 8);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitionsMap);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(this->__fbthrift_field_sources))) {
    xfer += prot_->serializedFieldSize("sources", apache::thrift::protocol::T_MAP, 5);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(*prot_, this->__fbthrift_field_sources);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(this->__fbthrift_field_identifierSourceRanges))) {
    xfer += prot_->serializedFieldSize("identifierSourceRanges", apache::thrift::protocol::T_LIST, 6);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(*prot_, this->__fbthrift_field_identifierSourceRanges);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(this->__fbthrift_field_includeSourceRanges))) {
    xfer += prot_->serializedFieldSize("includeSourceRanges", apache::thrift::protocol::T_LIST, 7);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(*prot_, this->__fbthrift_field_includeSourceRanges);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Schema::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Schema");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(this->__fbthrift_field_programs))) {
    xfer += prot_->serializedFieldSize("programs", apache::thrift::protocol::T_LIST, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(*prot_, this->__fbthrift_field_programs);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_values))) {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_values);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_valuesMap))) {
    xfer += prot_->serializedFieldSize("valuesMap", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_valuesMap);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitions))) {
    xfer += prot_->serializedFieldSize("definitions", apache::thrift::protocol::T_LIST, 4);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitions);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitionsMap))) {
    xfer += prot_->serializedFieldSize("definitionsMap", apache::thrift::protocol::T_MAP, 8);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitionsMap);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(this->__fbthrift_field_sources))) {
    xfer += prot_->serializedFieldSize("sources", apache::thrift::protocol::T_MAP, 5);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(*prot_, this->__fbthrift_field_sources);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(this->__fbthrift_field_identifierSourceRanges))) {
    xfer += prot_->serializedFieldSize("identifierSourceRanges", apache::thrift::protocol::T_LIST, 6);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(*prot_, this->__fbthrift_field_identifierSourceRanges);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(this->__fbthrift_field_includeSourceRanges))) {
    xfer += prot_->serializedFieldSize("includeSourceRanges", apache::thrift::protocol::T_LIST, 7);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(*prot_, this->__fbthrift_field_includeSourceRanges);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Schema::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Schema");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(this->__fbthrift_field_programs))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 1, kPrevFieldId>(*prot_, "programs", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<std::deque<::apache::thrift::type::Program>, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::Program>>>>(*prot_, this->__fbthrift_field_programs);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_values))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 2, kPrevFieldId>(*prot_, "values", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_values);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(this->__fbthrift_field_valuesMap))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, kPrevFieldId>(*prot_, "valuesMap", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::protocol::detail::ValueWrapper<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, this->__fbthrift_field_valuesMap);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitions))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "definitions", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitions);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(this->__fbthrift_field_definitionsMap))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 8, kPrevFieldId>(*prot_, "definitionsMap", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::cpp_type<folly::fbstring, ::apache::thrift::type::binary_t>, ::apache::thrift::type::union_t<::apache::thrift::type::Definition>>>(*prot_, this->__fbthrift_field_definitionsMap);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(this->__fbthrift_field_sources))) {
    constexpr int16_t kPrevFieldId = 8;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 5, kPrevFieldId>(*prot_, "sources", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::struct_t<::apache::thrift::type::SourceInfo>>>(*prot_, this->__fbthrift_field_sources);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(this->__fbthrift_field_identifierSourceRanges))) {
    constexpr int16_t kPrevFieldId = 5;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 6, kPrevFieldId>(*prot_, "identifierSourceRanges", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IdentifierRef>>>(*prot_, this->__fbthrift_field_identifierSourceRanges);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(this->__fbthrift_field_includeSourceRanges))) {
    constexpr int16_t kPrevFieldId = 6;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 7, kPrevFieldId>(*prot_, "includeSourceRanges", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type::IncludeRef>>>(*prot_, this->__fbthrift_field_includeSourceRanges);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SourceInfo::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_fileName:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_fileName, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_languageIncludes:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(*iprot, this->__fbthrift_field_languageIncludes);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_namespaces:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*iprot, this->__fbthrift_field_namespaces);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<SourceInfo>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_fileName;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_languageIncludes;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_namespaces;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SourceInfo::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SourceInfo");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fileName))) {
    xfer += prot_->serializedFieldSize("fileName", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_fileName);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(this->__fbthrift_field_languageIncludes))) {
    xfer += prot_->serializedFieldSize("languageIncludes", apache::thrift::protocol::T_MAP, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(*prot_, this->__fbthrift_field_languageIncludes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_namespaces))) {
    xfer += prot_->serializedFieldSize("namespaces", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_namespaces);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SourceInfo::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SourceInfo");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fileName))) {
    xfer += prot_->serializedFieldSize("fileName", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_fileName);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(this->__fbthrift_field_languageIncludes))) {
    xfer += prot_->serializedFieldSize("languageIncludes", apache::thrift::protocol::T_MAP, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(*prot_, this->__fbthrift_field_languageIncludes);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_namespaces))) {
    xfer += prot_->serializedFieldSize("namespaces", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_namespaces);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SourceInfo::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SourceInfo");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_fileName))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "fileName", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_fileName);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(this->__fbthrift_field_languageIncludes))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 2, kPrevFieldId>(*prot_, "languageIncludes", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>>(*prot_, this->__fbthrift_field_languageIncludes);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(this->__fbthrift_field_namespaces))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, kPrevFieldId>(*prot_, "namespaces", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>>(*prot_, this->__fbthrift_field_namespaces);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void IdentifierRef::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_range:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::readWithContext(*iprot, this->__fbthrift_field_range, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_uri:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, this->__fbthrift_field_uri, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_enumValue:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_enumValue, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<IdentifierRef>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_range;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_uri;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) {
        goto _readField_enumValue;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t IdentifierRef::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("IdentifierRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    xfer += prot_->serializedFieldSize("range", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<false>(*prot_, this->__fbthrift_field_range);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, this->__fbthrift_field_uri);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_enumValue))) {
    xfer += prot_->serializedFieldSize("enumValue", apache::thrift::protocol::T_STRING, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_enumValue);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t IdentifierRef::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("IdentifierRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    xfer += prot_->serializedFieldSize("range", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<true>(*prot_, this->__fbthrift_field_range);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, this->__fbthrift_field_uri);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_enumValue))) {
    xfer += prot_->serializedFieldSize("enumValue", apache::thrift::protocol::T_STRING, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, this->__fbthrift_field_enumValue);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t IdentifierRef::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("IdentifierRef");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "range", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::write(*prot_, this->__fbthrift_field_range);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type::TypeUri>>(this->__fbthrift_field_uri))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "uri", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, this->__fbthrift_field_uri);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_enumValue))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 3, kPrevFieldId>(*prot_, "enumValue", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_enumValue);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void IncludeRef::readNoXfer(Protocol_* iprot) {
  __fbthrift_clear_terse_fields();

  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_range:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::readWithContext(*iprot, this->__fbthrift_field_range, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I64))) {
    goto _advance_failure;
  }
_readField_target:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*iprot, this->__fbthrift_field_target);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          0,
          apache::thrift::protocol::T_STOP))) {
    goto _advance_failure;
  }

_end:
  _readState.readStructEnd(iprot);

  return;

  goto _advance_failure; // Avoid compiler warnings about unused labels.
  _advance_failure:
  _readState.afterAdvanceFailure(iprot);
_loop:
  if (_readState.atStop()) {
    goto _end;
  }
  if (iprot->kUsesFieldNames()) {
    _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<IncludeRef>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_range;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64))) {
        goto _readField_target;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t IncludeRef::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("IncludeRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    xfer += prot_->serializedFieldSize("range", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<false>(*prot_, this->__fbthrift_field_range);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_target))) {
    xfer += prot_->serializedFieldSize("target", apache::thrift::protocol::T_I64, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_target);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t IncludeRef::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("IncludeRef");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    xfer += prot_->serializedFieldSize("range", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::serializedSize<true>(*prot_, this->__fbthrift_field_range);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_target))) {
    xfer += prot_->serializedFieldSize("target", apache::thrift::protocol::T_I64, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_target);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t IncludeRef::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("IncludeRef");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::struct_t<::apache::thrift::type::SourceRange>>(this->__fbthrift_field_range))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "range", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type::SourceRange>::write(*prot_, this->__fbthrift_field_range);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(this->__fbthrift_field_target))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 2, kPrevFieldId>(*prot_, "target", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ProgramId>, ::apache::thrift::type::i64_t>>(*prot_, this->__fbthrift_field_target);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


} // namespace apache::thrift::type
