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_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_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_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_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_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="myStruct", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.MyDataItem")), name="myDataItem", 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_DOUBLE_TYPE))), name="floatSet", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="hack.SkipCodegen"), fields={ "reason": _fbthrift_metadata.ThriftConstValue( cv_string="Invalid key type"), }), ]), ] 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) # myStruct new_struct = _fbthrift_gen_metadata_struct_MyDataItem( new_struct) # myDataItem # floatSet 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_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_I64_TYPE), name="MyIntField", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=2, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="MyStringField", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=3, type=_fbthrift_metadata.ThriftType( t_struct=_fbthrift_metadata.ThriftStructType( name="module.MyDataItem")), name="MyDataField", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=4, type=_fbthrift_metadata.ThriftType( t_enum=_fbthrift_metadata.ThriftEnumType( name="module.MyEnum")), name="myEnum", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=5, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_BOOL_TYPE), name="oneway", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=6, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_BOOL_TYPE), name="readonly", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=7, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_BOOL_TYPE), name="idempotent", is_optional=False, structured_annotations=[]), _fbthrift_metadata.ThriftField( id=8, type=_fbthrift_metadata.ThriftType( t_set=_fbthrift_metadata.ThriftSetType( valueType=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_DOUBLE_TYPE))), name="floatSet", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="hack.SkipCodegen"), fields={ "reason": _fbthrift_metadata.ThriftConstValue( cv_string="Invalid key type"), }), ]), _fbthrift_metadata.ThriftField( id=9, type=_fbthrift_metadata.ThriftType( t_primitive=_fbthrift_metadata.ThriftPrimitiveType. THRIFT_STRING_TYPE), name="no_hack_codegen_field", is_optional=False, structured_annotations=[ _fbthrift_metadata.ThriftConstStruct( type=_fbthrift_metadata.ThriftStructType( name="hack.SkipCodegen"), fields={ "reason": _fbthrift_metadata.ThriftConstValue( cv_string="skip field codegen for deprecation"), }), ]), ] 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) # MyIntField # MyStringField new_struct = _fbthrift_gen_metadata_struct_MyDataItem( new_struct) # MyDataField new_struct = _fbthrift_gen_metadata_enum_MyEnum(new_struct) # myEnum # oneway # readonly # idempotent # floatSet # no_hack_codegen_field return new_struct