class Teamlab::Calendar
Public Class Methods
new(config = nil)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 5 def initialize(config = nil) @request = Teamlab::Request.new(config, 'calendar') end
Public Instance Methods
add_event(calendar_id, name, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 57 def add_event(calendar_id, name, options = {}) @request.post([calendar_id.to_s, 'event'], { name: name }.merge(options)) end
add_icsevent(calendar_id, ics, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 61 def add_icsevent(calendar_id, ics, options = {}) @request.post(['icsevent'], { calendarId: calendar_id.to_s, ics: ics.to_s }.merge(options)) end
create_calendar(name, time_zone, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 49 def create_calendar(name, time_zone, options = {}) @request.post('', { name: name, timeZone: time_zone }.merge(options)) end
create_calendar_by_ical_link(ical_url, name, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 53 def create_calendar_by_ical_link(ical_url, name, options = {}) @request.post(%w[calendarurl], { iCalUrl: ical_url, name: name }.merge(options)) end
delete_calendar(calendar_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 93 def delete_calendar(calendar_id) @request.delete([calendar_id.to_s]) end
delete_event(event_id, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 101 def delete_event(event_id, options = {}) @request.delete(['events', event_id.to_s, 'custom'], options) end
Also aliased as: remove_event
delete_event_series(event_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 97 def delete_event_series(event_id) @request.delete(['events', event_id.to_s]) end
get_access_parameters(calendar_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 25 def get_access_parameters(calendar_id) @request.get([calendar_id.to_s, 'sharing']) end
get_calendar(id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 13 def get_calendar(id) @request.get([id.to_s]) end
get_calendar_events(start_date, end_date)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 41 def get_calendar_events(start_date, end_date) @request.get(['eventdays', start_date.to_s, end_date.to_s]) end
get_calendars_and_subscriptions(start_date, end_date)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 45 def get_calendars_and_subscriptions(start_date, end_date) @request.get(['calendars', start_date.to_s, end_date.to_s]) end
get_default_access()
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 9 def get_default_access @request.get(%w[sharing]) end
get_event_history_by_id(event_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 29 def get_event_history_by_id(event_id) @request.get(['events', event_id.to_s, 'historybyid']) end
get_event_history_by_uid(event_uid)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 33 def get_event_history_by_uid(event_uid) @request.get(['events', event_uid.to_s, 'historybyuid']) end
get_icalc_feed(calendar_id, signature)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 37 def get_icalc_feed(calendar_id, signature) @request.get([calendar_id.to_s, 'ical', signature.to_s]) end
get_icalc_link(calendar_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 21 def get_icalc_link(calendar_id) @request.get([calendar_id.to_s, 'icalurl']) end
get_subscription_list()
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 17 def get_subscription_list @request.get(%w[subscriptions]) end
import_events(calendar_id, ical)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 69 def import_events(calendar_id, ical) @request.post(['importIcs'], calendarId: calendar_id.to_s, iCalString: ical.to_s) end
import_ical(calendar_id, file)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 65 def import_ical(calendar_id, file) @request.post([calendar_id.to_s, 'import'], somefile: File.new(file)) end
manage_subscriptions(states)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 81 def manage_subscriptions(states) @request.put(%w[subscriptions manage], states: states) end
unsubscribe_from_event(event_id)
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 107 def unsubscribe_from_event(event_id) @request.delete(['events', event_id.to_s, 'unsubscribe']) end
update_calendar(calendar_id, name, time_zone, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 73 def update_calendar(calendar_id, name, time_zone, options = {}) @request.put([calendar_id.to_s], { name: name, timeZone: time_zone }.merge(options)) end
update_calendar_user_view(calendar_id, name, time_zone, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 77 def update_calendar_user_view(calendar_id, name, time_zone, options = {}) @request.put([calendar_id.to_s, 'view'], { name: name, timeZone: time_zone }.merge(options)) end
update_event(calendar_id, event_id, name, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 85 def update_event(calendar_id, event_id, name, options = {}) @request.put([calendar_id.to_s, event_id.to_s], { name: name }.merge(options)) end
update_icsevent(calendar_id, event_id, ics, options = {})
click to toggle source
# File lib/teamlab/modules/calendar.rb, line 89 def update_icsevent(calendar_id, event_id, ics, options = {}) @request.put(['icsevent'], { calendarId: calendar_id.to_s, eventId: event_id.to_s, ics: ics.to_s }.merge(options)) end