Example #1
0
def _fbthrift_gen_metadata_enum_EmptyEnum(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.EmptyEnum"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {}
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #2
0
def _fbthrift_gen_metadata_enum_AnEnumRenamed(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.AnEnumRenamed"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        0: "name",
        1: "value",
        2: "normal",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #3
0
def _fbthrift_gen_metadata_enum_Flags(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.Flags"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        1: "flag_A",
        2: "flag_B",
        4: "flag_C",
        8: "flag_D",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #4
0
def _fbthrift_gen_metadata_enum_AnEnum(metadata_struct: _fbthrift_metadata.ThriftMetadata) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.AnEnum"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        0: "None",
        1: "ONE",
        2: "TWO",
        3: "THREE",
        4: "FOUR",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #5
0
def _fbthrift_gen_metadata_enum_MyEnum2(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.MyEnum2"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        0: "ME2_0",
        1: "ME2_1",
        2: "ME2_2",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #6
0
def _fbthrift_gen_metadata_enum_Company(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.Company"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        0: "FACEBOOK",
        1: "WHATSAPP",
        2: "OCULUS",
        3: "INSTAGRAM",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #7
0
def _fbthrift_gen_metadata_enum_City(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.City"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        0: "NYC",
        1: "MPK",
        2: "SEA",
        3: "LON",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #8
0
def _fbthrift_gen_metadata_enum_MyEnum4(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.MyEnum4"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        2147483645: "ME4_A",
        2147483646: "ME4_B",
        2147483647: "ME4_C",
        -2147483648: "ME4_D",
        0: "Unspecified",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct
Example #9
0
def _fbthrift_gen_metadata_enum_Metasyntactic(
    metadata_struct: _fbthrift_metadata.ThriftMetadata
) -> _fbthrift_metadata.ThriftMetadata:
    qualified_name = "module.Metasyntactic"

    if qualified_name in metadata_struct.enums:
        return metadata_struct
    elements = {
        1: "FOO",
        2: "BAR",
        3: "BAZ",
        4: "BAX",
        0: "Unspecified",
    }
    enum_dict = dict(metadata_struct.enums)
    enum_dict[qualified_name] = _fbthrift_metadata.ThriftEnum(
        name=qualified_name, elements=elements, structured_annotations=[])
    new_struct = metadata_struct(enums=enum_dict)

    return new_struct