Class: LoopsSdk::Campaigns
Class Method Summary collapse
- .create(name:) ⇒ Object
- .get(campaign_id:) ⇒ Object
- .list(perPage: 20, cursor: nil) ⇒ Object
- .update(campaign_id:, name:) ⇒ Object
Class Method Details
.create(name:) ⇒ Object
10 11 12 |
# File 'lib/loops_sdk/campaigns.rb', line 10 def create(name:) make_request(method: :post, path: "v1/campaigns", body: { name: name }) end |
.get(campaign_id:) ⇒ Object
14 15 16 |
# File 'lib/loops_sdk/campaigns.rb', line 14 def get(campaign_id:) make_request(method: :get, path: "v1/campaigns/#{campaign_id}") end |
.list(perPage: 20, cursor: nil) ⇒ Object
6 7 8 |
# File 'lib/loops_sdk/campaigns.rb', line 6 def list(perPage: 20, cursor: nil) make_request(method: :get, path: "v1/campaigns", params: { perPage: perPage, cursor: cursor }) end |
.update(campaign_id:, name:) ⇒ Object
18 19 20 |
# File 'lib/loops_sdk/campaigns.rb', line 18 def update(campaign_id:, name:) make_request(method: :post, path: "v1/campaigns/#{campaign_id}", body: { name: name }) end |