Class: Reloop::Services::ContactChannels

Inherits:
Object
  • Object
show all
Defined in:
lib/reloop/services/contact_channels.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ContactChannels

Returns a new instance of ContactChannels.



6
7
8
# File 'lib/reloop/services/contact_channels.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#add_contact(channel_id, params) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/reloop/services/contact_channels.rb', line 43

def add_contact(channel_id, params)
  @client.fetch(
    :post,
    "/api/contacts/channel/#{channel_id}",
    Support::Parameters.for_request(params),
  )
end

#create(params) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/reloop/services/contact_channels.rb', line 10

def create(params)
  @client.fetch(
    :post,
    "/api/contacts/v1/channels/create",
    Support::Parameters.for_request(params),
  )
end

#delete(channel_id) ⇒ Object



39
40
41
# File 'lib/reloop/services/contact_channels.rb', line 39

def delete(channel_id)
  @client.fetch(:delete, "/api/contacts/v1/channels/#{channel_id}")
end

#get(channel_id) ⇒ Object



27
28
29
# File 'lib/reloop/services/contact_channels.rb', line 27

def get(channel_id)
  @client.fetch(:get, "/api/contacts/v1/channels/#{channel_id}")
end

#list(params = {}) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/reloop/services/contact_channels.rb', line 18

def list(params = {})
  @client.fetch(
    :get,
    "/api/contacts/v1/channels/list",
    nil,
    Support::Parameters.for_query(params),
  )
end

#update(channel_id, params) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/reloop/services/contact_channels.rb', line 31

def update(channel_id, params)
  @client.fetch(
    :patch,
    "/api/contacts/v1/channels/#{channel_id}",
    Support::Parameters.for_request(params),
  )
end

#update_subscription(channel_id, params) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/reloop/services/contact_channels.rb', line 51

def update_subscription(channel_id, params)
  @client.fetch(
    :patch,
    "/api/contacts/channel/#{channel_id}",
    Support::Parameters.for_request(params),
  )
end