def to_api_data(self):
data = {}<EOL>if self.__interval and isinstance(self.__interval, int):<EOL><INDENT>recurrence_pattern = data[self._cc('<STR_LIT>')] = {}<EOL>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[self._cc('<STR_LIT>')] = self.__interval<EOL>if self.__days_of_week and isinstance(self.__days_of_week,<EOL>(list, tuple, set)):<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[self._cc('<STR_LIT>')] = list(<EOL>self.__days_of_week)<EOL>if self.__first_day_of_week:<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[<EOL>self._cc('<STR_LIT>')] = self.__first_day_of_week<EOL><DEDENT>elif self.__month and isinstance(self.__month, int):<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[self._cc('<STR_LIT>')] = self.__month<EOL>if self.__index:<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:index>')] = self.__index<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.__index:<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:index>')] = self.__index<EOL><DEDENT><DEDENT><DEDENT>elif self.__day_of_month and isinstance(self.__day_of_month, int):<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[self._cc('<STR_LIT>')] = self.__day_of_month<EOL>if self.__month and isinstance(self.__month, int):<EOL><INDENT>recurrence_pattern[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_pattern[self._cc('<STR_LIT>')] = self.__month<EOL><DEDENT><DEDENT><DEDENT>if self.__start_date:<EOL><INDENT>recurrence_range = data[self._cc('<STR_LIT>')] = {}<EOL>recurrence_range[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_range[<EOL>self._cc('<STR_LIT>')] = self.__start_date.isoformat()<EOL>recurrence_range[<EOL>self._cc('<STR_LIT>')] = self.__recurrence_time_zone<EOL>if self.__end_date:<EOL><INDENT>recurrence_range[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_range[<EOL>self._cc('<STR_LIT>')] = self.__end_date.isoformat()<EOL><DEDENT>elif self.__occurrences is not None and isinstance(<EOL>self.__occurrences,<EOL>int):<EOL><INDENT>recurrence_range[self._cc('<STR_LIT:type>')] = '<STR_LIT>'<EOL>recurrence_range[<EOL>self._cc('<STR_LIT>')] = self.__occurrences<EOL><DEDENT><DEDENT>return data<EOL>
Returns a dict to communicate with the server

        :rtype: dict