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

from libc.stdint cimport (
    int8_t as cint8_t,
    int16_t as cint16_t,
    int32_t as cint32_t,
    int64_t as cint64_t,
    uint16_t as cuint16_t,
    uint32_t as cuint32_t,
)
from libcpp.string cimport string
from libcpp cimport bool as cbool, nullptr, nullptr_t
from cpython cimport bool as pbool
from libcpp.memory cimport shared_ptr, unique_ptr
from libcpp.vector cimport vector
from libcpp.set cimport set as cset
from libcpp.map cimport map as cmap, pair as cpair
from libcpp.unordered_map cimport unordered_map as cumap
cimport folly.iobuf as _fbthrift_iobuf
from thrift.python.exceptions cimport cTException
from thrift.py3.types cimport (
    bstring,
    field_ref as __field_ref,
    optional_field_ref as __optional_field_ref,
    required_field_ref as __required_field_ref,
    terse_field_ref as __terse_field_ref,
    union_field_ref as __union_field_ref,
    get_union_field_value as __get_union_field_value,
)
from thrift.python.common cimport cThriftMetadata as __fbthrift_cThriftMetadata
cimport thrift.py3.exceptions
cimport thrift.py3.types
from thrift.python.common cimport (
    RpcOptions as __RpcOptions,
    MetadataBox as __MetadataBox,
)
from folly.optional cimport cOptional as __cOptional


cimport module.types as _fbthrift_types
cimport module.types_fields as _fbthrift_types_fields
cimport module.cbindings as _module_cbindings

cdef extern from "thrift/compiler/test/fixtures/complex-union/gen-py3/module/types.h":
  pass



cdef class ComplexUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cComplexUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(ComplexUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cComplexUnion] _make_instance(
        _module_cbindings.cComplexUnion* base_instance,
        object intValue,
        str stringValue,
        object intListValue,
        object stringListValue,
        object typedefValue,
        str stringRef
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cComplexUnion])



cdef class ListUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cListUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(ListUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cListUnion] _make_instance(
        _module_cbindings.cListUnion* base_instance,
        object intListValue,
        object stringListValue
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cListUnion])



cdef class DataUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cDataUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(DataUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cDataUnion] _make_instance(
        _module_cbindings.cDataUnion* base_instance,
        bytes binaryData,
        str stringData
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cDataUnion])



cdef class Val(thrift.py3.types.Struct):
    cdef shared_ptr[_module_cbindings.cVal] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef _fbthrift_types_fields.__Val_FieldsSetter _fields_setter
    cdef inline object strVal_impl(self)
    cdef inline object intVal_impl(self)
    cdef inline object typedefValue_impl(self)
    cdef Map__i16_string __fbthrift_cached_typedefValue

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cVal])



cdef class ValUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cValUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(ValUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cValUnion] _make_instance(
        _module_cbindings.cValUnion* base_instance,
        Val v1,
        Val v2
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cValUnion])



cdef class VirtualComplexUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cVirtualComplexUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(VirtualComplexUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cVirtualComplexUnion] _make_instance(
        _module_cbindings.cVirtualComplexUnion* base_instance,
        str thingOne,
        str thingTwo
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cVirtualComplexUnion])



cdef class NonCopyableStruct(thrift.py3.types.Struct):
    cdef shared_ptr[_module_cbindings.cNonCopyableStruct] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef _fbthrift_types_fields.__NonCopyableStruct_FieldsSetter _fields_setter
    cdef inline object num_impl(self)

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cNonCopyableStruct])



cdef class NonCopyableUnion(thrift.py3.types.Union):
    cdef shared_ptr[_module_cbindings.cNonCopyableUnion] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    cdef readonly object type
    cdef readonly object value
    cdef _load_cache(NonCopyableUnion self)

    @staticmethod
    cdef unique_ptr[_module_cbindings.cNonCopyableUnion] _make_instance(
        _module_cbindings.cNonCopyableUnion* base_instance,
        NonCopyableStruct s
    ) except *

    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[_module_cbindings.cNonCopyableUnion])


cdef vector[cint64_t] List__i64__make_instance(object items) except *
cdef object List__i64__from_cpp(const vector[cint64_t]&) except *

cdef vector[string] List__string__make_instance(object items) except *
cdef object List__string__from_cpp(const vector[string]&) except *

cdef class Map__i16_string(thrift.py3.types.Map):
    cdef shared_ptr[cmap[cint16_t,string]] _cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE
    @staticmethod
    cdef _create_FBTHRIFT_ONLY_DO_NOT_USE(shared_ptr[cmap[cint16_t,string]])
    cdef _check_key_type(self, key)

cdef shared_ptr[cmap[cint16_t,string]] Map__i16_string__make_instance(object items) except *


