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

namespace apache {
namespace thrift {
namespace detail {

template <>
struct VisitByFieldId<::apache::thrift::type_system::FieldIdentityStruct> {
  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).id_ref());
    case 2:
      return f(1, static_cast<T&&>(t).name_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::FieldIdentityStruct");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::type_system::SerializableFieldDefinition> {
  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).identity_ref());
    case 2:
      return f(1, static_cast<T&&>(t).presence_ref());
    case 3:
      return f(2, static_cast<T&&>(t).type_ref());
    case 4:
      return f(3, static_cast<T&&>(t).customDefaultPartialRecord_ref());
    case 5:
      return f(4, static_cast<T&&>(t).annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::SerializableFieldDefinition");
    }
  }
};

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

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

template <>
struct VisitByFieldId<::apache::thrift::type_system::SerializableEnumValueDefinition> {
  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_ref());
    case 2:
      return f(1, static_cast<T&&>(t).datum_ref());
    case 3:
      return f(2, static_cast<T&&>(t).annotations_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::SerializableEnumValueDefinition");
    }
  }
};

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

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

template <>
struct VisitByFieldId<::apache::thrift::type_system::SerializableTypeDefinition> {
  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).structDef_ref());
    case 2:
      return f(1, static_cast<T&&>(t).unionDef_ref());
    case 3:
      return f(2, static_cast<T&&>(t).enumDef_ref());
    case 4:
      return f(3, static_cast<T&&>(t).opaqueAliasDef_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::SerializableTypeDefinition");
    }
  }
};

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

template <>
struct VisitByFieldId<::apache::thrift::type_system::SerializableTypeDefinitionEntry> {
  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).definition_ref());
    case 2:
      return f(1, static_cast<T&&>(t).sourceInfo_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::SerializableTypeDefinitionEntry");
    }
  }
};

template <>
struct VisitByFieldId<::apache::thrift::type_system::SerializableTypeSystem> {
  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).types_ref());
    default:
      throwInvalidThriftId(fieldId, "::apache::thrift::type_system::SerializableTypeSystem");
    }
  }
};
} // namespace detail
} // namespace thrift
} // namespace apache
