Class: Mailfloss::Resources::Keywords
- Defined in:
- lib/mailfloss/resources.rb,
sig/resources.rbs
Overview
/integrations/type/connections/id/keywords/#list*
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#add(type, id, list, rules:, idempotency_key: nil) ⇒ Hash
POST .../keywords/#list — add keyword rules (1-1000, all-or-nothing).
-
#delete(type, id, list, rule_id) ⇒ Hash
DELETE .../keywords/#list/ruleId — remove a keyword rule.
- #keywords_path(type, id, list) ⇒ String
-
#list(type, id, list, per_page: nil, cursor: nil) ⇒ Hash
GET .../keywords/#list — list keyword rules (blacklist or whitelist).
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mailfloss::Resources::Base
Instance Method Details
#add(type, id, list, rules:, idempotency_key: nil) ⇒ Hash
POST .../keywords/#list — add keyword rules (1-1000, all-or-nothing).
261 262 263 264 |
# File 'lib/mailfloss/resources.rb', line 261 def add(type, id, list, rules:, idempotency_key: nil) client.request(:post, keywords_path(type, id, list), body: { rules: rules }, idempotency_key: idempotency_key) end |
#delete(type, id, list, rule_id) ⇒ Hash
DELETE .../keywords/#list/ruleId — remove a keyword rule.
269 270 271 |
# File 'lib/mailfloss/resources.rb', line 269 def delete(type, id, list, rule_id) client.request(:delete, "#{keywords_path(type, id, list)}/#{encode(rule_id)}") end |
#keywords_path(type, id, list) ⇒ String
275 276 277 |
# File 'lib/mailfloss/resources.rb', line 275 def keywords_path(type, id, list) "/integrations/#{encode(type)}/connections/#{encode(id)}/keywords/#{encode(list)}" end |
#list(type, id, list, per_page: nil, cursor: nil) ⇒ Hash
GET .../keywords/#list — list keyword rules (blacklist or whitelist).
251 252 253 254 |
# File 'lib/mailfloss/resources.rb', line 251 def list(type, id, list, per_page: nil, cursor: nil) client.request(:get, keywords_path(type, id, list), query: { per_page: per_page, cursor: cursor }) end |