def save_event(event)
      method = event.new_event? ? :post : :put
      body = event.use_quickadd? ? nil : event.to_json
      notifications = "sendNotifications=#{event.send_notifications?}"
      query_string =  if event.use_quickadd?
                        "/quickAdd?#{notifications}&text=#{event.title}"
                      elsif event.new_event?
                        "?#{notifications}"
                      else # update existing event.
                        "/#{event.id}?#{notifications}"
                      end

      send_events_request(query_string, method, body)
    end
def save_event(event)
      method = event.new_event? ? :post : :put
      body = event.use_quickadd? ? nil : event.to_json
      notifications = "sendNotifications=#{event.send_notifications?}"
      query_string =  if event.use_quickadd?
                        "/quickAdd?#{notifications}&text=#{event.title}"
                      elsif event.new_event?
                        "?#{notifications}"
                      else # update existing event.
                        "/#{event.id}?#{notifications}"
                      end

      send_events_request(query_string, method, body)
    end
Saves the specified event.
 This is a callback used by the Event class.