Module: Markety::Command::ListOperation

Included in:
Markety::Client
Defined in:
lib/markety/command/list_operation.rb

Overview

ListOperation commands return Response::ListOperationResponse objects.

In all these functions:

  • An exception will be thrown if you pass in a Lead and it doesn’t have an idnum

  • Allowed options:

    strict

    From Marketo’s docs: Strict mode will fail for the entire operation if any subset of the call fails. Non-strict mode will complete everything it can and return errors for anything that failed.

All ListOp failures look similar, and all successes look similar.

Instance Method Summary collapse

Instance Method Details

#add_to_list(list_name, lead_or_idnum, options = {}) ⇒ Object

note: If you add something that’s already in the list, ListOperationResponse::list_operation_success? will be true



14
15
16
# File 'lib/markety/command/list_operation.rb', line 14

def add_to_list(list_name, lead_or_idnum, options={})
  list_operation(list_name, "ADDTOLIST", lead_or_idnum, options)
end

#is_member_of_list(list_name, lead_or_idnum, options = {}) ⇒ Object

ListOperationResponse::list_operation_success? is the result of this query



24
25
26
# File 'lib/markety/command/list_operation.rb', line 24

def is_member_of_list(list_name, lead_or_idnum, options={})
  list_operation(list_name, "ISMEMBEROFLIST", lead_or_idnum, options)
end

#remove_from_list(list_name, lead_or_idnum, options = {}) ⇒ Object

note: If you remove something that’s not in the list, ListOperationResponse::list_operation_success? will be false



19
20
21
# File 'lib/markety/command/list_operation.rb', line 19

def remove_from_list(list_name, lead_or_idnum, options={})
  list_operation(list_name, "REMOVEFROMLIST", lead_or_idnum, options)
end