/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/optionals/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

#pragma once

#include <functional>
#include <folly/Range.h>

#include "thrift/compiler/test/fixtures/optionals/gen-cpp2/module_data.h"
#include "thrift/compiler/test/fixtures/optionals/gen-cpp2/module_types.h"
#include "thrift/compiler/test/fixtures/optionals/gen-cpp2/module_metadata.h"
namespace thrift {
namespace py3 {



template<>
inline void reset_field<::cpp2::Color>(
    ::cpp2::Color& obj, uint16_t index) {
  switch (index) {
    case 0:
      obj.red_ref().copy_from(default_inst<::cpp2::Color>().red_ref());
      return;
    case 1:
      obj.green_ref().copy_from(default_inst<::cpp2::Color>().green_ref());
      return;
    case 2:
      obj.blue_ref().copy_from(default_inst<::cpp2::Color>().blue_ref());
      return;
    case 3:
      obj.alpha_ref().copy_from(default_inst<::cpp2::Color>().alpha_ref());
      return;
  }
}

template<>
inline void reset_field<::cpp2::Vehicle>(
    ::cpp2::Vehicle& obj, uint16_t index) {
  switch (index) {
    case 0:
      obj.color_ref().copy_from(default_inst<::cpp2::Vehicle>().color_ref());
      return;
    case 1:
      obj.licensePlate_ref().copy_from(default_inst<::cpp2::Vehicle>().licensePlate_ref());
      return;
    case 2:
      obj.description_ref().copy_from(default_inst<::cpp2::Vehicle>().description_ref());
      return;
    case 3:
      obj.name_ref().copy_from(default_inst<::cpp2::Vehicle>().name_ref());
      return;
    case 4:
      obj.hasAC_ref().copy_from(default_inst<::cpp2::Vehicle>().hasAC_ref());
      return;
  }
}

template<>
inline void reset_field<::cpp2::Person>(
    ::cpp2::Person& obj, uint16_t index) {
  switch (index) {
    case 0:
      obj.id_ref().copy_from(default_inst<::cpp2::Person>().id_ref());
      return;
    case 1:
      obj.name_ref().copy_from(default_inst<::cpp2::Person>().name_ref());
      return;
    case 2:
      obj.age_ref().copy_from(default_inst<::cpp2::Person>().age_ref());
      return;
    case 3:
      obj.address_ref().copy_from(default_inst<::cpp2::Person>().address_ref());
      return;
    case 4:
      obj.favoriteColor_ref().copy_from(default_inst<::cpp2::Person>().favoriteColor_ref());
      return;
    case 5:
      obj.friends_ref().copy_from(default_inst<::cpp2::Person>().friends_ref());
      return;
    case 6:
      obj.bestFriend_ref().copy_from(default_inst<::cpp2::Person>().bestFriend_ref());
      return;
    case 7:
      obj.petNames_ref().copy_from(default_inst<::cpp2::Person>().petNames_ref());
      return;
    case 8:
      obj.afraidOfAnimal_ref().copy_from(default_inst<::cpp2::Person>().afraidOfAnimal_ref());
      return;
    case 9:
      obj.vehicles_ref().copy_from(default_inst<::cpp2::Person>().vehicles_ref());
      return;
  }
}

template<>
inline const std::unordered_map<std::string_view, std::string_view>& PyStructTraits<
    ::cpp2::Color>::namesmap() {
  static const folly::Indestructible<NamesMap> map {
    {
    }
  };
  return *map;
}

template<>
inline const std::unordered_map<std::string_view, std::string_view>& PyStructTraits<
    ::cpp2::Vehicle>::namesmap() {
  static const folly::Indestructible<NamesMap> map {
    {
    }
  };
  return *map;
}

template<>
inline const std::unordered_map<std::string_view, std::string_view>& PyStructTraits<
    ::cpp2::Person>::namesmap() {
  static const folly::Indestructible<NamesMap> map {
    {
    }
  };
  return *map;
}
} // namespace py3
} // namespace thrift
