Class: Unitpost::Resources::Templates

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



308
309
310
# File 'lib/unitpost/resources.rb', line 308

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

#delete(id) ⇒ Object



320
321
322
# File 'lib/unitpost/resources.rb', line 320

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

#get(id) ⇒ Object



312
313
314
# File 'lib/unitpost/resources.rb', line 312

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

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



300
301
302
# File 'lib/unitpost/resources.rb', line 300

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

#list_all(**params) ⇒ Object



304
305
306
# File 'lib/unitpost/resources.rb', line 304

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

#update(id, body) ⇒ Object



316
317
318
# File 'lib/unitpost/resources.rb', line 316

def update(id, body)
  @http.request("PATCH", "/templates/#{enc(id)}", body: body)
end