Class: Reattract::Customer
- Inherits:
-
Object
- Object
- Reattract::Customer
- Defined in:
- lib/reattract/resources/customer.rb
Overview
/v1/organization_customers
Class Method Summary collapse
- .create(user_id:, **kwargs) ⇒ Object
- .get(user_id:) ⇒ Object
- .list(limit: 20, page: 1, order: ['id desc']) ⇒ Object
- .update(user_id:, **kwargs) ⇒ Object
Class Method Details
.create(user_id:, **kwargs) ⇒ Object
7 8 9 10 11 |
# File 'lib/reattract/resources/customer.rb', line 7 def create(user_id:, **kwargs) collection_request.post( body: kwargs.merge(organization_user_id: user_id) ) end |
.get(user_id:) ⇒ Object
19 20 21 |
# File 'lib/reattract/resources/customer.rb', line 19 def get(user_id:) member_request(user_id: user_id).get end |
.list(limit: 20, page: 1, order: ['id desc']) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/reattract/resources/customer.rb', line 23 def list(limit: 20, page: 1, order: ['id desc']) collection_request.get( sort: order, pagination: { limit: limit, page: page } ) end |
.update(user_id:, **kwargs) ⇒ Object
13 14 15 16 17 |
# File 'lib/reattract/resources/customer.rb', line 13 def update(user_id:, **kwargs) member_request(user_id: user_id).patch( body: kwargs ) end |