Class: MarketoAPI::Lists

Inherits:
ClientProxy show all
Defined in:
lib/marketo_api/lists.rb

Overview

Marketo list operations.

Constant Summary collapse

NAMED_TYPES =

:nodoc:

{ #:nodoc:
  name:                      :MKTOLISTNAME,
  sales_user_id:             :MKTOSALESUSERID,
  salesforce_lead_owner_id:  :SFDCLEADOWNERID
}.freeze
TYPES =
NAMED_TYPES.values.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ClientProxy

inherited, #initialize

Constructor Details

This class inherits a constructor from MarketoAPI::ClientProxy

Class Method Details

.key(type, value) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/marketo_api/lists.rb', line 72

def key(type, value)
  {
    listKey: {
      keyType:  key_type(type),
      keyValue: value
    }
  }
end

Instance Method Details

#nameObject

:method: member? :call-seq:

member?(list_key, options)

Options

leads

Required. An array of Lead objects or lead keys. If both leads and lead are provided, they will be merged.

lead

An alias for leads.

strict

If true, the entire operation fails if any subset fails. Non-strict mode will complete everything it can and return errors for anything that failed.

Add leads to a Marketo list.



61
62
63
64
65
66
67
68
69
# File 'lib/marketo_api/lists.rb', line 61

{
  add:      :ADDTOLIST,
  remove:   :REMOVEFROMLIST,
  member?:  :ISMEMBEROFLIST,
}.each do |name, operation|
  define_method(name) do |list_key, options = {}|
    list_operation(operation, list_key, options)
  end
end