def to_api_data(self, restrict_keys=None):
cc = self.parent._cc  <EOL>data = {<EOL>cc('<STR_LIT>'): self._bold,<EOL>cc('<STR_LIT>'): self._color,<EOL>cc('<STR_LIT>'): self._italic,<EOL>cc('<STR_LIT:name>'): self._name,<EOL>cc('<STR_LIT:size>'): self._size,<EOL>cc('<STR_LIT>'): self._underline<EOL>}<EOL>if restrict_keys:<EOL><INDENT>for key in list(data.keys()):<EOL><INDENT>if key not in restrict_keys:<EOL><INDENT>del data[key]<EOL><DEDENT><DEDENT><DEDENT>return data<EOL>
Returns a dict to communicate with the server

        :param restrict_keys: a set of keys to restrict the returned data to
        :rtype: dict