Module: IContact::Api::Subscriptions
- Included in:
- IContact::Api
- Defined in:
- lib/icontact/api/subscriptions.rb
Instance Method Summary collapse
- #create_subscription(data) ⇒ Object
- #create_subscriptions(data) ⇒ Object
- #get_subscription(id) ⇒ Object
- #get_subscriptions(limit = 10000) ⇒ Object
- #move_contact(id, data) ⇒ Object
- #update_subscription(id, data) ⇒ Object
- #update_subscriptions(data) ⇒ Object
Instance Method Details
#create_subscription(data) ⇒ Object
16 17 18 19 |
# File 'lib/icontact/api/subscriptions.rb', line 16 def create_subscription(data) response = post(subscriptions_path, wrap(data)) resource(response, 'subscriptions', true) end |
#create_subscriptions(data) ⇒ Object
21 22 23 24 |
# File 'lib/icontact/api/subscriptions.rb', line 21 def create_subscriptions(data) response = post(subscriptions_path, data) resource(response, 'subscriptions') end |
#get_subscription(id) ⇒ Object
5 6 7 8 9 |
# File 'lib/icontact/api/subscriptions.rb', line 5 def get_subscription(id) ensure_valid_id(id) response = get(subscriptions_path + id) resource(response, 'subscription') end |
#get_subscriptions(limit = 10000) ⇒ Object
11 12 13 14 |
# File 'lib/icontact/api/subscriptions.rb', line 11 def get_subscriptions(limit = 10000) response = get(subscriptions_path + query(limit: limit)) resource(response, 'subscriptions') end |
#move_contact(id, data) ⇒ Object
32 33 34 35 36 |
# File 'lib/icontact/api/subscriptions.rb', line 32 def move_contact(id, data) ensure_valid_id(id) response = put(subscriptions_path + id, data) resource(response, 'subscription') end |
#update_subscription(id, data) ⇒ Object
26 27 28 29 30 |
# File 'lib/icontact/api/subscriptions.rb', line 26 def update_subscription(id, data) ensure_valid_id(id) response = post(subscriptions_path + id, data) resource(response, 'subscription') end |
#update_subscriptions(data) ⇒ Object
38 39 40 41 |
# File 'lib/icontact/api/subscriptions.rb', line 38 def update_subscriptions(data) response = post(subscriptions_path, data) resource(response, 'subscriptions') end |