kazoo-ruby-sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18dd15e7663fd59b3e8b94c0ad156e1d0ba180a5
4
- data.tar.gz: fb0b1cdbe45f825110df53d86781d34b44d27978
3
+ metadata.gz: 922ecb832b8718bbf4a284762078e81ea42b6a81
4
+ data.tar.gz: fb5e485ad63a55fc826ccc01ec415004b8a70878
5
5
  SHA512:
6
- metadata.gz: 4afe2bec7fc29eabeea036dc3ba0a471acdc60fc6b907da3bb27b015b626045c84331d86d510761ba1ffc9d77db863fcd28a64fcd779e994b11c556072e114dc
7
- data.tar.gz: 125715ff7f377cc991107d46d35b62cd6ac46c7def93d0fcc927d3b21e1c9cb6aa74abe7d1b1cb31c9856a516e1b8d899d64472586d67440b49f8e21de7f4f59
6
+ metadata.gz: cf26e1c9733e23b67212ec3e1a780466e59996684a6964d9f67623c368c99b6521199b156194bb824cd835f425ca44e56875c91e2ccc9bc1ffe3a4ae260ca08f
7
+ data.tar.gz: 6671536b7ad79dd6e3d4815f5d60efd7280d1d512f1ae26f1defab558453ee73ba1a878d5c234cfae6095b3e078062a28c574249044b2e1ad4300c3fd4fc0975
data/README.md CHANGED
@@ -54,6 +54,18 @@ device = KazooRubySdk::Devices.get(device_id)
54
54
  * update(id, attributes)
55
55
  * destroy(id)
56
56
 
57
+ #### Callflows
58
+ * list()
59
+ * get(id)
60
+ * create(attributes)
61
+ * update(id, attributes)
62
+ * destroy(id)
63
+
64
+ #### CDRs
65
+ * range(from, to)
66
+ * get(cdr_id)
67
+ * get_all_by_user(user_id)
68
+
57
69
  ## Contributing
58
70
 
59
71
  Bug reports and pull requests are welcome on GitHub at https://github.com/pohodnya/kazoo-ruby-sdk.
@@ -8,6 +8,8 @@ require 'kazoo-ruby-sdk/session'
8
8
  require 'kazoo-ruby-sdk/base'
9
9
  require 'kazoo-ruby-sdk/devices'
10
10
  require 'kazoo-ruby-sdk/users'
11
+ require 'kazoo-ruby-sdk/callflows'
12
+ require 'kazoo-ruby-sdk/cdrs'
11
13
 
12
14
  module KazooRubySdk
13
15
  class << self
@@ -27,7 +29,7 @@ module KazooRubySdk
27
29
  end
28
30
 
29
31
  def self.configure
30
- self.cache = ActiveSupport::Cache::MemoryStore.new
32
+ self.cache = ActiveSupport::Cache::MemoryStore.new expires_in: 5.minutes
31
33
  yield(configuration)
32
34
  end
33
35
  end
@@ -0,0 +1,42 @@
1
+ module KazooRubySdk
2
+ class Callflows < Base
3
+ class << self
4
+ def create(attributes)
5
+ pipe.put do |request|
6
+ request.url "accounts/#{account_id}/callflows"
7
+ request.headers['X-Auth-Token'] = auth_token
8
+ request.body = { data: attributes }
9
+ end.body
10
+ end
11
+
12
+ def update(callflow_id, attributes)
13
+ pipe.patch do |request|
14
+ request.url "accounts/#{account_id}/callflows/#{callflow_id}"
15
+ request.headers['X-Auth-Token'] = auth_token
16
+ request.body = { data: attributes }
17
+ end.body
18
+ end
19
+
20
+ def list
21
+ pipe.get do |request|
22
+ request.url "accounts/#{account_id}/callflows"
23
+ request.headers['X-Auth-Token'] = auth_token
24
+ end.body
25
+ end
26
+
27
+ def get(callflow_id)
28
+ pipe.get do |request|
29
+ request.url "accounts/#{account_id}/callflows/#{callflow_id}"
30
+ request.headers['X-Auth-Token'] = auth_token
31
+ end.body
32
+ end
33
+
34
+ def destroy(callflow_id)
35
+ pipe.delete do |request|
36
+ request.url "accounts/#{account_id}/callflows/#{callflow_id}"
37
+ request.headers['X-Auth-Token'] = auth_token
38
+ end.body
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,26 @@
1
+ module KazooRubySdk
2
+ class CDRs < Base
3
+ class << self
4
+ def range(from, to)
5
+ pipe.get do |request|
6
+ request.url "accounts/#{account_id}/cdrs?created_from=#{from}&created_to=#{to}"
7
+ request.headers['X-Auth-Token'] = auth_token
8
+ end.body
9
+ end
10
+
11
+ def get(cdr_id)
12
+ pipe.get do |request|
13
+ request.url "accounts/#{account_id}/cdrs/#{cdr_id}"
14
+ request.headers['X-Auth-Token'] = auth_token
15
+ end.body
16
+ end
17
+
18
+ def get_all_by_user(user_id)
19
+ pipe.get do |request|
20
+ request.url "accounts/#{account_id}/users/#{user_id}/cdrs"
21
+ request.headers['X-Auth-Token'] = auth_token
22
+ end.body
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module KazooRubySdk
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kazoo-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksey Pohodnya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,6 +125,8 @@ files:
125
125
  - kazoo-ruby-sdk.gemspec
126
126
  - lib/kazoo-ruby-sdk.rb
127
127
  - lib/kazoo-ruby-sdk/base.rb
128
+ - lib/kazoo-ruby-sdk/callflows.rb
129
+ - lib/kazoo-ruby-sdk/cdrs.rb
128
130
  - lib/kazoo-ruby-sdk/configuration.rb
129
131
  - lib/kazoo-ruby-sdk/devices.rb
130
132
  - lib/kazoo-ruby-sdk/session.rb