1#
2# Autogenerated by Thrift
3#
4# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5#  @generated
6#
7cimport cython as __cython
8from cpython.object cimport PyTypeObject, Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
9from libcpp.memory cimport shared_ptr, make_shared, unique_ptr, make_unique
10from libcpp.string cimport string
11from libcpp cimport bool as cbool
12from libcpp.iterator cimport inserter as cinserter
13from cpython cimport bool as pbool
14from cython.operator cimport dereference as deref, preincrement as inc, address as ptr_address
15import thrift.py3.types
16cimport thrift.py3.types
17cimport thrift.py3.exceptions
18from thrift.py3.std_libcpp cimport sv_to_str as __sv_to_str, string_view as __cstring_view
19from thrift.py3.types cimport (
20    cSetOp as __cSetOp,
21    richcmp as __richcmp,
22    set_op as __set_op,
23    setcmp as __setcmp,
24    list_index as __list_index,
25    list_count as __list_count,
26    list_slice as __list_slice,
27    list_getitem as __list_getitem,
28    set_iter as __set_iter,
29    map_iter as __map_iter,
30    map_contains as __map_contains,
31    map_getitem as __map_getitem,
32    reference_shared_ptr as __reference_shared_ptr,
33    get_field_name_by_index as __get_field_name_by_index,
34    reset_field as __reset_field,
35    translate_cpp_enum_to_python,
36    SetMetaClass as __SetMetaClass,
37    const_pointer_cast,
38    constant_shared_ptr,
39    NOTSET as __NOTSET,
40    EnumData as __EnumData,
41    EnumFlagsData as __EnumFlagsData,
42    UnionTypeEnumData as __UnionTypeEnumData,
43    createEnumDataForUnionType as __createEnumDataForUnionType,
44)
45cimport thrift.py3.std_libcpp as std_libcpp
46cimport thrift.py3.serializer as serializer
47import folly.iobuf as _fbthrift_iobuf
48from folly.optional cimport cOptional
49from folly.memory cimport to_shared_ptr as __to_shared_ptr
50from folly.range cimport Range as __cRange
51
52import sys
53from collections.abc import Sequence, Set, Mapping, Iterable
54import weakref as __weakref
55import builtins as _builtins
56
57cimport module.types_reflection as _types_reflection
58
59
60
61@__cython.auto_pickle(False)
62cdef class Fiery(thrift.py3.exceptions.GeneratedError):
63    def __init__(Fiery self, *args, **kwargs):
64        self._cpp_obj = make_shared[cFiery]()
65        self._fields_setter = _fbthrift_types_fields.__Fiery_FieldsSetter._fbthrift_create(self._cpp_obj.get())
66        super().__init__( *args, **kwargs)
67
68    cdef void _fbthrift_set_field(self, str name, object value) except *:
69        self._fields_setter.set_field(name.encode("utf-8"), value)
70
71    cdef object _fbthrift_isset(self):
72        return thrift.py3.types._IsSet("Fiery", {
73          "message": deref(self._cpp_obj).message_ref().has_value(),
74        })
75
76    @staticmethod
77    cdef _fbthrift_create(shared_ptr[cFiery] cpp_obj):
78        __fbthrift_inst = <Fiery>Fiery.__new__(Fiery, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
79        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
80        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
81        return __fbthrift_inst
82
83    cdef inline message_impl(self):
84
85        return (<bytes>deref(self._cpp_obj).message_ref().value()).decode('UTF-8')
86
87    @property
88    def message(self):
89        return self.message_impl()
90
91
92    def __hash__(Fiery self):
93        return super().__hash__()
94
95    def __repr__(Fiery self):
96        return super().__repr__()
97
98    def __str__(Fiery self):
99        field = self.message
100        if field is None:
101            return str(field)
102        return field
103
104
105    def __copy__(Fiery self):
106        cdef shared_ptr[cFiery] cpp_obj = make_shared[cFiery](
107            deref(self._cpp_obj)
108        )
109        return Fiery._fbthrift_create(cmove(cpp_obj))
110
111    def __richcmp__(self, other, int op):
112        r = self._fbthrift_cmp_sametype(other, op)
113        return __richcmp[cFiery](
114            self._cpp_obj,
115            (<Fiery>other)._cpp_obj,
116            op,
117        ) if r is None else r
118
119    @staticmethod
120    def __get_reflection__():
121        return _types_reflection.get_reflection__Fiery()
122
123    @staticmethod
124    def __get_metadata__():
125        cdef __fbthrift_cThriftMetadata meta
126        ExceptionMetadata[cFiery].gen(meta)
127        return __MetadataBox.box(cmove(meta))
128
129    @staticmethod
130    def __get_thrift_name__():
131        return "module.Fiery"
132
133    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
134        return __get_field_name_by_index[cFiery](idx)
135
136    def __cinit__(self):
137        self._fbthrift_struct_size = 1
138
139    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(Fiery self, __Protocol proto):
140        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
141        with nogil:
142            data = cmove(serializer.cserialize[cFiery](self._cpp_obj.get(), proto))
143        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
144
145    cdef cuint32_t _fbthrift_deserialize(Fiery self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
146        cdef cuint32_t needed
147        self._cpp_obj = make_shared[cFiery]()
148        with nogil:
149            needed = serializer.cdeserialize[cFiery](buf, self._cpp_obj.get(), proto)
150        return needed
151
152
153@__cython.auto_pickle(False)
154cdef class Serious(thrift.py3.exceptions.GeneratedError):
155    def __init__(Serious self, *args, **kwargs):
156        self._cpp_obj = make_shared[cSerious]()
157        self._fields_setter = _fbthrift_types_fields.__Serious_FieldsSetter._fbthrift_create(self._cpp_obj.get())
158        super().__init__( *args, **kwargs)
159
160    cdef void _fbthrift_set_field(self, str name, object value) except *:
161        self._fields_setter.set_field(name.encode("utf-8"), value)
162
163    cdef object _fbthrift_isset(self):
164        return thrift.py3.types._IsSet("Serious", {
165          "sonnet": deref(self._cpp_obj).sonnet_ref().has_value(),
166        })
167
168    @staticmethod
169    cdef _fbthrift_create(shared_ptr[cSerious] cpp_obj):
170        __fbthrift_inst = <Serious>Serious.__new__(Serious, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
171        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
172        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
173        return __fbthrift_inst
174
175    cdef inline sonnet_impl(self):
176        if not deref(self._cpp_obj).sonnet_ref().has_value():
177            return None
178
179        return (<bytes>deref(self._cpp_obj).sonnet_ref().value_unchecked()).decode('UTF-8')
180
181    @property
182    def sonnet(self):
183        return self.sonnet_impl()
184
185
186    def __hash__(Serious self):
187        return super().__hash__()
188
189    def __repr__(Serious self):
190        return super().__repr__()
191
192    def __str__(Serious self):
193        field = self.sonnet
194        if field is None:
195            return str(field)
196        return field
197
198
199    def __copy__(Serious self):
200        cdef shared_ptr[cSerious] cpp_obj = make_shared[cSerious](
201            deref(self._cpp_obj)
202        )
203        return Serious._fbthrift_create(cmove(cpp_obj))
204
205    def __richcmp__(self, other, int op):
206        r = self._fbthrift_cmp_sametype(other, op)
207        return __richcmp[cSerious](
208            self._cpp_obj,
209            (<Serious>other)._cpp_obj,
210            op,
211        ) if r is None else r
212
213    @staticmethod
214    def __get_reflection__():
215        return _types_reflection.get_reflection__Serious()
216
217    @staticmethod
218    def __get_metadata__():
219        cdef __fbthrift_cThriftMetadata meta
220        ExceptionMetadata[cSerious].gen(meta)
221        return __MetadataBox.box(cmove(meta))
222
223    @staticmethod
224    def __get_thrift_name__():
225        return "module.Serious"
226
227    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
228        return __get_field_name_by_index[cSerious](idx)
229
230    def __cinit__(self):
231        self._fbthrift_struct_size = 1
232
233    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(Serious self, __Protocol proto):
234        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
235        with nogil:
236            data = cmove(serializer.cserialize[cSerious](self._cpp_obj.get(), proto))
237        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
238
239    cdef cuint32_t _fbthrift_deserialize(Serious self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
240        cdef cuint32_t needed
241        self._cpp_obj = make_shared[cSerious]()
242        with nogil:
243            needed = serializer.cdeserialize[cSerious](buf, self._cpp_obj.get(), proto)
244        return needed
245
246
247@__cython.auto_pickle(False)
248cdef class ComplexFieldNames(thrift.py3.exceptions.GeneratedError):
249    def __init__(ComplexFieldNames self, *args, **kwargs):
250        self._cpp_obj = make_shared[cComplexFieldNames]()
251        self._fields_setter = _fbthrift_types_fields.__ComplexFieldNames_FieldsSetter._fbthrift_create(self._cpp_obj.get())
252        super().__init__( *args, **kwargs)
253
254    cdef void _fbthrift_set_field(self, str name, object value) except *:
255        self._fields_setter.set_field(name.encode("utf-8"), value)
256
257    cdef object _fbthrift_isset(self):
258        return thrift.py3.types._IsSet("ComplexFieldNames", {
259          "error_message": deref(self._cpp_obj).error_message_ref().has_value(),
260          "internal_error_message": deref(self._cpp_obj).internal_error_message_ref().has_value(),
261        })
262
263    @staticmethod
264    cdef _fbthrift_create(shared_ptr[cComplexFieldNames] cpp_obj):
265        __fbthrift_inst = <ComplexFieldNames>ComplexFieldNames.__new__(ComplexFieldNames, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
266        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
267        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
268        return __fbthrift_inst
269
270    cdef inline error_message_impl(self):
271
272        return (<bytes>deref(self._cpp_obj).error_message_ref().value()).decode('UTF-8')
273
274    @property
275    def error_message(self):
276        return self.error_message_impl()
277
278    cdef inline internal_error_message_impl(self):
279
280        return (<bytes>deref(self._cpp_obj).internal_error_message_ref().value()).decode('UTF-8')
281
282    @property
283    def internal_error_message(self):
284        return self.internal_error_message_impl()
285
286
287    def __hash__(ComplexFieldNames self):
288        return super().__hash__()
289
290    def __repr__(ComplexFieldNames self):
291        return super().__repr__()
292
293    def __str__(ComplexFieldNames self):
294        field = self.internal_error_message
295        if field is None:
296            return str(field)
297        return field
298
299
300    def __copy__(ComplexFieldNames self):
301        cdef shared_ptr[cComplexFieldNames] cpp_obj = make_shared[cComplexFieldNames](
302            deref(self._cpp_obj)
303        )
304        return ComplexFieldNames._fbthrift_create(cmove(cpp_obj))
305
306    def __richcmp__(self, other, int op):
307        r = self._fbthrift_cmp_sametype(other, op)
308        return __richcmp[cComplexFieldNames](
309            self._cpp_obj,
310            (<ComplexFieldNames>other)._cpp_obj,
311            op,
312        ) if r is None else r
313
314    @staticmethod
315    def __get_reflection__():
316        return _types_reflection.get_reflection__ComplexFieldNames()
317
318    @staticmethod
319    def __get_metadata__():
320        cdef __fbthrift_cThriftMetadata meta
321        ExceptionMetadata[cComplexFieldNames].gen(meta)
322        return __MetadataBox.box(cmove(meta))
323
324    @staticmethod
325    def __get_thrift_name__():
326        return "module.ComplexFieldNames"
327
328    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
329        return __get_field_name_by_index[cComplexFieldNames](idx)
330
331    def __cinit__(self):
332        self._fbthrift_struct_size = 2
333
334    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ComplexFieldNames self, __Protocol proto):
335        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
336        with nogil:
337            data = cmove(serializer.cserialize[cComplexFieldNames](self._cpp_obj.get(), proto))
338        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
339
340    cdef cuint32_t _fbthrift_deserialize(ComplexFieldNames self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
341        cdef cuint32_t needed
342        self._cpp_obj = make_shared[cComplexFieldNames]()
343        with nogil:
344            needed = serializer.cdeserialize[cComplexFieldNames](buf, self._cpp_obj.get(), proto)
345        return needed
346
347
348@__cython.auto_pickle(False)
349cdef class CustomFieldNames(thrift.py3.exceptions.GeneratedError):
350    def __init__(CustomFieldNames self, *args, **kwargs):
351        self._cpp_obj = make_shared[cCustomFieldNames]()
352        self._fields_setter = _fbthrift_types_fields.__CustomFieldNames_FieldsSetter._fbthrift_create(self._cpp_obj.get())
353        super().__init__( *args, **kwargs)
354
355    cdef void _fbthrift_set_field(self, str name, object value) except *:
356        self._fields_setter.set_field(name.encode("utf-8"), value)
357
358    cdef object _fbthrift_isset(self):
359        return thrift.py3.types._IsSet("CustomFieldNames", {
360          "error_message": deref(self._cpp_obj).error_message_ref().has_value(),
361          "internal_error_message": deref(self._cpp_obj).internal_error_message_ref().has_value(),
362        })
363
364    @staticmethod
365    cdef _fbthrift_create(shared_ptr[cCustomFieldNames] cpp_obj):
366        __fbthrift_inst = <CustomFieldNames>CustomFieldNames.__new__(CustomFieldNames, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
367        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
368        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
369        return __fbthrift_inst
370
371    cdef inline error_message_impl(self):
372
373        return (<bytes>deref(self._cpp_obj).error_message_ref().value()).decode('UTF-8')
374
375    @property
376    def error_message(self):
377        return self.error_message_impl()
378
379    cdef inline internal_error_message_impl(self):
380
381        return (<bytes>deref(self._cpp_obj).internal_error_message_ref().value()).decode('UTF-8')
382
383    @property
384    def internal_error_message(self):
385        return self.internal_error_message_impl()
386
387
388    def __hash__(CustomFieldNames self):
389        return super().__hash__()
390
391    def __repr__(CustomFieldNames self):
392        return super().__repr__()
393
394    def __str__(CustomFieldNames self):
395        field = self.internal_error_message
396        if field is None:
397            return str(field)
398        return field
399
400
401    def __copy__(CustomFieldNames self):
402        cdef shared_ptr[cCustomFieldNames] cpp_obj = make_shared[cCustomFieldNames](
403            deref(self._cpp_obj)
404        )
405        return CustomFieldNames._fbthrift_create(cmove(cpp_obj))
406
407    def __richcmp__(self, other, int op):
408        r = self._fbthrift_cmp_sametype(other, op)
409        return __richcmp[cCustomFieldNames](
410            self._cpp_obj,
411            (<CustomFieldNames>other)._cpp_obj,
412            op,
413        ) if r is None else r
414
415    @staticmethod
416    def __get_reflection__():
417        return _types_reflection.get_reflection__CustomFieldNames()
418
419    @staticmethod
420    def __get_metadata__():
421        cdef __fbthrift_cThriftMetadata meta
422        ExceptionMetadata[cCustomFieldNames].gen(meta)
423        return __MetadataBox.box(cmove(meta))
424
425    @staticmethod
426    def __get_thrift_name__():
427        return "module.CustomFieldNames"
428
429    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
430        return __get_field_name_by_index[cCustomFieldNames](idx)
431
432    def __cinit__(self):
433        self._fbthrift_struct_size = 2
434
435    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(CustomFieldNames self, __Protocol proto):
436        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
437        with nogil:
438            data = cmove(serializer.cserialize[cCustomFieldNames](self._cpp_obj.get(), proto))
439        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
440
441    cdef cuint32_t _fbthrift_deserialize(CustomFieldNames self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
442        cdef cuint32_t needed
443        self._cpp_obj = make_shared[cCustomFieldNames]()
444        with nogil:
445            needed = serializer.cdeserialize[cCustomFieldNames](buf, self._cpp_obj.get(), proto)
446        return needed
447
448
449@__cython.auto_pickle(False)
450cdef class ExceptionWithPrimitiveField(thrift.py3.exceptions.GeneratedError):
451    def __init__(ExceptionWithPrimitiveField self, *args, **kwargs):
452        self._cpp_obj = make_shared[cExceptionWithPrimitiveField]()
453        self._fields_setter = _fbthrift_types_fields.__ExceptionWithPrimitiveField_FieldsSetter._fbthrift_create(self._cpp_obj.get())
454        super().__init__( *args, **kwargs)
455
456    cdef void _fbthrift_set_field(self, str name, object value) except *:
457        self._fields_setter.set_field(name.encode("utf-8"), value)
458
459    cdef object _fbthrift_isset(self):
460        return thrift.py3.types._IsSet("ExceptionWithPrimitiveField", {
461          "message": deref(self._cpp_obj).message_ref().has_value(),
462          "error_code": deref(self._cpp_obj).error_code_ref().has_value(),
463        })
464
465    @staticmethod
466    cdef _fbthrift_create(shared_ptr[cExceptionWithPrimitiveField] cpp_obj):
467        __fbthrift_inst = <ExceptionWithPrimitiveField>ExceptionWithPrimitiveField.__new__(ExceptionWithPrimitiveField, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
468        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
469        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
470        return __fbthrift_inst
471
472    cdef inline message_impl(self):
473
474        return (<bytes>deref(self._cpp_obj).message_ref().value()).decode('UTF-8')
475
476    @property
477    def message(self):
478        return self.message_impl()
479
480    cdef inline error_code_impl(self):
481
482        return deref(self._cpp_obj).error_code_ref().value()
483
484    @property
485    def error_code(self):
486        return self.error_code_impl()
487
488
489    def __hash__(ExceptionWithPrimitiveField self):
490        return super().__hash__()
491
492    def __repr__(ExceptionWithPrimitiveField self):
493        return super().__repr__()
494
495    def __str__(ExceptionWithPrimitiveField self):
496        field = self.message
497        if field is None:
498            return str(field)
499        return field
500
501
502    def __copy__(ExceptionWithPrimitiveField self):
503        cdef shared_ptr[cExceptionWithPrimitiveField] cpp_obj = make_shared[cExceptionWithPrimitiveField](
504            deref(self._cpp_obj)
505        )
506        return ExceptionWithPrimitiveField._fbthrift_create(cmove(cpp_obj))
507
508    def __richcmp__(self, other, int op):
509        r = self._fbthrift_cmp_sametype(other, op)
510        return __richcmp[cExceptionWithPrimitiveField](
511            self._cpp_obj,
512            (<ExceptionWithPrimitiveField>other)._cpp_obj,
513            op,
514        ) if r is None else r
515
516    @staticmethod
517    def __get_reflection__():
518        return _types_reflection.get_reflection__ExceptionWithPrimitiveField()
519
520    @staticmethod
521    def __get_metadata__():
522        cdef __fbthrift_cThriftMetadata meta
523        ExceptionMetadata[cExceptionWithPrimitiveField].gen(meta)
524        return __MetadataBox.box(cmove(meta))
525
526    @staticmethod
527    def __get_thrift_name__():
528        return "module.ExceptionWithPrimitiveField"
529
530    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
531        return __get_field_name_by_index[cExceptionWithPrimitiveField](idx)
532
533    def __cinit__(self):
534        self._fbthrift_struct_size = 2
535
536    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(ExceptionWithPrimitiveField self, __Protocol proto):
537        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
538        with nogil:
539            data = cmove(serializer.cserialize[cExceptionWithPrimitiveField](self._cpp_obj.get(), proto))
540        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
541
542    cdef cuint32_t _fbthrift_deserialize(ExceptionWithPrimitiveField self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
543        cdef cuint32_t needed
544        self._cpp_obj = make_shared[cExceptionWithPrimitiveField]()
545        with nogil:
546            needed = serializer.cdeserialize[cExceptionWithPrimitiveField](buf, self._cpp_obj.get(), proto)
547        return needed
548
549
550@__cython.auto_pickle(False)
551cdef class Banal(thrift.py3.exceptions.GeneratedError):
552    def __init__(Banal self, *args, **kwargs):
553        self._cpp_obj = make_shared[cBanal]()
554        self._fields_setter = _fbthrift_types_fields.__Banal_FieldsSetter._fbthrift_create(self._cpp_obj.get())
555        super().__init__( *args, **kwargs)
556
557    cdef void _fbthrift_set_field(self, str name, object value) except *:
558        self._fields_setter.set_field(name.encode("utf-8"), value)
559
560    cdef object _fbthrift_isset(self):
561        return thrift.py3.types._IsSet("Banal", {
562        })
563
564    @staticmethod
565    cdef _fbthrift_create(shared_ptr[cBanal] cpp_obj):
566        __fbthrift_inst = <Banal>Banal.__new__(Banal, (<bytes>deref(cpp_obj).what()).decode('utf-8'))
567        __fbthrift_inst._cpp_obj = cmove(cpp_obj)
568        _builtins.Exception.__init__(__fbthrift_inst, *(v for _, v in __fbthrift_inst))
569        return __fbthrift_inst
570
571
572    def __hash__(Banal self):
573        return super().__hash__()
574
575    def __repr__(Banal self):
576        return super().__repr__()
577
578    def __str__(Banal self):
579        return super().__str__()
580
581
582    def __copy__(Banal self):
583        cdef shared_ptr[cBanal] cpp_obj = make_shared[cBanal](
584            deref(self._cpp_obj)
585        )
586        return Banal._fbthrift_create(cmove(cpp_obj))
587
588    def __richcmp__(self, other, int op):
589        r = self._fbthrift_cmp_sametype(other, op)
590        return __richcmp[cBanal](
591            self._cpp_obj,
592            (<Banal>other)._cpp_obj,
593            op,
594        ) if r is None else r
595
596    @staticmethod
597    def __get_reflection__():
598        return _types_reflection.get_reflection__Banal()
599
600    @staticmethod
601    def __get_metadata__():
602        cdef __fbthrift_cThriftMetadata meta
603        ExceptionMetadata[cBanal].gen(meta)
604        return __MetadataBox.box(cmove(meta))
605
606    @staticmethod
607    def __get_thrift_name__():
608        return "module.Banal"
609
610    cdef __cstring_view _fbthrift_get_field_name_by_index(self, size_t idx):
611        return __get_field_name_by_index[cBanal](idx)
612
613    def __cinit__(self):
614        self._fbthrift_struct_size = 0
615
616    cdef _fbthrift_iobuf.IOBuf _fbthrift_serialize(Banal self, __Protocol proto):
617        cdef unique_ptr[_fbthrift_iobuf.cIOBuf] data
618        with nogil:
619            data = cmove(serializer.cserialize[cBanal](self._cpp_obj.get(), proto))
620        return _fbthrift_iobuf.from_unique_ptr(cmove(data))
621
622    cdef cuint32_t _fbthrift_deserialize(Banal self, const _fbthrift_iobuf.cIOBuf* buf, __Protocol proto) except? 0:
623        cdef cuint32_t needed
624        self._cpp_obj = make_shared[cBanal]()
625        with nogil:
626            needed = serializer.cdeserialize[cBanal](buf, self._cpp_obj.get(), proto)
627        return needed
628
629
630