class Teamlab::Calendar

Public Class Methods

new() click to toggle source
# File lib/teamlab/modules/calendar.rb, line 3
def initialize
  @request = Teamlab::Request.new('calendar')
end

Public Instance Methods

add_event(calendar_id, name, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES
# File lib/teamlab/modules/calendar.rb, line 49
def add_event(calendar_id, name, options = {})
  @request.post([calendar_id.to_s, 'event'], { name: name }.merge(options))
end
create_calendar(name, time_zone, options = {}) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 39
def create_calendar(name, time_zone, options = {})
  @request.post('', { name: name, timeZone: time_zone }.merge(options))
end
delete_calendar(calendar_id) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 79
def delete_calendar(calendar_id)
  @request.delete([calendar_id.to_s])
end
delete_event_series(event_id) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 83
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 23
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 11
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 31
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 35
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 7
def get_default_access
  @request.get(%w(sharing))
end
get_icalc_feed(calendar_id, signature) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 27
def get_icalc_feed(calendar_id, signature)
  @request.get([calendar_id.to_s, 'ical', signature.to_s])
end
get_subscription_list() click to toggle source
# File lib/teamlab/modules/calendar.rb, line 15
def get_subscription_list
  @request.get(%w(subscriptions))
end
import_ical(calendar_id, file) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 53
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 69
def manage_subscriptions(states)
  @request.put(%w(subscriptions manage), states: states)
end
remove_event(event_id, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES
# File lib/teamlab/modules/calendar.rb, line 89
def remove_event(event_id, options = {})
  @request.delete(['events', event_id.to_s, 'custom'], options)
end
unsubscribe_from_event(event_id) click to toggle source
# File lib/teamlab/modules/calendar.rb, line 93
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
TODO: OPTIONAL VARIABLES
# File lib/teamlab/modules/calendar.rb, line 59
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
TODO: OPTIONAL VARIABLES
# File lib/teamlab/modules/calendar.rb, line 65
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
TODO: OPTIONAL VARIABLES
# File lib/teamlab/modules/calendar.rb, line 75
def update_event(calendar_id, event_id, name, options = {})
  @request.put([calendar_id.to_s, event_id.to_s], { name: name }.merge(options))
end