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

#include "thrift/lib/thrift/gen-cpp2/protocol_detail_types.h"

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


namespace apache {
namespace thrift {
namespace detail {

template <>
struct TccStructTraits<::apache::thrift::protocol::detail::detail::Object> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::protocol::detail::detail::Value> {
  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::protocol::detail {
namespace detail {

template <class Protocol_>
void Object::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_type:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::string_t>(*iprot, this->__fbthrift_field_type);
  }
 this->__isset.set(0, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_MAP))) {
    goto _advance_failure;
  }
_readField_members:
  {
    _readState.beforeSubobject(iprot);
    auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>>>();
    ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*iprot, *ptr);
    this->__fbthrift_field_members = std::move(ptr);
    _readState.afterSubobject(iprot);
  }

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

_end:
  _readState.readStructEnd(iprot);

  return;

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

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

template <class Protocol_>
uint32_t Object::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Object");
  {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::string_t>(*prot_, this->__fbthrift_field_type);
  }
  {
    xfer += prot_->serializedFieldSize("members", apache::thrift::protocol::T_MAP, 2);
    if (this->__fbthrift_field_members) {
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *this->__fbthrift_field_members);
    } else {
      xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
      xfer += prot_->serializedSizeMapEnd();
    }
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Object::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Object");
  {
    xfer += prot_->serializedFieldSize("type", apache::thrift::protocol::T_STRING, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::string_t>(*prot_, this->__fbthrift_field_type);
  }
  {
    xfer += prot_->serializedFieldSize("members", apache::thrift::protocol::T_MAP, 2);
    if (this->__fbthrift_field_members) {
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *this->__fbthrift_field_members);
    } else {
      xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
      xfer += prot_->serializedSizeMapEnd();
    }
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Object::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Object");
  bool previousFieldHasValue = true;
  {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "type", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::string_t>(*prot_, this->__fbthrift_field_type);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 2, kPrevFieldId>(*prot_, "members", previousFieldHasValue);
    previousFieldHasValue = true;
    if (this->__fbthrift_field_members) {
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<::folly::F14NodeMap<::std::int16_t, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::i16_t, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *this->__fbthrift_field_members);
    } else {
      xfer += prot_->writeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
      xfer += prot_->writeMapEnd();
    }
    xfer += prot_->writeFieldEnd();
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

extern template void Object::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
extern template uint32_t Object::write<>(apache::thrift::BinaryProtocolWriter*) const;
extern template uint32_t Object::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
extern template uint32_t Object::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
extern template void Object::readNoXfer<>(apache::thrift::CompactProtocolReader*);
extern template uint32_t Object::write<>(apache::thrift::CompactProtocolWriter*) const;
extern template uint32_t Object::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
extern template uint32_t Object::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
} // namespace detail

namespace detail {

template <class Protocol_>
void Value::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<Value>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BOOL)) {
          this->boolValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::bool_t>(*iprot, value_.boolValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BYTE)) {
          this->byteValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::byte_t>(*iprot, value_.byteValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I16)) {
          this->i16Value_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::i16_t>(*iprot, value_.i16Value);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->i32Value_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::i32_t>(*iprot, value_.i32Value);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 5:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64)) {
          this->i64Value_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::i64_t>(*iprot, value_.i64Value);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 6:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_FLOAT)) {
          this->floatValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::float_t>(*iprot, value_.floatValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 7:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_DOUBLE)) {
          this->doubleValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::double_t>(*iprot, value_.doubleValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 8:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->stringValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::binary_t>(*iprot, value_.stringValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 9:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->binaryValue_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<folly::IOBuf, ::apache::thrift::type::binary_t>>(*iprot, value_.binaryValue);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 11:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->objectValue_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ObjectAdapter, ::apache::thrift::type::struct_t<::apache::thrift::protocol::detail::detail::Object>>>(*iprot, value_.objectValue);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 14:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST)) {
          this->listValue_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*iprot, value_.listValue);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 15:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_SET)) {
          this->setValue_ref().emplace();
          _readState.beforeSubobject(iprot);
          auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>>>();
          ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*iprot, *ptr);
          value_.setValue = std::move(ptr);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 16:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP)) {
          this->mapValue_ref().emplace();
          _readState.beforeSubobject(iprot);
          auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>>>();
          ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*iprot, *ptr);
          value_.mapValue = std::move(ptr);
          _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 Value::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Value");
  switch(this->getType()) {
    case Value::Type::boolValue:
    {
      xfer += prot_->serializedFieldSize("boolValue", apache::thrift::protocol::T_BOOL, 1);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::bool_t>(*prot_, value_.boolValue);
      break;
    }
    case Value::Type::byteValue:
    {
      xfer += prot_->serializedFieldSize("byteValue", apache::thrift::protocol::T_BYTE, 2);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::byte_t>(*prot_, value_.byteValue);
      break;
    }
    case Value::Type::i16Value:
    {
      xfer += prot_->serializedFieldSize("i16Value", apache::thrift::protocol::T_I16, 3);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i16_t>(*prot_, value_.i16Value);
      break;
    }
    case Value::Type::i32Value:
    {
      xfer += prot_->serializedFieldSize("i32Value", apache::thrift::protocol::T_I32, 4);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i32_t>(*prot_, value_.i32Value);
      break;
    }
    case Value::Type::i64Value:
    {
      xfer += prot_->serializedFieldSize("i64Value", apache::thrift::protocol::T_I64, 5);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i64_t>(*prot_, value_.i64Value);
      break;
    }
    case Value::Type::floatValue:
    {
      xfer += prot_->serializedFieldSize("floatValue", apache::thrift::protocol::T_FLOAT, 6);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::float_t>(*prot_, value_.floatValue);
      break;
    }
    case Value::Type::doubleValue:
    {
      xfer += prot_->serializedFieldSize("doubleValue", apache::thrift::protocol::T_DOUBLE, 7);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::double_t>(*prot_, value_.doubleValue);
      break;
    }
    case Value::Type::stringValue:
    {
      xfer += prot_->serializedFieldSize("stringValue", apache::thrift::protocol::T_STRING, 8);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::binary_t>(*prot_, value_.stringValue);
      break;
    }
    case Value::Type::binaryValue:
    {
      xfer += prot_->serializedFieldSize("binaryValue", apache::thrift::protocol::T_STRING, 9);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<folly::IOBuf, ::apache::thrift::type::binary_t>>(*prot_, value_.binaryValue);
      break;
    }
    case Value::Type::objectValue:
    {
      xfer += prot_->serializedFieldSize("objectValue", apache::thrift::protocol::T_STRUCT, 11);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ObjectAdapter, ::apache::thrift::type::struct_t<::apache::thrift::protocol::detail::detail::Object>>>(*prot_, value_.objectValue);
      break;
    }
    case Value::Type::listValue:
    {
      xfer += prot_->serializedFieldSize("listValue", apache::thrift::protocol::T_LIST, 14);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, value_.listValue);
      break;
    }
    case Value::Type::setValue:
    {
      xfer += prot_->serializedFieldSize("setValue", apache::thrift::protocol::T_SET, 15);
      if (value_.setValue) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.setValue);
      } else {
        xfer += prot_->serializedSizeSetBegin(apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeSetEnd();
      }
      break;
    }
    case Value::Type::mapValue:
    {
      xfer += prot_->serializedFieldSize("mapValue", apache::thrift::protocol::T_MAP, 16);
      if (value_.mapValue) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.mapValue);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_STRUCT, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case Value::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Value::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("Value");
  switch(this->getType()) {
    case Value::Type::boolValue:
    {
      xfer += prot_->serializedFieldSize("boolValue", apache::thrift::protocol::T_BOOL, 1);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::bool_t>(*prot_, value_.boolValue);
      break;
    }
    case Value::Type::byteValue:
    {
      xfer += prot_->serializedFieldSize("byteValue", apache::thrift::protocol::T_BYTE, 2);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::byte_t>(*prot_, value_.byteValue);
      break;
    }
    case Value::Type::i16Value:
    {
      xfer += prot_->serializedFieldSize("i16Value", apache::thrift::protocol::T_I16, 3);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i16_t>(*prot_, value_.i16Value);
      break;
    }
    case Value::Type::i32Value:
    {
      xfer += prot_->serializedFieldSize("i32Value", apache::thrift::protocol::T_I32, 4);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i32_t>(*prot_, value_.i32Value);
      break;
    }
    case Value::Type::i64Value:
    {
      xfer += prot_->serializedFieldSize("i64Value", apache::thrift::protocol::T_I64, 5);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::i64_t>(*prot_, value_.i64Value);
      break;
    }
    case Value::Type::floatValue:
    {
      xfer += prot_->serializedFieldSize("floatValue", apache::thrift::protocol::T_FLOAT, 6);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::float_t>(*prot_, value_.floatValue);
      break;
    }
    case Value::Type::doubleValue:
    {
      xfer += prot_->serializedFieldSize("doubleValue", apache::thrift::protocol::T_DOUBLE, 7);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::double_t>(*prot_, value_.doubleValue);
      break;
    }
    case Value::Type::stringValue:
    {
      xfer += prot_->serializedFieldSize("stringValue", apache::thrift::protocol::T_STRING, 8);
      xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::binary_t>(*prot_, value_.stringValue);
      break;
    }
    case Value::Type::binaryValue:
    {
      xfer += prot_->serializedFieldSize("binaryValue", apache::thrift::protocol::T_STRING, 9);
      xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::cpp_type<folly::IOBuf, ::apache::thrift::type::binary_t>>(*prot_, value_.binaryValue);
      break;
    }
    case Value::Type::objectValue:
    {
      xfer += prot_->serializedFieldSize("objectValue", apache::thrift::protocol::T_STRUCT, 11);
      xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ObjectAdapter, ::apache::thrift::type::struct_t<::apache::thrift::protocol::detail::detail::Object>>>(*prot_, value_.objectValue);
      break;
    }
    case Value::Type::listValue:
    {
      xfer += prot_->serializedFieldSize("listValue", apache::thrift::protocol::T_LIST, 14);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, value_.listValue);
      break;
    }
    case Value::Type::setValue:
    {
      xfer += prot_->serializedFieldSize("setValue", apache::thrift::protocol::T_SET, 15);
      if (value_.setValue) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.setValue);
      } else {
        xfer += prot_->serializedSizeSetBegin(apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeSetEnd();
      }
      break;
    }
    case Value::Type::mapValue:
    {
      xfer += prot_->serializedFieldSize("mapValue", apache::thrift::protocol::T_MAP, 16);
      if (value_.mapValue) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.mapValue);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_STRUCT, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case Value::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t Value::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("Value");
  switch(this->getType()) {
    case Value::Type::boolValue:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BOOL, 1, kPrevFieldId>(*prot_, "boolValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::bool_t>(*prot_, value_.boolValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::byteValue:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_BYTE, 2, kPrevFieldId>(*prot_, "byteValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::byte_t>(*prot_, value_.byteValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::i16Value:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I16, 3, kPrevFieldId>(*prot_, "i16Value", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::i16_t>(*prot_, value_.i16Value);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::i32Value:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 4, kPrevFieldId>(*prot_, "i32Value", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::i32_t>(*prot_, value_.i32Value);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::i64Value:
    {
      constexpr int16_t kPrevFieldId = 4;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 5, kPrevFieldId>(*prot_, "i64Value", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::i64_t>(*prot_, value_.i64Value);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::floatValue:
    {
      constexpr int16_t kPrevFieldId = 5;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_FLOAT, 6, kPrevFieldId>(*prot_, "floatValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::float_t>(*prot_, value_.floatValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::doubleValue:
    {
      constexpr int16_t kPrevFieldId = 6;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_DOUBLE, 7, kPrevFieldId>(*prot_, "doubleValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::double_t>(*prot_, value_.doubleValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::stringValue:
    {
      constexpr int16_t kPrevFieldId = 7;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 8, kPrevFieldId>(*prot_, "stringValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::binary_t>(*prot_, value_.stringValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::binaryValue:
    {
      constexpr int16_t kPrevFieldId = 8;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 9, kPrevFieldId>(*prot_, "binaryValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<folly::IOBuf, ::apache::thrift::type::binary_t>>(*prot_, value_.binaryValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::objectValue:
    {
      constexpr int16_t kPrevFieldId = 9;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 11, kPrevFieldId>(*prot_, "objectValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ObjectAdapter, ::apache::thrift::type::struct_t<::apache::thrift::protocol::detail::detail::Object>>>(*prot_, value_.objectValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::listValue:
    {
      constexpr int16_t kPrevFieldId = 11;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 14, kPrevFieldId>(*prot_, "listValue", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>(*prot_, value_.listValue);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::setValue:
    {
      constexpr int16_t kPrevFieldId = 14;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_SET, 15, kPrevFieldId>(*prot_, "setValue", false);
      if (value_.setValue) {
        xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<::folly::F14FastSet<::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::set<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.setValue);
      } else {
        xfer += prot_->writeSetBegin(apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->writeSetEnd();
      }
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::mapValue:
    {
      constexpr int16_t kPrevFieldId = 15;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 16, kPrevFieldId>(*prot_, "mapValue", false);
      if (value_.mapValue) {
        xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<::folly::F14FastMap<::apache::thrift::protocol::detail::Value, ::apache::thrift::protocol::detail::Value>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>, ::apache::thrift::type::adapted<::apache::thrift::protocol::detail::ValueAdapter, ::apache::thrift::type::union_t<::apache::thrift::protocol::detail::detail::Value>>>>>(*prot_, *value_.mapValue);
      } else {
        xfer += prot_->writeMapBegin(apache::thrift::protocol::T_STRUCT, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->writeMapEnd();
      }
      xfer += prot_->writeFieldEnd();
      break;
    }
    case Value::Type::__EMPTY__:;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

extern template void Value::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
extern template uint32_t Value::write<>(apache::thrift::BinaryProtocolWriter*) const;
extern template uint32_t Value::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
extern template uint32_t Value::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
extern template void Value::readNoXfer<>(apache::thrift::CompactProtocolReader*);
extern template uint32_t Value::write<>(apache::thrift::CompactProtocolWriter*) const;
extern template uint32_t Value::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
extern template uint32_t Value::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
} // namespace detail


} // namespace apache::thrift::protocol::detail
