#
# Autogenerated by Thrift for thrift/compiler/test/fixtures/mcpp2-compare/src/module.thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#  @generated
#
cimport cython as __cython
from cpython.object cimport PyTypeObject
from libcpp.memory cimport shared_ptr, make_shared, unique_ptr
from libcpp.optional cimport optional as __optional
from libcpp.string cimport string
from libcpp cimport bool as cbool
from libcpp.iterator cimport inserter as cinserter
from libcpp.utility cimport move as cmove
from cpython cimport bool as pbool
from cython.operator cimport dereference as deref, preincrement as inc, address as ptr_address
import thrift.py3.types
from thrift.py3.types import _IsSet as _fbthrift_IsSet
from thrift.py3.types cimport make_unique
cimport thrift.py3.types
cimport thrift.py3.exceptions
cimport thrift.python.exceptions
from thrift.python.types import EnumMeta as __EnumMeta
from thrift.python.std_libcpp cimport sv_to_str as __sv_to_str, string_view as __cstring_view
from thrift.python.types cimport(
    BadEnum as __BadEnum,
)
from thrift.py3.types cimport (
    cSetOp as __cSetOp,
    richcmp as __richcmp,
    set_op as __set_op,
    setcmp as __setcmp,
    init_unicode_from_cpp as __init_unicode_from_cpp,
    set_iter as __set_iter,
    map_iter as __map_iter,
    map_contains as __map_contains,
    map_getitem as __map_getitem,
    reference_shared_ptr as __reference_shared_ptr,
    get_field_name_by_index as __get_field_name_by_index,
    reset_field as __reset_field,
    translate_cpp_enum_to_python,
    const_pointer_cast,
    make_const_shared,
    constant_shared_ptr,
)
cimport thrift.py3.serializer as serializer
from thrift.python.protocol cimport Protocol as __Protocol
import folly.iobuf as _fbthrift_iobuf
from folly.optional cimport cOptional
from folly.memory cimport to_shared_ptr as __to_shared_ptr
from folly.range cimport Range as __cRange

import sys
from collections.abc import Sequence, Set, Mapping, Iterable
import weakref as __weakref
import builtins as _builtins
import importlib
cimport includes.types as _includes_types
import includes.types as _includes_types

from module.types_impl_FBTHRIFT_ONLY_DO_NOT_USE import (
    MyEnumA,
    AnnotatedEnum,
    AnnotatedEnum2,
    MyEnumB,
    __SimpleUnionType,
    __ComplexUnionType,
    __FloatUnionType,
)

from module.containers_FBTHRIFT_ONLY_DO_NOT_USE import (
    List__Map__Empty_MyStruct,
    List__List__Map__Empty_MyStruct,
    List__List__List__Map__Empty_MyStruct,
    List__MyEnumA,
    List__ComplexUnion,
    List__string,
    List__bool,
    List__i32,
    List__List__i32,
    List__List__List__i32,
    List__List__List__List__i32,
    List__Set__string,
    List__binary,
    List__SimpleUnion,
    List__Set__SimpleUnion,
    List__Set__i32,
    folly_small_vector_int64_t_8__List__i64,
    std_list__List__i32,
    std_deque__List__string,
    List__Bar__double,
    List__Map__string_i32,
    List__Map__i16_string,
    List__MyStruct,
)


cdef object get_types_reflection():
    import importlib
    return importlib.import_module(
        "module.types_reflection"
    )

@__cython.auto_pickle(False)
cdef class Empty(thrift.py3.types.Struct):
    def __init__(Empty self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cEmpty]()
        self._fields_setter = _fbthrift_types_fields.__Empty_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(Empty self, **kwargs):
        return self

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("Empty", {
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cEmpty] cpp_obj):
        __fbthrift_inst = <Empty>Empty.__new__(Empty)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst


    def __hash__(Empty self):
        return super().__hash__()

    def __repr__(Empty self):
        return super().__repr__()

    def __str__(Empty self):
        return super().__str__()


    def __copy__(Empty self):
        cdef shared_ptr[_module_cbindings.cEmpty] cpp_obj = make_shared[_module_cbindings.cEmpty](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Empty._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cEmpty](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Empty>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Empty()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cEmpty].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.Empty"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cEmpty](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 0

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(Empty self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cEmpty](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(Empty self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cEmpty]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cEmpty](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.Empty, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.Empty, self)

@__cython.auto_pickle(False)
cdef class ASimpleStruct(thrift.py3.types.Struct):
    def __init__(ASimpleStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStruct]()
        self._fields_setter = _fbthrift_types_fields.__ASimpleStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(ASimpleStruct self, **kwargs):
        if not kwargs:
            return self
        cdef ASimpleStruct __fbthrift_inst = ASimpleStruct.__new__(ASimpleStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__ASimpleStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("ASimpleStruct", {
          "boolField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).boolField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cASimpleStruct] cpp_obj):
        __fbthrift_inst = <ASimpleStruct>ASimpleStruct.__new__(ASimpleStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline boolField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).boolField_ref().value()

    @property
    def boolField(self):
        return self.boolField_impl()


    def __hash__(ASimpleStruct self):
        return super().__hash__()

    def __repr__(ASimpleStruct self):
        return super().__repr__()

    def __str__(ASimpleStruct self):
        return super().__str__()


    def __copy__(ASimpleStruct self):
        cdef shared_ptr[_module_cbindings.cASimpleStruct] cpp_obj = make_shared[_module_cbindings.cASimpleStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return ASimpleStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __eq__(ASimpleStruct self, other):
        if not isinstance(other, ASimpleStruct):
            return False
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get()) == deref((<ASimpleStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())

    def __ne__(ASimpleStruct self, other):
        if not isinstance(other, ASimpleStruct):
            return True
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE) != deref((<ASimpleStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__ASimpleStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cASimpleStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.ASimpleStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cASimpleStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 1

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ASimpleStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cASimpleStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(ASimpleStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cASimpleStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.ASimpleStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.ASimpleStruct, self)

@__cython.auto_pickle(False)
cdef class ASimpleStructNoexcept(thrift.py3.types.Struct):
    def __init__(ASimpleStructNoexcept self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStructNoexcept]()
        self._fields_setter = _fbthrift_types_fields.__ASimpleStructNoexcept_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(ASimpleStructNoexcept self, **kwargs):
        if not kwargs:
            return self
        cdef ASimpleStructNoexcept __fbthrift_inst = ASimpleStructNoexcept.__new__(ASimpleStructNoexcept)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStructNoexcept](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__ASimpleStructNoexcept_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("ASimpleStructNoexcept", {
          "boolField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).boolField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cASimpleStructNoexcept] cpp_obj):
        __fbthrift_inst = <ASimpleStructNoexcept>ASimpleStructNoexcept.__new__(ASimpleStructNoexcept)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline boolField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).boolField_ref().value()

    @property
    def boolField(self):
        return self.boolField_impl()


    def __hash__(ASimpleStructNoexcept self):
        return super().__hash__()

    def __repr__(ASimpleStructNoexcept self):
        return super().__repr__()

    def __str__(ASimpleStructNoexcept self):
        return super().__str__()


    def __copy__(ASimpleStructNoexcept self):
        cdef shared_ptr[_module_cbindings.cASimpleStructNoexcept] cpp_obj = make_shared[_module_cbindings.cASimpleStructNoexcept](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return ASimpleStructNoexcept._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cASimpleStructNoexcept](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<ASimpleStructNoexcept>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__ASimpleStructNoexcept()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cASimpleStructNoexcept].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.ASimpleStructNoexcept"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cASimpleStructNoexcept](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 1

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ASimpleStructNoexcept self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cASimpleStructNoexcept](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(ASimpleStructNoexcept self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cASimpleStructNoexcept]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cASimpleStructNoexcept](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.ASimpleStructNoexcept, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.ASimpleStructNoexcept, self)

@__cython.auto_pickle(False)
cdef class MyStruct(thrift.py3.types.Struct):
    def __init__(MyStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyStruct]()
        self._fields_setter = _fbthrift_types_fields.__MyStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(MyStruct self, **kwargs):
        if not kwargs:
            return self
        cdef MyStruct __fbthrift_inst = MyStruct.__new__(MyStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__MyStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("MyStruct", {
          "MyBoolField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBoolField_ref().has_value(),
          "MyIntField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIntField_ref().has_value(),
          "MyStringField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyStringField_ref().has_value(),
          "MyStringField2": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyStringField2_ref().has_value(),
          "MyBinaryField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField_ref().has_value(),
          "MyBinaryField2": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField2_ref().has_value(),
          "MyBinaryField3": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField3_ref().has_value(),
          "MyBinaryListField4": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryListField4_ref().has_value(),
          "MyMapEnumAndInt": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyMapEnumAndInt_ref().has_value(),
          "MyCustomField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyCustomField_ref().has_value(),
          "MyOptCustomField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cMyStruct] cpp_obj):
        __fbthrift_inst = <MyStruct>MyStruct.__new__(MyStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline MyBoolField_impl(self):
        return <pbool> deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBoolField_ref().value()

    @property
    def MyBoolField(self):
        return self.MyBoolField_impl()

    cdef inline MyIntField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIntField_ref().value()

    @property
    def MyIntField(self):
        return self.MyIntField_impl()

    cdef inline MyStringField_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyStringField_ref().value()).decode('UTF-8')

    @property
    def MyStringField(self):
        return self.MyStringField_impl()

    cdef inline MyStringField2_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyStringField2_ref().value()).decode('UTF-8')

    @property
    def MyStringField2(self):
        return self.MyStringField2_impl()

    cdef inline MyBinaryField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField_ref().value()

    @property
    def MyBinaryField(self):
        return self.MyBinaryField_impl()

    cdef inline MyBinaryField2_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField2_ref().has_value():
            return None
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField2_ref().value_unchecked()

    @property
    def MyBinaryField2(self):
        return self.MyBinaryField2_impl()

    cdef inline MyBinaryField3_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryField3_ref().value()

    @property
    def MyBinaryField3(self):
        return self.MyBinaryField3_impl()

    cdef inline MyBinaryListField4_impl(self):
        if self.__fbthrift_cached_MyBinaryListField4 is None:
            self.__fbthrift_cached_MyBinaryListField4 = List__binary__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyBinaryListField4_ref().ref())
        return self.__fbthrift_cached_MyBinaryListField4

    @property
    def MyBinaryListField4(self):
        return self.MyBinaryListField4_impl()

    cdef inline MyMapEnumAndInt_impl(self):
        if self.__fbthrift_cached_MyMapEnumAndInt is None:
            self.__fbthrift_cached_MyMapEnumAndInt = Map__MyEnumA_string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyMapEnumAndInt_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_MyMapEnumAndInt

    @property
    def MyMapEnumAndInt(self):
        return self.MyMapEnumAndInt_impl()

    cdef inline MyCustomField_impl(self):
        if self.__fbthrift_cached_MyCustomField is None:
            self.__fbthrift_cached_MyCustomField = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyCustomField_ref().ref()), self)
        return self.__fbthrift_cached_MyCustomField

    @property
    def MyCustomField(self):
        return self.MyCustomField_impl()

    cdef inline MyOptCustomField_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().has_value():
            return None
        if self.__fbthrift_cached_MyOptCustomField is None:
            self.__fbthrift_cached_MyOptCustomField = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().ref_unchecked()), self)
        return self.__fbthrift_cached_MyOptCustomField

    @property
    def MyOptCustomField(self):
        return self.MyOptCustomField_impl()


    def __hash__(MyStruct self):
        return super().__hash__()

    def __repr__(MyStruct self):
        return super().__repr__()

    def __str__(MyStruct self):
        return super().__str__()


    def __copy__(MyStruct self):
        cdef shared_ptr[_module_cbindings.cMyStruct] cpp_obj = make_shared[_module_cbindings.cMyStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cMyStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<MyStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__MyStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cMyStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.MyStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cMyStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 11

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(MyStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cMyStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(MyStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cMyStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.MyStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.MyStruct, self)



@__cython.auto_pickle(False)
cdef class SimpleUnion(thrift.py3.types.Union):
    Type = __SimpleUnionType

    def __init__(
        self, *,
        intValue=None,
        str stringValue=None
    ):
        if intValue is not None:
            if not isinstance(intValue, int):
                raise TypeError(f'intValue is not a { int !r}.')
            intValue = <cint64_t> intValue

        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = __to_shared_ptr(cmove(SimpleUnion._make_instance(
          NULL,
          intValue,
          stringValue,
        )))
        self._load_cache()

    @staticmethod
    def fromValue(value):
        if value is None:
            return SimpleUnion()
        if isinstance(value, int):
            if not isinstance(value, pbool):
                try:
                    <cint64_t> value
                    return SimpleUnion(intValue=value)
                except OverflowError:
                    pass
        if isinstance(value, str):
            return SimpleUnion(stringValue=value)
        raise ValueError(f"Unable to derive correct union field for value: {value}")

    @staticmethod
    cdef unique_ptr[_module_cbindings.cSimpleUnion] _make_instance(
        _module_cbindings.cSimpleUnion* base_instance,
        object intValue,
        str stringValue
    ) except *:
        cdef unique_ptr[_module_cbindings.cSimpleUnion] c_inst = make_unique[_module_cbindings.cSimpleUnion]()
        cdef bint any_set = False
        if intValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_intValue(intValue)
            any_set = True
        if stringValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_stringValue(stringValue.encode('UTF-8'))
            any_set = True
        # in C++ you don't have to call move(), but this doesn't translate
        # into a C++ return statement, so you do here
        return cmove(c_inst)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cSimpleUnion] cpp_obj):
        __fbthrift_inst = <SimpleUnion>SimpleUnion.__new__(SimpleUnion)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        __fbthrift_inst._load_cache()
        return __fbthrift_inst

    @property
    def intValue(self):
        if self.type.value != 7:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not intValue')
        return self.value

    @property
    def stringValue(self):
        if self.type.value != 2:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not stringValue')
        return self.value


    def __hash__(SimpleUnion self):
        return  super().__hash__()

    cdef _load_cache(SimpleUnion self):
        self.type = SimpleUnion.Type(<int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).getType()))
        cdef int type = self.type.value
        if type == 0:    # Empty
            self.value = None
        elif type == 7:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_intValue()
        elif type == 2:
            self.value = bytes(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_stringValue()).decode('UTF-8')

    def __copy__(SimpleUnion self):
        cdef shared_ptr[_module_cbindings.cSimpleUnion] cpp_obj = make_shared[_module_cbindings.cSimpleUnion](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cSimpleUnion](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<SimpleUnion>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__SimpleUnion()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cSimpleUnion].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.SimpleUnion"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cSimpleUnion](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 2

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(SimpleUnion self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cSimpleUnion](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(SimpleUnion self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cSimpleUnion]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cSimpleUnion](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        # force a cache reload since the underlying data's changed
        self._load_cache()
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.SimpleUnion, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.SimpleUnion, self)



