class MarketoAPI::Lists
Marketo list operations.
Constants
- TYPES
Public Class Methods
# File lib/marketo_api/lists.rb, line 72 def key(type, value) { listKey: { keyType: key_type(type), keyValue: value } } end
Private Class Methods
# File lib/marketo_api/lists.rb, line 82 def key_type(key) res = if TYPES.include? key key else NAMED_TYPES[key] end raise ArgumentError, "Invalid key #{key}" unless res res end
Public Instance Methods
Options¶ ↑
leads
-
Required. An array of Lead objects or lead keys. If both
leads
andlead
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.
# File lib/marketo_api/lists.rb, line 14
Options¶ ↑
leads
-
Required. An array of Lead objects or lead keys. If both
leads
andlead
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.
# File lib/marketo_api/lists.rb, line 46
Options¶ ↑
leads
-
Required. An array of Lead objects or lead keys. If both
leads
andlead
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.
# File lib/marketo_api/lists.rb, line 30
Private Instance Methods
# File lib/marketo_api/lists.rb, line 94 def list_operation(operation, list_key, options = {}) leads = MarketoAPI.array(options.delete(:leads)) + MarketoAPI.array(options.delete(:lead)) if leads.empty? raise ArgumentError, ':lead or :leads must be provided' end call( :list_operation, listOperation: operation, listKey: list_key, strict: false, listMemberList: transform_param_list(:get, leads) ) end