plivo 4.27.0 → 4.27.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ac7974dc26d379831ecc8637397c0cbf43156b5
4
- data.tar.gz: 65b7a24f1cba9542117edefd8c19a48fc89e39bd
3
+ metadata.gz: 41cd25f112799f4fb4e95c0fadd5b7ba21d22d94
4
+ data.tar.gz: f8fdff993484bbf582168aaa778e4d36673cec4e
5
5
  SHA512:
6
- metadata.gz: 6b897b48d2cc18aeccbf0d5a9795fafe5f025d8d7375aad700bcdc05ea9c94a7786db3f667ed37af56df127749f66b3a6039deb90700582b8a536538e34c6278
7
- data.tar.gz: 9dcc97d2cb1fe1d6473daf99652a5ec7fec9aaea5c8681b67e7acf4aff56f4261e9496cf096835ae64b79a0bea574e2e51a7c91169797fadbe4a856c6e4cbd20
6
+ metadata.gz: eb2714de044e486a8c098d78ece87266f80c3ce05bdc6db8b5bd87ffd41326c3ef63b1c420be142bd9a1bf4baa7a8b72ceec36114fa9d1e747b247bd42936e7d
7
+ data.tar.gz: 3e08b774f282d3b92207e0ff7eeaa1e31da0b54461dc705245a8760b448af584ca68b730ac6845341c91ea16ede9ab52f2e44595f87ecc4b0b9b11bb7eb676ab
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [4.27.1](https://github.com/plivo/plivo-ruby/tree/v4.27.1) (2022-06-30)
4
+ - `from_number`, `to_number` and `stir_verification` added to filter param [Retrieve all calls] (https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)
5
+
3
6
  ## [4.27.0](https://github.com/plivo/plivo-ruby/tree/v4.27.0) (2022-05-05)
4
7
  **Feature - List all recordings**
5
8
  - `from_number` and `to_number` added to filter param [List all recordings](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
data/README.md CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'plivo', '>= 4.27.0'
12
+ gem 'plivo', '>= 4.27.1'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -275,14 +275,14 @@ module Plivo
275
275
  # @option options [String] :parent_call_uuid - The call_uuid of the first leg in an ongoing conference call. It is recommended to use this parameter in scenarios where a member who is already present in the conference intends to add new members by initiating outbound API calls. This minimizes the delay in adding a new memeber to the conference.
276
276
  # @option options [Boolean] :error_parent_not_found - if set to true and the parent_call_uuid cannot be found, the API request would return an error. If set to false, the outbound call API request will be executed even if the parent_call_uuid is not found. Defaults to false.
277
277
  # @return [Call] Call
278
- def create(from, to, answer_url, options = nil)
278
+ def create(from, to, answer_url, options = nil)
279
279
  valid_param?(:from, from, [String, Symbol, Integer], true)
280
280
  valid_param?(:to, to, Array, true)
281
281
  to.each do |to_num|
282
282
  valid_param?(:to_num, to_num, [Integer, String, Symbol], true)
283
283
  end
284
284
  valid_param?(:answer_url, answer_url, [String, Symbol], true)
285
-
285
+
286
286
 
287
287
  params = {
288
288
  from: from,
@@ -345,31 +345,6 @@ module Plivo
345
345
  return perform_list if options.nil?
346
346
  valid_param?(:options, options, Hash, true)
347
347
 
348
- params = {}
349
- params_expected = %i[
350
- subaccount bill_duration bill_duration__gt bill_duration__gte
351
- bill_duration__lt bill_duration__lte end_time end_time__gt
352
- end_time__gte end_time__lt end_time__lte parent_call_uuid hangup_source
353
- ]
354
- params_expected.each do |param|
355
- if options.key?(param) &&
356
- valid_param?(param, options[param], [String, Symbol], true)
357
- params[param] = options[param]
358
- end
359
- end
360
-
361
- if options.key?(:call_direction) &&
362
- valid_param?(:call_direction, options[:call_direction],
363
- [String, Symbol], true, %w[inbound outbound])
364
- params[:call_direction] = options[:call_direction]
365
- end
366
-
367
- %i[offset limit hangup_cause_code].each do |param|
368
- if options.key?(param) && valid_param?(param, options[param], [Integer, Integer], true)
369
- params[param] = options[param]
370
- end
371
- end
372
-
373
348
  raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0
374
349
 
375
350
  if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
@@ -377,6 +352,47 @@ module Plivo
377
352
  "fetched is 20. limit can't be more than 20 or less than 1")
378
353
  end
379
354
 
355
+ # initial list of possible params
356
+ params = %i[
357
+ bill_duration
358
+ bill_duration__gt
359
+ bill_duration__gte
360
+ bill_duration__lt
361
+ bill_duration__lte
362
+ call_direction
363
+ end_time
364
+ end_time__gt
365
+ end_time__gte
366
+ end_time__lt
367
+ end_time__lte
368
+ from_number
369
+ hangup_cause_code
370
+ hangup_source
371
+ limit
372
+ offset
373
+ parent_call_uuid
374
+ subaccount
375
+ to_number
376
+ stir_verification
377
+ ].reduce({}) do |result_hash, param|
378
+ if options.key?(param)
379
+ if param == :call_direction
380
+ if valid_param?(:call_direction, options[:call_direction],
381
+ [String, Symbol], true, %w[inbound outbound])
382
+ result_hash[:call_direction] = options[:call_direction]
383
+ end
384
+ elsif %i[offset limit hangup_cause_code].include?(param)
385
+ if valid_param?(param, options[param], [Integer, Integer], true)
386
+ result_hash[param] = options[param]
387
+ end
388
+ elsif valid_param?(param, options[param], [String, Symbol], true)
389
+ result_hash[param] = options[param]
390
+ end
391
+ end
392
+
393
+ result_hash
394
+ end
395
+
380
396
  perform_list(params)
381
397
  end
382
398
 
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.27.0".freeze
2
+ VERSION = "4.27.1".freeze
3
3
  end
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.27.0
4
+ version: 4.27.1
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: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -155,7 +155,6 @@ files:
155
155
  - ".github/workflows/unitTests.yml"
156
156
  - ".gitignore"
157
157
  - ".rspec"
158
- - ".travis.yml"
159
158
  - AUTHORS.md
160
159
  - CHANGELOG.md
161
160
  - Gemfile
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- bundler_args: --without development
5
- rvm:
6
- - ruby-head
7
- - 2.4.0
8
- - 2.3.0
9
- - 2.2.0
10
- - 2.1
11
- - 2.0.0