action_network_rest 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/action_network_rest/events.rb +22 -2
- data/lib/action_network_rest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8b7b240942768a53e1147e7fffa36b885b26fb18dd6f776840b94ce8dc49e55
|
4
|
+
data.tar.gz: 30a574c7f97c5d24821705a26c3342d54cb19b51e3c5c8ea5675562457575067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff8444e27578df2e68ab63a794dac3404b3b2c6cea64f1b1ef79d75b1ebc4a66ac513a47f8e08c8a434587b09fb7af2b1121c52a6ee929a45440d2841ead784
|
7
|
+
data.tar.gz: 1008be4924275825b9b31c520259d33b538543db9c8ea0a37e0bd672d2ebfdf2a48704689ad579c3271e0331b30a4f7336836d40deb811ece18b10716b8a2dde
|
@@ -16,8 +16,22 @@ module ActionNetworkRest
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def create(event_data)
|
20
|
-
|
19
|
+
def create(event_data, creator_person_id: nil, organizer_person_id: nil)
|
20
|
+
post_body = event_data
|
21
|
+
|
22
|
+
if creator_person_id.present?
|
23
|
+
creator_person_url = action_network_url("/people/#{url_escape(creator_person_id)}")
|
24
|
+
post_body['_links'] ||= {}
|
25
|
+
post_body['_links']['osdi:creator'] = { href: creator_person_url }
|
26
|
+
end
|
27
|
+
|
28
|
+
if organizer_person_id.present?
|
29
|
+
organizer_person_url = action_network_url("/people/#{url_escape(organizer_person_id)}")
|
30
|
+
post_body['_links'] ||= {}
|
31
|
+
post_body['_links']['osdi:organizer'] = { href: organizer_person_url }
|
32
|
+
end
|
33
|
+
|
34
|
+
response = client.post_request(base_path, post_body)
|
21
35
|
object_from_response(response)
|
22
36
|
end
|
23
37
|
|
@@ -26,6 +40,12 @@ module ActionNetworkRest
|
|
26
40
|
event_campaign_id: event_campaign_id)
|
27
41
|
end
|
28
42
|
|
43
|
+
def update(id, event_data)
|
44
|
+
event_path = "#{base_path}#{url_escape(id)}"
|
45
|
+
response = client.put_request event_path, event_data
|
46
|
+
object_from_response(response)
|
47
|
+
end
|
48
|
+
|
29
49
|
private
|
30
50
|
|
31
51
|
def osdi_key
|