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.



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

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

#delete(id_or_email) ⇒ Object



447
448
449
# File 'lib/unitpost/resources.rb', line 447

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

#get(id_or_email) ⇒ Object



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

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

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



430
431
432
# File 'lib/unitpost/resources.rb', line 430

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



434
435
436
# File 'lib/unitpost/resources.rb', line 434

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