Returns a dict to communicate with the server

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

def to_api_data(self, restrict_keys=None):
        """ Returns a dict to communicate with the server

        :param restrict_keys: a set of keys to restrict the returned data to
        :rtype: dict
        """
        cc = self.parent._cc  # alias
        data = {
            cc('bold'): self._bold,
            cc('color'): self._color,
            cc('italic'): self._italic,
            cc('name'): self._name,
            cc('size'): self._size,
            cc('underline'): self._underline
        }

        if restrict_keys:
            for key in list(data.keys()):
                if key not in restrict_keys:
                    del data[key]
        return data