/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/fbthrift-07c1dc61/work/fbthrift-2025.12.15.00/thrift/lib/thrift/type_system.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/type_system_types.tcc"

#include "thrift/lib/thrift/gen-cpp2/id_types_custom_protocol.h"
#include "thrift/lib/thrift/gen-cpp2/type_id_types_custom_protocol.h"
#include "thrift/lib/thrift/gen-cpp2/record_types_custom_protocol.h"


namespace apache {
namespace thrift {
namespace detail {

template <>
struct TccStructTraits<::apache::thrift::type_system::FieldIdentityStruct> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableFieldDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableStructDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableUnionDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableEnumValueDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableEnumDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableOpaqueAliasDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableTypeDefinition> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableThriftSourceInfo> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableTypeDefinitionEntry> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableTypeSystem> {
  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_system {

template <class Protocol_>
void FieldIdentityStruct::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_STRING))) {
    goto _advance_failure;
  }
_readField_name:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::apache::thrift::type_system::FieldName>::readWithContext(*iprot, this->__fbthrift_field_name, _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<FieldIdentityStruct>>();
  }

  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_STRING))) {
        goto _readField_name;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t FieldIdentityStruct::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("FieldIdentity");
  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::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::apache::thrift::type_system::FieldName>::serializedSize<false>(*prot_, this->__fbthrift_field_name);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t FieldIdentityStruct::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("FieldIdentity");
  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::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::apache::thrift::type_system::FieldName>::serializedSize<false>(*prot_, this->__fbthrift_field_name);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t FieldIdentityStruct::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("FieldIdentity");
  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::string_t>(this->__fbthrift_field_name))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 2, kPrevFieldId>(*prot_, "name", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::apache::thrift::type_system::FieldName>::write(*prot_, this->__fbthrift_field_name);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableFieldDefinition::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_identity:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(*iprot, this->__fbthrift_field_identity);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_presence:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type_system::PresenceQualifier>::readWithContext(*iprot, this->__fbthrift_field_presence, _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::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*iprot, this->__fbthrift_field_type);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_customDefaultPartialRecord:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::readWithContext(*iprot, this->__fbthrift_field_customDefaultPartialRecord, _readState);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(0, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          4,
          5,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _readState);
    _readState.afterSubobject(iprot);
  }

  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<SerializableFieldDefinition>>();
  }

  switch (_readState.fieldId) {
    case 1:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) {
        goto _readField_identity;
      } else {
        goto _skip;
      }
    }
    case 2:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32))) {
        goto _readField_presence;
      } 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_customDefaultPartialRecord;
      } else {
        goto _skip;
      }
    }
    case 5:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotations;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SerializableFieldDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableFieldDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(this->__fbthrift_field_identity))) {
    xfer += prot_->serializedFieldSize("identity", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(*prot_, this->__fbthrift_field_identity);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type_system::PresenceQualifier>>(this->__fbthrift_field_presence))) {
    xfer += prot_->serializedFieldSize("presence", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type_system::PresenceQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_presence);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(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::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_type);
  }
  if (this->__isset.get(0)) {
    xfer += prot_->serializedFieldSize("customDefaultPartialRecord", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<false>(*prot_, this->__fbthrift_field_customDefaultPartialRecord);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableFieldDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableFieldDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(this->__fbthrift_field_identity))) {
    xfer += prot_->serializedFieldSize("identity", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(*prot_, this->__fbthrift_field_identity);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type_system::PresenceQualifier>>(this->__fbthrift_field_presence))) {
    xfer += prot_->serializedFieldSize("presence", apache::thrift::protocol::T_I32, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type_system::PresenceQualifier>::serializedSize<false>(*prot_, this->__fbthrift_field_presence);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(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::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_type);
  }
  if (this->__isset.get(0)) {
    xfer += prot_->serializedFieldSize("customDefaultPartialRecord", apache::thrift::protocol::T_STRUCT, 4);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<true>(*prot_, this->__fbthrift_field_customDefaultPartialRecord);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableFieldDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableFieldDefinition");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(this->__fbthrift_field_identity))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "identity", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::FieldIdentityAdapter, ::apache::thrift::type::struct_t<::apache::thrift::type_system::FieldIdentityStruct>>>(*prot_, this->__fbthrift_field_identity);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::enum_t<::apache::thrift::type_system::PresenceQualifier>>(this->__fbthrift_field_presence))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "presence", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type_system::PresenceQualifier>::write(*prot_, this->__fbthrift_field_presence);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(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::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (this->__isset.get(0)) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 4, kPrevFieldId>(*prot_, "customDefaultPartialRecord", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::write(*prot_, this->__fbthrift_field_customDefaultPartialRecord);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 4;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 5, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableStructDefinition::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,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

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

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _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<SerializableStructDefinition>>();
  }

  switch (_readState.fieldId) {
    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_BOOL))) {
        goto _readField_isSealed;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotations;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SerializableStructDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableStructDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    xfer += prot_->serializedFieldSize("isSealed", apache::thrift::protocol::T_BOOL, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isSealed);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableStructDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableStructDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    xfer += prot_->serializedFieldSize("isSealed", apache::thrift::protocol::T_BOOL, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isSealed);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableStructDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableStructDefinition");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 0;
    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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BOOL, 3, kPrevFieldId>(*prot_, "isSealed", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::write(*prot_, this->__fbthrift_field_isSealed);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 4, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableUnionDefinition::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,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_fields:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_fields = ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::readWithContext(*iprot, this->__fbthrift_field_fields, _readState);
    _readState.afterSubobject(iprot);
  }

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

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _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<SerializableUnionDefinition>>();
  }

  switch (_readState.fieldId) {
    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_BOOL))) {
        goto _readField_isSealed;
      } else {
        goto _skip;
      }
    }
    case 4:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotations;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SerializableUnionDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableUnionDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::serializedSize<false>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    xfer += prot_->serializedFieldSize("isSealed", apache::thrift::protocol::T_BOOL, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isSealed);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableUnionDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableUnionDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::serializedSize<true>(*prot_, this->__fbthrift_field_fields);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    xfer += prot_->serializedFieldSize("isSealed", apache::thrift::protocol::T_BOOL, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, this->__fbthrift_field_isSealed);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableUnionDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableUnionDefinition");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableFieldDefinition>>>(this->__fbthrift_field_fields))) {
    constexpr int16_t kPrevFieldId = 0;
    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>, ::std::vector<::apache::thrift::type_system::SerializableFieldDefinition>>::write(*prot_, this->__fbthrift_field_fields);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::bool_t>(this->__fbthrift_field_isSealed))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BOOL, 3, kPrevFieldId>(*prot_, "isSealed", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::write(*prot_, this->__fbthrift_field_isSealed);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 4, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableEnumValueDefinition::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_I32))) {
    goto _advance_failure;
  }
