Class: Podio::CalendarEvent
Overview
Instance Attribute Summary
#attributes
Class Method Summary
collapse
-
.find_all(options = {}) ⇒ Object
-
.find_all_for_app(app_id, options = {}) ⇒ Object
-
.find_all_for_linked_account(linked_account_id, options = {}) ⇒ Object
-
.find_all_for_space(space_id, options = {}) ⇒ Object
-
.find_personal_summary ⇒ Object
-
.find_summary(options = {}) ⇒ Object
-
.find_summary_for_org(org_id) ⇒ Object
-
.find_summary_for_space(space_id) ⇒ Object
-
.get_calendars_for_linked_acc(acc_id, options = {}) ⇒ Object
-
.get_global_exports ⇒ Object
-
.get_reference_exports(ref_type, ref_id) ⇒ Object
-
.move_event(uid, attributes = {}) ⇒ Object
-
.move_event_external(linked_account_id, uid, attributes = {}) ⇒ Object
-
.set_global_export(linked_account_id, attributes = {}) ⇒ Object
-
.set_reference_export(linked_account_id, ref_type, ref_id, attributes = {}) ⇒ Object
-
.stop_global_export(linked_account_id) ⇒ Object
-
.stop_reference_export(linked_account_id, ref_type, ref_id) ⇒ Object
-
.update_event_duration(uid, attributes = {}) ⇒ Object
-
.update_event_duration_external(linked_account_id, uid, attributes = {}) ⇒ Object
#==, #[], #[]=, #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
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 find_all_for_linked_account(linked_account_id, options = {})
list Podio.connection.get { |req|
req.url("/calendar/linked_account/#{linked_account_id}/", 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_summary ⇒ Object
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_exports ⇒ Object
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
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
64
65
66
67
68
69
70
|
# File 'lib/podio/models/calendar_event.rb', line 64
def move_event_external(linked_account_id, uid, attributes={})
response = Podio.connection.post do |req|
req.url "/calendar/linked_account/#{linked_account_id}/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(linked_account_id, attributes={})
response = Podio.connection.put do |req|
req.url "/calendar/export/linked_account/#{linked_account_id}"
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(linked_account_id, ref_type, ref_id, attributes={})
response = Podio.connection.put do |req|
req.url "/calendar/export/linked_account/#{linked_account_id}/#{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(linked_account_id)
Podio.connection.delete("/calendar/export/linked_account/#{linked_account_id}").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(linked_account_id, ref_type, ref_id)
Podio.connection.delete("/calendar/export/linked_account/#{linked_account_id}/#{ref_type}/#{ref_id}").status
end
|
.update_event_duration(uid, attributes = {}) ⇒ Object
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
82
83
84
85
86
87
88
|
# File 'lib/podio/models/calendar_event.rb', line 82
def update_event_duration_external(linked_account_id, uid, attributes={})
response = Podio.connection.put do |req|
req.url "/calendar/linked_account/#{linked_account_id}/event/#{CGI.escape(uid)}/duration"
req.body = attributes
end
member response.body
end
|