Class: Unitpost::Resources::Suppressions

Inherits:
Base
  • Object
show all
Defined in:
lib/unitpost/resources.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Unitpost::Resources::Base

Instance Method Details

#create(body) ⇒ Object

Single ({ email: ... }) or bulk ({ emails: [...] }). Idempotent.



449
450
451
# File 'lib/unitpost/resources.rb', line 449

def create(body)
  @http.request("POST", "/suppressions", body: body)
end

#delete(id_or_email) ⇒ Object



457
458
459
# File 'lib/unitpost/resources.rb', line 457

def delete(id_or_email)
  @http.request("DELETE", "/suppressions/#{enc(id_or_email)}")
end

#get(id_or_email) ⇒ Object



453
454
455
# File 'lib/unitpost/resources.rb', line 453

def get(id_or_email)
  @http.request("GET", "/suppressions/#{enc(id_or_email)}")
end

#list(limit: nil, after: nil, before: nil, **filters) ⇒ Object



440
441
442
# File 'lib/unitpost/resources.rb', line 440

def list(limit: nil, after: nil, before: nil, **filters)
  @http.request("GET", "/suppressions", query: list_params(limit: limit, after: after, before: before, **filters))
end

#list_all(**params) ⇒ Object



444
445
446
# File 'lib/unitpost/resources.rb', line 444

def list_all(**params)
  paginate("/suppressions", params)
end