/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2025.01.13.00/thrift/lib/thrift/protocol.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_types.h"

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


namespace apache {
namespace thrift {
namespace detail {

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

template <class Protocol_>
void MaskedData::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<MaskedData>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I64)) {
          this->full_ref().emplace();
          ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*iprot, value_.full);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP)) {
          this->fields_ref().emplace();
          _readState.beforeSubobject(iprot);
          auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<folly::F14VectorMap<::apache::thrift::type::FieldId, ::apache::thrift::protocol::MaskedData>>>();
          ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::FieldId, ::apache::thrift::protocol::MaskedData>, ::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::protocol::MaskedData>>>>(*iprot, *ptr);
          value_.fields = std::move(ptr);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_MAP)) {
          this->values_ref().emplace();
          _readState.beforeSubobject(iprot);
          auto ptr = ::apache::thrift::detail::make_mutable_smart_ptr<::std::unique_ptr<folly::F14VectorMap<::apache::thrift::type::ValueId, ::apache::thrift::protocol::MaskedData>>>();
          ::apache::thrift::op::decode<::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::ValueId, ::apache::thrift::protocol::MaskedData>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>>>(*iprot, *ptr);
          value_.values = 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 MaskedData::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("MaskedData");
  switch(this->getType()) {
    case MaskedData::Type::full:
    {
      xfer += prot_->serializedFieldSize("full", apache::thrift::protocol::T_I64, 1);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, value_.full);
      break;
    }
    case MaskedData::Type::fields:
    {
      xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 2);
      if (value_.fields) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::FieldId, ::apache::thrift::protocol::MaskedData>, ::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::protocol::MaskedData>>>>(*prot_, *value_.fields);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case MaskedData::Type::values:
    {
      xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_MAP, 3);
      if (value_.values) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::ValueId, ::apache::thrift::protocol::MaskedData>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>>>(*prot_, *value_.values);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I64, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case MaskedData::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t MaskedData::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("MaskedData");
  switch(this->getType()) {
    case MaskedData::Type::full:
    {
      xfer += prot_->serializedFieldSize("full", apache::thrift::protocol::T_I64, 1);
      xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, value_.full);
      break;
    }
    case MaskedData::Type::fields:
    {
      xfer += prot_->serializedFieldSize("fields", apache::thrift::protocol::T_MAP, 2);
      if (value_.fields) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::FieldId, ::apache::thrift::protocol::MaskedData>, ::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::protocol::MaskedData>>>>(*prot_, *value_.fields);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case MaskedData::Type::values:
    {
      xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_MAP, 3);
      if (value_.values) {
        xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::ValueId, ::apache::thrift::protocol::MaskedData>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>>>(*prot_, *value_.values);
      } else {
        xfer += prot_->serializedSizeMapBegin(apache::thrift::protocol::T_I64, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->serializedSizeMapEnd();
      }
      break;
    }
    case MaskedData::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t MaskedData::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("MaskedData");
  switch(this->getType()) {
    case MaskedData::Type::full:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I64, 1, kPrevFieldId>(*prot_, "full", false);
      xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>>(*prot_, value_.full);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case MaskedData::Type::fields:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 2, kPrevFieldId>(*prot_, "fields", false);
      if (value_.fields) {
        xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::FieldId, ::apache::thrift::protocol::MaskedData>, ::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::protocol::MaskedData>>>>(*prot_, *value_.fields);
      } else {
        xfer += prot_->writeMapBegin(apache::thrift::protocol::T_I16, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->writeMapEnd();
      }
      xfer += prot_->writeFieldEnd();
      break;
    }
    case MaskedData::Type::values:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_MAP, 3, kPrevFieldId>(*prot_, "values", false);
      if (value_.values) {
        xfer += ::apache::thrift::op::encode<::apache::thrift::type::cpp_type<folly::F14VectorMap<::apache::thrift::type::ValueId, ::apache::thrift::protocol::MaskedData>, ::apache::thrift::type::map<::apache::thrift::type::adapted<::apache::thrift::type::detail::StrongIntegerAdapter<::apache::thrift::type::ValueId>, ::apache::thrift::type::i64_t>, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>>>(*prot_, *value_.values);
      } else {
        xfer += prot_->writeMapBegin(apache::thrift::protocol::T_I64, apache::thrift::protocol::T_STRUCT, 0);
        xfer += prot_->writeMapEnd();
      }
      xfer += prot_->writeFieldEnd();
      break;
    }
    case MaskedData::Type::__EMPTY__:;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


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

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

  _readState.readStructBegin(iprot);

  using apache::thrift::TProtocolException;


  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          0,
          1,
          apache::thrift::protocol::T_I32))) {
    goto _advance_failure;
  }
_readField_wireType:
  {
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::StaticCastAdapter<::apache::thrift::type::BaseType, ::apache::thrift::type::BaseTypeEnum>, ::apache::thrift::type::enum_t<::apache::thrift::type::BaseTypeEnum>>>(*iprot, this->__fbthrift_field_wireType);
  }
 this->__isset.set(0, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRING))) {
    goto _advance_failure;
  }
_readField_data:
  {
    ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::readWithContext(*iprot, this->__fbthrift_field_data, _readState);
  }
 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<EncodedValue>>();
  }

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