_readField_datum:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, this->__fbthrift_field_datum, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _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<SerializableEnumValueDefinition>>();
  }

  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_I32))) {
        goto _readField_datum;
      } else {
        goto _skip;
      }
    }
    case 3:
    {
      if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP))) {
        goto _readField_annotations;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SerializableEnumValueDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableEnumValueDefinition");
  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::i32_t>(this->__fbthrift_field_datum))) {
    xfer += prot_->serializedFieldSize("datum", 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_datum);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableEnumValueDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableEnumValueDefinition");
  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::i32_t>(this->__fbthrift_field_datum))) {
    xfer += prot_->serializedFieldSize("datum", 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_datum);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableEnumValueDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableEnumValueDefinition");
  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::i32_t>(this->__fbthrift_field_datum))) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "datum", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, this->__fbthrift_field_datum);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableEnumDefinition::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,
          2,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_values:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_values = ::std::vector<::apache::thrift::type_system::SerializableEnumValueDefinition>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableEnumValueDefinition>>::readWithContext(*iprot, this->__fbthrift_field_values, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _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<SerializableEnumDefinition>>();
  }

  switch (_readState.fieldId) {
    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_annotations;
      } else {
        goto _skip;
      }
    }
    default:
    {
_skip:
      _readState.skip(iprot);
      _readState.readFieldEnd(iprot);
      _readState.readFieldBeginNoInline(iprot);
      goto _loop;
    }
  }
}

template <class Protocol_>
uint32_t SerializableEnumDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableEnumDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableEnumValueDefinition>>>(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_system::SerializableEnumValueDefinition>>::serializedSize<false>(*prot_, this->__fbthrift_field_values);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableEnumDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableEnumDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableEnumValueDefinition>>>(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_system::SerializableEnumValueDefinition>>::serializedSize<true>(*prot_, this->__fbthrift_field_values);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableEnumDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableEnumDefinition");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableEnumValueDefinition>>>(this->__fbthrift_field_values))) {
    constexpr int16_t kPrevFieldId = 0;
    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_system::SerializableEnumValueDefinition>>::write(*prot_, this->__fbthrift_field_values);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableOpaqueAliasDefinition::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,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_targetType:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*iprot, this->__fbthrift_field_targetType);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_annotations:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_annotations = folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, this->__fbthrift_field_annotations, _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<SerializableOpaqueAliasDefinition>>();
  }

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

