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

#include <thrift/lib/cpp2/visitation/visit_by_thrift_field_metadata.h>
#include "thrift/lib/thrift/gen-cpp2/RpcMetadata_metadata.h"

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitByFieldId<::apache::thrift::Checksum> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).algorithm_ref());
    case 2:
      return f(1, static_cast<T&&>(t).checksum_ref());
    case 3:
      return f(2, static_cast<T&&>(t).salt_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::Checksum");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ZlibCompressionCodecConfig> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ZlibCompressionCodecConfig");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ZstdCompressionCodecConfig> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ZstdCompressionCodecConfig");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::CodecConfig> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).zlibConfig_ref());
    case 2:
      return f(1, static_cast<T&&>(t).zstdConfig_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::CodecConfig");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::CompressionConfig> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).codecConfig_ref());
    case 2:
      return f(1, static_cast<T&&>(t).compressionSizeLimit_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::CompressionConfig");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::NegotiationParameters> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).compressionAlgos_ref());
    case 2:
      return f(1, static_cast<T&&>(t).useStopTLS_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::NegotiationParameters");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::InteractionCreate> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).interactionId_ref());
    case 2:
      return f(1, static_cast<T&&>(t).interactionName_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::InteractionCreate");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::InteractionTerminate> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).interactionId_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::InteractionTerminate");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::FdMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).fdSeqNum_ref());
    case 2:
      return f(1, static_cast<T&&>(t).numFds_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::FdMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::LoggingContext> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).logSampleRatio_ref());
    case 2:
      return f(1, static_cast<T&&>(t).logErrorSampleRatio_ref());
    case 3:
      return f(2, static_cast<T&&>(t).requestId_ref());
    case 4:
      return f(3, static_cast<T&&>(t).routingTarget_ref());
    case 5:
      return f(4, static_cast<T&&>(t).requestAttemptId_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::LoggingContext");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::RequestRpcMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).protocol_ref());
    case 2:
      return f(1, static_cast<T&&>(t).name_ref());
    case 3:
      return f(2, static_cast<T&&>(t).kind_ref());
    case 5:
      return f(3, static_cast<T&&>(t).clientTimeoutMs_ref());
    case 6:
      return f(4, static_cast<T&&>(t).queueTimeoutMs_ref());
    case 7:
      return f(5, static_cast<T&&>(t).priority_ref());
    case 8:
      return f(6, static_cast<T&&>(t).otherMetadata_ref());
    case 11:
      return f(7, static_cast<T&&>(t).crc32c_ref());
    case 13:
      return f(8, static_cast<T&&>(t).loadMetric_ref());
    case 14:
      return f(9, static_cast<T&&>(t).compression_ref());
    case 15:
      return f(10, static_cast<T&&>(t).compressionConfig_ref());
    case 16:
      return f(11, static_cast<T&&>(t).interactionId_ref());
    case 17:
      return f(12, static_cast<T&&>(t).interactionCreate_ref());
    case 18:
      return f(13, static_cast<T&&>(t).clientId_ref());
    case 19:
      return f(14, static_cast<T&&>(t).serviceTraceMeta_ref());
    case 20:
      return f(15, static_cast<T&&>(t).frameworkMetadata_ref());
    case 22:
      return f(16, static_cast<T&&>(t).fdMetadata_ref());
    case 23:
      return f(17, static_cast<T&&>(t).loggingContext_ref());
    case 24:
      return f(18, static_cast<T&&>(t).tenantId_ref());
    case 25:
      return f(19, static_cast<T&&>(t).checksum_ref());
    case 26:
      return f(20, static_cast<T&&>(t).checksumResponse_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::RequestRpcMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ErrorClassification> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).kind_ref());
    case 2:
      return f(1, static_cast<T&&>(t).blame_ref());
    case 3:
      return f(2, static_cast<T&&>(t).safety_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ErrorClassification");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadResponseMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadResponseMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadDeclaredExceptionMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).errorClassification_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadDeclaredExceptionMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadProxyExceptionMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadProxyExceptionMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadProxiedExceptionMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadProxiedExceptionMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadAppUnknownExceptionMetdata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).errorClassification_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadAppUnknownExceptionMetdata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadAnyExceptionMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadAnyExceptionMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadExceptionMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).declaredException_ref());
    case 2:
      return f(1, static_cast<T&&>(t).DEPRECATED_proxyException_ref());
    case 6:
      return f(2, static_cast<T&&>(t).appUnknownException_ref());
    case 7:
      return f(3, static_cast<T&&>(t).anyException_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadExceptionMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadExceptionMetadataBase> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_utf8_ref());
    case 2:
      return f(1, static_cast<T&&>(t).what_utf8_ref());
    case 3:
      return f(2, static_cast<T&&>(t).metadata_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadExceptionMetadataBase");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::PayloadMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).responseMetadata_ref());
    case 2:
      return f(1, static_cast<T&&>(t).exceptionMetadata_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::PayloadMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ProxiedPayloadMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ProxiedPayloadMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::QueueMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).queueingTimeMs_ref());
    case 2:
      return f(1, static_cast<T&&>(t).queueTimeoutMs_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::QueueMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ResponseRpcMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 3:
      return f(0, static_cast<T&&>(t).otherMetadata_ref());
    case 4:
      return f(1, static_cast<T&&>(t).load_ref());
    case 5:
      return f(2, static_cast<T&&>(t).crc32c_ref());
    case 6:
      return f(3, static_cast<T&&>(t).compression_ref());
    case 7:
      return f(4, static_cast<T&&>(t).payloadMetadata_ref());
    case 8:
      return f(5, static_cast<T&&>(t).proxiedPayloadMetadata_ref());
    case 9:
      return f(6, static_cast<T&&>(t).streamId_ref());
    case 10:
      return f(7, static_cast<T&&>(t).queueMetadata_ref());
    case 12:
      return f(8, static_cast<T&&>(t).fdMetadata_ref());
    case 13:
      return f(9, static_cast<T&&>(t).frameworkMetadata_ref());
    case 14:
      return f(10, static_cast<T&&>(t).checksum_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ResponseRpcMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ResponseRpcError> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_utf8_ref());
    case 2:
      return f(1, static_cast<T&&>(t).what_utf8_ref());
    case 3:
      return f(2, static_cast<T&&>(t).category_ref());
    case 4:
      return f(3, static_cast<T&&>(t).code_ref());
    case 5:
      return f(4, static_cast<T&&>(t).load_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ResponseRpcError");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::StreamRpcError> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_utf8_ref());
    case 2:
      return f(1, static_cast<T&&>(t).what_utf8_ref());
    case 4:
      return f(2, static_cast<T&&>(t).code_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::StreamRpcError");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::StreamPayloadMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).compression_ref());
    case 2:
      return f(1, static_cast<T&&>(t).otherMetadata_ref());
    case 3:
      return f(2, static_cast<T&&>(t).payloadMetadata_ref());
    case 5:
      return f(3, static_cast<T&&>(t).fdMetadata_ref());
    case 6:
      return f(4, static_cast<T&&>(t).checksum_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::StreamPayloadMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ClientMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).agent_ref());
    case 2:
      return f(1, static_cast<T&&>(t).hostname_ref());
    case 3:
      return f(2, static_cast<T&&>(t).otherMetadata_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ClientMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::RequestSetupMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).opaque_ref());
    case 2:
      return f(1, static_cast<T&&>(t).interfaceKind_ref());
    case 3:
      return f(2, static_cast<T&&>(t).minVersion_ref());
    case 4:
      return f(3, static_cast<T&&>(t).maxVersion_ref());
    case 5:
      return f(4, static_cast<T&&>(t).dscpToReflect_ref());
    case 6:
      return f(5, static_cast<T&&>(t).markToReflect_ref());
    case 10:
      return f(6, static_cast<T&&>(t).qosUseCaseId_ref());
    case 11:
      return f(7, static_cast<T&&>(t).qosPolicyId_ref());
    case 9:
      return f(8, static_cast<T&&>(t).clientMetadata_ref());
    case 12:
      return f(9, static_cast<T&&>(t).keepAliveTimeoutMs_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::RequestSetupMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::SetupResponse> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).version_ref());
    case 2:
      return f(1, static_cast<T&&>(t).zstdSupported_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::SetupResponse");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::StreamHeadersPush> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).streamId_ref());
    case 2:
      return f(1, static_cast<T&&>(t).headersPayloadContent_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::StreamHeadersPush");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::TransportMetadataPush> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).transportMetadata_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::TransportMetadataPush");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::DrainCompletePush> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).drainCompleteCode_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::DrainCompletePush");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ServerPushMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).setupResponse_ref());
    case 2:
      return f(1, static_cast<T&&>(t).streamHeadersPush_ref());
    case 3:
      return f(2, static_cast<T&&>(t).drainCompletePush_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ServerPushMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::ClientPushMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).interactionTerminate_ref());
    case 2:
      return f(1, static_cast<T&&>(t).streamHeadersPush_ref());
    case 3:
      return f(2, static_cast<T&&>(t).transportMetadataPush_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::ClientPushMetadata");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::HeadersPayloadContent> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).otherMetadata_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::HeadersPayloadContent");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::HeadersPayloadMetadata> {
  template <typename F, typename T>
  void operator()([[maybe_unused]] F&& f, int32_t fieldId, [[maybe_unused]] T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).compression_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::HeadersPayloadMetadata");
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
