class ActiveCampaignWrapper::Core::TaskTypeGateway

Public Class Methods

new(client) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 6
def initialize(client)
  @client = client
  @config = client.config
end

Public Instance Methods

all(**params) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 11
def all(**params)
  @config.get('/dealTasktypes', query: params)
end
create(params) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 15
def create(params)
  params = { deal_tasktype: params }
  @config.post(
    '/dealTasktypes',
    body: ActiveCampaignWrapper::Helpers.normalize_body(params)
  )
end
delete(task_type_id) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 23
def delete(task_type_id)
  @config.delete("/dealTasktypes/#{task_type_id}")
end
find(task_type_id) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 35
def find(task_type_id)
  @config.get("/dealTasktypes/#{task_type_id}")
end
move_tasks(from_task_type_id, to_task_type_id) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 39
def move_tasks(from_task_type_id, to_task_type_id)
  params = { deal_task: { deal_tasktype: to_task_type_id } }
  @config.put(
    "/dealTasktypes/#{from_task_type_id}/dealTasks",
    body: ActiveCampaignWrapper::Helpers.normalize_body(params)
  )
end
update(task_type_id, params) click to toggle source
# File lib/active_campaign_wrapper/core/task_type_gateway.rb, line 27
def update(task_type_id, params)
  params = { deal_tasktype: params }
  @config.put(
    "/dealTasktypes/#{task_type_id}", body:
    ActiveCampaignWrapper::Helpers.normalize_body(params)
  )
end