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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ad7612c6bccf090f5e717750753d3f47314b53b0a36d0b59907102f1dcd1eb
4
- data.tar.gz: adddc2d4bb8bab60b0db1ebb4312651793e757f193f177c68562c2b96d57cdd2
3
+ metadata.gz: d8b7b240942768a53e1147e7fffa36b885b26fb18dd6f776840b94ce8dc49e55
4
+ data.tar.gz: 30a574c7f97c5d24821705a26c3342d54cb19b51e3c5c8ea5675562457575067
5
5
  SHA512:
6
- metadata.gz: f9e77003bda8400d416e299575383eb36c4d9aa43e8451abb29877e7fd329d5fad8dd58655137218525d351ae49e6b274e75f80e75db90a94161f4ac9eeb9f43
7
- data.tar.gz: 171aa0166b8a8667f9ee1540ca5bdf3182401a9a7c91badd0bb701815d17e4f0ae22435da8e9202d636a25d7f9a3dd607272f13519238d0110cc4944e0f66021
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
- response = client.post_request(base_path, event_data)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionNetworkRest
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_network_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Moore