Class: Unitpost::Resources::Topics

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



234
235
236
# File 'lib/unitpost/resources.rb', line 234

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

#delete(id) ⇒ Object



246
247
248
# File 'lib/unitpost/resources.rb', line 246

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

#get(id) ⇒ Object



238
239
240
# File 'lib/unitpost/resources.rb', line 238

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

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



226
227
228
# File 'lib/unitpost/resources.rb', line 226

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

#list_all(**params) ⇒ Object



230
231
232
# File 'lib/unitpost/resources.rb', line 230

def list_all(**params)
  paginate("/email/topics", params)
end

#list_topics(contact_id, limit: nil, after: nil, before: nil) ⇒ Object



250
251
252
# File 'lib/unitpost/resources.rb', line 250

def list_topics(contact_id, limit: nil, after: nil, before: nil)
  @http.request("GET", "/contacts/#{enc(contact_id)}/topics", query: list_params(limit: limit, after: after, before: before))
end

#set_topic(contact_id, body) ⇒ Object



254
255
256
# File 'lib/unitpost/resources.rb', line 254

def set_topic(contact_id, body)
  @http.request("POST", "/contacts/#{enc(contact_id)}/topics", body: body)
end

#update(id, body) ⇒ Object



242
243
244
# File 'lib/unitpost/resources.rb', line 242

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