Module: IContact::Api::Users
- Included in:
- IContact::Api
- Defined in:
- lib/icontact/api/users.rb
Instance Method Summary collapse
- #create_user(data) ⇒ Object
- #create_users(data) ⇒ Object
- #delete_user(id) ⇒ Object
- #get_user(id) ⇒ Object
- #get_users(limit = 10000) ⇒ Object
- #update_user(id, data) ⇒ Object
- #update_users(data) ⇒ Object
Instance Method Details
#create_user(data) ⇒ Object
16 17 18 19 |
# File 'lib/icontact/api/users.rb', line 16 def create_user(data) response = post(users_path, wrap(data)) resource(response, 'users', true) end |
#create_users(data) ⇒ Object
21 22 23 24 |
# File 'lib/icontact/api/users.rb', line 21 def create_users(data) response = post(users_path, data) resource(response, 'users') end |
#delete_user(id) ⇒ Object
37 38 39 40 41 |
# File 'lib/icontact/api/users.rb', line 37 def delete_user(id) ensure_valid_id(id) response = delete(users_path + id) resource(response, 'status') end |
#get_user(id) ⇒ Object
5 6 7 8 9 |
# File 'lib/icontact/api/users.rb', line 5 def get_user(id) ensure_valid_id(id) response = get(users_path + id) resource(response, 'user') end |
#get_users(limit = 10000) ⇒ Object
11 12 13 14 |
# File 'lib/icontact/api/users.rb', line 11 def get_users(limit = 10000) response = get(users_path + query(limit: limit)) resource(response, 'users') end |
#update_user(id, data) ⇒ Object
26 27 28 29 30 |
# File 'lib/icontact/api/users.rb', line 26 def update_user(id, data) ensure_valid_id(id) response = post(users_path + id, data) resource(response, 'user') end |
#update_users(data) ⇒ Object
32 33 34 35 |
# File 'lib/icontact/api/users.rb', line 32 def update_users(data) response = post(users_path, data) resource(response, 'users') end |