/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_fbthrift/fbthrift/work/fbthrift-2024.01.22.00/thrift/lib/thrift/metadata.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/metadata_metadata.h"

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftConstValuePair> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).key_ref());
    case 2:
      return f(1, static_cast<T&&>(t).value_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftConstValuePair");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftConstValue> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).cv_bool_ref());
    case 2:
      return f(1, static_cast<T&&>(t).cv_integer_ref());
    case 3:
      return f(2, static_cast<T&&>(t).cv_double_ref());
    case 4:
      return f(3, static_cast<T&&>(t).cv_string_ref());
    case 5:
      return f(4, static_cast<T&&>(t).cv_map_ref());
    case 6:
      return f(5, static_cast<T&&>(t).cv_list_ref());
    case 7:
      return f(6, static_cast<T&&>(t).cv_struct_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftConstValue");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftConstStruct> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).type_ref());
    case 2:
      return f(1, static_cast<T&&>(t).fields_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftConstStruct");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftListType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).valueType_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftListType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftSetType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).valueType_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftSetType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftMapType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).keyType_ref());
    case 2:
      return f(1, static_cast<T&&>(t).valueType_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftMapType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftEnumType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftEnumType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftStructType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftStructType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftUnionType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftUnionType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftTypedefType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).underlyingType_ref());
    case 3:
      return f(2, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftTypedefType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftStreamType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).elemType_ref());
    case 2:
      return f(1, static_cast<T&&>(t).initialResponseType_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftStreamType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftSinkType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).elemType_ref());
    case 2:
      return f(1, static_cast<T&&>(t).finalResponseType_ref());
    case 3:
      return f(2, static_cast<T&&>(t).initialResponseType_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftSinkType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftType> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).t_primitive_ref());
    case 2:
      return f(1, static_cast<T&&>(t).t_list_ref());
    case 3:
      return f(2, static_cast<T&&>(t).t_set_ref());
    case 4:
      return f(3, static_cast<T&&>(t).t_map_ref());
    case 5:
      return f(4, static_cast<T&&>(t).t_enum_ref());
    case 6:
      return f(5, static_cast<T&&>(t).t_struct_ref());
    case 7:
      return f(6, static_cast<T&&>(t).t_union_ref());
    case 8:
      return f(7, static_cast<T&&>(t).t_typedef_ref());
    case 9:
      return f(8, static_cast<T&&>(t).t_stream_ref());
    case 10:
      return f(9, static_cast<T&&>(t).t_sink_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftType");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftEnum> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).elements_ref());
    case 3:
      return f(2, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftEnum");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftField> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).id_ref());
    case 2:
      return f(1, static_cast<T&&>(t).type_ref());
    case 3:
      return f(2, static_cast<T&&>(t).name_ref());
    case 4:
      return f(3, static_cast<T&&>(t).is_optional_ref());
    case 5:
      return f(4, static_cast<T&&>(t).structured_annotations_ref());
    case 6:
      return f(5, static_cast<T&&>(t).unstructured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftField");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftStruct> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).fields_ref());
    case 3:
      return f(2, static_cast<T&&>(t).is_union_ref());
    case 4:
      return f(3, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftStruct");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftException> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).fields_ref());
    case 3:
      return f(2, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftException");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftFunction> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).return_type_ref());
    case 3:
      return f(2, static_cast<T&&>(t).arguments_ref());
    case 4:
      return f(3, static_cast<T&&>(t).exceptions_ref());
    case 5:
      return f(4, static_cast<T&&>(t).is_oneway_ref());
    case 6:
      return f(5, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftFunction");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftService> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).functions_ref());
    case 3:
      return f(2, static_cast<T&&>(t).parent_ref());
    case 4:
      return f(3, static_cast<T&&>(t).structured_annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftService");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftModuleContext> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).name_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftModuleContext");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftServiceContext> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).service_info_ref());
    case 2:
      return f(1, static_cast<T&&>(t).module_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftServiceContext");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftServiceContextRef> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).service_name_ref());
    case 2:
      return f(1, static_cast<T&&>(t).module_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftServiceContextRef");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftServiceMetadataResponse> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 1:
      return f(0, static_cast<T&&>(t).context_ref());
    case 2:
      return f(1, static_cast<T&&>(t).metadata_ref());
    case 3:
      return f(2, static_cast<T&&>(t).services_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftServiceMetadataResponse");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::metadata::ThriftMetadata> {
  template <typename F, typename T>
  void operator()(FOLLY_MAYBE_UNUSED F&& f, int32_t fieldId, FOLLY_MAYBE_UNUSED T&& t) const {
    switch (fieldId) {
    case 2:
      return f(0, static_cast<T&&>(t).enums_ref());
    case 4:
      return f(1, static_cast<T&&>(t).structs_ref());
    case 5:
      return f(2, static_cast<T&&>(t).exceptions_ref());
    case 6:
      return f(3, static_cast<T&&>(t).services_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::metadata::ThriftMetadata");
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
