@staticmethod<EOL><INDENT>def create_payload(entities):<DEDENT>
<EOL>types = {e.etype for e in entities}<EOL>if len(types) != <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>" +<EOL>str(len(types)) + "<STR_LIT>")<EOL><DEDENT>all_attrs = set()<EOL>for e in entities:<EOL><INDENT>all_attrs.update(set(e.attrs.keys()))<EOL><DEDENT>all_attrs = list(all_attrs)<EOL>header = "<STR_LIT>" + entities[<NUM_LIT:0>].etype + "<STR_LIT>"<EOL>payload = '<STR_LIT:\t>'.join([header] + all_attrs) + '<STR_LIT:\n>'<EOL>for e in entities:<EOL><INDENT>line = e.entity_id<EOL>for a in all_attrs:<EOL><INDENT>line += '<STR_LIT:\t>' + e.attrs.get(a, "<STR_LIT>")<EOL><DEDENT>payload += line + '<STR_LIT:\n>'<EOL><DEDENT>return payload<EOL>
Create a tsv payload describing entities.

        A TSV payload consists of 1 header row describing entity type
        and attribute names. Each subsequent line is an entity_id followed
        by attribute values separated by the tab "\\t" character. This
        payload can be uploaded to the workspace via
        firecloud.api.upload_entities()