Class: KazooRubySdk::Callflows

Inherits:
Base
  • Object
show all
Defined in:
lib/kazoo-ruby-sdk/callflows.rb

Instance Method Summary collapse

Methods inherited from Base

#account_id, #auth_token, #initialize, #owner_id, #pipe

Methods included from Connection

#pipeline

Constructor Details

This class inherits a constructor from KazooRubySdk::Base

Instance Method Details

#create(attributes) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/kazoo-ruby-sdk/callflows.rb', line 4

def create(attributes)
  pipe.put do |request|
    request.url "accounts/#{}/callflows"
    request.headers['X-Auth-Token'] = auth_token
    request.body = { data: attributes }
  end.body
end

#destroy(callflow_id) ⇒ Object



34
35
36
37
38
39
# File 'lib/kazoo-ruby-sdk/callflows.rb', line 34

def destroy(callflow_id)
  pipe.delete do |request|
    request.url "accounts/#{}/callflows/#{callflow_id}"
    request.headers['X-Auth-Token'] = auth_token
  end.body
end

#get(callflow_id) ⇒ Object



27
28
29
30
31
32
# File 'lib/kazoo-ruby-sdk/callflows.rb', line 27

def get(callflow_id)
  pipe.get do |request|
    request.url "accounts/#{}/callflows/#{callflow_id}"
    request.headers['X-Auth-Token'] = auth_token
  end.body
end

#listObject



20
21
22
23
24
25
# File 'lib/kazoo-ruby-sdk/callflows.rb', line 20

def list
  pipe.get do |request|
    request.url "accounts/#{}/callflows"
    request.headers['X-Auth-Token'] = auth_token
  end.body
end

#update(callflow_id, attributes) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/kazoo-ruby-sdk/callflows.rb', line 12

def update(callflow_id, attributes)
  pipe.patch do |request|
    request.url "accounts/#{}/callflows/#{callflow_id}"
    request.headers['X-Auth-Token'] = auth_token
    request.body = { data: attributes }
  end.body
end