template <class Protocol_>
uint32_t EncodedValue::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("EncodedValue");
  {
    xfer += prot_->serializedFieldSize("wireType", apache::thrift::protocol::T_I32, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::StaticCastAdapter<::apache::thrift::type::BaseType, ::apache::thrift::type::BaseTypeEnum>, ::apache::thrift::type::enum_t<::apache::thrift::type::BaseTypeEnum>>>(*prot_, this->__fbthrift_field_wireType);
  }
  {
    xfer += prot_->serializedFieldSize("data", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::serializedSize<false>(*prot_, this->__fbthrift_field_data);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t EncodedValue::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("EncodedValue");
  {
    xfer += prot_->serializedFieldSize("wireType", apache::thrift::protocol::T_I32, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::StaticCastAdapter<::apache::thrift::type::BaseType, ::apache::thrift::type::BaseTypeEnum>, ::apache::thrift::type::enum_t<::apache::thrift::type::BaseTypeEnum>>>(*prot_, this->__fbthrift_field_wireType);
  }
  {
    xfer += prot_->serializedFieldSize("data", apache::thrift::protocol::T_STRING, 2);
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::serializedSize<true>(*prot_, this->__fbthrift_field_data);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t EncodedValue::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("EncodedValue");
  bool previousFieldHasValue = true;
  {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 1, kPrevFieldId>(*prot_, "wireType", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::StaticCastAdapter<::apache::thrift::type::BaseType, ::apache::thrift::type::BaseTypeEnum>, ::apache::thrift::type::enum_t<::apache::thrift::type::BaseTypeEnum>>>(*prot_, this->__fbthrift_field_wireType);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 2, kPrevFieldId>(*prot_, "data", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteBuffer>::write(*prot_, this->__fbthrift_field_data);
    xfer += prot_->writeFieldEnd();
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void MaskedProtocolData::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_protocol:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Protocol>, ::apache::thrift::type::union_t<::apache::thrift::type::ProtocolUnion>>>(*iprot, this->__fbthrift_field_protocol);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(0, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          1,
          2,
          apache::thrift::protocol::T_STRUCT))) {
    goto _advance_failure;
  }
_readField_data:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>(*iprot, this->__fbthrift_field_data);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(1, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          2,
          3,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_values:
  {
    _readState.beforeSubobject(iprot);
    ::apache::thrift::op::decode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::protocol::EncodedValue>>>(*iprot, this->__fbthrift_field_values);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(2, true);

  if (UNLIKELY(!_readState.advanceToNextField(
          iprot,
          3,
          4,
          apache::thrift::protocol::T_LIST))) {
    goto _advance_failure;
  }
_readField_keys:
  {
    _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, this->__fbthrift_field_keys);
    _readState.afterSubobject(iprot);
  }
 this->__isset.set(3, true);

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

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

template <class Protocol_>
uint32_t MaskedProtocolData::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("MaskedProtocolData");
  {
    xfer += prot_->serializedFieldSize("protocol", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Protocol>, ::apache::thrift::type::union_t<::apache::thrift::type::ProtocolUnion>>>(*prot_, this->__fbthrift_field_protocol);
  }
  {
    xfer += prot_->serializedFieldSize("data", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>(*prot_, this->__fbthrift_field_data);
  }
  {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::protocol::EncodedValue>>>(*prot_, this->__fbthrift_field_values);
  }
  {
    xfer += prot_->serializedFieldSize("keys", apache::thrift::protocol::T_LIST, 4);
    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_, this->__fbthrift_field_keys);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t MaskedProtocolData::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("MaskedProtocolData");
  {
    xfer += prot_->serializedFieldSize("protocol", apache::thrift::protocol::T_STRUCT, 1);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Protocol>, ::apache::thrift::type::union_t<::apache::thrift::type::ProtocolUnion>>>(*prot_, this->__fbthrift_field_protocol);
  }
  {
    xfer += prot_->serializedFieldSize("data", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::op::serialized_size<true, ::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>(*prot_, this->__fbthrift_field_data);
  }
  {
    xfer += prot_->serializedFieldSize("values", apache::thrift::protocol::T_LIST, 3);
    xfer += ::apache::thrift::op::serialized_size<false, ::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::protocol::EncodedValue>>>(*prot_, this->__fbthrift_field_values);
  }
  {
    xfer += prot_->serializedFieldSize("keys", apache::thrift::protocol::T_LIST, 4);
    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_, this->__fbthrift_field_keys);
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t MaskedProtocolData::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("MaskedProtocolData");
  bool previousFieldHasValue = true;
  {
    constexpr int16_t kPrevFieldId = 0;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 1, kPrevFieldId>(*prot_, "protocol", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::adapted<::apache::thrift::InlineAdapter<::apache::thrift::type::Protocol>, ::apache::thrift::type::union_t<::apache::thrift::type::ProtocolUnion>>>(*prot_, this->__fbthrift_field_protocol);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 1;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 2, kPrevFieldId>(*prot_, "data", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::union_t<::apache::thrift::protocol::MaskedData>>(*prot_, this->__fbthrift_field_data);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 2;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 3, kPrevFieldId>(*prot_, "values", previousFieldHasValue);
    previousFieldHasValue = true;
    xfer += ::apache::thrift::op::encode<::apache::thrift::type::list<::apache::thrift::type::struct_t<::apache::thrift::protocol::EncodedValue>>>(*prot_, this->__fbthrift_field_values);
    xfer += prot_->writeFieldEnd();
  }
  {
    constexpr int16_t kPrevFieldId = 3;
    xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_LIST, 4, kPrevFieldId>(*prot_, "keys", previousFieldHasValue);
    previousFieldHasValue = true;
    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_, this->__fbthrift_field_keys);
    xfer += prot_->writeFieldEnd();
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


} // namespace apache::thrift::protocol
