def _fbthrift_gen_metadata_exception_ComplexFieldNames( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.ComplexFieldNames" if qualified_name in metadata_struct.exceptions: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="error_message", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="internal_error_message", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.exceptions) struct_dict[qualified_name] = _fbthrift_metadata.ThriftException( name=qualified_name, fields=fields, structured_annotations=[]) new_struct = metadata_struct(exceptions=struct_dict) # error_message # internal_error_message return new_struct
def _fbthrift_gen_metadata_service_TestService(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "emptyns.TestService" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction(name="init", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE), name="int1", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService(name=qualified_name, functions=functions, structured_annotations=[ ]) new_struct = metadata_struct(services=service_dict) # int1 # return value return new_struct
def _fbthrift_gen_metadata_struct_SomeStruct( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.SomeStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.Metasyntactic")), name="reasonable", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.Metasyntactic")), name="fine", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.Metasyntactic")), name="questionable", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_set=_fbthrift_metadata.ThriftSetType( valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE))), name="tags", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_enum_Metasyntactic( new_struct) # reasonable new_struct = _fbthrift_gen_metadata_enum_Metasyntactic(new_struct) # fine new_struct = _fbthrift_gen_metadata_enum_Metasyntactic( new_struct) # questionable # tags return new_struct
def _fbthrift_gen_metadata_service_FB303Service( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.FB303Service" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction( name="simple_rpc", return_type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.ReservedKeyword")), arguments=[ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="int_parameter", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="hack.Name"), fields={ "name": _fbthrift_metadata.ThriftConstValue( cv_string="renamed_parameter"), }), ]), ], exceptions=[], is_oneway=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType(name="hack.Name"), fields={ "name": _fbthrift_metadata.ThriftConstValue( cv_string="renamed_rpc"), }), ]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService( name=qualified_name, functions=functions, structured_annotations=[]) new_struct = metadata_struct(services=service_dict) # int_parameter new_struct = _fbthrift_gen_metadata_struct_ReservedKeyword( new_struct) # return value return new_struct
def _fbthrift_gen_metadata_struct_struct2( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.struct2" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="a", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="b", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.struct1")), name="c", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_list=_fbthrift_metadata.ThriftListType( valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE))), name="d", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # a # b new_struct = _fbthrift_gen_metadata_struct_struct1(new_struct) # c # d return new_struct
def _fbthrift_gen_metadata_struct_union2( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.union2" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="i", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_FLOAT_TYPE), name="d", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.struct1")), name="s", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_union=_fbthrift_metadata.ThriftUnionType( name="module.union1")), name="u", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # i # d new_struct = _fbthrift_gen_metadata_struct_struct1(new_struct) # s new_struct = _fbthrift_gen_metadata_struct_union1(new_struct) # u return new_struct
def _fbthrift_gen_metadata_struct_MyStruct( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.MyStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum2")), name="me2_3", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum3")), name="me3_n3", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum1")), name="me1_t1", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=6, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum1")), name="me1_t2", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_enum_MyEnum2(new_struct) # me2_3 new_struct = _fbthrift_gen_metadata_enum_MyEnum3(new_struct) # me3_n3 new_struct = _fbthrift_gen_metadata_enum_MyEnum1(new_struct) # me1_t1 new_struct = _fbthrift_gen_metadata_enum_MyEnum1(new_struct) # me1_t2 return new_struct
def _fbthrift_gen_metadata_struct_Val( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.Val" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="strVal", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="intVal", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=9, type=_fbthrift_metadata.ThriftType( t_map=_fbthrift_metadata.ThriftMapType( keyType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I16_TYPE), valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE))), name="typedefValue", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # strVal # intVal # key # val # typedefValue return new_struct
def _fbthrift_gen_metadata_struct_Fields( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "foo.Fields" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=100, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="injected_field", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=101, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="injected_structured_annotation_field", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="thrift.Box"), fields={}), ]), _fbthrift_metadata.ThriftField( id=102, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="injected_unstructured_annotation_field", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # injected_field # injected_structured_annotation_field # injected_unstructured_annotation_field return new_struct
def _fbthrift_gen_metadata_struct_NonCopyableUnion( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.NonCopyableUnion" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.NonCopyableStruct")), name="s", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_struct_NonCopyableStruct( new_struct) # s return new_struct
def _fbthrift_gen_metadata_struct_Foo( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "emptyns.Foo" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I64_TYPE), name="MyInt", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # MyInt return new_struct
def _fbthrift_gen_metadata_exception_Serious( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.Serious" if qualified_name in metadata_struct.exceptions: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="sonnet", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.exceptions) struct_dict[qualified_name] = _fbthrift_metadata.ThriftException( name=qualified_name, fields=fields, structured_annotations=[]) new_struct = metadata_struct(exceptions=struct_dict) # sonnet return new_struct
def _fbthrift_gen_metadata_struct_NonCopyableStruct( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.NonCopyableStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I64_TYPE), name="num", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # num return new_struct
def _fbthrift_gen_metadata_service_RederivedService(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.RederivedService" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction(name="get_seven", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService(name=qualified_name, functions=functions, parent="module.DerivedService", structured_annotations=[ ]) new_struct = metadata_struct(services=service_dict) new_struct = _fbthrift_gen_metadata_service_DerivedService(new_struct) # return value return new_struct
def _fbthrift_gen_metadata_struct_struct4( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.struct4" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="a", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_FLOAT_TYPE), name="b", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_BYTE_TYPE), name="c", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # a # b # c return new_struct
def _fbthrift_gen_metadata_struct_FieldsInjectedToStruct( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.FieldsInjectedToStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=-1100, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="injected_field", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="string_field", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="internal.InjectMetadataFields"), fields={ "type": _fbthrift_metadata.ThriftConstValue(cv_string="Fields"), }), ]) new_struct = metadata_struct(structs=struct_dict) # string_field # injected_field return new_struct
def _fbthrift_gen_metadata_struct_ListUnion( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.ListUnion" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_list=_fbthrift_metadata.ThriftListType( valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I64_TYPE))), name="intListValue", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_list=_fbthrift_metadata.ThriftListType( valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE))), name="stringListValue", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # intListValue # stringListValue return new_struct
def _fbthrift_gen_metadata_service_MyService( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.MyService" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction( name="query", return_type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.MyStruct")), arguments=[ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_union=_fbthrift_metadata.ThriftUnionType( name="module.MyUnion")), name="u", is_optional=False, structured_annotations=[]), ], exceptions=[], is_oneway=False, structured_annotations=[]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService( name=qualified_name, functions=functions, structured_annotations=[]) new_struct = metadata_struct(services=service_dict) new_struct = _fbthrift_gen_metadata_struct_MyUnion(new_struct) # u new_struct = _fbthrift_gen_metadata_struct_MyStruct( new_struct) # return value return new_struct
def _fbthrift_gen_metadata_struct_MyUnion( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.MyUnion" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum")), name="myEnum", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.MyStruct")), name="myDataItem", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_enum_MyEnum(new_struct) # myEnum new_struct = _fbthrift_gen_metadata_struct_MyStruct( new_struct) # myDataItem return new_struct
def _fbthrift_gen_metadata_struct_ComplexStruct(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.ComplexStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")), name="structOne", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")), name="structTwo", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=3, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), name="an_integer", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=4, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="name", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=5, type=_fbthrift_metadata.ThriftType(t_enum=_fbthrift_metadata.ThriftEnumType(name="module.AnEnum")), name="an_enum", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=6, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE), name="some_bytes", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=7, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="from", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=8, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="cdef", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=9, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE), name="bytes_with_cpp_type", is_optional=False, structured_annotations=[ ]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct(name=qualified_name, fields=fields, is_union=False, structured_annotations=[ ]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # structOne new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # structTwo # an_integer # name new_struct = _fbthrift_gen_metadata_enum_AnEnum(new_struct) # an_enum # some_bytes # from # cdef # bytes_with_cpp_type return new_struct
def _fbthrift_gen_metadata_struct_VirtualComplexUnion( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.VirtualComplexUnion" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="thingOne", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="thingTwo", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # thingOne # thingTwo return new_struct
def _fbthrift_gen_metadata_struct_DataUnion( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.DataUnion" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_BINARY_TYPE), name="binaryData", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="stringData", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # binaryData # stringData return new_struct
def _fbthrift_gen_metadata_struct_Range( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.Range" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="min", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="max", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # min # max return new_struct
def _fbthrift_gen_metadata_struct_UnionToBeRenamed( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.UnionToBeRenamed" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="reserved_field", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType(name="hack.Name"), fields={ "name": _fbthrift_metadata.ThriftConstValue( cv_string="renamed_field"), }), ]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=True, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType(name="hack.Name"), fields={ "name": _fbthrift_metadata.ThriftConstValue( cv_string="MyRenamedUnion"), }), ]) new_struct = metadata_struct(structs=struct_dict) # reserved_field return new_struct
def _fbthrift_gen_metadata_struct_BinaryUnionStruct(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.BinaryUnionStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_union=_fbthrift_metadata.ThriftUnionType(name="module.BinaryUnion")), name="u", is_optional=False, structured_annotations=[ ]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct(name=qualified_name, fields=fields, is_union=False, structured_annotations=[ ]) new_struct = metadata_struct(structs=struct_dict) new_struct = _fbthrift_gen_metadata_struct_BinaryUnion(new_struct) # u return new_struct
def _fbthrift_gen_metadata_struct_SimpleStruct(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.SimpleStruct" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BOOL_TYPE), name="is_on", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BYTE_TYPE), name="tiny_int", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=3, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="small_int", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=4, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), name="nice_sized_int", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=5, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE), name="big_int", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=6, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_FLOAT_TYPE), name="real", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=7, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_DOUBLE_TYPE), name="smaller_real", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=8, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="hidden_field", is_optional=False, structured_annotations=[ ]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct(name=qualified_name, fields=fields, is_union=False, structured_annotations=[ ]) new_struct = metadata_struct(structs=struct_dict) # is_on # tiny_int # small_int # nice_sized_int # big_int # real # smaller_real # hidden_field return new_struct
def _fbthrift_gen_metadata_service_FooService( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.FooService" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction( name="simple_rpc", return_type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_VOID_TYPE), arguments=[], exceptions=[], is_oneway=False, structured_annotations=[]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService( name=qualified_name, functions=functions, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType(name="hack.Name"), fields={ "name": _fbthrift_metadata.ThriftConstValue( cv_string="RenamedService"), }), ]) new_struct = metadata_struct(services=service_dict) # return value return new_struct
def _fbthrift_gen_metadata_struct_Internship( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.Internship" if qualified_name in metadata_struct.structs: return metadata_struct fields = [ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I32_TYPE), name="weeks", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="title", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.Company")), name="employer", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_FLOAT_TYPE), name="compensation", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=5, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="school", is_optional=False, structured_annotations=[]), ] struct_dict = dict(metadata_struct.structs) struct_dict[qualified_name] = _fbthrift_metadata.ThriftStruct( name=qualified_name, fields=fields, is_union=False, structured_annotations=[]) new_struct = metadata_struct(structs=struct_dict) # weeks # title new_struct = _fbthrift_gen_metadata_enum_Company(new_struct) # employer # compensation # school return new_struct
def _fbthrift_gen_metadata_service_SimpleService(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.SimpleService" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction(name="get_five", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="add_five", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), name="num", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="do_nothing", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_VOID_TYPE), arguments=[ ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="concat", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="first", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="second", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_value", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")), name="simple_struct", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="negate", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BOOL_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BOOL_TYPE), name="input", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="tiny", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BYTE_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BYTE_TYPE), name="input", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="small", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="input", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="big", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE), name="input", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="two", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_FLOAT_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_FLOAT_TYPE), name="input", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="expected_exception", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_VOID_TYPE), arguments=[ ], exceptions = [ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleException")), name="se", is_optional=False, structured_annotations=[ ]), ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="unexpected_exception", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="sum_i16_list", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE))), name="numbers", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="sum_i32_list", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))), name="numbers", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="sum_i64_list", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I64_TYPE))), name="numbers", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="concat_many", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), name="words", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="count_structs", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")))), name="items", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="sum_set", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))), name="numbers", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="contains_word", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BOOL_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), name="words", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="word", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_map_value", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), name="words", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="key", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="map_length", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")))), name="items", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="sum_map_values", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE))), name="items", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="complex_sum_i32", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.ComplexStruct")), name="counter", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="repeat_name", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.ComplexStruct")), name="counter", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_struct", return_type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")), arguments=[ ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="fib", return_type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="n", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="unique_words", return_type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), name="words", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="words_count", return_type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), name="words", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="set_enum", return_type=_fbthrift_metadata.ThriftType(t_enum=_fbthrift_metadata.ThriftEnumType(name="module.AnEnum")), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_enum=_fbthrift_metadata.ThriftEnumType(name="module.AnEnum")), name="in_enum", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="list_of_lists", return_type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="num_lists", is_optional=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftField(id=2, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I16_TYPE), name="num_items", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="word_character_frequency", return_type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="sentence", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="list_of_sets", return_type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), name="some_words", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="nested_map_argument", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.SimpleStruct")))))), name="struct_map", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="make_sentence", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))))), name="word_chars", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_union", return_type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE))))), name="sets", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_keys", return_type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_map=_fbthrift_metadata.ThriftMapType(keyType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE),valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_STRING_TYPE))))), name="string_map", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="lookup_double", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_FLOAT_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_I32_TYPE), name="key", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="retrieve_binary", return_type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE), name="something", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="contain_binary", return_type=_fbthrift_metadata.ThriftType(t_set=_fbthrift_metadata.ThriftSetType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_primitive=_fbthrift_metadata.ThriftPrimitiveType.THRIFT_BINARY_TYPE))), name="binaries", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="contain_enum", return_type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_enum=_fbthrift_metadata.ThriftEnumType(name="module.AnEnum")))), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_list=_fbthrift_metadata.ThriftListType(valueType=_fbthrift_metadata.ThriftType(t_enum=_fbthrift_metadata.ThriftEnumType(name="module.AnEnum")))), name="the_enum", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), _fbthrift_metadata.ThriftFunction(name="get_binary_union_struct", return_type=_fbthrift_metadata.ThriftType(t_struct=_fbthrift_metadata.ThriftStructType(name="module.BinaryUnionStruct")), arguments=[ _fbthrift_metadata.ThriftField(id=1, type=_fbthrift_metadata.ThriftType(t_union=_fbthrift_metadata.ThriftUnionType(name="module.BinaryUnion")), name="u", is_optional=False, structured_annotations=[ ]), ], exceptions = [ ], is_oneway=False, structured_annotations=[ ]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService(name=qualified_name, functions=functions, structured_annotations=[ ]) new_struct = metadata_struct(services=service_dict) # return value # num # return value # return value # first # second # return value new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # simple_struct # return value # input # return value # input # return value # input # return value # input # return value # input # return value new_struct = _fbthrift_gen_metadata_exception_SimpleException(new_struct) # se # return value # return value # numbers # return value # numbers # return value # numbers # return value # words # return value new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # items # return value # numbers # return value # words # word # return value # key # val # words # key # return value # key new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # val # items # return value # key # val # items # return value new_struct = _fbthrift_gen_metadata_struct_ComplexStruct(new_struct) # counter # return value new_struct = _fbthrift_gen_metadata_struct_ComplexStruct(new_struct) # counter # return value new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # return value # n # return value # words # return value # words # key # val # return value new_struct = _fbthrift_gen_metadata_enum_AnEnum(new_struct) # in_enum new_struct = _fbthrift_gen_metadata_enum_AnEnum(new_struct) # return value # num_lists # num_items # return value # sentence # key # key # val # val # return value # some_words # return value # key new_struct = _fbthrift_gen_metadata_struct_SimpleStruct(new_struct) # val # struct_map # return value # word_chars # return value # sets # return value # key # val # string_map # return value # key # return value # something # return value # binaries # return value new_struct = _fbthrift_gen_metadata_enum_AnEnum(new_struct) # the_enum new_struct = _fbthrift_gen_metadata_enum_AnEnum(new_struct) # return value new_struct = _fbthrift_gen_metadata_struct_BinaryUnion(new_struct) # u new_struct = _fbthrift_gen_metadata_struct_BinaryUnionStruct(new_struct) # return value return new_struct
def _fbthrift_gen_metadata_service_Raiser( metadata_struct: _fbthrift_metadata.ThriftMetadata ) -> _fbthrift_metadata.ThriftMetadata: qualified_name = "module.Raiser" if qualified_name in metadata_struct.services: return metadata_struct functions = [ _fbthrift_metadata.ThriftFunction( name="doBland", return_type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_VOID_TYPE), arguments=[], exceptions=[], is_oneway=False, structured_annotations=[]), _fbthrift_metadata.ThriftFunction( name="doRaise", return_type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_VOID_TYPE), arguments=[], exceptions=[ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Banal")), name="b", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Fiery")), name="f", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Serious")), name="s", is_optional=False, structured_annotations=[]), ], is_oneway=False, structured_annotations=[]), _fbthrift_metadata.ThriftFunction( name="get200", return_type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), arguments=[], exceptions=[], is_oneway=False, structured_annotations=[]), _fbthrift_metadata.ThriftFunction( name="get500", return_type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), arguments=[], exceptions=[ _fbthrift_metadata.ThriftField( id=1, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Fiery")), name="f", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Banal")), name="b", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.Serious")), name="s", is_optional=False, structured_annotations=[]), ], is_oneway=False, structured_annotations=[]), ] service_dict = dict(metadata_struct.services) service_dict[qualified_name] = _fbthrift_metadata.ThriftService( name=qualified_name, functions=functions, structured_annotations=[]) new_struct = metadata_struct(services=service_dict) # return value new_struct = _fbthrift_gen_metadata_exception_Banal(new_struct) # b new_struct = _fbthrift_gen_metadata_exception_Fiery(new_struct) # f new_struct = _fbthrift_gen_metadata_exception_Serious(new_struct) # s # return value # return value new_struct = _fbthrift_gen_metadata_exception_Fiery(new_struct) # f new_struct = _fbthrift_gen_metadata_exception_Banal(new_struct) # b new_struct = _fbthrift_gen_metadata_exception_Serious(new_struct) # s # return value return new_struct