def cancel_recurrence()

in libs/google/calendar.py [0:0]


  def cancel_recurrence(self, event_id, new_event_rule):
    """
    Updates event recurrence rule to cancel future instances.
    :param event_id: eventId
    :param new_event_rule: body
    :return: list of canceled event ids.
    """

    patch_body = {
        "recurrence": new_event_rule
    }
    try:
      r = json.loads(self.call_google_api(service=self.service,
                                          api_resource="events",
                                          api_method="patch",
                                          response_field="id",
                                          calendarId="primary",
                                          eventId=event_id,
                                          sendNotifications=False,
                                          body=patch_body))
      return r
    except(ValueError, KeyError, TypeError):
      return None