@__cython.auto_pickle(False)
cdef class ComplexUnion(thrift.py3.types.Union):
    Type = __ComplexUnionType

    def __init__(
        self, *,
        intValue=None,
        opt_intValue=None,
        str stringValue=None,
        str opt_stringValue=None,
        intValue2=None,
        intValue3=None,
        doubelValue=None,
        pbool boolValue=None,
        union_list=None,
        union_set=None,
        union_map=None,
        opt_union_map=None,
        object enum_field=None,
        enum_container=None,
        MyStruct a_struct=None,
        a_set_struct=None,
        SimpleUnion a_union=None,
        SimpleUnion opt_a_union=None,
        a_union_list=None,
        a_union_typedef=None,
        a_union_typedef_list=None,
        bytes MyBinaryField=None,
        bytes MyBinaryField2=None,
        MyBinaryListField4=None,
        MyStruct ref_field=None,
        MyStruct ref_field2=None,
        AnException excp_field=None,
        _fbthrift_iobuf.IOBuf MyCustomField=None
    ):
        if intValue is not None:
            if not isinstance(intValue, int):
                raise TypeError(f'intValue is not a { int !r}.')
            intValue = <cint64_t> intValue

        if opt_intValue is not None:
            if not isinstance(opt_intValue, int):
                raise TypeError(f'opt_intValue is not a { int !r}.')
            opt_intValue = <cint64_t> opt_intValue

        if intValue2 is not None:
            if not isinstance(intValue2, int):
                raise TypeError(f'intValue2 is not a { int !r}.')
            intValue2 = <cint16_t> intValue2

        if intValue3 is not None:
            if not isinstance(intValue3, int):
                raise TypeError(f'intValue3 is not a { int !r}.')
            intValue3 = <cint32_t> intValue3

        if doubelValue is not None:
            if not isinstance(doubelValue, (float, int)):
                raise TypeError(f'doubelValue is not a { float !r}.')

        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = __to_shared_ptr(cmove(ComplexUnion._make_instance(
          NULL,
          intValue,
          opt_intValue,
          stringValue,
          opt_stringValue,
          intValue2,
          intValue3,
          doubelValue,
          boolValue,
          union_list,
          union_set,
          union_map,
          opt_union_map,
          enum_field,
          enum_container,
          a_struct,
          a_set_struct,
          a_union,
          opt_a_union,
          a_union_list,
          a_union_typedef,
          a_union_typedef_list,
          MyBinaryField,
          MyBinaryField2,
          MyBinaryListField4,
          ref_field,
          ref_field2,
          excp_field,
          MyCustomField,
        )))
        self._load_cache()

    @staticmethod
    def fromValue(value):
        if value is None:
            return ComplexUnion()
        if isinstance(value, int):
            if not isinstance(value, pbool):
                try:
                    <cint64_t> value
                    return ComplexUnion(intValue=value)
                except OverflowError:
                    pass
        if isinstance(value, int):
            if not isinstance(value, pbool):
                try:
                    <cint64_t> value
                    return ComplexUnion(opt_intValue=value)
                except OverflowError:
                    pass
        if isinstance(value, str):
            return ComplexUnion(stringValue=value)
        if isinstance(value, str):
            return ComplexUnion(opt_stringValue=value)
        if isinstance(value, int):
            if not isinstance(value, pbool):
                try:
                    <cint16_t> value
                    return ComplexUnion(intValue2=value)
                except OverflowError:
                    pass
        if isinstance(value, int):
            if not isinstance(value, pbool):
                try:
                    <cint32_t> value
                    return ComplexUnion(intValue3=value)
                except OverflowError:
                    pass
        if isinstance(value, float):
            if not isinstance(value, pbool):
                try:
                    return ComplexUnion(doubelValue=value)
                except OverflowError:
                    pass
        if isinstance(value, bool):
            return ComplexUnion(boolValue=value)
        if isinstance(value, List__i32):
            return ComplexUnion(union_list=value)
        if isinstance(value, Set__i64):
            return ComplexUnion(union_set=value)
        if isinstance(value, Map__string_i32):
            return ComplexUnion(union_map=value)
        if isinstance(value, Map__string_i32):
            return ComplexUnion(opt_union_map=value)
        if isinstance(value, MyEnumA):
            return ComplexUnion(enum_field=value)
        if isinstance(value, List__MyEnumA):
            return ComplexUnion(enum_container=value)
        if isinstance(value, MyStruct):
            return ComplexUnion(a_struct=value)
        if isinstance(value, Set__MyStruct):
            return ComplexUnion(a_set_struct=value)
        if isinstance(value, SimpleUnion):
            return ComplexUnion(a_union=value)
        if isinstance(value, SimpleUnion):
            return ComplexUnion(opt_a_union=value)
        if isinstance(value, List__SimpleUnion):
            return ComplexUnion(a_union_list=value)
        if isinstance(value, Set__SimpleUnion):
            return ComplexUnion(a_union_typedef=value)
        if isinstance(value, List__Set__SimpleUnion):
            return ComplexUnion(a_union_typedef_list=value)
        if isinstance(value, bytes):
            return ComplexUnion(MyBinaryField=value)
        if isinstance(value, bytes):
            return ComplexUnion(MyBinaryField2=value)
        if isinstance(value, List__binary):
            return ComplexUnion(MyBinaryListField4=value)
        if isinstance(value, MyStruct):
            return ComplexUnion(ref_field=value)
        if isinstance(value, MyStruct):
            return ComplexUnion(ref_field2=value)
        if isinstance(value, AnException):
            return ComplexUnion(excp_field=value)
        if isinstance(value, _fbthrift_iobuf.IOBuf):
            return ComplexUnion(MyCustomField=value)
        if isinstance(value, (float, int)):
            try:
                <double> value
                return ComplexUnion(doubelValue=value)
            except OverflowError:
                pass
        raise ValueError(f"Unable to derive correct union field for value: {value}")

    @staticmethod
    cdef unique_ptr[_module_cbindings.cComplexUnion] _make_instance(
        _module_cbindings.cComplexUnion* base_instance,
        object intValue,
        object opt_intValue,
        str stringValue,
        str opt_stringValue,
        object intValue2,
        object intValue3,
        object doubelValue,
        pbool boolValue,
        object union_list,
        object union_set,
        object union_map,
        object opt_union_map,
        object enum_field,
        object enum_container,
        MyStruct a_struct,
        object a_set_struct,
        SimpleUnion a_union,
        SimpleUnion opt_a_union,
        object a_union_list,
        object a_union_typedef,
        object a_union_typedef_list,
        bytes MyBinaryField,
        bytes MyBinaryField2,
        object MyBinaryListField4,
        MyStruct ref_field,
        MyStruct ref_field2,
        AnException excp_field,
        _fbthrift_iobuf.IOBuf MyCustomField
    ) except *:
        cdef unique_ptr[_module_cbindings.cComplexUnion] c_inst = make_unique[_module_cbindings.cComplexUnion]()
        cdef bint any_set = False
        if intValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_intValue(intValue)
            any_set = True
        if opt_intValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_opt_intValue(opt_intValue)
            any_set = True
        if stringValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_stringValue(stringValue.encode('UTF-8'))
            any_set = True
        if opt_stringValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_opt_stringValue(opt_stringValue.encode('UTF-8'))
            any_set = True
        if intValue2 is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_intValue2(intValue2)
            any_set = True
        if intValue3 is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_intValue3(intValue3)
            any_set = True
        if doubelValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_doubelValue(doubelValue)
            any_set = True
        if boolValue is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_boolValue(boolValue)
            any_set = True
        if union_list is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_union_list(List__i32__make_instance(union_list))
            any_set = True
        if union_set is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_union_set(<cset[cint64_t]>deref(Set__i64(union_set)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if union_map is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_union_map(<cmap[string,cint32_t]>deref(Map__string_i32(union_map)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if opt_union_map is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_opt_union_map(<cmap[string,cint32_t]>deref(Map__string_i32(opt_union_map)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if enum_field is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_enum_field(<_module_cbindings.cMyEnumA><int>enum_field)
            any_set = True
        if enum_container is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_enum_container(List__MyEnumA__make_instance(enum_container))
            any_set = True
        if a_struct is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_struct(deref((<MyStruct?> a_struct)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if a_set_struct is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_set_struct(<cset[_module_cbindings.cMyStruct]>deref(Set__MyStruct(a_set_struct)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if a_union is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_union(deref((<SimpleUnion?> a_union)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if opt_a_union is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_opt_a_union(deref((<SimpleUnion?> opt_a_union)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if a_union_list is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_union_list(List__SimpleUnion__make_instance(a_union_list))
            any_set = True
        if a_union_typedef is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_union_typedef(<cset[_module_cbindings.cSimpleUnion]>deref(Set__SimpleUnion(a_union_typedef)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if a_union_typedef_list is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_a_union_typedef_list(List__Set__SimpleUnion__make_instance(a_union_typedef_list))
            any_set = True
        if MyBinaryField is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_MyBinaryField(MyBinaryField)
            any_set = True
        if MyBinaryField2 is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_MyBinaryField2(MyBinaryField2)
            any_set = True
        if MyBinaryListField4 is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_MyBinaryListField4(List__binary__make_instance(MyBinaryListField4))
            any_set = True
        if ref_field is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_ref_field(_module_cbindings.cMyStruct(deref((<MyStruct?>ref_field)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)))
            any_set = True
        if ref_field2 is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_ref_field2(deref((<MyStruct?>ref_field2)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if excp_field is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_excp_field(deref((<AnException?> excp_field)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
            any_set = True
        if MyCustomField is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_MyCustomField(deref((<_fbthrift_iobuf.IOBuf?>MyCustomField)._this)) 
            any_set = True
        # in C++ you don't have to call move(), but this doesn't translate
        # into a C++ return statement, so you do here
        return cmove(c_inst)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cComplexUnion] cpp_obj):
        __fbthrift_inst = <ComplexUnion>ComplexUnion.__new__(ComplexUnion)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        __fbthrift_inst._load_cache()
        return __fbthrift_inst

    @property
    def intValue(self):
        if self.type.value != 1:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not intValue')
        return self.value

    @property
    def opt_intValue(self):
        if self.type.value != 201:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not opt_intValue')
        return self.value

    @property
    def stringValue(self):
        if self.type.value != 3:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not stringValue')
        return self.value

    @property
    def opt_stringValue(self):
        if self.type.value != 203:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not opt_stringValue')
        return self.value

    @property
    def intValue2(self):
        if self.type.value != 4:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not intValue2')
        return self.value

    @property
    def intValue3(self):
        if self.type.value != 6:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not intValue3')
        return self.value

    @property
    def doubelValue(self):
        if self.type.value != 7:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not doubelValue')
        return self.value

    @property
    def boolValue(self):
        if self.type.value != 8:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not boolValue')
        return self.value

    @property
    def union_list(self):
        if self.type.value != 9:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not union_list')
        return self.value

    @property
    def union_set(self):
        if self.type.value != 10:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not union_set')
        return self.value

    @property
    def union_map(self):
        if self.type.value != 11:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not union_map')
        return self.value

    @property
    def opt_union_map(self):
        if self.type.value != 211:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not opt_union_map')
        return self.value

    @property
    def enum_field(self):
        if self.type.value != 12:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not enum_field')
        return self.value

    @property
    def enum_container(self):
        if self.type.value != 13:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not enum_container')
        return self.value

    @property
    def a_struct(self):
        if self.type.value != 14:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_struct')
        return self.value

    @property
    def a_set_struct(self):
        if self.type.value != 15:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_set_struct')
        return self.value

    @property
    def a_union(self):
        if self.type.value != 16:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_union')
        return self.value

    @property
    def opt_a_union(self):
        if self.type.value != 216:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not opt_a_union')
        return self.value

    @property
    def a_union_list(self):
        if self.type.value != 17:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_union_list')
        return self.value

    @property
    def a_union_typedef(self):
        if self.type.value != 18:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_union_typedef')
        return self.value

    @property
    def a_union_typedef_list(self):
        if self.type.value != 19:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not a_union_typedef_list')
        return self.value

    @property
    def MyBinaryField(self):
        if self.type.value != 20:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not MyBinaryField')
        return self.value

    @property
    def MyBinaryField2(self):
        if self.type.value != 21:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not MyBinaryField2')
        return self.value

    @property
    def MyBinaryListField4(self):
        if self.type.value != 23:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not MyBinaryListField4')
        return self.value

    @property
    def ref_field(self):
        if self.type.value != 24:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not ref_field')
        return self.value

    @property
    def ref_field2(self):
        if self.type.value != 25:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not ref_field2')
        return self.value

    @property
    def excp_field(self):
        if self.type.value != 26:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not excp_field')
        return self.value

    @property
    def MyCustomField(self):
        if self.type.value != 27:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not MyCustomField')
        return self.value


    def __hash__(ComplexUnion self):
        return  super().__hash__()

    cdef _load_cache(ComplexUnion self):
        self.type = ComplexUnion.Type(<int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).getType()))
        cdef int type = self.type.value
        if type == 0:    # Empty
            self.value = None
        elif type == 1:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_intValue()
        elif type == 201:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_opt_intValue()
        elif type == 3:
            self.value = bytes(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_stringValue()).decode('UTF-8')
        elif type == 203:
            self.value = bytes(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_opt_stringValue()).decode('UTF-8')
        elif type == 4:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_intValue2()
        elif type == 6:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_intValue3()
        elif type == 7:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_doubelValue()
        elif type == 8:
            self.value = <bint>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_boolValue())
        elif type == 9:
            self.value = List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_union_list())
        elif type == 10:
            self.value = Set__i64._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[cint64_t]](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_union_set()))
        elif type == 11:
            self.value = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cmap[string,cint32_t]](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_union_map()))
        elif type == 211:
            self.value = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cmap[string,cint32_t]](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_opt_union_map()))
        elif type == 12:
            self.value = translate_cpp_enum_to_python(MyEnumA, <int>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_enum_field())
        elif type == 13:
            self.value = List__MyEnumA__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_enum_container())
        elif type == 14:
            self.value = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cMyStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_struct()))
        elif type == 15:
            self.value = Set__MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[_module_cbindings.cMyStruct]](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_set_struct()))
        elif type == 16:
            self.value = SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cSimpleUnion](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_union()))
        elif type == 216:
            self.value = SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cSimpleUnion](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_opt_a_union()))
        elif type == 17:
            self.value = List__SimpleUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_union_list())
        elif type == 18:
            self.value = Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[_module_cbindings.cSimpleUnion]](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_union_typedef()))
        elif type == 19:
            self.value = List__Set__SimpleUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_a_union_typedef_list())
        elif type == 20:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_MyBinaryField()
        elif type == 21:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_MyBinaryField2()
        elif type == 23:
            self.value = List__binary__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_MyBinaryListField4())
        elif type == 24:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_ref_field():
                self.value = None
            else:
            
                self.value = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_ref_field()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        elif type == 25:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_ref_field2():
                self.value = None
            else:
            
                self.value = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_ref_field2()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        elif type == 26:
            self.value = AnException._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cAnException](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_excp_field()))
        elif type == 27:
            self.value =  _fbthrift_iobuf.from_unique_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_MyCustomField().clone())

    def __copy__(ComplexUnion self):
        cdef shared_ptr[_module_cbindings.cComplexUnion] cpp_obj = make_shared[_module_cbindings.cComplexUnion](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cComplexUnion](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<ComplexUnion>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__ComplexUnion()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cComplexUnion].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.ComplexUnion"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cComplexUnion](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 28

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ComplexUnion self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cComplexUnion](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(ComplexUnion self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cComplexUnion]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cComplexUnion](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        # force a cache reload since the underlying data's changed
        self._load_cache()
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.ComplexUnion, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.ComplexUnion, self)

