Class: Keplars::Resources::Automations
- Inherits:
-
Base
- Object
- Base
- Keplars::Resources::Automations
show all
- Defined in:
- lib/keplars/automations.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#enroll(id, email:) ⇒ Object
17
18
19
|
# File 'lib/keplars/automations.rb', line 17
def enroll(id, email:)
@client.request('POST', "/api/v1/public/automations/add-automation/#{id}/enroll", body: { email: email })[:data]
end
|
#get(id) ⇒ Object
13
14
15
|
# File 'lib/keplars/automations.rb', line 13
def get(id)
@client.request('GET', "/api/v1/public/automations/get-automation/#{id}")[:data]
end
|
#list(page: nil, limit: nil) ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'lib/keplars/automations.rb', line 4
def list(page: nil, limit: nil)
params = {}
params[:page] = page if page
params[:limit] = limit if limit
query = @client.send(:build_query_string, params)
@client.request('GET', "/api/v1/public/automations/get-all#{query}")[:data]
end
|
#unenroll(id, email:) ⇒ Object
21
22
23
|
# File 'lib/keplars/automations.rb', line 21
def unenroll(id, email:)
@client.request('DELETE', "/api/v1/public/automations/delete-automation/#{id}/subscribers", body: { email: email })[:data]
end
|