def upsert_event(calendar_id, event)
      body = event.dup

      body[:start] = encode_event_time(body[:start])
      body[:end] = encode_event_time(body[:end])

      post("/v1/calendars/#{calendar_id}/events", body)
      nil
    end
def upsert_event(calendar_id, event)
      body = event.dup

      body[:start] = encode_event_time(body[:start])
      body[:end] = encode_event_time(body[:end])

      post("/v1/calendars/#{calendar_id}/events", body)
      nil
    end
Public: Creates or updates an event for the event_id in the calendar
 relating to the given calendar_id.

 calendar_id - The String Cronofy ID for the calendar to upsert the event
               to.
 event       - A Hash describing the event with symbolized keys:
               :event_id     - A String uniquely identifying the event for
                               your application (note: this is NOT an ID
                               generated by Cronofy).
               :summary      - A String to use as the summary, sometimes
                               referred to as the name or title, of the
                               event.
               :description  - A String to use as the description, sometimes
                               referred to as the notes or body, of the
                               event.
               :start        - The Time or Date the event starts.
               :end          - The Time or Date the event ends.
               :url          - The URL associated with the event.
               :location     - A Hash describing the location of the event
                               with symbolized keys (optional):
                               :description - A String describing the
                                              location.
                               :lat - A String of the location's latitude.
                               :long - A String of the location's longitude.
               :reminders    - An Array of Hashes describing the desired
                               reminders for the event. Reminders should be
                               specified in priority order as, for example,
                               when the underlying provider only supports a
                               single reminder then the first reminder will
                               be used.
                               :minutes - An Integer specifying the number
                                          of minutes before the start of the
                                          event that the reminder should
                                          occur.
               :transparency - The transparency state for the event (optional).
                               Accepted values are "transparent" and "opaque".
               :color        - The color of the event (optional).
               :attendees    - A Hash of :invite and :reject, each of which is
                               an array of invitees to invite to or reject from
                               the event. Invitees are represented by a hash of
                               :email and :display_name (optional).

 Examples

   client.upsert_event(
     "cal_n23kjnwrw2_jsdfjksn234",
     event_id: "qTtZdczOccgaPncGJaCiLg",
     summary: "Board meeting",
     description: "Discuss plans for the next quarter.",
     start: Time.utc(2014, 8, 5, 15, 30),
     end:   Time.utc(2014, 8, 5, 17, 30),
     location: {
       description: "Board room",
       lat: "1.2345",
       long: "0.1234"
     })

 See http://www.cronofy.com/developers/api#upsert-event for reference.

 Returns nothing.

 Raises Cronofy::CredentialsMissingError if no credentials available.
 Raises Cronofy::AuthenticationFailureError if the access token is no
 longer valid.
 Raises Cronofy::AuthorizationFailureError if the access token does not
 include the required scope.
 Raises Cronofy::NotFoundError if the calendar does not exist.
 Raises Cronofy::InvalidRequestError if the request contains invalid
 parameters.
 Raises Cronofy::TooManyRequestsError if the request exceeds the rate
 limits for the application.