Example #1
0
        import importlib
        py_deprecated_types = importlib.import_module("hsmodule.ttypes")
        import thrift.util.converter
        return thrift.util.converter.to_py_struct(py_deprecated_types.HsFoo, self)

# This unfortunately has to be down here to prevent circular imports
import python_module_root.my.namespacing.test.hsmodule.thrift_metadata


def _fbthrift_metadata__struct_HsFoo():
    return python_module_root.my.namespacing.test.hsmodule.thrift_metadata.gen_metadata_struct_HsFoo()

_fbthrift_all_structs = [
    HsFoo,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)


class _fbthrift_HsTestService_init_args(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
        (
            1,  # id
            _fbthrift_python_types.FieldQualifier.Unqualified, # qualifier
            "int1",  # name
            _fbthrift_python_types.typeinfo_i64,  # typeinfo
            None,  # default value
            None,  # adapter class
        ),
    )

Example #2
0
    def _to_python(self):
        return self

    def _to_py3(self):
        import importlib
        py3_types = importlib.import_module("foo.types")
        import thrift.py3.converter
        return thrift.py3.converter.to_py3_struct(py3_types.Fields, self)

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


# This unfortunately has to be down here to prevent circular imports
import foo.thrift_metadata


def _fbthrift_metadata__struct_Fields():
    return foo.thrift_metadata.gen_metadata_struct_Fields()


_fbthrift_all_structs = [
    Fields,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)
Example #3
0
def _fbthrift_metadata__exception_CustomFieldNames():
    return module.thrift_metadata.gen_metadata_exception_CustomFieldNames()
def _fbthrift_metadata__exception_ExceptionWithPrimitiveField():
    return module.thrift_metadata.gen_metadata_exception_ExceptionWithPrimitiveField()
def _fbthrift_metadata__exception_Banal():
    return module.thrift_metadata.gen_metadata_exception_Banal()

_fbthrift_all_structs = [
    Fiery,
    Serious,
    ComplexFieldNames,
    CustomFieldNames,
    ExceptionWithPrimitiveField,
    Banal,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)


class _fbthrift_Raiser_doBland_args(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
    )


class _fbthrift_Raiser_doBland_result(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
    )


class _fbthrift_Raiser_doRaise_args(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
    )
Example #4
0
def _fbthrift_metadata__struct_MyStruct():
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_MyStruct(
    )


def _fbthrift_metadata__struct_MyUnion():
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_MyUnion(
    )


_fbthrift_all_structs = [
    MyStruct,
    MyUnion,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)


class _fbthrift_MyService_query_args(
        metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
        (
            1,  # id
            _fbthrift_python_types.FieldQualifier.Unqualified,  # qualifier
            "u",  # name
            lambda: _fbthrift_python_types.StructTypeInfo(MyUnion),  # typeinfo
            None,  # default value
            None,  # adapter class
        ), )

Example #5
0
#
# Autogenerated by Thrift
#
# DO NOT EDIT
#  @generated
#

from __future__ import annotations

import folly.iobuf as _fbthrift_iobuf
import thrift.python.types as _fbthrift_python_types
import thrift.python.exceptions as _fbthrift_python_exceptions

# This unfortunately has to be down here to prevent circular imports
import empty.thrift_metadata

_fbthrift_all_structs = []

_fbthrift_python_types.fill_specs()
Example #6
0
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_MyDataItem()
def _fbthrift_metadata__struct_MyUnion():
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_MyUnion()
def _fbthrift_metadata__struct_ReservedKeyword():
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_ReservedKeyword()
def _fbthrift_metadata__struct_UnionToBeRenamed():
    return test.fixtures.basic.module.thrift_metadata.gen_metadata_struct_UnionToBeRenamed()

_fbthrift_all_structs = [
    MyStruct,
    MyDataItem,
    MyUnion,
    ReservedKeyword,
    UnionToBeRenamed,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)


class _fbthrift_FooService_simple_rpc_args(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
    )


class _fbthrift_FooService_simple_rpc_result(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
    )


class _fbthrift_FB303Service_simple_rpc_args(metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
        (
Example #7
0
import module.thrift_metadata


def _fbthrift_metadata__exception_FooStreamEx():
    return module.thrift_metadata.gen_metadata_exception_FooStreamEx()


def _fbthrift_metadata__exception_FooEx():
    return module.thrift_metadata.gen_metadata_exception_FooEx()


_fbthrift_all_structs = [
    FooStreamEx,
    FooEx,
]
_fbthrift_python_types.fill_specs(*_fbthrift_all_structs)


class _fbthrift_PubSubStreamingService_returnstream_args(
        metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
        (
            1,  # id
            _fbthrift_python_types.FieldQualifier.Unqualified,  # qualifier
            "i32_from",  # name
            _fbthrift_python_types.typeinfo_i32,  # typeinfo
            None,  # default value
            None,  # adapter class
        ),
        (
            2,  # id
Example #8
0
    _fbthrift_SPEC = (
        (
            1,  # id
            _fbthrift_python_types.FieldQualifier.Unqualified,  # qualifier
            "struct1",  # name
            lambda: _fbthrift_python_types.
            StructTypeInfo(python_module_root.my.namespacing.test.hsmodule.
                           thrift_types.HsFoo),  # typeinfo
            None,  # default value
            None,  # adapter class
        ), )


class _fbthrift_ExtendTestService_check_result(
        metaclass=_fbthrift_python_types.StructMeta):
    _fbthrift_SPEC = (
        (
            0,  # id
            _fbthrift_python_types.FieldQualifier.Optional,  # qualifier
            "success",  # name
            _fbthrift_python_types.typeinfo_bool,  # typeinfo
            None,  # default value
            None,  # adapter class
        ), )


_fbthrift_python_types.fill_specs(
    _fbthrift_ExtendTestService_check_args,
    _fbthrift_ExtendTestService_check_result,
)