class MaropostApi::Workflows

Public Class Methods

new(request:, parser: Parser::EntityParser.new) click to toggle source
# File lib/maropost_api/workflows.rb, line 3
def initialize(request:, parser: Parser::EntityParser.new)
  @request = request
  @parser = parser
end

Public Instance Methods

reset(workflow_id:, contact_id:) click to toggle source
# File lib/maropost_api/workflows.rb, line 18
def reset(workflow_id:, contact_id:)
  response = @request.put(endpoint: "/workflows/#{workflow_id}/reset/#{contact_id}.json")
  Response.new(response: response, parser: @parser).call
end
start(workflow_id:, contact_id:) click to toggle source
# File lib/maropost_api/workflows.rb, line 13
def start(workflow_id:, contact_id:)
  response = @request.put(endpoint: "/workflows/#{workflow_id}/start/#{contact_id}.json")
  Response.new(response: response, parser: @parser).call
end
stop(workflow_id:, contact_id:) click to toggle source
# File lib/maropost_api/workflows.rb, line 8
def stop(workflow_id:, contact_id:)
  response = @request.put(endpoint: "/workflows/#{workflow_id}/stop/#{contact_id}.json")
  Response.new(response: response, parser: @parser).call
end