def to_json
      attributes = {
        "summary" => title,
        "visibility" => visibility,
        "transparency" => transparency,
        "description" => description,
        "location" => location,
        "start" => time_or_all_day(start_time),
        "end" => time_or_all_day(end_time),
        "reminders" => reminders_attributes,
        "guestsCanInviteOthers" => guests_can_invite_others,
        "guestsCanSeeOtherGuests" => guests_can_see_other_guests
      }

      if id
        attributes["id"] = id
      end

      if timezone_needed?
        attributes['start'].merge!(local_timezone_attributes)
        attributes['end'].merge!(local_timezone_attributes)
      end

      attributes.merge!(recurrence_attributes)
      attributes.merge!(color_attributes)
      attributes.merge!(attendees_attributes)
      attributes.merge!(extended_properties_attributes)

      JSON.generate attributes
    end
def to_json
      attributes = {
        "summary" => title,
        "visibility" => visibility,
        "transparency" => transparency,
        "description" => description,
        "location" => location,
        "start" => time_or_all_day(start_time),
        "end" => time_or_all_day(end_time),
        "reminders" => reminders_attributes,
        "guestsCanInviteOthers" => guests_can_invite_others,
        "guestsCanSeeOtherGuests" => guests_can_see_other_guests
      }

      if id
        attributes["id"] = id
      end

      if timezone_needed?
        attributes['start'].merge!(local_timezone_attributes)
        attributes['end'].merge!(local_timezone_attributes)
      end

      attributes.merge!(recurrence_attributes)
      attributes.merge!(color_attributes)
      attributes.merge!(attendees_attributes)
      attributes.merge!(extended_properties_attributes)

      JSON.generate attributes
    end
Google JSON representation of an event object.