Class: Podio::CalendarEvent

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/calendar_event.rb

Overview

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.find_all(options = {}) ⇒ Object



28
29
30
31
32
# File 'lib/podio/models/calendar_event.rb', line 28

def find_all(options = {})
  list Podio.connection.get { |req|
    req.url('/calendar/', options)
  }.body
end

.find_all_for_app(app_id, options = {}) ⇒ Object



48
49
50
51
52
# File 'lib/podio/models/calendar_event.rb', line 48

def find_all_for_app(app_id, options={})
  list Podio.connection.get { |req|
    req.url("/calendar/app/#{app_id}/", options)
  }.body
end

.find_all_for_linked_account(linked_account_id, options = {}) ⇒ Object



34
35
36
37
38
# File 'lib/podio/models/calendar_event.rb', line 34

def (, options = {})
  list Podio.connection.get { |req|
    req.url("/calendar/linked_account/#{}/", options)
  }.body
end

.find_all_for_space(space_id, options = {}) ⇒ Object



41
42
43
44
45
# File 'lib/podio/models/calendar_event.rb', line 41

def find_all_for_space(space_id, options={})
  list Podio.connection.get { |req|
    req.url("/calendar/space/#{space_id}/", options)
  }.body
end

.find_personal_summaryObject



122
123
124
125
126
127
# File 'lib/podio/models/calendar_event.rb', line 122

def find_personal_summary
  response = Podio.connection.get("/calendar/personal/summary").body
  response['today']['events'] = list(response['today']['events'])
  response['upcoming']['events'] = list(response['upcoming']['events'])
  response
end

.find_summary(options = {}) ⇒ Object



97
98
99
100
101
102
103
104
# File 'lib/podio/models/calendar_event.rb', line 97

def find_summary(options = {})
  response = Podio.connection.get do |req|
    req.url("/calendar/summary", options)
  end.body
  response['today']['events'] = list(response['today']['events'])
  response['upcoming']['events'] = list(response['upcoming']['events'])
  response
end

.find_summary_for_org(org_id) ⇒ Object



114
115
116
117
118
119
# File 'lib/podio/models/calendar_event.rb', line 114

def find_summary_for_org(org_id)
  response = Podio.connection.get("/calendar/org/#{org_id}/summary").body
  response['today']['events'] = list(response['today']['events'])
  response['upcoming']['events'] = list(response['upcoming']['events'])
  response
end

.find_summary_for_space(space_id) ⇒ Object



107
108
109
110
111
112
# File 'lib/podio/models/calendar_event.rb', line 107

def find_summary_for_space(space_id)
  response = Podio.connection.get("/calendar/space/#{space_id}/summary").body
  response['today']['events'] = list(response['today']['events'])
  response['upcoming']['events'] = list(response['upcoming']['events'])
  response
end

.get_calendars_for_linked_acc(acc_id, options = {}) ⇒ Object



90
91
92
93
94
# File 'lib/podio/models/calendar_event.rb', line 90

def get_calendars_for_linked_acc(acc_id, options={})
  list Podio.connection.get { |req|
    req.url("/calendar/export/linked_account/#{acc_id}/available", options)
  }.body
end

.get_global_exportsObject



160
161
162
163
164
# File 'lib/podio/models/calendar_event.rb', line 160

def get_global_exports()
  list Podio.connection.get { |req|
    req.url("/calendar/export/")
  }.body
end

.get_reference_exports(ref_type, ref_id) ⇒ Object



139
140
141
142
143
# File 'lib/podio/models/calendar_event.rb', line 139

def get_reference_exports(ref_type, ref_id)
  list Podio.connection.get { |req|
    req.url("/calendar/export/#{ref_type}/#{ref_id}/")
  }.body
end

.move_event(uid, attributes = {}) ⇒ Object

See Also:



55
56
57
58
59
60
61
# File 'lib/podio/models/calendar_event.rb', line 55

def move_event(uid, attributes={})
  response = Podio.connection.post do |req|
    req.url "/calendar/event/#{uid}/move"
    req.body = attributes
  end
  member response.body
end

.move_event_external(linked_account_id, uid, attributes = {}) ⇒ Object

See Also:



64
65
66
67
68
69
70
# File 'lib/podio/models/calendar_event.rb', line 64

def move_event_external(, uid, attributes={})
  response = Podio.connection.post do |req|
    req.url "/calendar/linked_account/#{}/event/#{CGI.escape(uid)}/move"
    req.body = attributes
  end
  member response.body
end

.set_global_export(linked_account_id, attributes = {}) ⇒ Object



151
152
153
154
155
156
157
# File 'lib/podio/models/calendar_event.rb', line 151

def set_global_export(, attributes={})
  response = Podio.connection.put do |req|
    req.url "/calendar/export/linked_account/#{}"
    req.body = attributes
  end
  response.status
end

.set_reference_export(linked_account_id, ref_type, ref_id, attributes = {}) ⇒ Object



130
131
132
133
134
135
136
# File 'lib/podio/models/calendar_event.rb', line 130

def set_reference_export(, ref_type, ref_id, attributes={})
  response = Podio.connection.put do |req|
    req.url "/calendar/export/linked_account/#{}/#{ref_type}/#{ref_id}"
    req.body = attributes
  end
  response.status
end

.stop_global_export(linked_account_id) ⇒ Object



166
167
168
# File 'lib/podio/models/calendar_event.rb', line 166

def stop_global_export()
  Podio.connection.delete("/calendar/export/linked_account/#{}").status
end

.stop_reference_export(linked_account_id, ref_type, ref_id) ⇒ Object



146
147
148
# File 'lib/podio/models/calendar_event.rb', line 146

def stop_reference_export(, ref_type, ref_id)
  Podio.connection.delete("/calendar/export/linked_account/#{}/#{ref_type}/#{ref_id}").status
end

.update_event_duration(uid, attributes = {}) ⇒ Object

See Also:



73
74
75
76
77
78
79
# File 'lib/podio/models/calendar_event.rb', line 73

def update_event_duration(uid, attributes={})
  response = Podio.connection.put do |req|
    req.url "/calendar/event/#{uid}/duration"
    req.body = attributes
  end
  member response.body
end

.update_event_duration_external(linked_account_id, uid, attributes = {}) ⇒ Object

See Also:



82
83
84
85
86
87
88
# File 'lib/podio/models/calendar_event.rb', line 82

def update_event_duration_external(, uid, attributes={})
  response = Podio.connection.put do |req|
    req.url "/calendar/linked_account/#{}/event/#{CGI.escape(uid)}/duration"
    req.body = attributes
  end
  member response.body
end