template <class Protocol_>
uint32_t SerializableOpaqueAliasDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableOpaqueAliasDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(this->__fbthrift_field_targetType))) {
    xfer += prot_->serializedFieldSize("targetType", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_targetType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableOpaqueAliasDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableOpaqueAliasDefinition");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(this->__fbthrift_field_targetType))) {
    xfer += prot_->serializedFieldSize("targetType", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_targetType);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    xfer += prot_->serializedFieldSize("annotations", apache::thrift::protocol::T_MAP, 3);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, this->__fbthrift_field_annotations);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableOpaqueAliasDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableOpaqueAliasDefinition");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(this->__fbthrift_field_targetType))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "targetType", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type_system::detail::TypeIdAdapter, ::apache::thrift::type::union_t<::apache::thrift::type_system::TypeIdUnion>>>(*prot_, this->__fbthrift_field_targetType);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::cpp_type<folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>, ::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>>(this->__fbthrift_field_annotations))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, 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::variant>, folly::F14FastMap<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, this->__fbthrift_field_annotations);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableTypeDefinition::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<SerializableTypeDefinition>>();
    }
    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_system::SerializableStructDefinition>::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_system::SerializableUnionDefinition>::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->enumDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableEnumDefinition>::readWithContext(*iprot, value_.enumDef, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->opaqueAliasDef_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableOpaqueAliasDefinition>::readWithContext(*iprot, value_.opaqueAliasDef, _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 SerializableTypeDefinition::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeDefinition");
  switch(this->getType()) {
    case SerializableTypeDefinition::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_system::SerializableStructDefinition>::serializedSize<false>(*prot_, value_.structDef);
      break;
    }
    case SerializableTypeDefinition::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_system::SerializableUnionDefinition>::serializedSize<false>(*prot_, value_.unionDef);
      break;
    }
    case SerializableTypeDefinition::Type::enumDef:
    {
      xfer += prot_->serializedFieldSize("enumDef", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableEnumDefinition>::serializedSize<false>(*prot_, value_.enumDef);
      break;
    }
    case SerializableTypeDefinition::Type::opaqueAliasDef:
    {
      xfer += prot_->serializedFieldSize("opaqueAliasDef", apache::thrift::protocol::T_STRUCT, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableOpaqueAliasDefinition>::serializedSize<false>(*prot_, value_.opaqueAliasDef);
      break;
    }
    case SerializableTypeDefinition::Type::__EMPTY__:
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeDefinition::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeDefinition");
  switch(this->getType()) {
    case SerializableTypeDefinition::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_system::SerializableStructDefinition>::serializedSize<true>(*prot_, value_.structDef);
      break;
    }
    case SerializableTypeDefinition::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_system::SerializableUnionDefinition>::serializedSize<true>(*prot_, value_.unionDef);
      break;
    }
    case SerializableTypeDefinition::Type::enumDef:
    {
      xfer += prot_->serializedFieldSize("enumDef", apache::thrift::protocol::T_STRUCT, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableEnumDefinition>::serializedSize<true>(*prot_, value_.enumDef);
      break;
    }
    case SerializableTypeDefinition::Type::opaqueAliasDef:
    {
      xfer += prot_->serializedFieldSize("opaqueAliasDef", apache::thrift::protocol::T_STRUCT, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableOpaqueAliasDefinition>::serializedSize<true>(*prot_, value_.opaqueAliasDef);
      break;
    }
    case SerializableTypeDefinition::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeDefinition::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableTypeDefinition");
  switch(this->getType()) {
    case SerializableTypeDefinition::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_system::SerializableStructDefinition>::write(*prot_, value_.structDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableTypeDefinition::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_system::SerializableUnionDefinition>::write(*prot_, value_.unionDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableTypeDefinition::Type::enumDef:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 3, kPrevFieldId>(*prot_, "enumDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableEnumDefinition>::write(*prot_, value_.enumDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableTypeDefinition::Type::opaqueAliasDef:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 4, kPrevFieldId>(*prot_, "opaqueAliasDef", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableOpaqueAliasDefinition>::write(*prot_, value_.opaqueAliasDef);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableTypeDefinition::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableThriftSourceInfo::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,
          2,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_locator:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, this->__fbthrift_field_locator, _readState);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          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,
          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<SerializableThriftSourceInfo>>();
  }

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

template <class Protocol_>
uint32_t SerializableThriftSourceInfo::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableThriftSourceInfo");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_locator))) {
    xfer += prot_->serializedFieldSize("locator", 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_locator);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", 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_name);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableThriftSourceInfo::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableThriftSourceInfo");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_locator))) {
    xfer += prot_->serializedFieldSize("locator", 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_locator);
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    xfer += prot_->serializedFieldSize("name", 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_name);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableThriftSourceInfo::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableThriftSourceInfo");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_locator))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 2, kPrevFieldId>(*prot_, "locator", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, this->__fbthrift_field_locator);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::string_t>(this->__fbthrift_field_name))) {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 3, 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;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableTypeDefinitionEntry::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_definition:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableTypeDefinition>::readWithContext(*iprot, this->__fbthrift_field_definition, _readState);
    _readState.afterSubobject(iprot);
  }

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_sourceInfo:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableThriftSourceInfo>::readWithContext(*iprot, this->__fbthrift_field_sourceInfo, _readState);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(0, true);

  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<SerializableTypeDefinitionEntry>>();
  }

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

template <class Protocol_>
uint32_t SerializableTypeDefinitionEntry::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeDefinitionEntry");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableTypeDefinition>>(this->__fbthrift_field_definition))) {
    xfer += prot_->serializedFieldSize("definition", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableTypeDefinition>::serializedSize<false>(*prot_, this->__fbthrift_field_definition);
  }
  if (this->__isset.get(0)) {
    xfer += prot_->serializedFieldSize("sourceInfo", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableThriftSourceInfo>::serializedSize<false>(*prot_, this->__fbthrift_field_sourceInfo);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeDefinitionEntry::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeDefinitionEntry");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableTypeDefinition>>(this->__fbthrift_field_definition))) {
    xfer += prot_->serializedFieldSize("definition", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableTypeDefinition>::serializedSize<true>(*prot_, this->__fbthrift_field_definition);
  }
  if (this->__isset.get(0)) {
    xfer += prot_->serializedFieldSize("sourceInfo", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableThriftSourceInfo>::serializedSize<true>(*prot_, this->__fbthrift_field_sourceInfo);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeDefinitionEntry::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableTypeDefinitionEntry");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableTypeDefinition>>(this->__fbthrift_field_definition))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "definition", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableTypeDefinition>::write(*prot_, this->__fbthrift_field_definition);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  if (this->__isset.get(0)) {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "sourceInfo", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::structure, ::apache::thrift::type_system::SerializableThriftSourceInfo>::write(*prot_, this->__fbthrift_field_sourceInfo);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableTypeSystem::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_types:
  {
    _readState.beforeSubobject(iprot);
    this->__fbthrift_field_types = ::std::map<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableTypeDefinitionEntry>();
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableTypeDefinitionEntry>>::readWithContext(*iprot, this->__fbthrift_field_types, _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<SerializableTypeSystem>>();
  }

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

template <class Protocol_>
uint32_t SerializableTypeSystem::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeSystem");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableTypeDefinitionEntry>>>(this->__fbthrift_field_types))) {
    xfer += prot_->serializedFieldSize("types", apache::thrift::protocol::T_MAP, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableTypeDefinitionEntry>>::serializedSize<false>(*prot_, this->__fbthrift_field_types);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeSystem::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableTypeSystem");
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableTypeDefinitionEntry>>>(this->__fbthrift_field_types))) {
    xfer += prot_->serializedFieldSize("types", apache::thrift::protocol::T_MAP, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableTypeDefinitionEntry>>::serializedSize<true>(*prot_, this->__fbthrift_field_types);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableTypeSystem::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableTypeSystem");
  bool previousFieldHasValue = true;
  if (!(::apache::thrift::op::isEmpty<::apache::thrift::type::map<::apache::thrift::type::string_t, ::apache::thrift::type::struct_t<::apache::thrift::type_system::SerializableTypeDefinitionEntry>>>(this->__fbthrift_field_types))) {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 1, kPrevFieldId>(*prot_, "types", 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<::apache::thrift::type_system::Uri, ::apache::thrift::type_system::SerializableTypeDefinitionEntry>>::write(*prot_, this->__fbthrift_field_types);
    xfer += prot_->writeFieldEnd();
  } else {
    previousFieldHasValue = false;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


} // namespace apache::thrift::type_system
