Module: IContact::Api::Lists
- Included in:
- IContact::Api
- Defined in:
- lib/icontact/api/lists.rb
Instance Method Summary collapse
- #create_list(data) ⇒ Object
- #create_lists(data) ⇒ Object
- #delete_list(id) ⇒ Object
- #get_list(id) ⇒ Object
- #get_lists(limit = 10000) ⇒ Object
- #update_list(id, data) ⇒ Object
- #update_list!(id, data) ⇒ Object
- #update_lists(data) ⇒ Object
Instance Method Details
#create_list(data) ⇒ Object
16 17 18 19 |
# File 'lib/icontact/api/lists.rb', line 16 def create_list(data) response = post(lists_path, wrap(data)) resource(response, 'lists', true) end |
#create_lists(data) ⇒ Object
21 22 23 24 |
# File 'lib/icontact/api/lists.rb', line 21 def create_lists(data) response = post(lists_path, data) resource(response, 'lists') end |
#delete_list(id) ⇒ Object
43 44 45 46 47 |
# File 'lib/icontact/api/lists.rb', line 43 def delete_list(id) ensure_valid_id(id) response = delete(lists_path + id) resource(response, 'status') end |
#get_list(id) ⇒ Object
5 6 7 8 9 |
# File 'lib/icontact/api/lists.rb', line 5 def get_list(id) ensure_valid_id(id) response = get(lists_path + id) resource(response, 'list') end |
#get_lists(limit = 10000) ⇒ Object
11 12 13 14 |
# File 'lib/icontact/api/lists.rb', line 11 def get_lists(limit = 10000) response = get(lists_path + query(limit: limit)) resource(response, 'lists') end |
#update_list(id, data) ⇒ Object
26 27 28 29 30 |
# File 'lib/icontact/api/lists.rb', line 26 def update_list(id, data) ensure_valid_id(id) response = post(lists_path + id, data) resource(response, 'list') end |
#update_list!(id, data) ⇒ Object
32 33 34 35 36 |
# File 'lib/icontact/api/lists.rb', line 32 def update_list!(id, data) ensure_valid_id(id) response = put(lists_path + id, data) resource(response, 'list') end |
#update_lists(data) ⇒ Object
38 39 40 41 |
# File 'lib/icontact/api/lists.rb', line 38 def update_lists(data) response = post(lists_path, data) resource(response, 'lists') end |