def to_api_data(self, restrict_keys=None):
cc = self._cc  <EOL>data = {<EOL>cc('<STR_LIT>'): self.__subject,<EOL>cc('<STR_LIT:body>'): {<EOL>cc('<STR_LIT>'): self.body_type,<EOL>cc('<STR_LIT:content>'): self.__body},<EOL>cc('<STR_LIT:start>'): self._build_date_time_time_zone(self.__start),<EOL>cc('<STR_LIT:end>'): self._build_date_time_time_zone(self.__end),<EOL>cc('<STR_LIT>'): self.__attendees.to_api_data(),<EOL>cc('<STR_LIT:location>'): {cc('<STR_LIT>'): self.__location},<EOL>cc('<STR_LIT>'): self.__categories,<EOL>cc('<STR_LIT>'): self.__is_all_day,<EOL>cc('<STR_LIT>'): cc(self.__importance.value),<EOL>cc('<STR_LIT>'): self.__is_reminder_on,<EOL>cc('<STR_LIT>'): self.__remind_before_minutes,<EOL>cc('<STR_LIT>'): self.__response_requested,<EOL>cc('<STR_LIT>'): cc(self.__sensitivity.value),<EOL>cc('<STR_LIT>'): cc(self.__show_as.value),<EOL>}<EOL>if self.__recurrence:<EOL><INDENT>data[cc('<STR_LIT>')] = self.__recurrence.to_api_data()<EOL><DEDENT>if self.has_attachments:<EOL><INDENT>data[cc('<STR_LIT>')] = self.__attachments.to_api_data()<EOL><DEDENT>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