Module: Resend::Topics

Defined in:
lib/resend/topics.rb

Overview

Topics api wrapper

Class Method Summary collapse

Class Method Details

.create(params = {}) ⇒ Object



8
9
10
11
# File 'lib/resend/topics.rb', line 8

def create(params = {})
  path = "topics"
  Resend::Request.new(path, params, "post").perform
end

.get(topic_id = "") ⇒ Object



14
15
16
17
# File 'lib/resend/topics.rb', line 14

def get(topic_id = "")
  path = "topics/#{topic_id}"
  Resend::Request.new(path, {}, "get").perform
end

.list(params = {}) ⇒ Object



26
27
28
29
# File 'lib/resend/topics.rb', line 26

def list(params = {})
  path = Resend::PaginationHelper.build_paginated_path("topics", params)
  Resend::Request.new(path, {}, "get").perform
end

.remove(topic_id = "") ⇒ Object



32
33
34
35
# File 'lib/resend/topics.rb', line 32

def remove(topic_id = "")
  path = "topics/#{topic_id}"
  Resend::Request.new(path, {}, "delete").perform
end

.update(params = {}) ⇒ Object



20
21
22
23
# File 'lib/resend/topics.rb', line 20

def update(params = {})
  path = "topics/#{params[:topic_id]}"
  Resend::Request.new(path, params, "patch").perform
end