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

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


namespace apache {
namespace thrift {
namespace detail {

template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableRecordUnion> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type_system::SerializableRecordMapEntry> {
  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 SerializableRecordUnion::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<SerializableRecordUnion>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BOOL)) {
          this->boolDatum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::readWithContext(*iprot, value_.boolDatum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BYTE)) {
          this->int8Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int8_t>::readWithContext(*iprot, value_.int8Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I16)) {
          this->int16Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int16_t>::readWithContext(*iprot, value_.int16Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 5:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->int32Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::readWithContext(*iprot, value_.int32Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 6:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64)) {
          this->int64Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int64_t>::readWithContext(*iprot, value_.int64Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 7:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_FLOAT)) {
          this->float32Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, float>::readWithContext(*iprot, value_.float32Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 8:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_DOUBLE)) {
          this->float64Datum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, double>::readWithContext(*iprot, value_.float64Datum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 9:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->textDatum_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, value_.textDatum, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 10:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->byteArrayDatum_ref().emplace();
          auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::apache::thrift::type::ByteBuffer>>();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::readWithContext(*iprot, *ptr, _readState);
          value_.byteArrayDatum = std::move(ptr);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 11:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP)) {
          this->fieldSetDatum_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::op::decode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>(*iprot, value_.fieldSetDatum);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 12:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST)) {
          this->listDatum_ref().emplace();
          _readState.beforeSubobject(iprot);
          value_.listDatum = ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, value_.listDatum, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 13:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST)) {
          this->setDatum_ref().emplace();
          _readState.beforeSubobject(iprot);
          value_.setDatum = ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::readWithContext(*iprot, value_.setDatum, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 14:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST)) {
          this->mapDatum_ref().emplace();
          _readState.beforeSubobject(iprot);
          value_.mapDatum = ::std::vector<::apache::thrift::type_system::SerializableRecordMapEntry>();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableRecordMapEntry>>::readWithContext(*iprot, value_.mapDatum, _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 SerializableRecordUnion::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableRecord");
  switch(this->getType()) {
    case SerializableRecordUnion::Type::boolDatum:
    {
      xfer += prot_->serializedFieldSize("boolDatum", apache::thrift::protocol::T_BOOL, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, value_.boolDatum);
      break;
    }
    case SerializableRecordUnion::Type::int8Datum:
    {
      xfer += prot_->serializedFieldSize("int8Datum", apache::thrift::protocol::T_BYTE, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int8_t>::serializedSize<false>(*prot_, value_.int8Datum);
      break;
    }
    case SerializableRecordUnion::Type::int16Datum:
    {
      xfer += prot_->serializedFieldSize("int16Datum", apache::thrift::protocol::T_I16, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int16_t>::serializedSize<false>(*prot_, value_.int16Datum);
      break;
    }
    case SerializableRecordUnion::Type::int32Datum:
    {
      xfer += prot_->serializedFieldSize("int32Datum", apache::thrift::protocol::T_I32, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, value_.int32Datum);
      break;
    }
    case SerializableRecordUnion::Type::int64Datum:
    {
      xfer += prot_->serializedFieldSize("int64Datum", apache::thrift::protocol::T_I64, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int64_t>::serializedSize<false>(*prot_, value_.int64Datum);
      break;
    }
    case SerializableRecordUnion::Type::float32Datum:
    {
      xfer += prot_->serializedFieldSize("float32Datum", apache::thrift::protocol::T_FLOAT, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, float>::serializedSize<false>(*prot_, value_.float32Datum);
      break;
    }
    case SerializableRecordUnion::Type::float64Datum:
    {
      xfer += prot_->serializedFieldSize("float64Datum", apache::thrift::protocol::T_DOUBLE, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, double>::serializedSize<false>(*prot_, value_.float64Datum);
      break;
    }
    case SerializableRecordUnion::Type::textDatum:
    {
      xfer += prot_->serializedFieldSize("textDatum", apache::thrift::protocol::T_STRING, 9);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.textDatum);
      break;
    }
    case SerializableRecordUnion::Type::byteArrayDatum:
    {
      xfer += prot_->serializedFieldSize("byteArrayDatum", apache::thrift::protocol::T_STRING, 10);
      if (value_.byteArrayDatum) {
        xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::serializedSize<false>(*prot_, *value_.byteArrayDatum);
      }
      break;
    }
    case SerializableRecordUnion::Type::fieldSetDatum:
    {
      xfer += prot_->serializedFieldSize("fieldSetDatum", apache::thrift::protocol::T_MAP, 11);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>(*prot_, value_.fieldSetDatum);
      break;
    }
    case SerializableRecordUnion::Type::listDatum:
    {
      xfer += prot_->serializedFieldSize("listDatum", apache::thrift::protocol::T_LIST, 12);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, value_.listDatum);
      break;
    }
    case SerializableRecordUnion::Type::setDatum:
    {
      xfer += prot_->serializedFieldSize("setDatum", apache::thrift::protocol::T_LIST, 13);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<false>(*prot_, value_.setDatum);
      break;
    }
    case SerializableRecordUnion::Type::mapDatum:
    {
      xfer += prot_->serializedFieldSize("mapDatum", apache::thrift::protocol::T_LIST, 14);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableRecordMapEntry>>::serializedSize<false>(*prot_, value_.mapDatum);
      break;
    }
    case SerializableRecordUnion::Type::__EMPTY__:
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableRecordUnion::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableRecord");
  switch(this->getType()) {
    case SerializableRecordUnion::Type::boolDatum:
    {
      xfer += prot_->serializedFieldSize("boolDatum", apache::thrift::protocol::T_BOOL, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::serializedSize<false>(*prot_, value_.boolDatum);
      break;
    }
    case SerializableRecordUnion::Type::int8Datum:
    {
      xfer += prot_->serializedFieldSize("int8Datum", apache::thrift::protocol::T_BYTE, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int8_t>::serializedSize<false>(*prot_, value_.int8Datum);
      break;
    }
    case SerializableRecordUnion::Type::int16Datum:
    {
      xfer += prot_->serializedFieldSize("int16Datum", apache::thrift::protocol::T_I16, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int16_t>::serializedSize<false>(*prot_, value_.int16Datum);
      break;
    }
    case SerializableRecordUnion::Type::int32Datum:
    {
      xfer += prot_->serializedFieldSize("int32Datum", apache::thrift::protocol::T_I32, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::serializedSize<false>(*prot_, value_.int32Datum);
      break;
    }
    case SerializableRecordUnion::Type::int64Datum:
    {
      xfer += prot_->serializedFieldSize("int64Datum", apache::thrift::protocol::T_I64, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int64_t>::serializedSize<false>(*prot_, value_.int64Datum);
      break;
    }
    case SerializableRecordUnion::Type::float32Datum:
    {
      xfer += prot_->serializedFieldSize("float32Datum", apache::thrift::protocol::T_FLOAT, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, float>::serializedSize<false>(*prot_, value_.float32Datum);
      break;
    }
    case SerializableRecordUnion::Type::float64Datum:
    {
      xfer += prot_->serializedFieldSize("float64Datum", apache::thrift::protocol::T_DOUBLE, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, double>::serializedSize<false>(*prot_, value_.float64Datum);
      break;
    }
    case SerializableRecordUnion::Type::textDatum:
    {
      xfer += prot_->serializedFieldSize("textDatum", apache::thrift::protocol::T_STRING, 9);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.textDatum);
      break;
    }
    case SerializableRecordUnion::Type::byteArrayDatum:
    {
      xfer += prot_->serializedFieldSize("byteArrayDatum", apache::thrift::protocol::T_STRING, 10);
      if (value_.byteArrayDatum) {
        xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::serializedSize<true>(*prot_, *value_.byteArrayDatum);
      }
      break;
    }
    case SerializableRecordUnion::Type::fieldSetDatum:
    {
      xfer += prot_->serializedFieldSize("fieldSetDatum", apache::thrift::protocol::T_MAP, 11);
      xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>(*prot_, value_.fieldSetDatum);
      break;
    }
    case SerializableRecordUnion::Type::listDatum:
    {
      xfer += prot_->serializedFieldSize("listDatum", apache::thrift::protocol::T_LIST, 12);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, value_.listDatum);
      break;
    }
    case SerializableRecordUnion::Type::setDatum:
    {
      xfer += prot_->serializedFieldSize("setDatum", apache::thrift::protocol::T_LIST, 13);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::serializedSize<true>(*prot_, value_.setDatum);
      break;
    }
    case SerializableRecordUnion::Type::mapDatum:
    {
      xfer += prot_->serializedFieldSize("mapDatum", apache::thrift::protocol::T_LIST, 14);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableRecordMapEntry>>::serializedSize<true>(*prot_, value_.mapDatum);
      break;
    }
    case SerializableRecordUnion::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableRecordUnion::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableRecord");
  switch(this->getType()) {
    case SerializableRecordUnion::Type::boolDatum:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BOOL, 1, kPrevFieldId>(*prot_, "boolDatum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, bool>::write(*prot_, value_.boolDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::int8Datum:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BYTE, 2, kPrevFieldId>(*prot_, "int8Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int8_t>::write(*prot_, value_.int8Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::int16Datum:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I16, 3, kPrevFieldId>(*prot_, "int16Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int16_t>::write(*prot_, value_.int16Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::int32Datum:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 5, kPrevFieldId>(*prot_, "int32Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int32_t>::write(*prot_, value_.int32Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::int64Datum:
    {
      constexpr int16_t kPrevFieldId = 5;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 6, kPrevFieldId>(*prot_, "int64Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral, ::std::int64_t>::write(*prot_, value_.int64Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::float32Datum:
    {
      constexpr int16_t kPrevFieldId = 6;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_FLOAT, 7, kPrevFieldId>(*prot_, "float32Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, float>::write(*prot_, value_.float32Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::float64Datum:
    {
      constexpr int16_t kPrevFieldId = 7;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_DOUBLE, 8, kPrevFieldId>(*prot_, "float64Datum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::floating_point, double>::write(*prot_, value_.float64Datum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::textDatum:
    {
      constexpr int16_t kPrevFieldId = 8;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 9, kPrevFieldId>(*prot_, "textDatum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, value_.textDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::byteArrayDatum:
    {
      constexpr int16_t kPrevFieldId = 9;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 10, kPrevFieldId>(*prot_, "byteArrayDatum", false);
      if (value_.byteArrayDatum) {
        xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::write(*prot_, *value_.byteArrayDatum);
      }
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::fieldSetDatum:
    {
      constexpr int16_t kPrevFieldId = 10;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 11, kPrevFieldId>(*prot_, "fieldSetDatum", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::FieldId>, ::apache::thrift::type::i16_t>, ::apache::thrift::type::union_t<::apache::thrift::type_system::SerializableRecordUnion>>>(*prot_, value_.fieldSetDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::listDatum:
    {
      constexpr int16_t kPrevFieldId = 11;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 12, kPrevFieldId>(*prot_, "listDatum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, value_.listDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::setDatum:
    {
      constexpr int16_t kPrevFieldId = 12;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 13, kPrevFieldId>(*prot_, "setDatum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::apache::thrift::type_system::SerializableRecordUnion>>::write(*prot_, value_.setDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::mapDatum:
    {
      constexpr int16_t kPrevFieldId = 13;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 14, kPrevFieldId>(*prot_, "mapDatum", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::apache::thrift::type_system::SerializableRecordMapEntry>>::write(*prot_, value_.mapDatum);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case SerializableRecordUnion::Type::__EMPTY__:;
      break;
    default:
      break;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void SerializableRecordMapEntry::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_key:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::readWithContext(*iprot, this->__fbthrift_field_key, _readState);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(0, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_value:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::readWithContext(*iprot, this->__fbthrift_field_value, _readState);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(1, 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<SerializableRecordMapEntry>>();
  }

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

template <class Protocol_>
uint32_t SerializableRecordMapEntry::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableRecordMapEntry");
  {
    xfer += prot_->serializedFieldSize("key", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<false>(*prot_, this->__fbthrift_field_key);
  }
  {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<false>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableRecordMapEntry::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("SerializableRecordMapEntry");
  {
    xfer += prot_->serializedFieldSize("key", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<true>(*prot_, this->__fbthrift_field_key);
  }
  {
    xfer += prot_->serializedFieldSize("value", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type_system::SerializableRecordUnion>::serializedSize<true>(*prot_, this->__fbthrift_field_value);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t SerializableRecordMapEntry::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("SerializableRecordMapEntry");
  bool previousFieldHasValue = true;
  {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "key", 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_key);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "value", 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_value);
    xfer += prot_->writeFieldEnd();
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


} // namespace apache::thrift::type_system