@__cython.auto_pickle(False)
cdef class AnException(thrift.py3.exceptions.GeneratedError):
    def __init__(AnException self, *args, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnException]()
        self._fields_setter = _fbthrift_types_fields.__AnException_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__( *args, **kwargs)

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("AnException", {
          "code": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).code_ref().has_value(),
          "req_code": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_code_ref().has_value(),
          "message2": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).message2_ref().has_value(),
          "req_message": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_message_ref().has_value(),
          "exception_list": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_list_ref().has_value(),
          "exception_set": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_set_ref().has_value(),
          "exception_map": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_map_ref().has_value(),
          "req_exception_map": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_exception_map_ref().has_value(),
          "enum_field": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).enum_field_ref().has_value(),
          "enum_container": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).enum_container_ref().has_value(),
          "a_struct": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_struct_ref().has_value(),
          "a_set_struct": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_set_struct_ref().has_value(),
          "a_union_list": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_union_list_ref().has_value(),
          "union_typedef": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).union_typedef_ref().has_value(),
          "a_union_typedef_list": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_union_typedef_list_ref().has_value(),
          "MyCustomField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyCustomField_ref().has_value(),
          "MyOptCustomField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cAnException] cpp_obj):
        __fbthrift_inst = <AnException>AnException.__new__(AnException, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
        return __fbthrift_inst

    cdef inline code_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).code_ref().value()

    @property
    def code(self):
        return self.code_impl()

    cdef inline req_code_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_code_ref().value()

    @property
    def req_code(self):
        return self.req_code_impl()

    cdef inline message2_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).message2_ref().value()).decode('UTF-8')

    @property
    def message2(self):
        return self.message2_impl()

    cdef inline req_message_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_message_ref().value()).decode('UTF-8')

    @property
    def req_message(self):
        return self.req_message_impl()

    cdef inline exception_list_impl(self):
        if self.__fbthrift_cached_exception_list is None:
            self.__fbthrift_cached_exception_list = List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_list_ref().ref())
        return self.__fbthrift_cached_exception_list

    @property
    def exception_list(self):
        return self.exception_list_impl()

    cdef inline exception_set_impl(self):
        if self.__fbthrift_cached_exception_set is None:
            self.__fbthrift_cached_exception_set = Set__i64._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_set_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_exception_set

    @property
    def exception_set(self):
        return self.exception_set_impl()

    cdef inline exception_map_impl(self):
        if self.__fbthrift_cached_exception_map is None:
            self.__fbthrift_cached_exception_map = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).exception_map_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_exception_map

    @property
    def exception_map(self):
        return self.exception_map_impl()

    cdef inline req_exception_map_impl(self):
        if self.__fbthrift_cached_req_exception_map is None:
            self.__fbthrift_cached_req_exception_map = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_exception_map_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_exception_map

    @property
    def req_exception_map(self):
        return self.req_exception_map_impl()

    cdef inline enum_field_impl(self):
        if self.__fbthrift_cached_enum_field is None:
            self.__fbthrift_cached_enum_field = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).enum_field_ref().value()))
        return self.__fbthrift_cached_enum_field

    @property
    def enum_field(self):
        return self.enum_field_impl()

    cdef inline enum_container_impl(self):
        if self.__fbthrift_cached_enum_container is None:
            self.__fbthrift_cached_enum_container = List__MyEnumA__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).enum_container_ref().ref())
        return self.__fbthrift_cached_enum_container

    @property
    def enum_container(self):
        return self.enum_container_impl()

    cdef inline a_struct_impl(self):
        if self.__fbthrift_cached_a_struct is None:
            self.__fbthrift_cached_a_struct = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_struct_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_a_struct

    @property
    def a_struct(self):
        return self.a_struct_impl()

    cdef inline a_set_struct_impl(self):
        if self.__fbthrift_cached_a_set_struct is None:
            self.__fbthrift_cached_a_set_struct = Set__MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_set_struct_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_a_set_struct

    @property
    def a_set_struct(self):
        return self.a_set_struct_impl()

    cdef inline a_union_list_impl(self):
        if self.__fbthrift_cached_a_union_list is None:
            self.__fbthrift_cached_a_union_list = List__SimpleUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_union_list_ref().ref())
        return self.__fbthrift_cached_a_union_list

    @property
    def a_union_list(self):
        return self.a_union_list_impl()

    cdef inline union_typedef_impl(self):
        if self.__fbthrift_cached_union_typedef is None:
            self.__fbthrift_cached_union_typedef = Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).union_typedef_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_union_typedef

    @property
    def union_typedef(self):
        return self.union_typedef_impl()

    cdef inline a_union_typedef_list_impl(self):
        if self.__fbthrift_cached_a_union_typedef_list is None:
            self.__fbthrift_cached_a_union_typedef_list = List__Set__SimpleUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).a_union_typedef_list_ref().ref())
        return self.__fbthrift_cached_a_union_typedef_list

    @property
    def a_union_typedef_list(self):
        return self.a_union_typedef_list_impl()

    cdef inline MyCustomField_impl(self):
        if self.__fbthrift_cached_MyCustomField is None:
            self.__fbthrift_cached_MyCustomField = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyCustomField_ref().ref()), self)
        return self.__fbthrift_cached_MyCustomField

    @property
    def MyCustomField(self):
        return self.MyCustomField_impl()

    cdef inline MyOptCustomField_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().has_value():
            return None
        if self.__fbthrift_cached_MyOptCustomField is None:
            self.__fbthrift_cached_MyOptCustomField = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyOptCustomField_ref().ref_unchecked()), self)
        return self.__fbthrift_cached_MyOptCustomField

    @property
    def MyOptCustomField(self):
        return self.MyOptCustomField_impl()


    def __hash__(AnException self):
        return super().__hash__()

    def __repr__(AnException self):
        return super().__repr__()

    def __str__(AnException self):
        field = self.message2
        if field is None:
            return str(field)
        return field


    def __copy__(AnException self):
        cdef shared_ptr[_module_cbindings.cAnException] cpp_obj = make_shared[_module_cbindings.cAnException](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return AnException._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cAnException](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<AnException>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__AnException()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.ExceptionMetadata[_module_cbindings.cAnException].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.AnException"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cAnException](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 17

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(AnException self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cAnException](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(AnException self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnException]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cAnException](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.AnException, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.AnException, self)

@__cython.auto_pickle(False)
cdef class AnotherException(thrift.py3.exceptions.GeneratedError):
    def __init__(AnotherException self, *args, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnotherException]()
        self._fields_setter = _fbthrift_types_fields.__AnotherException_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__( *args, **kwargs)

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("AnotherException", {
          "code": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).code_ref().has_value(),
          "req_code": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_code_ref().has_value(),
          "message": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).message_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cAnotherException] cpp_obj):
        __fbthrift_inst = <AnotherException>AnotherException.__new__(AnotherException, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
        return __fbthrift_inst

    cdef inline code_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).code_ref().value()

    @property
    def code(self):
        return self.code_impl()

    cdef inline req_code_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_code_ref().value()

    @property
    def req_code(self):
        return self.req_code_impl()

    cdef inline message_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).message_ref().value()).decode('UTF-8')

    @property
    def message(self):
        return self.message_impl()


    def __hash__(AnotherException self):
        return super().__hash__()

    def __repr__(AnotherException self):
        return super().__repr__()

    def __str__(AnotherException self):
        return super().__str__()


    def __copy__(AnotherException self):
        cdef shared_ptr[_module_cbindings.cAnotherException] cpp_obj = make_shared[_module_cbindings.cAnotherException](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return AnotherException._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cAnotherException](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<AnotherException>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__AnotherException()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.ExceptionMetadata[_module_cbindings.cAnotherException].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.AnotherException"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cAnotherException](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 3

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(AnotherException self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cAnotherException](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(AnotherException self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnotherException]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cAnotherException](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.AnotherException, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.AnotherException, self)

@__cython.auto_pickle(False)
cdef class containerStruct(thrift.py3.types.Struct):
    def __init__(containerStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.ccontainerStruct]()
        self._fields_setter = _fbthrift_types_fields.__containerStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("containerStruct", {
          "fieldA": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldA_ref().has_value(),
          "req_fieldA": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldA_ref().has_value(),
          "opt_fieldA": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldA_ref().has_value(),
          "fieldB": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldB_ref().has_value(),
          "req_fieldB": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldB_ref().has_value(),
          "opt_fieldB": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldB_ref().has_value(),
          "fieldC": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldC_ref().has_value(),
          "req_fieldC": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldC_ref().has_value(),
          "opt_fieldC": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldC_ref().has_value(),
          "fieldD": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldD_ref().has_value(),
          "fieldE": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldE_ref().has_value(),
          "req_fieldE": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldE_ref().has_value(),
          "opt_fieldE": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldE_ref().has_value(),
          "fieldF": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldF_ref().has_value(),
          "fieldG": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldG_ref().has_value(),
          "fieldH": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldH_ref().has_value(),
          "fieldI": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldI_ref().has_value(),
          "fieldJ": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldJ_ref().has_value(),
          "fieldK": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldK_ref().has_value(),
          "fieldL": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldL_ref().has_value(),
          "fieldM": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldM_ref().has_value(),
          "fieldN": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldN_ref().has_value(),
          "fieldO": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldO_ref().has_value(),
          "fieldP": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldP_ref().has_value(),
          "fieldQ": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldQ_ref().has_value(),
          "fieldR": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldR_ref().has_value(),
          "req_fieldR": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldR_ref().has_value(),
          "opt_fieldR": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldR_ref().has_value(),
          "fieldS": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldS_ref().has_value(),
          "fieldT": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldT_ref().has_value(),
          "fieldU": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldU_ref().has_value(),
          "fieldV": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldV_ref().has_value(),
          "req_fieldV": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldV_ref().has_value(),
          "opt_fieldV": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldV_ref().has_value(),
          "fieldW": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldW_ref().has_value(),
          "fieldX": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldX_ref().has_value(),
          "req_fieldX": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldX_ref().has_value(),
          "opt_fieldX": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldX_ref().has_value(),
          "fieldY": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldY_ref().has_value(),
          "fieldZ": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldZ_ref().has_value(),
          "fieldAA": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAA_ref().has_value(),
          "fieldAB": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAB_ref().has_value(),
          "fieldAC": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAC_ref().has_value(),
          "fieldAD": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAD_ref().has_value(),
          "fieldAE": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAE_ref().has_value(),
          "fieldSD": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldSD_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.ccontainerStruct] cpp_obj):
        __fbthrift_inst = <containerStruct>containerStruct.__new__(containerStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline fieldA_impl(self):
        return <pbool> deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldA_ref().value()

    @property
    def fieldA(self):
        return self.fieldA_impl()

    cdef inline req_fieldA_impl(self):
        return <pbool> deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldA_ref().value()

    @property
    def req_fieldA(self):
        return self.req_fieldA_impl()

    cdef inline opt_fieldA_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldA_ref().has_value():
            return None
        return <pbool> deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldA_ref().value_unchecked()

    @property
    def opt_fieldA(self):
        return self.opt_fieldA_impl()

    cdef inline fieldB_impl(self):
        if self.__fbthrift_cached_fieldB is None:
            self.__fbthrift_cached_fieldB = Map__string_bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldB_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldB

    @property
    def fieldB(self):
        return self.fieldB_impl()

    cdef inline req_fieldB_impl(self):
        if self.__fbthrift_cached_req_fieldB is None:
            self.__fbthrift_cached_req_fieldB = Map__string_bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldB_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_fieldB

    @property
    def req_fieldB(self):
        return self.req_fieldB_impl()

    cdef inline opt_fieldB_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldB_ref().has_value():
            return None
        if self.__fbthrift_cached_opt_fieldB is None:
            self.__fbthrift_cached_opt_fieldB = Map__string_bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldB_ref().ref_unchecked(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_fieldB

    @property
    def opt_fieldB(self):
        return self.opt_fieldB_impl()

    cdef inline fieldC_impl(self):
        if self.__fbthrift_cached_fieldC is None:
            self.__fbthrift_cached_fieldC = Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldC_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldC

    @property
    def fieldC(self):
        return self.fieldC_impl()

    cdef inline req_fieldC_impl(self):
        if self.__fbthrift_cached_req_fieldC is None:
            self.__fbthrift_cached_req_fieldC = Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldC_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_fieldC

    @property
    def req_fieldC(self):
        return self.req_fieldC_impl()

    cdef inline opt_fieldC_impl(self):
        if self.__fbthrift_cached_opt_fieldC is None:
            self.__fbthrift_cached_opt_fieldC = Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldC_ref().ref_unchecked(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_fieldC

    @property
    def opt_fieldC(self):
        return self.opt_fieldC_impl()

    cdef inline fieldD_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldD_ref().value()).decode('UTF-8')

    @property
    def fieldD(self):
        return self.fieldD_impl()

    cdef inline fieldE_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldE_ref().value()).decode('UTF-8')

    @property
    def fieldE(self):
        return self.fieldE_impl()

    cdef inline req_fieldE_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldE_ref().value()).decode('UTF-8')

    @property
    def req_fieldE(self):
        return self.req_fieldE_impl()

    cdef inline opt_fieldE_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldE_ref().value_unchecked()).decode('UTF-8')

    @property
    def opt_fieldE(self):
        return self.opt_fieldE_impl()

    cdef inline fieldF_impl(self):
        if self.__fbthrift_cached_fieldF is None:
            self.__fbthrift_cached_fieldF = List__List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldF_ref().ref())
        return self.__fbthrift_cached_fieldF

    @property
    def fieldF(self):
        return self.fieldF_impl()

    cdef inline fieldG_impl(self):
        if self.__fbthrift_cached_fieldG is None:
            self.__fbthrift_cached_fieldG = Map__string_Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldG_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldG

    @property
    def fieldG(self):
        return self.fieldG_impl()

    cdef inline fieldH_impl(self):
        if self.__fbthrift_cached_fieldH is None:
            self.__fbthrift_cached_fieldH = List__Set__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldH_ref().ref())
        return self.__fbthrift_cached_fieldH

    @property
    def fieldH(self):
        return self.fieldH_impl()

    cdef inline fieldI_impl(self):
        return <pbool> deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldI_ref().value()

    @property
    def fieldI(self):
        return self.fieldI_impl()

    cdef inline fieldJ_impl(self):
        if self.__fbthrift_cached_fieldJ is None:
            self.__fbthrift_cached_fieldJ = Map__string_List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldJ_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldJ

    @property
    def fieldJ(self):
        return self.fieldJ_impl()

    cdef inline fieldK_impl(self):
        if self.__fbthrift_cached_fieldK is None:
            self.__fbthrift_cached_fieldK = List__List__List__List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldK_ref().ref())
        return self.__fbthrift_cached_fieldK

    @property
    def fieldK(self):
        return self.fieldK_impl()

    cdef inline fieldL_impl(self):
        if self.__fbthrift_cached_fieldL is None:
            self.__fbthrift_cached_fieldL = Set__Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldL_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldL

    @property
    def fieldL(self):
        return self.fieldL_impl()

    cdef inline fieldM_impl(self):
        if self.__fbthrift_cached_fieldM is None:
            self.__fbthrift_cached_fieldM = Map__Set__List__i32_Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldM_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldM

    @property
    def fieldM(self):
        return self.fieldM_impl()

    cdef inline fieldN_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldN_ref().value()

    @property
    def fieldN(self):
        return self.fieldN_impl()

    cdef inline fieldO_impl(self):
        if self.__fbthrift_cached_fieldO is None:
            self.__fbthrift_cached_fieldO = List__Map__Empty_MyStruct__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldO_ref().ref())
        return self.__fbthrift_cached_fieldO

    @property
    def fieldO(self):
        return self.fieldO_impl()

    cdef inline fieldP_impl(self):
        if self.__fbthrift_cached_fieldP is None:
            self.__fbthrift_cached_fieldP = List__List__List__Map__Empty_MyStruct__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldP_ref().ref())
        return self.__fbthrift_cached_fieldP

    @property
    def fieldP(self):
        return self.fieldP_impl()

    cdef inline fieldQ_impl(self):
        if self.__fbthrift_cached_fieldQ is None:
            self.__fbthrift_cached_fieldQ = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldQ_ref().value()))
        return self.__fbthrift_cached_fieldQ

    @property
    def fieldQ(self):
        return self.fieldQ_impl()

    cdef inline fieldR_impl(self):
        if self.__fbthrift_cached_fieldR is None:
            self.__fbthrift_cached_fieldR = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldR_ref().value()))
        return self.__fbthrift_cached_fieldR

    @property
    def fieldR(self):
        return self.fieldR_impl()

    cdef inline req_fieldR_impl(self):
        if self.__fbthrift_cached_req_fieldR is None:
            self.__fbthrift_cached_req_fieldR = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldR_ref().value()))
        return self.__fbthrift_cached_req_fieldR

    @property
    def req_fieldR(self):
        return self.req_fieldR_impl()

    cdef inline opt_fieldR_impl(self):
        if self.__fbthrift_cached_opt_fieldR is None:
            self.__fbthrift_cached_opt_fieldR = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldR_ref().value_unchecked()))
        return self.__fbthrift_cached_opt_fieldR

    @property
    def opt_fieldR(self):
        return self.opt_fieldR_impl()

    cdef inline fieldS_impl(self):
        if self.__fbthrift_cached_fieldS is None:
            self.__fbthrift_cached_fieldS = translate_cpp_enum_to_python(MyEnumA, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldS_ref().value()))
        return self.__fbthrift_cached_fieldS

    @property
    def fieldS(self):
        return self.fieldS_impl()

    cdef inline fieldT_impl(self):
        if self.__fbthrift_cached_fieldT is None:
            self.__fbthrift_cached_fieldT = List__MyEnumA__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldT_ref().ref())
        return self.__fbthrift_cached_fieldT

    @property
    def fieldT(self):
        return self.fieldT_impl()

    cdef inline fieldU_impl(self):
        if self.__fbthrift_cached_fieldU is None:
            self.__fbthrift_cached_fieldU = List__MyEnumA__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldU_ref().ref())
        return self.__fbthrift_cached_fieldU

    @property
    def fieldU(self):
        return self.fieldU_impl()

    cdef inline fieldV_impl(self):
        if self.__fbthrift_cached_fieldV is None:
            self.__fbthrift_cached_fieldV = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldV_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldV

    @property
    def fieldV(self):
        return self.fieldV_impl()

    cdef inline req_fieldV_impl(self):
        if self.__fbthrift_cached_req_fieldV is None:
            self.__fbthrift_cached_req_fieldV = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldV_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_fieldV

    @property
    def req_fieldV(self):
        return self.req_fieldV_impl()

    cdef inline opt_fieldV_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldV_ref().has_value():
            return None
        if self.__fbthrift_cached_opt_fieldV is None:
            self.__fbthrift_cached_opt_fieldV = MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldV_ref().ref_unchecked(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_fieldV

    @property
    def opt_fieldV(self):
        return self.opt_fieldV_impl()

    cdef inline fieldW_impl(self):
        if self.__fbthrift_cached_fieldW is None:
            self.__fbthrift_cached_fieldW = Set__MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldW_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldW

    @property
    def fieldW(self):
        return self.fieldW_impl()

    cdef inline fieldX_impl(self):
        if self.__fbthrift_cached_fieldX is None:
            self.__fbthrift_cached_fieldX = ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldX_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldX

    @property
    def fieldX(self):
        return self.fieldX_impl()

    cdef inline req_fieldX_impl(self):
        if self.__fbthrift_cached_req_fieldX is None:
            self.__fbthrift_cached_req_fieldX = ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_fieldX_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_fieldX

    @property
    def req_fieldX(self):
        return self.req_fieldX_impl()

    cdef inline opt_fieldX_impl(self):
        if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldX_ref().has_value():
            return None
        if self.__fbthrift_cached_opt_fieldX is None:
            self.__fbthrift_cached_opt_fieldX = ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_fieldX_ref().ref_unchecked(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_fieldX

    @property
    def opt_fieldX(self):
        return self.opt_fieldX_impl()

    cdef inline fieldY_impl(self):
        if self.__fbthrift_cached_fieldY is None:
            self.__fbthrift_cached_fieldY = List__ComplexUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldY_ref().ref())
        return self.__fbthrift_cached_fieldY

    @property
    def fieldY(self):
        return self.fieldY_impl()

    cdef inline fieldZ_impl(self):
        if self.__fbthrift_cached_fieldZ is None:
            self.__fbthrift_cached_fieldZ = Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldZ_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldZ

    @property
    def fieldZ(self):
        return self.fieldZ_impl()

    cdef inline fieldAA_impl(self):
        if self.__fbthrift_cached_fieldAA is None:
            self.__fbthrift_cached_fieldAA = List__Set__SimpleUnion__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAA_ref().ref())
        return self.__fbthrift_cached_fieldAA

    @property
    def fieldAA(self):
        return self.fieldAA_impl()

    cdef inline fieldAB_impl(self):
        if self.__fbthrift_cached_fieldAB is None:
            self.__fbthrift_cached_fieldAB = Map__Bar__double_Baz__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAB_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldAB

    @property
    def fieldAB(self):
        return self.fieldAB_impl()

    cdef inline fieldAC_impl(self):
        if self.__fbthrift_cached_fieldAC is None:
            self.__fbthrift_cached_fieldAC = translate_cpp_enum_to_python(MyEnumB, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAC_ref().value()))
        return self.__fbthrift_cached_fieldAC

    @property
    def fieldAC(self):
        return self.fieldAC_impl()

    cdef inline fieldAD_impl(self):
        if self.__fbthrift_cached_fieldAD is None:
            self.__fbthrift_cached_fieldAD = translate_cpp_enum_to_python(_includes_types.AnEnum, <int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAD_ref().value()))
        return self.__fbthrift_cached_fieldAD

    @property
    def fieldAD(self):
        return self.fieldAD_impl()

    cdef inline fieldAE_impl(self):
        if self.__fbthrift_cached_fieldAE is None:
            self.__fbthrift_cached_fieldAE = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldAE_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_fieldAE

    @property
    def fieldAE(self):
        return self.fieldAE_impl()

    cdef inline fieldSD_impl(self):
        return (<bytes>deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).fieldSD_ref().value()).decode('UTF-8')

    @property
    def fieldSD(self):
        return self.fieldSD_impl()


    def __hash__(containerStruct self):
        return super().__hash__()

    def __repr__(containerStruct self):
        return super().__repr__()

    def __str__(containerStruct self):
        return super().__str__()


    def __copy__(containerStruct self):
        raise TypeError("containerStruct is noncopyable")

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.ccontainerStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<containerStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__containerStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.ccontainerStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.containerStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.ccontainerStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 46

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(containerStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.ccontainerStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(containerStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.ccontainerStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.ccontainerStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.containerStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.containerStruct, self)

@__cython.auto_pickle(False)
cdef class MyIncludedStruct(thrift.py3.types.Struct):
    def __init__(MyIncludedStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyIncludedStruct]()
        self._fields_setter = _fbthrift_types_fields.__MyIncludedStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(MyIncludedStruct self, **kwargs):
        if not kwargs:
            return self
        cdef MyIncludedStruct __fbthrift_inst = MyIncludedStruct.__new__(MyIncludedStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyIncludedStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__MyIncludedStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("MyIncludedStruct", {
          "MyIncludedInt": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIncludedInt_ref().has_value(),
          "MyIncludedStruct": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIncludedStruct_ref().has_value(),
          "ARequiredField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ARequiredField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cMyIncludedStruct] cpp_obj):
        __fbthrift_inst = <MyIncludedStruct>MyIncludedStruct.__new__(MyIncludedStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline MyIncludedInt_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIncludedInt_ref().value()

    @property
    def MyIncludedInt(self):
        return self.MyIncludedInt_impl()

    cdef inline MyIncludedStruct_impl(self):
        if self.__fbthrift_cached_MyIncludedStruct is None:
            self.__fbthrift_cached_MyIncludedStruct = _includes_types.AStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).MyIncludedStruct_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_MyIncludedStruct

    @property
    def MyIncludedStruct(self):
        return self.MyIncludedStruct_impl()

    cdef inline ARefField_impl(self):
        if self.__fbthrift_cached_ARefField is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ARefField_ref():
                return None
            self.__fbthrift_cached_ARefField = _includes_types.AStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ARefField_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_ARefField

    @property
    def ARefField(self):
        return self.ARefField_impl()

    cdef inline ARequiredField_impl(self):
        if self.__fbthrift_cached_ARequiredField is None:
            self.__fbthrift_cached_ARequiredField = _includes_types.AStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ARequiredField_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_ARequiredField

    @property
    def ARequiredField(self):
        return self.ARequiredField_impl()


    def __hash__(MyIncludedStruct self):
        return super().__hash__()

    def __repr__(MyIncludedStruct self):
        return super().__repr__()

    def __str__(MyIncludedStruct self):
        return super().__str__()


    def __copy__(MyIncludedStruct self):
        cdef shared_ptr[_module_cbindings.cMyIncludedStruct] cpp_obj = make_shared[_module_cbindings.cMyIncludedStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return MyIncludedStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cMyIncludedStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<MyIncludedStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__MyIncludedStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cMyIncludedStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.MyIncludedStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cMyIncludedStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 4

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(MyIncludedStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cMyIncludedStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(MyIncludedStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cMyIncludedStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cMyIncludedStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.MyIncludedStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.MyIncludedStruct, self)

@__cython.auto_pickle(False)
cdef class AnnotatedStruct(thrift.py3.types.Struct):
    def __init__(AnnotatedStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnnotatedStruct]()
        self._fields_setter = _fbthrift_types_fields.__AnnotatedStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("AnnotatedStruct", {
          "no_annotation": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).no_annotation_ref().has_value(),
          "base_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).base_type_ref().has_value(),
          "list_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_type_ref().has_value(),
          "set_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).set_type_ref().has_value(),
          "map_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_type_ref().has_value(),
          "map_struct_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_struct_type_ref().has_value(),
          "iobuf_type": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_type_ref().has_value(),
          "iobuf_ptr": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_ref().has_value(),
          "list_i32_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_i32_template_ref().has_value(),
          "list_string_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_string_template_ref().has_value(),
          "set_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).set_template_ref().has_value(),
          "map_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_template_ref().has_value(),
          "typedef_list_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_list_template_ref().has_value(),
          "typedef_deque_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_deque_template_ref().has_value(),
          "typedef_set_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_set_template_ref().has_value(),
          "typedef_map_template": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_map_template_ref().has_value(),
          "indirection_a": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_a_ref().has_value(),
          "indirection_b": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_b_ref().has_value(),
          "indirection_c": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_c_ref().has_value(),
          "iobuf_type_val": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_type_val_ref().has_value(),
          "iobuf_ptr_val": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_val_ref().has_value(),
          "struct_struct": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).struct_struct_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cAnnotatedStruct] cpp_obj):
        __fbthrift_inst = <AnnotatedStruct>AnnotatedStruct.__new__(AnnotatedStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline no_annotation_impl(self):
        if self.__fbthrift_cached_no_annotation is None:
            self.__fbthrift_cached_no_annotation = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).no_annotation_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_no_annotation

    @property
    def no_annotation(self):
        return self.no_annotation_impl()

    cdef inline cpp_unique_ref_impl(self):
        if self.__fbthrift_cached_cpp_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).cpp_unique_ref_ref():
                return None
            self.__fbthrift_cached_cpp_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).cpp_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_cpp_unique_ref

    @property
    def cpp_unique_ref(self):
        return self.cpp_unique_ref_impl()

    cdef inline cpp2_unique_ref_impl(self):
        if self.__fbthrift_cached_cpp2_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).cpp2_unique_ref_ref():
                return None
            self.__fbthrift_cached_cpp2_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).cpp2_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_cpp2_unique_ref

    @property
    def cpp2_unique_ref(self):
        return self.cpp2_unique_ref_impl()

    cdef inline container_with_ref_impl(self):
        if self.__fbthrift_cached_container_with_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).container_with_ref_ref():
                return None
            self.__fbthrift_cached_container_with_ref = Map__i32_List__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).container_with_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_container_with_ref

    @property
    def container_with_ref(self):
        return self.container_with_ref_impl()

    cdef inline req_cpp_unique_ref_impl(self):
        if self.__fbthrift_cached_req_cpp_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_cpp_unique_ref_ref():
                return None
            self.__fbthrift_cached_req_cpp_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_cpp_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_cpp_unique_ref

    @property
    def req_cpp_unique_ref(self):
        return self.req_cpp_unique_ref_impl()

    cdef inline req_cpp2_unique_ref_impl(self):
        if self.__fbthrift_cached_req_cpp2_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_cpp2_unique_ref_ref():
                return None
            self.__fbthrift_cached_req_cpp2_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_cpp2_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_cpp2_unique_ref

    @property
    def req_cpp2_unique_ref(self):
        return self.req_cpp2_unique_ref_impl()

    cdef inline req_container_with_ref_impl(self):
        if self.__fbthrift_cached_req_container_with_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_container_with_ref_ref():
                return None
            self.__fbthrift_cached_req_container_with_ref = List__string__from_cpp(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_container_with_ref_ref()))
        return self.__fbthrift_cached_req_container_with_ref

    @property
    def req_container_with_ref(self):
        return self.req_container_with_ref_impl()

    cdef inline opt_cpp_unique_ref_impl(self):
        if self.__fbthrift_cached_opt_cpp_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_cpp_unique_ref_ref():
                return None
            self.__fbthrift_cached_opt_cpp_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_cpp_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_cpp_unique_ref

    @property
    def opt_cpp_unique_ref(self):
        return self.opt_cpp_unique_ref_impl()

    cdef inline opt_cpp2_unique_ref_impl(self):
        if self.__fbthrift_cached_opt_cpp2_unique_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_cpp2_unique_ref_ref():
                return None
            self.__fbthrift_cached_opt_cpp2_unique_ref = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_cpp2_unique_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_cpp2_unique_ref

    @property
    def opt_cpp2_unique_ref(self):
        return self.opt_cpp2_unique_ref_impl()

    cdef inline opt_container_with_ref_impl(self):
        if self.__fbthrift_cached_opt_container_with_ref is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_container_with_ref_ref():
                return None
            self.__fbthrift_cached_opt_container_with_ref = Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_container_with_ref_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_container_with_ref

    @property
    def opt_container_with_ref(self):
        return self.opt_container_with_ref_impl()

    cdef inline ref_type_unique_impl(self):
        if self.__fbthrift_cached_ref_type_unique is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_unique_ref():
                return None
            self.__fbthrift_cached_ref_type_unique = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_unique_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_ref_type_unique

    @property
    def ref_type_unique(self):
        return self.ref_type_unique_impl()

    cdef inline ref_type_shared_impl(self):
        if self.__fbthrift_cached_ref_type_shared is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_shared_ref():
                return None
            self.__fbthrift_cached_ref_type_shared = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_shared_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_ref_type_shared

    @property
    def ref_type_shared(self):
        return self.ref_type_shared_impl()

    cdef inline ref_type_const_impl(self):
        if self.__fbthrift_cached_ref_type_const is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_const_ref():
                return None
            self.__fbthrift_cached_ref_type_const = Map__i32_List__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).ref_type_const_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_ref_type_const

    @property
    def ref_type_const(self):
        return self.ref_type_const_impl()

    cdef inline req_ref_type_shared_impl(self):
        if self.__fbthrift_cached_req_ref_type_shared is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_shared_ref():
                return None
            self.__fbthrift_cached_req_ref_type_shared = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_shared_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_ref_type_shared

    @property
    def req_ref_type_shared(self):
        return self.req_ref_type_shared_impl()

    cdef inline req_ref_type_const_impl(self):
        if self.__fbthrift_cached_req_ref_type_const is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_const_ref():
                return None
            self.__fbthrift_cached_req_ref_type_const = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_const_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_req_ref_type_const

    @property
    def req_ref_type_const(self):
        return self.req_ref_type_const_impl()

    cdef inline req_ref_type_unique_impl(self):
        if self.__fbthrift_cached_req_ref_type_unique is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_unique_ref():
                return None
            self.__fbthrift_cached_req_ref_type_unique = List__string__from_cpp(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).req_ref_type_unique_ref()))
        return self.__fbthrift_cached_req_ref_type_unique

    @property
    def req_ref_type_unique(self):
        return self.req_ref_type_unique_impl()

    cdef inline opt_ref_type_const_impl(self):
        if self.__fbthrift_cached_opt_ref_type_const is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_const_ref():
                return None
            self.__fbthrift_cached_opt_ref_type_const = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_const_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_ref_type_const

    @property
    def opt_ref_type_const(self):
        return self.opt_ref_type_const_impl()

    cdef inline opt_ref_type_unique_impl(self):
        if self.__fbthrift_cached_opt_ref_type_unique is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_unique_ref():
                return None
            self.__fbthrift_cached_opt_ref_type_unique = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_unique_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_ref_type_unique

    @property
    def opt_ref_type_unique(self):
        return self.opt_ref_type_unique_impl()

    cdef inline opt_ref_type_shared_impl(self):
        if self.__fbthrift_cached_opt_ref_type_shared is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_shared_ref():
                return None
            self.__fbthrift_cached_opt_ref_type_shared = Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).opt_ref_type_shared_ref()), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_opt_ref_type_shared

    @property
    def opt_ref_type_shared(self):
        return self.opt_ref_type_shared_impl()

    cdef inline base_type_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).base_type_ref().value()

    @property
    def base_type(self):
        return self.base_type_impl()

    cdef inline list_type_impl(self):
        if self.__fbthrift_cached_list_type is None:
            self.__fbthrift_cached_list_type = folly_small_vector_int64_t_8__List__i64__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_type_ref().ref())
        return self.__fbthrift_cached_list_type

    @property
    def list_type(self):
        return self.list_type_impl()

    cdef inline set_type_impl(self):
        if self.__fbthrift_cached_set_type is None:
            self.__fbthrift_cached_set_type = folly_sorted_vector_set_std_string__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).set_type_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_set_type

    @property
    def set_type(self):
        return self.set_type_impl()

    cdef inline map_type_impl(self):
        if self.__fbthrift_cached_map_type is None:
            self.__fbthrift_cached_map_type = FakeMap__Map__i64_double._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_type_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_map_type

    @property
    def map_type(self):
        return self.map_type_impl()

    cdef inline map_struct_type_impl(self):
        if self.__fbthrift_cached_map_struct_type is None:
            self.__fbthrift_cached_map_struct_type = std_unordered_map_std_string_containerStruct__Map__string_containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_struct_type_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_map_struct_type

    @property
    def map_struct_type(self):
        return self.map_struct_type_impl()

    cdef inline iobuf_type_impl(self):
        if self.__fbthrift_cached_iobuf_type is None:
            self.__fbthrift_cached_iobuf_type = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_type_ref().ref()), self)
        return self.__fbthrift_cached_iobuf_type

    @property
    def iobuf_type(self):
        return self.iobuf_type_impl()

    cdef inline iobuf_ptr_impl(self):
        if self.__fbthrift_cached_iobuf_ptr is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_ref().value():
                return None
            self.__fbthrift_cached_iobuf_ptr = _fbthrift_iobuf.IOBuf.create(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_ref().value().get(), self)
        return self.__fbthrift_cached_iobuf_ptr

    @property
    def iobuf_ptr(self):
        return self.iobuf_ptr_impl()

    cdef inline list_i32_template_impl(self):
        if self.__fbthrift_cached_list_i32_template is None:
            self.__fbthrift_cached_list_i32_template = std_list__List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_i32_template_ref().ref())
        return self.__fbthrift_cached_list_i32_template

    @property
    def list_i32_template(self):
        return self.list_i32_template_impl()

    cdef inline list_string_template_impl(self):
        if self.__fbthrift_cached_list_string_template is None:
            self.__fbthrift_cached_list_string_template = std_deque__List__string__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).list_string_template_ref().ref())
        return self.__fbthrift_cached_list_string_template

    @property
    def list_string_template(self):
        return self.list_string_template_impl()

    cdef inline set_template_impl(self):
        if self.__fbthrift_cached_set_template is None:
            self.__fbthrift_cached_set_template = folly_sorted_vector_set__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).set_template_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_set_template

    @property
    def set_template(self):
        return self.set_template_impl()

    cdef inline map_template_impl(self):
        if self.__fbthrift_cached_map_template is None:
            self.__fbthrift_cached_map_template = folly_sorted_vector_map__Map__i64_string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_template_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_map_template

    @property
    def map_template(self):
        return self.map_template_impl()

    cdef inline typedef_list_template_impl(self):
        if self.__fbthrift_cached_typedef_list_template is None:
            self.__fbthrift_cached_typedef_list_template = std_list__List__i32__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_list_template_ref().ref())
        return self.__fbthrift_cached_typedef_list_template

    @property
    def typedef_list_template(self):
        return self.typedef_list_template_impl()

    cdef inline typedef_deque_template_impl(self):
        if self.__fbthrift_cached_typedef_deque_template is None:
            self.__fbthrift_cached_typedef_deque_template = std_deque__List__string__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_deque_template_ref().ref())
        return self.__fbthrift_cached_typedef_deque_template

    @property
    def typedef_deque_template(self):
        return self.typedef_deque_template_impl()

    cdef inline typedef_set_template_impl(self):
        if self.__fbthrift_cached_typedef_set_template is None:
            self.__fbthrift_cached_typedef_set_template = folly_sorted_vector_set__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_set_template_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_typedef_set_template

    @property
    def typedef_set_template(self):
        return self.typedef_set_template_impl()

    cdef inline typedef_map_template_impl(self):
        if self.__fbthrift_cached_typedef_map_template is None:
            self.__fbthrift_cached_typedef_map_template = folly_sorted_vector_map__Map__i64_string._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).typedef_map_template_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_typedef_map_template

    @property
    def typedef_map_template(self):
        return self.typedef_map_template_impl()

    cdef inline indirection_a_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_a_ref().value()

    @property
    def indirection_a(self):
        return self.indirection_a_impl()

    cdef inline indirection_b_impl(self):
        if self.__fbthrift_cached_indirection_b is None:
            self.__fbthrift_cached_indirection_b = List__Bar__double__from_cpp(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_b_ref().ref())
        return self.__fbthrift_cached_indirection_b

    @property
    def indirection_b(self):
        return self.indirection_b_impl()

    cdef inline indirection_c_impl(self):
        if self.__fbthrift_cached_indirection_c is None:
            self.__fbthrift_cached_indirection_c = Set__Baz__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).indirection_c_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_indirection_c

    @property
    def indirection_c(self):
        return self.indirection_c_impl()

    cdef inline iobuf_type_val_impl(self):
        if self.__fbthrift_cached_iobuf_type_val is None:
            self.__fbthrift_cached_iobuf_type_val = _fbthrift_iobuf.IOBuf.create(ptr_address(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_type_val_ref().ref()), self)
        return self.__fbthrift_cached_iobuf_type_val

    @property
    def iobuf_type_val(self):
        return self.iobuf_type_val_impl()

    cdef inline iobuf_ptr_val_impl(self):
        if self.__fbthrift_cached_iobuf_ptr_val is None:
            if not deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_val_ref().value():
                return None
            self.__fbthrift_cached_iobuf_ptr_val = _fbthrift_iobuf.IOBuf.create(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).iobuf_ptr_val_ref().value().get(), self)
        return self.__fbthrift_cached_iobuf_ptr_val

    @property
    def iobuf_ptr_val(self):
        return self.iobuf_ptr_val_impl()

    cdef inline struct_struct_impl(self):
        if self.__fbthrift_cached_struct_struct is None:
            self.__fbthrift_cached_struct_struct = containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).struct_struct_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_struct_struct

    @property
    def struct_struct(self):
        return self.struct_struct_impl()


    def __hash__(AnnotatedStruct self):
        return super().__hash__()

    def __repr__(AnnotatedStruct self):
        return super().__repr__()

    def __str__(AnnotatedStruct self):
        return super().__str__()


    def __copy__(AnnotatedStruct self):
        raise TypeError("AnnotatedStruct is noncopyable")

    def __eq__(AnnotatedStruct self, other):
        if not isinstance(other, AnnotatedStruct):
            return False
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get()) == deref((<AnnotatedStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())

    def __ne__(AnnotatedStruct self, other):
        if not isinstance(other, AnnotatedStruct):
            return True
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE) != deref((<AnnotatedStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__AnnotatedStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cAnnotatedStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.AnnotatedStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cAnnotatedStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 40

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(AnnotatedStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cAnnotatedStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(AnnotatedStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAnnotatedStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cAnnotatedStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.AnnotatedStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.AnnotatedStruct, self)

@__cython.auto_pickle(False)
cdef class ComplexContainerStruct(thrift.py3.types.Struct):
    def __init__(ComplexContainerStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cComplexContainerStruct]()
        self._fields_setter = _fbthrift_types_fields.__ComplexContainerStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(ComplexContainerStruct self, **kwargs):
        if not kwargs:
            return self
        cdef ComplexContainerStruct __fbthrift_inst = ComplexContainerStruct.__new__(ComplexContainerStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cComplexContainerStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__ComplexContainerStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("ComplexContainerStruct", {
          "map_of_iobufs": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_of_iobufs_ref().has_value(),
          "map_of_iobuf_ptrs": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_of_iobuf_ptrs_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cComplexContainerStruct] cpp_obj):
        __fbthrift_inst = <ComplexContainerStruct>ComplexContainerStruct.__new__(ComplexContainerStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline map_of_iobufs_impl(self):
        if self.__fbthrift_cached_map_of_iobufs is None:
            self.__fbthrift_cached_map_of_iobufs = Map__string_folly_IOBuf__binary._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_of_iobufs_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_map_of_iobufs

    @property
    def map_of_iobufs(self):
        return self.map_of_iobufs_impl()

    cdef inline map_of_iobuf_ptrs_impl(self):
        if self.__fbthrift_cached_map_of_iobuf_ptrs is None:
            self.__fbthrift_cached_map_of_iobuf_ptrs = Map__string_std_unique_ptr_folly_IOBuf__binary._create_FBTHRIFT_ONLY_DO_NOT_USE(__reference_shared_ptr(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).map_of_iobuf_ptrs_ref().ref(), self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        return self.__fbthrift_cached_map_of_iobuf_ptrs

    @property
    def map_of_iobuf_ptrs(self):
        return self.map_of_iobuf_ptrs_impl()


    def __hash__(ComplexContainerStruct self):
        return super().__hash__()

    def __repr__(ComplexContainerStruct self):
        return super().__repr__()

    def __str__(ComplexContainerStruct self):
        return super().__str__()


    def __copy__(ComplexContainerStruct self):
        cdef shared_ptr[_module_cbindings.cComplexContainerStruct] cpp_obj = make_shared[_module_cbindings.cComplexContainerStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return ComplexContainerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cComplexContainerStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<ComplexContainerStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__ComplexContainerStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cComplexContainerStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.ComplexContainerStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cComplexContainerStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 2

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ComplexContainerStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cComplexContainerStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(ComplexContainerStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cComplexContainerStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cComplexContainerStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.ComplexContainerStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.ComplexContainerStruct, self)

@__cython.auto_pickle(False)
cdef class FloatStruct(thrift.py3.types.Struct):
    def __init__(FloatStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cFloatStruct]()
        self._fields_setter = _fbthrift_types_fields.__FloatStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(FloatStruct self, **kwargs):
        if not kwargs:
            return self
        cdef FloatStruct __fbthrift_inst = FloatStruct.__new__(FloatStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cFloatStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__FloatStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("FloatStruct", {
          "floatField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).floatField_ref().has_value(),
          "doubleField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).doubleField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cFloatStruct] cpp_obj):
        __fbthrift_inst = <FloatStruct>FloatStruct.__new__(FloatStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline floatField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).floatField_ref().value()

    @property
    def floatField(self):
        return self.floatField_impl()

    cdef inline doubleField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).doubleField_ref().value()

    @property
    def doubleField(self):
        return self.doubleField_impl()


    def __hash__(FloatStruct self):
        return super().__hash__()

    def __repr__(FloatStruct self):
        return super().__repr__()

    def __str__(FloatStruct self):
        return super().__str__()


    def __copy__(FloatStruct self):
        cdef shared_ptr[_module_cbindings.cFloatStruct] cpp_obj = make_shared[_module_cbindings.cFloatStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return FloatStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cFloatStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<FloatStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__FloatStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cFloatStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.FloatStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cFloatStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 2

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(FloatStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cFloatStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(FloatStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cFloatStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cFloatStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.FloatStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.FloatStruct, self)



@__cython.auto_pickle(False)
cdef class FloatUnion(thrift.py3.types.Union):
    Type = __FloatUnionType

    def __init__(
        self, *,
        floatSide=None,
        doubleSide=None
    ):
        if floatSide is not None:
            if not isinstance(floatSide, (float, int)):
                raise TypeError(f'floatSide is not a { float !r}.')

        if doubleSide is not None:
            if not isinstance(doubleSide, (float, int)):
                raise TypeError(f'doubleSide is not a { float !r}.')

        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = __to_shared_ptr(cmove(FloatUnion._make_instance(
          NULL,
          floatSide,
          doubleSide,
        )))
        self._load_cache()

    @staticmethod
    def fromValue(value):
        if value is None:
            return FloatUnion()
        if isinstance(value, float):
            if not isinstance(value, pbool):
                try:
                    if <float>value != value:
                        raise OverflowError
                    return FloatUnion(floatSide=value)
                except OverflowError:
                    pass
        if isinstance(value, float):
            if not isinstance(value, pbool):
                try:
                    return FloatUnion(doubleSide=value)
                except OverflowError:
                    pass
        if isinstance(value, (float, int)):
            try:
                <float> value
                return FloatUnion(floatSide=value)
            except OverflowError:
                pass
        if isinstance(value, (float, int)):
            try:
                <double> value
                return FloatUnion(doubleSide=value)
            except OverflowError:
                pass
        raise ValueError(f"Unable to derive correct union field for value: {value}")

    @staticmethod
    cdef unique_ptr[_module_cbindings.cFloatUnion] _make_instance(
        _module_cbindings.cFloatUnion* base_instance,
        object floatSide,
        object doubleSide
    ) except *:
        cdef unique_ptr[_module_cbindings.cFloatUnion] c_inst = make_unique[_module_cbindings.cFloatUnion]()
        cdef bint any_set = False
        if floatSide is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_floatSide(floatSide)
            any_set = True
        if doubleSide is not None:
            if any_set:
                raise TypeError("At most one field may be set when initializing a union")
            deref(c_inst).set_doubleSide(doubleSide)
            any_set = True
        # in C++ you don't have to call move(), but this doesn't translate
        # into a C++ return statement, so you do here
        return cmove(c_inst)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cFloatUnion] cpp_obj):
        __fbthrift_inst = <FloatUnion>FloatUnion.__new__(FloatUnion)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        __fbthrift_inst._load_cache()
        return __fbthrift_inst

    @property
    def floatSide(self):
        if self.type.value != 1:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not floatSide')
        return self.value

    @property
    def doubleSide(self):
        if self.type.value != 2:
            raise AttributeError(f'Union contains a value of type {self.type.name}, not doubleSide')
        return self.value


    def __hash__(FloatUnion self):
        return  super().__hash__()

    cdef _load_cache(FloatUnion self):
        self.type = FloatUnion.Type(<int>(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).getType()))
        cdef int type = self.type.value
        if type == 0:    # Empty
            self.value = None
        elif type == 1:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_floatSide()
        elif type == 2:
            self.value = deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).get_doubleSide()

    def __copy__(FloatUnion self):
        cdef shared_ptr[_module_cbindings.cFloatUnion] cpp_obj = make_shared[_module_cbindings.cFloatUnion](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return FloatUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cFloatUnion](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<FloatUnion>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__FloatUnion()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cFloatUnion].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.FloatUnion"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cFloatUnion](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 2

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(FloatUnion self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cFloatUnion](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(FloatUnion self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cFloatUnion]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cFloatUnion](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        # force a cache reload since the underlying data's changed
        self._load_cache()
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.FloatUnion, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.FloatUnion, self)

@__cython.auto_pickle(False)
cdef class AllRequiredNoExceptMoveCtrStruct(thrift.py3.types.Struct):
    def __init__(AllRequiredNoExceptMoveCtrStruct self, **kwargs):
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct]()
        self._fields_setter = _fbthrift_types_fields.__AllRequiredNoExceptMoveCtrStruct_FieldsSetter._fbthrift_create(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        super().__init__(**kwargs)

    def __call__(AllRequiredNoExceptMoveCtrStruct self, **kwargs):
        if not kwargs:
            return self
        cdef AllRequiredNoExceptMoveCtrStruct __fbthrift_inst = AllRequiredNoExceptMoveCtrStruct.__new__(AllRequiredNoExceptMoveCtrStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
        __fbthrift_inst._fields_setter = _fbthrift_types_fields.__AllRequiredNoExceptMoveCtrStruct_FieldsSetter._fbthrift_create(__fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get())
        for __fbthrift_name, _fbthrift_value in kwargs.items():
            __fbthrift_inst._fbthrift_set_field(__fbthrift_name, _fbthrift_value)
        return __fbthrift_inst

    cdef void _fbthrift_set_field(self, str name, object value) except *:
        self._fields_setter.set_field(name.encode("utf-8"), value)

    cdef object _fbthrift_isset(self):
        return _fbthrift_IsSet("AllRequiredNoExceptMoveCtrStruct", {
          "intField": deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).intField_ref().has_value(),
        })

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct] cpp_obj):
        __fbthrift_inst = <AllRequiredNoExceptMoveCtrStruct>AllRequiredNoExceptMoveCtrStruct.__new__(AllRequiredNoExceptMoveCtrStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(cpp_obj)
        return __fbthrift_inst

    cdef inline intField_impl(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).intField_ref().value()

    @property
    def intField(self):
        return self.intField_impl()


    def __hash__(AllRequiredNoExceptMoveCtrStruct self):
        return super().__hash__()

    def __repr__(AllRequiredNoExceptMoveCtrStruct self):
        return super().__repr__()

    def __str__(AllRequiredNoExceptMoveCtrStruct self):
        return super().__str__()


    def __copy__(AllRequiredNoExceptMoveCtrStruct self):
        cdef shared_ptr[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct] cpp_obj = make_shared[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return AllRequiredNoExceptMoveCtrStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __richcmp__(self, other, int op):
        r = self._fbthrift_cmp_sametype(other, op)
        return __richcmp[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<AllRequiredNoExceptMoveCtrStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ) if r is None else r

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__AllRequiredNoExceptMoveCtrStruct()

    @staticmethod
    def __get_metadata__():
        cdef __fbthrift_cThriftMetadata meta
        _module_cbindings.StructMetadata[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct].gen(meta)
        return __MetadataBox.box(cmove(meta))

    @staticmethod
    def __get_thrift_name__():
        return "module.AllRequiredNoExceptMoveCtrStruct"

    @classmethod
    def _fbthrift_get_field_name_by_index(cls, idx):
        return __sv_to_str(__get_field_name_by_index[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](idx))

    @classmethod
    def _fbthrift_get_struct_size(cls):
        return 1

    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(AllRequiredNoExceptMoveCtrStruct self, __Protocol proto):
        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
        with nogil:
            data = cmove(serializer.cserialize[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto))
        return _fbthrift_iobuf.from_unique_ptr(cmove(data))

    cdef cuint32_t _fbthrift_deserialize(AllRequiredNoExceptMoveCtrStruct self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
        cdef cuint32_t needed
        self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = make_shared[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct]()
        with nogil:
            needed = serializer.cdeserialize[_module_cbindings.cAllRequiredNoExceptMoveCtrStruct](buf, self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), proto)
        return needed


    def _to_python(self):
        import importlib
        import thrift.python.converter
        python_types = importlib.import_module(
            "module.thrift_types"
        )
        return thrift.python.converter.to_python_struct(python_types.AllRequiredNoExceptMoveCtrStruct, self)

    def _to_py3(self):
        return self

    def _to_py_deprecated(self):
        import importlib
        import thrift.util.converter
        py_deprecated_types = importlib.import_module("module.ttypes")
        return thrift.util.converter.to_py_struct(py_deprecated_types.AllRequiredNoExceptMoveCtrStruct, self)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_i64(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_i64):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_i64> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_i64__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,cint64_t]] c_items):
        __fbthrift_inst = <Map__string_i64>Map__string_i64.__new__(Map__string_i64)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_i64 self):
        cdef shared_ptr[cmap[string,cint64_t]] cpp_obj = make_shared[cmap[string,cint64_t]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_i64._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef cint64_t citem = 0
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return citem

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint64_t]] itr = __map_iter[cmap[string,cint64_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint64_t]] itr = __map_iter[cmap[string,cint64_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint64_t]] itr = __map_iter[cmap[string,cint64_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef cint64_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), citem)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_i64()

Mapping.register(Map__string_i64)

cdef shared_ptr[cmap[string,cint64_t]] Map__string_i64__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,cint64_t]] c_inst = make_shared[cmap[string,cint64_t]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint64_t> item

            deref(c_inst)[key.encode('UTF-8')] = item
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__Empty_MyStruct(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__Empty_MyStruct):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__Empty_MyStruct> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__Empty_MyStruct__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] c_items):
        __fbthrift_inst = <Map__Empty_MyStruct>Map__Empty_MyStruct.__new__(Map__Empty_MyStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__Empty_MyStruct self):
        cdef shared_ptr[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] cpp_obj = make_shared[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__Empty_MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, Empty):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef _module_cbindings.cEmpty ckey = deref((<Empty>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[_module_cbindings.cMyStruct] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] itr = __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.cEmpty] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Empty._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef _module_cbindings.cEmpty ckey = deref((<Empty>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] itr = __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.cMyStruct] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] itr = __map_iter[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.cEmpty] ckey
        cdef shared_ptr[_module_cbindings.cMyStruct] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (Empty._create_FBTHRIFT_ONLY_DO_NOT_USE(ckey), MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__Empty_MyStruct()

Mapping.register(Map__Empty_MyStruct)

cdef shared_ptr[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] Map__Empty_MyStruct__make_instance(object items) except *:
    cdef shared_ptr[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] c_inst = make_shared[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, Empty):
                raise TypeError(f"{key!r} is not of type Empty")
            if not isinstance(item, MyStruct):
                raise TypeError(f"{item!r} is not of type MyStruct")

            deref(c_inst)[deref((<Empty>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)] = deref((<MyStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
    return cmove(c_inst)



cdef vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] List__Map__Empty_MyStruct__make_instance(object items) except *:
    cdef vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Mapping[Empty, MyStruct]")
            if not isinstance(item, Map__Empty_MyStruct):
                item = Map__Empty_MyStruct(item)
            c_inst.push_back(deref((<Map__Empty_MyStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Map__Empty_MyStruct__from_cpp(const vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Map__Empty_MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]](c_vec[idx])))
    return List__Map__Empty_MyStruct(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]] List__List__Map__Empty_MyStruct__make_instance(object items) except *:
    cdef vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Sequence[_typing.Mapping[Empty, MyStruct]]")
            if not isinstance(item, List__Map__Empty_MyStruct):
                item = List__Map__Empty_MyStruct(item)
            c_inst.push_back(List__Map__Empty_MyStruct__make_instance(item))
    return cmove(c_inst)

cdef object List__List__Map__Empty_MyStruct__from_cpp(const vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(List__Map__Empty_MyStruct__from_cpp(c_vec[idx]))
    return List__List__Map__Empty_MyStruct(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]] List__List__List__Map__Empty_MyStruct__make_instance(object items) except *:
    cdef vector[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Sequence[_typing.Sequence[_typing.Mapping[Empty, MyStruct]]]")
            if not isinstance(item, List__List__Map__Empty_MyStruct):
                item = List__List__Map__Empty_MyStruct(item)
            c_inst.push_back(List__List__Map__Empty_MyStruct__make_instance(item))
    return cmove(c_inst)

cdef object List__List__List__Map__Empty_MyStruct__from_cpp(const vector[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(List__List__Map__Empty_MyStruct__from_cpp(c_vec[idx]))
    return List__List__List__Map__Empty_MyStruct(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[_module_cbindings.cMyEnumA] List__MyEnumA__make_instance(object items) except *:
    cdef vector[_module_cbindings.cMyEnumA] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, MyEnumA):
                raise TypeError(f"{item!r} is not of type MyEnumA")
            c_inst.push_back(<_module_cbindings.cMyEnumA><int>item)
    return cmove(c_inst)

cdef object List__MyEnumA__from_cpp(const vector[_module_cbindings.cMyEnumA]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(translate_cpp_enum_to_python(MyEnumA, <int> c_vec[idx]))
    return List__MyEnumA(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Set__MyStruct(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__MyStruct):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__MyStruct> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__MyStruct__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[_module_cbindings.cMyStruct]] c_items):
        __fbthrift_inst = <Set__MyStruct>Set__MyStruct.__new__(Set__MyStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__MyStruct self):
        cdef shared_ptr[cset[_module_cbindings.cMyStruct]] cpp_obj = make_shared[cset[_module_cbindings.cMyStruct]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, MyStruct):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(deref((<MyStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[_module_cbindings.cMyStruct]] itr = __set_iter[cset[_module_cbindings.cMyStruct]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.cMyStruct] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__MyStruct):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__MyStruct> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__MyStruct):
            other = Set__MyStruct(other)
        cdef shared_ptr[cset[_module_cbindings.cMyStruct]] result
        return Set__MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[_module_cbindings.cMyStruct]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__MyStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__MyStruct()


Set.register(Set__MyStruct)

cdef shared_ptr[cset[_module_cbindings.cMyStruct]] Set__MyStruct__make_instance(object items) except *:
    cdef shared_ptr[cset[_module_cbindings.cMyStruct]] c_inst = make_shared[cset[_module_cbindings.cMyStruct]]()
    if items is not None:
        for item in items:
            if not isinstance(item, MyStruct):
                raise TypeError(f"{item!r} is not of type MyStruct")
            deref(c_inst).insert(deref((<MyStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)



cdef vector[_module_cbindings.cComplexUnion] List__ComplexUnion__make_instance(object items) except *:
    cdef vector[_module_cbindings.cComplexUnion] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, ComplexUnion):
                raise TypeError(f"{item!r} is not of type ComplexUnion")
            c_inst.push_back(deref((<ComplexUnion>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__ComplexUnion__from_cpp(const vector[_module_cbindings.cComplexUnion]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cComplexUnion](c_vec[idx])))
    return List__ComplexUnion(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[string] List__string__make_instance(object items) except *:
    cdef vector[string] c_inst
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.Sequence[str] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")
            c_inst.push_back(item.encode('UTF-8'))
    return cmove(c_inst)

cdef object List__string__from_cpp(const vector[string]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(__init_unicode_from_cpp(c_vec[idx]))
    return List__string(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Set__List__string(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__List__string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__List__string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__List__string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[vector[string]]] c_items):
        __fbthrift_inst = <Set__List__string>Set__List__string.__new__(Set__List__string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__List__string self):
        cdef shared_ptr[cset[vector[string]]] cpp_obj = make_shared[cset[vector[string]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__List__string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        try:
            if not isinstance(item, List__string):
                item = List__string(item)
        except Exception:
            return False
        if not isinstance(item, List__string):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(List__string__make_instance(item)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[vector[string]]] itr = __set_iter[cset[vector[string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[string] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__string__from_cpp(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__List__string):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__List__string> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__List__string):
            other = Set__List__string(other)
        cdef shared_ptr[cset[vector[string]]] result
        return Set__List__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[vector[string]]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__List__string>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__List__string()


Set.register(Set__List__string)

cdef shared_ptr[cset[vector[string]]] Set__List__string__make_instance(object items) except *:
    cdef shared_ptr[cset[vector[string]]] c_inst = make_shared[cset[vector[string]]]()
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of type _typing.Sequence[str]")
            if not isinstance(item, List__string):
                item = List__string(item)
            deref(c_inst).insert(List__string__make_instance(item))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__List__List__Map__Empty_MyStruct(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__List__List__Map__Empty_MyStruct):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__List__List__Map__Empty_MyStruct> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__List__List__Map__Empty_MyStruct__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] c_items):
        __fbthrift_inst = <Set__List__List__Map__Empty_MyStruct>Set__List__List__Map__Empty_MyStruct.__new__(Set__List__List__Map__Empty_MyStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__List__List__Map__Empty_MyStruct self):
        cdef shared_ptr[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] cpp_obj = make_shared[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__List__List__Map__Empty_MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        try:
            if not isinstance(item, List__List__Map__Empty_MyStruct):
                item = List__List__Map__Empty_MyStruct(item)
        except Exception:
            return False
        if not isinstance(item, List__List__Map__Empty_MyStruct):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(List__List__Map__Empty_MyStruct__make_instance(item)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] itr = __set_iter[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__List__Map__Empty_MyStruct__from_cpp(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__List__List__Map__Empty_MyStruct):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__List__List__Map__Empty_MyStruct> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__List__List__Map__Empty_MyStruct):
            other = Set__List__List__Map__Empty_MyStruct(other)
        cdef shared_ptr[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] result
        return Set__List__List__Map__Empty_MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__List__List__Map__Empty_MyStruct>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__List__List__Map__Empty_MyStruct()


Set.register(Set__List__List__Map__Empty_MyStruct)

cdef shared_ptr[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] Set__List__List__Map__Empty_MyStruct__make_instance(object items) except *:
    cdef shared_ptr[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]] c_inst = make_shared[cset[vector[vector[cmap[_module_cbindings.cEmpty,_module_cbindings.cMyStruct]]]]]()
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of type _typing.Sequence[_typing.Sequence[_typing.Mapping[Empty, MyStruct]]]")
            if not isinstance(item, List__List__Map__Empty_MyStruct):
                item = List__List__Map__Empty_MyStruct(item)
            deref(c_inst).insert(List__List__Map__Empty_MyStruct__make_instance(item))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__i32_List__string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__i32_List__string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__i32_List__string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__i32_List__string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[cint32_t,vector[string]]] c_items):
        __fbthrift_inst = <Map__i32_List__string>Map__i32_List__string.__new__(Map__i32_List__string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__i32_List__string self):
        cdef shared_ptr[cmap[cint32_t,vector[string]]] cpp_obj = make_shared[cmap[cint32_t,vector[string]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__i32_List__string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, int):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cint32_t ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef vector[string] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return List__string__from_cpp(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,vector[string]]] itr = __map_iter[cmap[cint32_t,vector[string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cint32_t ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,vector[string]]] itr = __map_iter[cmap[cint32_t,vector[string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[string] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__string__from_cpp(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,vector[string]]] itr = __map_iter[cmap[cint32_t,vector[string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t ckey = 0
        cdef vector[string] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, List__string__from_cpp(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__i32_List__string()

Mapping.register(Map__i32_List__string)

cdef shared_ptr[cmap[cint32_t,vector[string]]] Map__i32_List__string__make_instance(object items) except *:
    cdef shared_ptr[cmap[cint32_t,vector[string]]] c_inst = make_shared[cmap[cint32_t,vector[string]]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, int):
                raise TypeError(f"{key!r} is not of type int")
            key = <cint32_t> key
            if item is None:
                raise TypeError("None is not of type _typing.Sequence[str]")
            if not isinstance(item, List__string):
                item = List__string(item)

            deref(c_inst)[key] = List__string__make_instance(item)
    return cmove(c_inst)



cdef vector[cbool] List__bool__make_instance(object items) except *:
    cdef vector[cbool] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, bool):
                raise TypeError(f"{item!r} is not of type bool")
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object List__bool__from_cpp(const vector[cbool]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(c_vec[idx])
    return List__bool(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[cint32_t] List__i32__make_instance(object items) except *:
    cdef vector[cint32_t] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object List__i32__from_cpp(const vector[cint32_t]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(c_vec[idx])
    return List__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[vector[cint32_t]] List__List__i32__make_instance(object items) except *:
    cdef vector[vector[cint32_t]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Sequence[int]")
            if not isinstance(item, List__i32):
                item = List__i32(item)
            c_inst.push_back(List__i32__make_instance(item))
    return cmove(c_inst)

cdef object List__List__i32__from_cpp(const vector[vector[cint32_t]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(List__i32__from_cpp(c_vec[idx]))
    return List__List__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[vector[vector[cint32_t]]] List__List__List__i32__make_instance(object items) except *:
    cdef vector[vector[vector[cint32_t]]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Sequence[_typing.Sequence[int]]")
            if not isinstance(item, List__List__i32):
                item = List__List__i32(item)
            c_inst.push_back(List__List__i32__make_instance(item))
    return cmove(c_inst)

cdef object List__List__List__i32__from_cpp(const vector[vector[vector[cint32_t]]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(List__List__i32__from_cpp(c_vec[idx]))
    return List__List__List__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[vector[vector[vector[cint32_t]]]] List__List__List__List__i32__make_instance(object items) except *:
    cdef vector[vector[vector[vector[cint32_t]]]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Sequence[_typing.Sequence[_typing.Sequence[int]]]")
            if not isinstance(item, List__List__List__i32):
                item = List__List__List__i32(item)
            c_inst.push_back(List__List__List__i32__make_instance(item))
    return cmove(c_inst)

cdef object List__List__List__List__i32__from_cpp(const vector[vector[vector[vector[cint32_t]]]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(List__List__List__i32__from_cpp(c_vec[idx]))
    return List__List__List__List__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Set__List__i32(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__List__i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__List__i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__List__i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[vector[cint32_t]]] c_items):
        __fbthrift_inst = <Set__List__i32>Set__List__i32.__new__(Set__List__i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__List__i32 self):
        cdef shared_ptr[cset[vector[cint32_t]]] cpp_obj = make_shared[cset[vector[cint32_t]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        try:
            if not isinstance(item, List__i32):
                item = List__i32(item)
        except Exception:
            return False
        if not isinstance(item, List__i32):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(List__i32__make_instance(item)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[vector[cint32_t]]] itr = __set_iter[cset[vector[cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[cint32_t] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__i32__from_cpp(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__List__i32):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__List__i32> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__List__i32):
            other = Set__List__i32(other)
        cdef shared_ptr[cset[vector[cint32_t]]] result
        return Set__List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[vector[cint32_t]]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__List__i32>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__List__i32()


Set.register(Set__List__i32)

cdef shared_ptr[cset[vector[cint32_t]]] Set__List__i32__make_instance(object items) except *:
    cdef shared_ptr[cset[vector[cint32_t]]] c_inst = make_shared[cset[vector[cint32_t]]]()
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of type _typing.Sequence[int]")
            if not isinstance(item, List__i32):
                item = List__i32(item)
            deref(c_inst).insert(List__i32__make_instance(item))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__string(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[string]] c_items):
        __fbthrift_inst = <Set__string>Set__string.__new__(Set__string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__string self):
        cdef shared_ptr[cset[string]] cpp_obj = make_shared[cset[string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, str):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item.encode('UTF-8')))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[string]] itr = __set_iter[cset[string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__string):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__string> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__string):
            other = Set__string(other)
        cdef shared_ptr[cset[string]] result
        return Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[string]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__string>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__string()


Set.register(Set__string)

cdef shared_ptr[cset[string]] Set__string__make_instance(object items) except *:
    cdef shared_ptr[cset[string]] c_inst = make_shared[cset[string]]()
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.AbstractSet[str] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")
            deref(c_inst).insert(item.encode('UTF-8'))
    return cmove(c_inst)



cdef vector[cset[string]] List__Set__string__make_instance(object items) except *:
    cdef vector[cset[string]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.AbstractSet[str]")
            if not isinstance(item, Set__string):
                item = Set__string(item)
            c_inst.push_back(deref((<Set__string>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Set__string__from_cpp(const vector[cset[string]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[string]](c_vec[idx])))
    return List__Set__string(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__List__Set__string_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__List__Set__string_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__List__Set__string_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__List__Set__string_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[vector[cset[string]],string]] c_items):
        __fbthrift_inst = <Map__List__Set__string_string>Map__List__Set__string_string.__new__(Map__List__Set__string_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__List__Set__string_string self):
        cdef shared_ptr[cmap[vector[cset[string]],string]] cpp_obj = make_shared[cmap[vector[cset[string]],string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, List__Set__string):
            return key
        try:
            return List__Set__string(key)
        except:
            pass

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef vector[cset[string]] ckey = List__Set__string__make_instance(key)
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef string citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return bytes(citem).decode('UTF-8')

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[vector[cset[string]],string]] itr = __map_iter[cmap[vector[cset[string]],string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[cset[string]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__Set__string__from_cpp(citem)

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef vector[cset[string]] ckey = List__Set__string__make_instance(key)
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[vector[cset[string]],string]] itr = __map_iter[cmap[vector[cset[string]],string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[vector[cset[string]],string]] itr = __map_iter[cmap[vector[cset[string]],string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[cset[string]] ckey
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (List__Set__string__from_cpp(ckey), bytes(citem).decode('UTF-8'))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__List__Set__string_string()

Mapping.register(Map__List__Set__string_string)

cdef shared_ptr[cmap[vector[cset[string]],string]] Map__List__Set__string_string__make_instance(object items) except *:
    cdef shared_ptr[cmap[vector[cset[string]],string]] c_inst = make_shared[cmap[vector[cset[string]],string]]()
    if items is not None:
        for key, item in items.items():
            if key is None:
                raise TypeError("None is not of type _typing.Sequence[_typing.AbstractSet[str]]")
            if not isinstance(key, List__Set__string):
                key = List__Set__string(key)
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")

            deref(c_inst)[List__Set__string__make_instance(key)] = item.encode('UTF-8')
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__Set__List__i32_Map__List__Set__string_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__Set__List__i32_Map__List__Set__string_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__Set__List__i32_Map__List__Set__string_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__Set__List__i32_Map__List__Set__string_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] c_items):
        __fbthrift_inst = <Map__Set__List__i32_Map__List__Set__string_string>Map__Set__List__i32_Map__List__Set__string_string.__new__(Map__Set__List__i32_Map__List__Set__string_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__Set__List__i32_Map__List__Set__string_string self):
        cdef shared_ptr[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] cpp_obj = make_shared[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__Set__List__i32_Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, Set__List__i32):
            return key
        try:
            return Set__List__i32(key)
        except:
            pass

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cset[vector[cint32_t]] ckey = deref((<Set__List__i32>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[cmap[vector[cset[string]],string]] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] itr = __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cset[vector[cint32_t]]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Set__List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cset[vector[cint32_t]] ckey = deref((<Set__List__i32>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] itr = __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cmap[vector[cset[string]],string]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] itr = __map_iter[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cset[vector[cint32_t]]] ckey
        cdef shared_ptr[cmap[vector[cset[string]],string]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (Set__List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(ckey), Map__List__Set__string_string._create_FBTHRIFT_ONLY_DO_NOT_USE(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__Set__List__i32_Map__List__Set__string_string()

Mapping.register(Map__Set__List__i32_Map__List__Set__string_string)

cdef shared_ptr[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] Map__Set__List__i32_Map__List__Set__string_string__make_instance(object items) except *:
    cdef shared_ptr[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]] c_inst = make_shared[cmap[cset[vector[cint32_t]],cmap[vector[cset[string]],string]]]()
    if items is not None:
        for key, item in items.items():
            if key is None:
                raise TypeError("None is not of type _typing.AbstractSet[_typing.Sequence[int]]")
            if not isinstance(key, Set__List__i32):
                key = Set__List__i32(key)
            if item is None:
                raise TypeError("None is not of type _typing.Mapping[_typing.Sequence[_typing.AbstractSet[str]], str]")
            if not isinstance(item, Map__List__Set__string_string):
                item = Map__List__Set__string_string(item)

            deref(c_inst)[deref((<Set__List__i32>key)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)] = deref((<Map__List__Set__string_string>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
    return cmove(c_inst)



cdef vector[string] List__binary__make_instance(object items) except *:
    cdef vector[string] c_inst
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.Sequence[bytes] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, bytes):
                raise TypeError(f"{item!r} is not of type bytes")
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object List__binary__from_cpp(const vector[string]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(bytes(<string>c_vec[idx]))
    return List__binary(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__MyEnumA_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__MyEnumA_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__MyEnumA_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__MyEnumA_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[_module_cbindings.cMyEnumA,string]] c_items):
        __fbthrift_inst = <Map__MyEnumA_string>Map__MyEnumA_string.__new__(Map__MyEnumA_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__MyEnumA_string self):
        cdef shared_ptr[cmap[_module_cbindings.cMyEnumA,string]] cpp_obj = make_shared[cmap[_module_cbindings.cMyEnumA,string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__MyEnumA_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, MyEnumA):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef _module_cbindings.cMyEnumA ckey = <_module_cbindings.cMyEnumA><int>key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef string citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return bytes(citem).decode('UTF-8')

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cMyEnumA,string]] itr = __map_iter[cmap[_module_cbindings.cMyEnumA,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.cMyEnumA citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield translate_cpp_enum_to_python(MyEnumA, <int> citem)

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef _module_cbindings.cMyEnumA ckey = <_module_cbindings.cMyEnumA><int>key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cMyEnumA,string]] itr = __map_iter[cmap[_module_cbindings.cMyEnumA,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.cMyEnumA,string]] itr = __map_iter[cmap[_module_cbindings.cMyEnumA,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.cMyEnumA ckey
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (translate_cpp_enum_to_python(MyEnumA, <int> ckey), bytes(citem).decode('UTF-8'))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__MyEnumA_string()

Mapping.register(Map__MyEnumA_string)

cdef shared_ptr[cmap[_module_cbindings.cMyEnumA,string]] Map__MyEnumA_string__make_instance(object items) except *:
    cdef shared_ptr[cmap[_module_cbindings.cMyEnumA,string]] c_inst = make_shared[cmap[_module_cbindings.cMyEnumA,string]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, MyEnumA):
                raise TypeError(f"{key!r} is not of type MyEnumA")
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")

            deref(c_inst)[<_module_cbindings.cMyEnumA><int>key] = item.encode('UTF-8')
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__i64(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__i64):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__i64> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__i64__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[cint64_t]] c_items):
        __fbthrift_inst = <Set__i64>Set__i64.__new__(Set__i64)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__i64 self):
        cdef shared_ptr[cset[cint64_t]] cpp_obj = make_shared[cset[cint64_t]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__i64._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, int):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[cint64_t]] itr = __set_iter[cset[cint64_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__i64):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__i64> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__i64):
            other = Set__i64(other)
        cdef shared_ptr[cset[cint64_t]] result
        return Set__i64._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[cint64_t]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__i64>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__i64()


Set.register(Set__i64)

cdef shared_ptr[cset[cint64_t]] Set__i64__make_instance(object items) except *:
    cdef shared_ptr[cset[cint64_t]] c_inst = make_shared[cset[cint64_t]]()
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint64_t> item
            deref(c_inst).insert(item)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_i32(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,cint32_t]] c_items):
        __fbthrift_inst = <Map__string_i32>Map__string_i32.__new__(Map__string_i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_i32 self):
        cdef shared_ptr[cmap[string,cint32_t]] cpp_obj = make_shared[cmap[string,cint32_t]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef cint32_t citem = 0
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return citem

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint32_t]] itr = __map_iter[cmap[string,cint32_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint32_t]] itr = __map_iter[cmap[string,cint32_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cint32_t]] itr = __map_iter[cmap[string,cint32_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef cint32_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), citem)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_i32()

Mapping.register(Map__string_i32)

cdef shared_ptr[cmap[string,cint32_t]] Map__string_i32__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,cint32_t]] c_inst = make_shared[cmap[string,cint32_t]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item

            deref(c_inst)[key.encode('UTF-8')] = item
    return cmove(c_inst)



cdef vector[_module_cbindings.cSimpleUnion] List__SimpleUnion__make_instance(object items) except *:
    cdef vector[_module_cbindings.cSimpleUnion] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, SimpleUnion):
                raise TypeError(f"{item!r} is not of type SimpleUnion")
            c_inst.push_back(deref((<SimpleUnion>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__SimpleUnion__from_cpp(const vector[_module_cbindings.cSimpleUnion]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cSimpleUnion](c_vec[idx])))
    return List__SimpleUnion(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Set__SimpleUnion(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__SimpleUnion):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__SimpleUnion> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__SimpleUnion__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[_module_cbindings.cSimpleUnion]] c_items):
        __fbthrift_inst = <Set__SimpleUnion>Set__SimpleUnion.__new__(Set__SimpleUnion)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__SimpleUnion self):
        cdef shared_ptr[cset[_module_cbindings.cSimpleUnion]] cpp_obj = make_shared[cset[_module_cbindings.cSimpleUnion]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, SimpleUnion):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(deref((<SimpleUnion>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[_module_cbindings.cSimpleUnion]] itr = __set_iter[cset[_module_cbindings.cSimpleUnion]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.cSimpleUnion] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__SimpleUnion):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__SimpleUnion> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__SimpleUnion):
            other = Set__SimpleUnion(other)
        cdef shared_ptr[cset[_module_cbindings.cSimpleUnion]] result
        return Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[_module_cbindings.cSimpleUnion]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__SimpleUnion>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__SimpleUnion()


Set.register(Set__SimpleUnion)

cdef shared_ptr[cset[_module_cbindings.cSimpleUnion]] Set__SimpleUnion__make_instance(object items) except *:
    cdef shared_ptr[cset[_module_cbindings.cSimpleUnion]] c_inst = make_shared[cset[_module_cbindings.cSimpleUnion]]()
    if items is not None:
        for item in items:
            if not isinstance(item, SimpleUnion):
                raise TypeError(f"{item!r} is not of type SimpleUnion")
            deref(c_inst).insert(deref((<SimpleUnion>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)



cdef vector[cset[_module_cbindings.cSimpleUnion]] List__Set__SimpleUnion__make_instance(object items) except *:
    cdef vector[cset[_module_cbindings.cSimpleUnion]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.AbstractSet[SimpleUnion]")
            if not isinstance(item, Set__SimpleUnion):
                item = Set__SimpleUnion(item)
            c_inst.push_back(deref((<Set__SimpleUnion>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Set__SimpleUnion__from_cpp(const vector[cset[_module_cbindings.cSimpleUnion]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Set__SimpleUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[_module_cbindings.cSimpleUnion]](c_vec[idx])))
    return List__Set__SimpleUnion(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_bool(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_bool):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_bool> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_bool__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,cbool]] c_items):
        __fbthrift_inst = <Map__string_bool>Map__string_bool.__new__(Map__string_bool)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_bool self):
        cdef shared_ptr[cmap[string,cbool]] cpp_obj = make_shared[cmap[string,cbool]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_bool._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef cbool citem = False
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return citem

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cbool]] itr = __map_iter[cmap[string,cbool]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cbool]] itr = __map_iter[cmap[string,cbool]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cbool citem = False
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cbool]] itr = __map_iter[cmap[string,cbool]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef cbool citem = False
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), citem)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_bool()

Mapping.register(Map__string_bool)

cdef shared_ptr[cmap[string,cbool]] Map__string_bool__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,cbool]] c_inst = make_shared[cmap[string,cbool]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, bool):
                raise TypeError(f"{item!r} is not of type bool")

            deref(c_inst)[key.encode('UTF-8')] = item
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__i32(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[cint32_t]] c_items):
        __fbthrift_inst = <Set__i32>Set__i32.__new__(Set__i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__i32 self):
        cdef shared_ptr[cset[cint32_t]] cpp_obj = make_shared[cset[cint32_t]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, int):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[cint32_t]] itr = __set_iter[cset[cint32_t]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__i32):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__i32> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__i32):
            other = Set__i32(other)
        cdef shared_ptr[cset[cint32_t]] result
        return Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[cint32_t]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__i32>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__i32()


Set.register(Set__i32)

cdef shared_ptr[cset[cint32_t]] Set__i32__make_instance(object items) except *:
    cdef shared_ptr[cset[cint32_t]] c_inst = make_shared[cset[cint32_t]]()
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item
            deref(c_inst).insert(item)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_Map__string_i32(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_Map__string_i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_Map__string_i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_Map__string_i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,cmap[string,cint32_t]]] c_items):
        __fbthrift_inst = <Map__string_Map__string_i32>Map__string_Map__string_i32.__new__(Map__string_Map__string_i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_Map__string_i32 self):
        cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] cpp_obj = make_shared[cmap[string,cmap[string,cint32_t]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[cmap[string,cint32_t]] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cint32_t]]] itr = __map_iter[cmap[string,cmap[string,cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cint32_t]]] itr = __map_iter[cmap[string,cmap[string,cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cmap[string,cint32_t]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cint32_t]]] itr = __map_iter[cmap[string,cmap[string,cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef shared_ptr[cmap[string,cint32_t]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_Map__string_i32()

Mapping.register(Map__string_Map__string_i32)

cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] Map__string_Map__string_i32__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] c_inst = make_shared[cmap[string,cmap[string,cint32_t]]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if item is None:
                raise TypeError("None is not of type _typing.Mapping[str, int]")
            if not isinstance(item, Map__string_i32):
                item = Map__string_i32(item)

            deref(c_inst)[key.encode('UTF-8')] = deref((<Map__string_i32>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_Map__string_Map__string_i32(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_Map__string_Map__string_i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_Map__string_Map__string_i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_Map__string_Map__string_i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,cmap[string,cmap[string,cint32_t]]]] c_items):
        __fbthrift_inst = <Map__string_Map__string_Map__string_i32>Map__string_Map__string_Map__string_i32.__new__(Map__string_Map__string_Map__string_i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_Map__string_Map__string_i32 self):
        cdef shared_ptr[cmap[string,cmap[string,cmap[string,cint32_t]]]] cpp_obj = make_shared[cmap[string,cmap[string,cmap[string,cint32_t]]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]] itr = __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]] itr = __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]] itr = __map_iter[cmap[string,cmap[string,cmap[string,cint32_t]]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef shared_ptr[cmap[string,cmap[string,cint32_t]]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), Map__string_Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_Map__string_Map__string_i32()

Mapping.register(Map__string_Map__string_Map__string_i32)

cdef shared_ptr[cmap[string,cmap[string,cmap[string,cint32_t]]]] Map__string_Map__string_Map__string_i32__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,cmap[string,cmap[string,cint32_t]]]] c_inst = make_shared[cmap[string,cmap[string,cmap[string,cint32_t]]]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if item is None:
                raise TypeError("None is not of type _typing.Mapping[str, _typing.Mapping[str, int]]")
            if not isinstance(item, Map__string_Map__string_i32):
                item = Map__string_Map__string_i32(item)

            deref(c_inst)[key.encode('UTF-8')] = deref((<Map__string_Map__string_i32>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
    return cmove(c_inst)



cdef vector[cset[cint32_t]] List__Set__i32__make_instance(object items) except *:
    cdef vector[cset[cint32_t]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.AbstractSet[int]")
            if not isinstance(item, Set__i32):
                item = Set__i32(item)
            c_inst.push_back(deref((<Set__i32>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Set__i32__from_cpp(const vector[cset[cint32_t]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Set__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cset[cint32_t]](c_vec[idx])))
    return List__Set__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_List__i32(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_List__i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_List__i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_List__i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,vector[cint32_t]]] c_items):
        __fbthrift_inst = <Map__string_List__i32>Map__string_List__i32.__new__(Map__string_List__i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_List__i32 self):
        cdef shared_ptr[cmap[string,vector[cint32_t]]] cpp_obj = make_shared[cmap[string,vector[cint32_t]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_List__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef vector[cint32_t] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return List__i32__from_cpp(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,vector[cint32_t]]] itr = __map_iter[cmap[string,vector[cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,vector[cint32_t]]] itr = __map_iter[cmap[string,vector[cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef vector[cint32_t] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield List__i32__from_cpp(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,vector[cint32_t]]] itr = __map_iter[cmap[string,vector[cint32_t]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef vector[cint32_t] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), List__i32__from_cpp(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_List__i32()

Mapping.register(Map__string_List__i32)

cdef shared_ptr[cmap[string,vector[cint32_t]]] Map__string_List__i32__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,vector[cint32_t]]] c_inst = make_shared[cmap[string,vector[cint32_t]]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if item is None:
                raise TypeError("None is not of type _typing.Sequence[int]")
            if not isinstance(item, List__i32):
                item = List__i32(item)

            deref(c_inst)[key.encode('UTF-8')] = List__i32__make_instance(item)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__bool(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__bool):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__bool> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__bool__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[cbool]] c_items):
        __fbthrift_inst = <Set__bool>Set__bool.__new__(Set__bool)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__bool self):
        cdef shared_ptr[cset[cbool]] cpp_obj = make_shared[cset[cbool]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, bool):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[cbool]] itr = __set_iter[cset[cbool]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cbool citem = False
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__bool):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__bool> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__bool):
            other = Set__bool(other)
        cdef shared_ptr[cset[cbool]] result
        return Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[cbool]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__bool>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__bool()


Set.register(Set__bool)

cdef shared_ptr[cset[cbool]] Set__bool__make_instance(object items) except *:
    cdef shared_ptr[cset[cbool]] c_inst = make_shared[cset[cbool]]()
    if items is not None:
        for item in items:
            if not isinstance(item, bool):
                raise TypeError(f"{item!r} is not of type bool")
            deref(c_inst).insert(item)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__Set__bool(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__Set__bool):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__Set__bool> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__Set__bool__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[cset[cbool]]] c_items):
        __fbthrift_inst = <Set__Set__bool>Set__Set__bool.__new__(Set__Set__bool)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__Set__bool self):
        cdef shared_ptr[cset[cset[cbool]]] cpp_obj = make_shared[cset[cset[cbool]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        try:
            if not isinstance(item, Set__bool):
                item = Set__bool(item)
        except Exception:
            return False
        if not isinstance(item, Set__bool):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(deref((<Set__bool>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[cset[cbool]]] itr = __set_iter[cset[cset[cbool]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cset[cbool]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__Set__bool):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__Set__bool> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__Set__bool):
            other = Set__Set__bool(other)
        cdef shared_ptr[cset[cset[cbool]]] result
        return Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[cset[cbool]]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__Set__bool>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__Set__bool()


Set.register(Set__Set__bool)

cdef shared_ptr[cset[cset[cbool]]] Set__Set__bool__make_instance(object items) except *:
    cdef shared_ptr[cset[cset[cbool]]] c_inst = make_shared[cset[cset[cbool]]]()
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of type _typing.AbstractSet[bool]")
            if not isinstance(item, Set__bool):
                item = Set__bool(item)
            deref(c_inst).insert(deref((<Set__bool>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Set__Set__Set__bool(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__Set__Set__bool):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__Set__Set__bool> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__Set__Set__bool__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[cset[cset[cbool]]]] c_items):
        __fbthrift_inst = <Set__Set__Set__bool>Set__Set__Set__bool.__new__(Set__Set__Set__bool)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__Set__Set__bool self):
        cdef shared_ptr[cset[cset[cset[cbool]]]] cpp_obj = make_shared[cset[cset[cset[cbool]]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        try:
            if not isinstance(item, Set__Set__bool):
                item = Set__Set__bool(item)
        except Exception:
            return False
        if not isinstance(item, Set__Set__bool):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(deref((<Set__Set__bool>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[cset[cset[cbool]]]] itr = __set_iter[cset[cset[cset[cbool]]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[cset[cset[cbool]]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__Set__Set__bool):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__Set__Set__bool> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__Set__Set__bool):
            other = Set__Set__Set__bool(other)
        cdef shared_ptr[cset[cset[cset[cbool]]]] result
        return Set__Set__Set__bool._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[cset[cset[cbool]]]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__Set__Set__bool>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__Set__Set__bool()


Set.register(Set__Set__Set__bool)

cdef shared_ptr[cset[cset[cset[cbool]]]] Set__Set__Set__bool__make_instance(object items) except *:
    cdef shared_ptr[cset[cset[cset[cbool]]]] c_inst = make_shared[cset[cset[cset[cbool]]]]()
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of type _typing.AbstractSet[_typing.AbstractSet[bool]]")
            if not isinstance(item, Set__Set__bool):
                item = Set__Set__bool(item)
            deref(c_inst).insert(deref((<Set__Set__bool>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__Bar__double_Baz__i32(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__Bar__double_Baz__i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__Bar__double_Baz__i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__Bar__double_Baz__i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] c_items):
        __fbthrift_inst = <Map__Bar__double_Baz__i32>Map__Bar__double_Baz__i32.__new__(Map__Bar__double_Baz__i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__Bar__double_Baz__i32 self):
        cdef shared_ptr[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] cpp_obj = make_shared[cmap[_module_cbindings.Bar,_module_cbindings.Baz]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__Bar__double_Baz__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, float):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef _module_cbindings.Bar ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef _module_cbindings.Baz citem = 0
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return citem

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] itr = __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.Bar citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef _module_cbindings.Bar ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] itr = __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.Baz citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] itr = __map_iter[cmap[_module_cbindings.Bar,_module_cbindings.Baz]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.Bar ckey = 0
        cdef _module_cbindings.Baz citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, citem)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__Bar__double_Baz__i32()

Mapping.register(Map__Bar__double_Baz__i32)

cdef shared_ptr[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] Map__Bar__double_Baz__i32__make_instance(object items) except *:
    cdef shared_ptr[cmap[_module_cbindings.Bar,_module_cbindings.Baz]] c_inst = make_shared[cmap[_module_cbindings.Bar,_module_cbindings.Baz]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, (float, int)):
                raise TypeError(f"{key!r} is not of type float")
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item

            deref(c_inst)[key] = item
    return cmove(c_inst)



cdef _module_cbindings.folly_small_vector_int64_t_8 folly_small_vector_int64_t_8__List__i64__make_instance(object items) except *:
    cdef _module_cbindings.folly_small_vector_int64_t_8 c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint64_t> item
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object folly_small_vector_int64_t_8__List__i64__from_cpp(const _module_cbindings.folly_small_vector_int64_t_8& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(c_vec[idx])
    return folly_small_vector_int64_t_8__List__i64(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class folly_sorted_vector_set_std_string__Set__string(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, folly_sorted_vector_set_std_string__Set__string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<folly_sorted_vector_set_std_string__Set__string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = folly_sorted_vector_set_std_string__Set__string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.folly_sorted_vector_set_std_string] c_items):
        __fbthrift_inst = <folly_sorted_vector_set_std_string__Set__string>folly_sorted_vector_set_std_string__Set__string.__new__(folly_sorted_vector_set_std_string__Set__string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(folly_sorted_vector_set_std_string__Set__string self):
        cdef shared_ptr[_module_cbindings.folly_sorted_vector_set_std_string] cpp_obj = make_shared[_module_cbindings.folly_sorted_vector_set_std_string](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return folly_sorted_vector_set_std_string__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, str):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item.encode('UTF-8')))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[_module_cbindings.folly_sorted_vector_set_std_string] itr = __set_iter[_module_cbindings.folly_sorted_vector_set_std_string](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, folly_sorted_vector_set_std_string__Set__string):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<folly_sorted_vector_set_std_string__Set__string> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, folly_sorted_vector_set_std_string__Set__string):
            other = folly_sorted_vector_set_std_string__Set__string(other)
        cdef shared_ptr[_module_cbindings.folly_sorted_vector_set_std_string] result
        return folly_sorted_vector_set_std_string__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[_module_cbindings.folly_sorted_vector_set_std_string](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<folly_sorted_vector_set_std_string__Set__string>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__folly_sorted_vector_set_std_string__Set__string()


Set.register(folly_sorted_vector_set_std_string__Set__string)

cdef shared_ptr[_module_cbindings.folly_sorted_vector_set_std_string] folly_sorted_vector_set_std_string__Set__string__make_instance(object items) except *:
    cdef shared_ptr[_module_cbindings.folly_sorted_vector_set_std_string] c_inst = make_shared[_module_cbindings.folly_sorted_vector_set_std_string]()
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.AbstractSet[str] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")
            deref(c_inst).insert(item.encode('UTF-8'))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class FakeMap__Map__i64_double(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, FakeMap__Map__i64_double):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<FakeMap__Map__i64_double> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = FakeMap__Map__i64_double__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.FakeMap] c_items):
        __fbthrift_inst = <FakeMap__Map__i64_double>FakeMap__Map__i64_double.__new__(FakeMap__Map__i64_double)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(FakeMap__Map__i64_double self):
        cdef shared_ptr[_module_cbindings.FakeMap] cpp_obj = make_shared[_module_cbindings.FakeMap](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return FakeMap__Map__i64_double._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, int):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cint64_t ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef double citem = 0
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return citem

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.FakeMap] itr = __map_iter[_module_cbindings.FakeMap](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cint64_t ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.FakeMap] itr = __map_iter[_module_cbindings.FakeMap](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef double citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def items(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.FakeMap] itr = __map_iter[_module_cbindings.FakeMap](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t ckey = 0
        cdef double citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, citem)

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__FakeMap__Map__i64_double()

Mapping.register(FakeMap__Map__i64_double)

cdef shared_ptr[_module_cbindings.FakeMap] FakeMap__Map__i64_double__make_instance(object items) except *:
    cdef shared_ptr[_module_cbindings.FakeMap] c_inst = make_shared[_module_cbindings.FakeMap]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, int):
                raise TypeError(f"{key!r} is not of type int")
            key = <cint64_t> key
            if not isinstance(item, (float, int)):
                raise TypeError(f"{item!r} is not of type float")

            deref(c_inst)[key] = item
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class std_unordered_map_std_string_containerStruct__Map__string_containerStruct(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, std_unordered_map_std_string_containerStruct__Map__string_containerStruct):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<std_unordered_map_std_string_containerStruct__Map__string_containerStruct> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = std_unordered_map_std_string_containerStruct__Map__string_containerStruct__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.std_unordered_map_std_string_containerStruct] c_items):
        __fbthrift_inst = <std_unordered_map_std_string_containerStruct__Map__string_containerStruct>std_unordered_map_std_string_containerStruct__Map__string_containerStruct.__new__(std_unordered_map_std_string_containerStruct__Map__string_containerStruct)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(std_unordered_map_std_string_containerStruct__Map__string_containerStruct self):
        cdef shared_ptr[_module_cbindings.std_unordered_map_std_string_containerStruct] cpp_obj = make_shared[_module_cbindings.std_unordered_map_std_string_containerStruct](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return std_unordered_map_std_string_containerStruct__Map__string_containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[_module_cbindings.ccontainerStruct] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct] itr = __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct] itr = __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_module_cbindings.ccontainerStruct] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem)

    def items(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct] itr = __map_iter[_module_cbindings.std_unordered_map_std_string_containerStruct](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef shared_ptr[_module_cbindings.ccontainerStruct] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), containerStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(citem))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__std_unordered_map_std_string_containerStruct__Map__string_containerStruct()

Mapping.register(std_unordered_map_std_string_containerStruct__Map__string_containerStruct)

cdef shared_ptr[_module_cbindings.std_unordered_map_std_string_containerStruct] std_unordered_map_std_string_containerStruct__Map__string_containerStruct__make_instance(object items) except *:
    cdef shared_ptr[_module_cbindings.std_unordered_map_std_string_containerStruct] c_inst = make_shared[_module_cbindings.std_unordered_map_std_string_containerStruct]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, containerStruct):
                raise TypeError(f"{item!r} is not of type containerStruct")

            deref(c_inst)[key.encode('UTF-8')] = deref((<containerStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
    return cmove(c_inst)



cdef _module_cbindings.std_list[cint32_t] std_list__List__i32__make_instance(object items) except *:
    cdef _module_cbindings.std_list[cint32_t] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object std_list__List__i32__from_cpp(const _module_cbindings.std_list[cint32_t]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(c_vec[idx])
    return std_list__List__i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef _module_cbindings.std_deque[string] std_deque__List__string__make_instance(object items) except *:
    cdef _module_cbindings.std_deque[string] c_inst
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.Sequence[str] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")
            c_inst.push_back(item.encode('UTF-8'))
    return cmove(c_inst)

cdef object std_deque__List__string__from_cpp(const _module_cbindings.std_deque[string]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(__init_unicode_from_cpp(c_vec[idx]))
    return std_deque__List__string(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class folly_sorted_vector_set__Set__string(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, folly_sorted_vector_set__Set__string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<folly_sorted_vector_set__Set__string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = folly_sorted_vector_set__Set__string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.folly_sorted_vector_set[string]] c_items):
        __fbthrift_inst = <folly_sorted_vector_set__Set__string>folly_sorted_vector_set__Set__string.__new__(folly_sorted_vector_set__Set__string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(folly_sorted_vector_set__Set__string self):
        cdef shared_ptr[_module_cbindings.folly_sorted_vector_set[string]] cpp_obj = make_shared[_module_cbindings.folly_sorted_vector_set[string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return folly_sorted_vector_set__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, str):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item.encode('UTF-8')))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[_module_cbindings.folly_sorted_vector_set[string]] itr = __set_iter[_module_cbindings.folly_sorted_vector_set[string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, folly_sorted_vector_set__Set__string):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<folly_sorted_vector_set__Set__string> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, folly_sorted_vector_set__Set__string):
            other = folly_sorted_vector_set__Set__string(other)
        cdef shared_ptr[_module_cbindings.folly_sorted_vector_set[string]] result
        return folly_sorted_vector_set__Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[_module_cbindings.folly_sorted_vector_set[string]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<folly_sorted_vector_set__Set__string>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__folly_sorted_vector_set__Set__string()


Set.register(folly_sorted_vector_set__Set__string)

cdef shared_ptr[_module_cbindings.folly_sorted_vector_set[string]] folly_sorted_vector_set__Set__string__make_instance(object items) except *:
    cdef shared_ptr[_module_cbindings.folly_sorted_vector_set[string]] c_inst = make_shared[_module_cbindings.folly_sorted_vector_set[string]]()
    if items is not None:
        if isinstance(items, str):
            raise TypeError("If you really want to pass a string into a _typing.AbstractSet[str] field, explicitly convert it first.")
        for item in items:
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")
            deref(c_inst).insert(item.encode('UTF-8'))
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class folly_sorted_vector_map__Map__i64_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, folly_sorted_vector_map__Map__i64_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<folly_sorted_vector_map__Map__i64_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = folly_sorted_vector_map__Map__i64_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] c_items):
        __fbthrift_inst = <folly_sorted_vector_map__Map__i64_string>folly_sorted_vector_map__Map__i64_string.__new__(folly_sorted_vector_map__Map__i64_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(folly_sorted_vector_map__Map__i64_string self):
        cdef shared_ptr[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] cpp_obj = make_shared[_module_cbindings.folly_sorted_vector_map[cint64_t,string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return folly_sorted_vector_map__Map__i64_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, int):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cint64_t ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef string citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return bytes(citem).decode('UTF-8')

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] itr = __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cint64_t ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] itr = __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def items(self):
        if not self:
            return
        cdef __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] itr = __map_iter[_module_cbindings.folly_sorted_vector_map[cint64_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint64_t ckey = 0
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, bytes(citem).decode('UTF-8'))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__folly_sorted_vector_map__Map__i64_string()

Mapping.register(folly_sorted_vector_map__Map__i64_string)

cdef shared_ptr[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] folly_sorted_vector_map__Map__i64_string__make_instance(object items) except *:
    cdef shared_ptr[_module_cbindings.folly_sorted_vector_map[cint64_t,string]] c_inst = make_shared[_module_cbindings.folly_sorted_vector_map[cint64_t,string]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, int):
                raise TypeError(f"{key!r} is not of type int")
            key = <cint64_t> key
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")

            deref(c_inst)[key] = item.encode('UTF-8')
    return cmove(c_inst)



cdef vector[_module_cbindings.Bar] List__Bar__double__make_instance(object items) except *:
    cdef vector[_module_cbindings.Bar] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, (float, int)):
                raise TypeError(f"{item!r} is not of type float")
            c_inst.push_back(item)
    return cmove(c_inst)

cdef object List__Bar__double__from_cpp(const vector[_module_cbindings.Bar]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(c_vec[idx])
    return List__Bar__double(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Set__Baz__i32(thrift.py3.types.Set):
    def __init__(self, items=None):
        if isinstance(items, Set__Baz__i32):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Set__Baz__i32> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Set__Baz__i32__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cset[_module_cbindings.Baz]] c_items):
        __fbthrift_inst = <Set__Baz__i32>Set__Baz__i32.__new__(Set__Baz__i32)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Set__Baz__i32 self):
        cdef shared_ptr[cset[_module_cbindings.Baz]] cpp_obj = make_shared[cset[_module_cbindings.Baz]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Set__Baz__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    def __contains__(self, item):
        if not self or item is None:
            return False
        if not isinstance(item, int):
            return False
        return pbool(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).count(item))


    def __iter__(self):
        if not self:
            return
        cdef __set_iter[cset[_module_cbindings.Baz]] itr = __set_iter[cset[_module_cbindings.Baz]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef _module_cbindings.Baz citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNext(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __hash__(self):
        return super().__hash__()

    def __richcmp__(self, other, int op):
        if isinstance(other, Set__Baz__i32):
            # C level comparisons
            return __setcmp(
                self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                (<Set__Baz__i32> other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
                op,
            )
        return self._fbthrift_py_richcmp(other, op)

    cdef _fbthrift_do_set_op(self, other, __cSetOp op):
        if not isinstance(other, Set__Baz__i32):
            other = Set__Baz__i32(other)
        cdef shared_ptr[cset[_module_cbindings.Baz]] result
        return Set__Baz__i32._create_FBTHRIFT_ONLY_DO_NOT_USE(__set_op[cset[_module_cbindings.Baz]](
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            (<Set__Baz__i32>other)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE,
            op,
        ))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Set__Baz__i32()


Set.register(Set__Baz__i32)

cdef shared_ptr[cset[_module_cbindings.Baz]] Set__Baz__i32__make_instance(object items) except *:
    cdef shared_ptr[cset[_module_cbindings.Baz]] c_inst = make_shared[cset[_module_cbindings.Baz]]()
    if items is not None:
        for item in items:
            if not isinstance(item, int):
                raise TypeError(f"{item!r} is not of type int")
            item = <cint32_t> item
            deref(c_inst).insert(item)
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_folly_IOBuf__binary(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_folly_IOBuf__binary):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_folly_IOBuf__binary> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_folly_IOBuf__binary__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,_fbthrift_iobuf.cIOBuf]] c_items):
        __fbthrift_inst = <Map__string_folly_IOBuf__binary>Map__string_folly_IOBuf__binary.__new__(Map__string_folly_IOBuf__binary)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_folly_IOBuf__binary self):
        cdef shared_ptr[cmap[string,_fbthrift_iobuf.cIOBuf]] cpp_obj = make_shared[cmap[string,_fbthrift_iobuf.cIOBuf]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_folly_IOBuf__binary._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[_fbthrift_iobuf.cIOBuf] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return _fbthrift_iobuf.IOBuf.create(citem.get(), self)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]] itr = __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]] itr = __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[_fbthrift_iobuf.cIOBuf] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield _fbthrift_iobuf.IOBuf.create(citem.get(), self)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]] itr = __map_iter[cmap[string,_fbthrift_iobuf.cIOBuf]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef shared_ptr[_fbthrift_iobuf.cIOBuf] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), _fbthrift_iobuf.IOBuf.create(citem.get(), self))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_folly_IOBuf__binary()

Mapping.register(Map__string_folly_IOBuf__binary)

cdef shared_ptr[cmap[string,_fbthrift_iobuf.cIOBuf]] Map__string_folly_IOBuf__binary__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,_fbthrift_iobuf.cIOBuf]] c_inst = make_shared[cmap[string,_fbthrift_iobuf.cIOBuf]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, _fbthrift_iobuf.IOBuf):
                raise TypeError(f"{item!r} is not of type _fbthrift_iobuf.IOBuf")

            deref(c_inst)[key.encode('UTF-8')] = deref((<_fbthrift_iobuf.IOBuf?>item).c_clone())
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__string_std_unique_ptr_folly_IOBuf__binary(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__string_std_unique_ptr_folly_IOBuf__binary):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__string_std_unique_ptr_folly_IOBuf__binary> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__string_std_unique_ptr_folly_IOBuf__binary__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] c_items):
        __fbthrift_inst = <Map__string_std_unique_ptr_folly_IOBuf__binary>Map__string_std_unique_ptr_folly_IOBuf__binary.__new__(Map__string_std_unique_ptr_folly_IOBuf__binary)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__string_std_unique_ptr_folly_IOBuf__binary self):
        cdef shared_ptr[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] cpp_obj = make_shared[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__string_std_unique_ptr_folly_IOBuf__binary._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, str):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef string ckey = key.encode('UTF-8')
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef shared_ptr[unique_ptr[_fbthrift_iobuf.cIOBuf]] citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return _fbthrift_iobuf.IOBuf.create(citem.get().get(), self)

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] itr = __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef string ckey = key.encode('UTF-8')
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] itr = __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef shared_ptr[unique_ptr[_fbthrift_iobuf.cIOBuf]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield _fbthrift_iobuf.IOBuf.create(citem.get().get(), self)

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] itr = __map_iter[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string ckey
        cdef shared_ptr[unique_ptr[_fbthrift_iobuf.cIOBuf]] citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey.data().decode('UTF-8'), _fbthrift_iobuf.IOBuf.create(citem.get().get(), self))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__string_std_unique_ptr_folly_IOBuf__binary()

Mapping.register(Map__string_std_unique_ptr_folly_IOBuf__binary)

cdef shared_ptr[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] Map__string_std_unique_ptr_folly_IOBuf__binary__make_instance(object items) except *:
    cdef shared_ptr[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]] c_inst = make_shared[cmap[string,unique_ptr[_fbthrift_iobuf.cIOBuf]]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, str):
                raise TypeError(f"{key!r} is not of type str")
            if not isinstance(item, _fbthrift_iobuf.IOBuf):
                raise TypeError(f"{item!r} is not of type _fbthrift_iobuf.IOBuf")

            deref(c_inst)[key.encode('UTF-8')] = (<_fbthrift_iobuf.IOBuf?>item).c_clone()
    return cmove(c_inst)


