def decline_event()

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


  def decline_event(self, event_id, user_email):
    """
    Declines event.
    :param event_id: eventId
    :param user_email: user_email
    :return: event details
    """

    patch_body = {"attendees": [{"responseStatus": "declined", "email": user_email}]}
    try:
      r = json.loads(self.call_google_api(service=self.service,
                                          api_resource="events",
                                          api_method="patch",
                                          response_field="attendees",
                                          calendarId="primary",
                                          eventId=event_id,
                                          sendNotifications=False,
                                          body=patch_body))
      return r
    except(ValueError, KeyError, TypeError):
      return None