plivo 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/plivo/resources/powerpacks.rb +102 -0
- data/lib/plivo/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3c84b1b66e13ca373b5da5190ef91780ceda80
|
4
|
+
data.tar.gz: 4007495802471698a81abca41717373193fbd6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab8a5c0ab8b211f0f3138400a6d70ddf2eb6950a78d9d19f304ca3416147da17d30099ca2342df6271042747c8321c0fad6abb6c0ac037e46740e85258bd726e
|
7
|
+
data.tar.gz: 87c6c2a4ebaedb8ed8c6b39a3f2bd0d3f80dbb02cb5b8a138315f29178a77a04b18aa66715ce80eff6fc6da680ce419229fd406695ae02669c20c0f9a139284f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [4.5.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.5.0) (2020-03-30)
|
4
|
+
- Add Tollfree support for Powerpack
|
5
|
+
|
3
6
|
## [4.4.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.4.0) (2020-03-27)
|
4
7
|
- Add post call quality feedback API support.
|
5
8
|
|
data/README.md
CHANGED
@@ -153,6 +153,12 @@ module Plivo
|
|
153
153
|
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Number/' + number.to_s ,
|
154
154
|
'POST')
|
155
155
|
end
|
156
|
+
|
157
|
+
def add_tollfree(tollfree)
|
158
|
+
number_pool_uuid = getnumberpool_uuid(uuid)
|
159
|
+
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Tollfree/' + tollfree.to_s ,
|
160
|
+
'POST')
|
161
|
+
end
|
156
162
|
|
157
163
|
def remove_number(number, unrent= false)
|
158
164
|
number_pool_uuid = getnumberpool_uuid(uuid)
|
@@ -160,6 +166,17 @@ module Plivo
|
|
160
166
|
'DELETE', { unrent: unrent }, false)
|
161
167
|
end
|
162
168
|
|
169
|
+
def remove_tollfree(number, unrent= false)
|
170
|
+
number_pool_uuid = getnumberpool_uuid(uuid)
|
171
|
+
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Tollfree/' + number.to_s ,
|
172
|
+
'DELETE', { unrent: unrent }, false)
|
173
|
+
end
|
174
|
+
|
175
|
+
def remove_shortcode(number)
|
176
|
+
number_pool_uuid = getnumberpool_uuid(uuid)
|
177
|
+
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Shortcode/' + number.to_s ,
|
178
|
+
'DELETE', { unrent: false }, false)
|
179
|
+
end
|
163
180
|
|
164
181
|
def list_shortcodes(options = nil)
|
165
182
|
number_pool_uuid = getnumberpool_uuid(uuid)
|
@@ -184,6 +201,30 @@ module Plivo
|
|
184
201
|
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Shortcode',
|
185
202
|
'GET', params)
|
186
203
|
end
|
204
|
+
|
205
|
+
def list_tollfree(options = nil)
|
206
|
+
number_pool_uuid = getnumberpool_uuid(uuid)
|
207
|
+
return perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Tollfree',
|
208
|
+
'GET') if options.nil?
|
209
|
+
params = {}
|
210
|
+
%i[offset limit].each do |param|
|
211
|
+
if options.key?(param) && valid_param?(param, options[param],
|
212
|
+
[Integer, Integer], true)
|
213
|
+
params[param] = options[param]
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
|
218
|
+
raise_invalid_request('The maximum number of results that can be '\
|
219
|
+
"fetched is 20. limit can't be more than 20 or less than 1")
|
220
|
+
end
|
221
|
+
|
222
|
+
if options.key?(:offset) && options[:offset] < 0
|
223
|
+
raise_invalid_request("Offset can't be negative")
|
224
|
+
end
|
225
|
+
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Tollfree',
|
226
|
+
'GET', params)
|
227
|
+
end
|
187
228
|
|
188
229
|
def find_shortcode(shortcode)
|
189
230
|
number_pool_uuid = getnumberpool_uuid(uuid)
|
@@ -191,6 +232,12 @@ module Plivo
|
|
191
232
|
'GET')
|
192
233
|
end
|
193
234
|
|
235
|
+
def find_tollfree(tollfree)
|
236
|
+
number_pool_uuid = getnumberpool_uuid(uuid)
|
237
|
+
perform_custom_action_apiresponse('NumberPool/' + number_pool_uuid + '/Tollfree/' + tollfree.to_s ,
|
238
|
+
'GET')
|
239
|
+
end
|
240
|
+
|
194
241
|
def buy_add_number(options = nil)
|
195
242
|
number_pool_uuid = getnumberpool_uuid(uuid)
|
196
243
|
params = {}
|
@@ -267,6 +314,10 @@ module Plivo
|
|
267
314
|
options = {'number_pool_id' => @number_pool_id}
|
268
315
|
Shortcode.new(@_client, {resource_json: options})
|
269
316
|
end
|
317
|
+
def tollfree
|
318
|
+
options = {'number_pool_id' => @number_pool_id}
|
319
|
+
Tollfree.new(@_client, {resource_json: options})
|
320
|
+
end
|
270
321
|
end
|
271
322
|
|
272
323
|
class Numbers < Base::Resource
|
@@ -455,6 +506,57 @@ module Plivo
|
|
455
506
|
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Shortcode/' + shortcode.to_s ,
|
456
507
|
'GET')
|
457
508
|
end
|
509
|
+
|
510
|
+
def remove(shortcode)
|
511
|
+
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Shortcode/' + shortcode.to_s ,
|
512
|
+
'DELETE', { unrent: false }, false)
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
516
|
+
class Tollfree < Base::Resource
|
517
|
+
def initialize(client, options = nil)
|
518
|
+
@_name = 'Tollfree'
|
519
|
+
@_identifier_string = 'number_pool_id'
|
520
|
+
super
|
521
|
+
end
|
522
|
+
|
523
|
+
def add(tollfree)
|
524
|
+
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Tollfree/' + tollfree.to_s ,
|
525
|
+
'POST')
|
526
|
+
end
|
527
|
+
|
528
|
+
def list(options = nil)
|
529
|
+
return perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Tollfree',
|
530
|
+
'GET') if options.nil?
|
531
|
+
params = {}
|
532
|
+
%i[offset limit].each do |param|
|
533
|
+
if options.key?(param) && valid_param?(param, options[param],
|
534
|
+
[Integer, Integer], true)
|
535
|
+
params[param] = options[param]
|
536
|
+
end
|
537
|
+
end
|
538
|
+
|
539
|
+
if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
|
540
|
+
raise_invalid_request('The maximum number of results that can be '\
|
541
|
+
"fetched is 20. limit can't be more than 20 or less than 1")
|
542
|
+
end
|
543
|
+
|
544
|
+
if options.key?(:offset) && options[:offset] < 0
|
545
|
+
raise_invalid_request("Offset can't be negative")
|
546
|
+
end
|
547
|
+
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Tollfree',
|
548
|
+
'GET')
|
549
|
+
end
|
550
|
+
|
551
|
+
def find(tollfree)
|
552
|
+
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Tollfree/' + tollfree.to_s ,
|
553
|
+
'GET')
|
554
|
+
end
|
555
|
+
|
556
|
+
def remove(tollfree, unrent= false)
|
557
|
+
perform_custom_action_apiresponse('NumberPool/' + @number_pool_id + '/Tollfree/' + tollfree.to_s ,
|
558
|
+
'DELETE', { unrent: unrent }, false)
|
559
|
+
end
|
458
560
|
end
|
459
561
|
|
460
562
|
class PowerpackInterface < Base::ResourceInterface
|
data/lib/plivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|