@__cython.auto_pickle(False)
@__cython.final
cdef class Map__i32_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__i32_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__i32_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__i32_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[cint32_t,string]] c_items):
        __fbthrift_inst = <Map__i32_string>Map__i32_string.__new__(Map__i32_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__i32_string self):
        cdef shared_ptr[cmap[cint32_t,string]] cpp_obj = make_shared[cmap[cint32_t,string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__i32_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, int):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cint32_t ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef string citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return bytes(citem).decode('UTF-8')

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,string]] itr = __map_iter[cmap[cint32_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cint32_t ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,string]] itr = __map_iter[cmap[cint32_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[cint32_t,string]] itr = __map_iter[cmap[cint32_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint32_t ckey = 0
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, bytes(citem).decode('UTF-8'))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__i32_string()

Mapping.register(Map__i32_string)

cdef shared_ptr[cmap[cint32_t,string]] Map__i32_string__make_instance(object items) except *:
    cdef shared_ptr[cmap[cint32_t,string]] c_inst = make_shared[cmap[cint32_t,string]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, int):
                raise TypeError(f"{key!r} is not of type int")
            key = <cint32_t> key
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")

            deref(c_inst)[key] = item.encode('UTF-8')
    return cmove(c_inst)



cdef vector[cmap[string,cint32_t]] List__Map__string_i32__make_instance(object items) except *:
    cdef vector[cmap[string,cint32_t]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Mapping[str, int]")
            if not isinstance(item, Map__string_i32):
                item = Map__string_i32(item)
            c_inst.push_back(deref((<Map__string_i32>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Map__string_i32__from_cpp(const vector[cmap[string,cint32_t]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cmap[string,cint32_t]](c_vec[idx])))
    return List__Map__string_i32(py_list, thrift.py3.types._fbthrift_list_private_ctor)

@__cython.auto_pickle(False)
@__cython.final
cdef class Map__i16_string(thrift.py3.types.Map):
    def __init__(self, items=None):
        if isinstance(items, Map__i16_string):
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = (<Map__i16_string> items)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
        else:
            self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = Map__i16_string__make_instance(items)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[cint16_t,string]] c_items):
        __fbthrift_inst = <Map__i16_string>Map__i16_string.__new__(Map__i16_string)
        __fbthrift_inst._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE = cmove(c_items)
        return __fbthrift_inst

    def __copy__(Map__i16_string self):
        cdef shared_ptr[cmap[cint16_t,string]] cpp_obj = make_shared[cmap[cint16_t,string]](
            deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        )
        return Map__i16_string._create_FBTHRIFT_ONLY_DO_NOT_USE(cmove(cpp_obj))

    def __len__(self):
        return deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()

    cdef _check_key_type(self, key):
        if not self or key is None:
            return
        if isinstance(key, int):
            return key

    def __getitem__(self, key):
        err = KeyError(f'{key}')
        key = self._check_key_type(key)
        if key is None:
            raise err
        cdef cint16_t ckey = key
        if not __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey):
            raise err
        cdef string citem
        __map_getitem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
        return bytes(citem).decode('UTF-8')

    def __iter__(self):
        if not self:
            return
        cdef __map_iter[cmap[cint16_t,string]] itr = __map_iter[cmap[cint16_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint16_t citem = 0
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextKey(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield citem

    def __contains__(self, key):
        key = self._check_key_type(key)
        if key is None:
            return False
        cdef cint16_t ckey = key
        return __map_contains(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey)

    def values(self):
        if not self:
            return
        cdef __map_iter[cmap[cint16_t,string]] itr = __map_iter[cmap[cint16_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextValue(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, citem)
            yield bytes(citem).decode('UTF-8')

    def items(self):
        if not self:
            return
        cdef __map_iter[cmap[cint16_t,string]] itr = __map_iter[cmap[cint16_t,string]](self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE)
        cdef cint16_t ckey = 0
        cdef string citem
        for i in range(deref(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE).size()):
            itr.genNextItem(self._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE, ckey, citem)
            yield (ckey, bytes(citem).decode('UTF-8'))

    @staticmethod
    def __get_reflection__():
        return get_types_reflection().get_reflection__Map__i16_string()

Mapping.register(Map__i16_string)

cdef shared_ptr[cmap[cint16_t,string]] Map__i16_string__make_instance(object items) except *:
    cdef shared_ptr[cmap[cint16_t,string]] c_inst = make_shared[cmap[cint16_t,string]]()
    if items is not None:
        for key, item in items.items():
            if not isinstance(key, int):
                raise TypeError(f"{key!r} is not of type int")
            key = <cint16_t> key
            if not isinstance(item, str):
                raise TypeError(f"{item!r} is not of type str")

            deref(c_inst)[key] = item.encode('UTF-8')
    return cmove(c_inst)



cdef vector[cmap[cint16_t,string]] List__Map__i16_string__make_instance(object items) except *:
    cdef vector[cmap[cint16_t,string]] c_inst
    if items is not None:
        for item in items:
            if item is None:
                raise TypeError("None is not of the type _typing.Mapping[int, str]")
            if not isinstance(item, Map__i16_string):
                item = Map__i16_string(item)
            c_inst.push_back(deref((<Map__i16_string>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__Map__i16_string__from_cpp(const vector[cmap[cint16_t,string]]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(Map__i16_string._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[cmap[cint16_t,string]](c_vec[idx])))
    return List__Map__i16_string(py_list, thrift.py3.types._fbthrift_list_private_ctor)


cdef vector[_module_cbindings.cMyStruct] List__MyStruct__make_instance(object items) except *:
    cdef vector[_module_cbindings.cMyStruct] c_inst
    if items is not None:
        for item in items:
            if not isinstance(item, MyStruct):
                raise TypeError(f"{item!r} is not of type MyStruct")
            c_inst.push_back(deref((<MyStruct>item)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE))
    return cmove(c_inst)

cdef object List__MyStruct__from_cpp(const vector[_module_cbindings.cMyStruct]& c_vec) except *:
    cdef list py_list = []
    cdef int idx = 0
    for idx in range(c_vec.size()):
        py_list.append(MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(make_shared[_module_cbindings.cMyStruct](c_vec[idx])))
    return List__MyStruct(py_list, thrift.py3.types._fbthrift_list_private_ctor)


aBool = True
aByte = 1
a16BitInt = 12
a32BitInt = 123
a64BitInt = 1234
aFloat = 0.1
aDouble = 0.12
aString = _module_cbindings.caString().decode('UTF-8')
aList = List__bool__from_cpp(_module_cbindings.caList())
anEmptyMap = Map__string_i32._create_FBTHRIFT_ONLY_DO_NOT_USE(constant_shared_ptr(_module_cbindings.canEmptyMap()))
aMap = Map__i32_string._create_FBTHRIFT_ONLY_DO_NOT_USE(constant_shared_ptr(_module_cbindings.caMap()))
aSet = Set__string._create_FBTHRIFT_ONLY_DO_NOT_USE(constant_shared_ptr(_module_cbindings.caSet()))
aListOfLists = List__List__i32__from_cpp(_module_cbindings.caListOfLists())
states = List__Map__string_i32__from_cpp(_module_cbindings.cstates())
AConstList = List__MyEnumA__from_cpp(_module_cbindings.cAConstList())
AnIntegerEnum2 = 2
ListOfIntsFromEnums = List__i32__from_cpp(_module_cbindings.cListOfIntsFromEnums())
constEnumA = MyEnumA(<int> (_module_cbindings.cconstEnumA()))
constEnumB = MyEnumA(<int> (_module_cbindings.cconstEnumB()))
AStruct = _includes_types.AStruct
simpleTypeDef = int
containerTypeDef = Map__i16_string
complexContainerTypeDef = List__Map__i16_string
unionTypeDef = Set__SimpleUnion
structTypeDef = List__MyStruct
complexStructTypeDef = List__Map__Empty_MyStruct
mostComplexTypeDef = List__List__Map__Empty_MyStruct
IndirectionA = int
IndirectionC = int
IndirectionB = float
IndirectionD = str
HashedTypedef = Map__MyEnumA_string
CppFakeI32 = int
FollySmallVectorI64 = folly_small_vector_int64_t_8__List__i64
SortedVectorSetString = folly_sorted_vector_set_std_string__Set__string
FakeMap = FakeMap__Map__i64_double
UnorderedMapStruct = std_unordered_map_std_string_containerStruct__Map__string_containerStruct
std_list = std_list__List__i32
std_deque = std_deque__List__string
folly_set = folly_sorted_vector_set__Set__string
folly_map = folly_sorted_vector_map__Map__i64_string
IOBuf = _fbthrift_iobuf.IOBuf
IOBufPtr = _fbthrift_iobuf.IOBuf
