plivo 4.5.0 → 4.6.0

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: 4b3c84b1b66e13ca373b5da5190ef91780ceda80
4
- data.tar.gz: 4007495802471698a81abca41717373193fbd6fa
3
+ metadata.gz: 50ebb6885dd7e4cf94686ac3d869347ab86d17bf
4
+ data.tar.gz: 9f1810e64cac9201e96bf3b65fd445d935ca5284
5
5
  SHA512:
6
- metadata.gz: ab8a5c0ab8b211f0f3138400a6d70ddf2eb6950a78d9d19f304ca3416147da17d30099ca2342df6271042747c8321c0fad6abb6c0ac037e46740e85258bd726e
7
- data.tar.gz: 87c6c2a4ebaedb8ed8c6b39a3f2bd0d3f80dbb02cb5b8a138315f29178a77a04b18aa66715ce80eff6fc6da680ce419229fd406695ae02669c20c0f9a139284f
6
+ metadata.gz: 2b06b067eee857a96bab7daa65d0939a086f14ab195f9c351e922d469707de3c049ac4c7ab4533eb2718e4e8c8b4289296633844f12991487ad77d5ffc0861cf
7
+ data.tar.gz: 4934198948c682574caf6b64c3fa35db2fc0055d092d3712ec216218d7667b8cf11a568860669ba422d3e36a8c0d3e61fe4c72eceb23536d031eae01ee3c9565
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [4.6.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.6.0) (2020-03-31)
4
+ - Add application cascade delete support.
5
+
3
6
  ## [4.5.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.5.0) (2020-03-30)
4
7
  - Add Tollfree support for Powerpack
5
8
 
data/README.md CHANGED
@@ -8,7 +8,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'plivo', '>= 4.5.0'
11
+ gem 'plivo', '>= 4.6.0'
12
12
  ```
13
13
 
14
14
  And then execute:
@@ -46,7 +46,7 @@ module Plivo
46
46
  response = case method
47
47
  when 'GET' then send_get(resource_path, data, timeout)
48
48
  when 'POST' then send_post(resource_path, data, timeout, use_multipart_conn)
49
- when 'DELETE' then send_delete(resource_path, timeout)
49
+ when 'DELETE' then send_delete(resource_path, data, timeout)
50
50
  else raise_invalid_request("#{method} not supported by Plivo, yet")
51
51
  end
52
52
 
@@ -190,10 +190,11 @@ module Plivo
190
190
  response
191
191
  end
192
192
 
193
- def send_delete(resource_path, timeout)
193
+ def send_delete(resource_path, data, timeout)
194
194
  response = @conn.delete do |req|
195
195
  req.url resource_path
196
196
  req.options.timeout = timeout if timeout
197
+ req.body = JSON.generate(data) if data
197
198
  end
198
199
  response
199
200
  end
@@ -57,8 +57,22 @@ module Plivo
57
57
  perform_update(params)
58
58
  end
59
59
 
60
- def delete
61
- perform_delete
60
+ # @param [Hash] options
61
+ # @option options [Boolean] :cascade - delete associated endpoints
62
+ # @option options [String] :new_endpoint_application - Link associated endpoints to this app
63
+ def delete(options = nil)
64
+ return perform_delete if options.nil?
65
+ params = {}
66
+
67
+ if options.key?(:cascade) && valid_param?(:cascade, options[:cascade], [TrueClass, FalseClass], false, [true, false])
68
+ params[:cascade] = options[:cascade]
69
+ end
70
+
71
+ if options.key?(:new_endpoint_application) && valid_param?(:new_endpoint_application, options[:new_endpoint_application], [String, Symbol])
72
+ params[:new_endpoint_application] = options[:new_endpoint_application]
73
+ end
74
+
75
+ perform_delete(params)
62
76
  end
63
77
 
64
78
  def to_s
@@ -227,10 +241,13 @@ module Plivo
227
241
  ##
228
242
  # Delete an application
229
243
  # @param [String] app_id
230
- def delete(app_id)
244
+ # @param [Hash] options
245
+ # @option options [Boolean] :cascade - delete associated endpoints
246
+ # @option options [String] :new_endpoint_application - Link associated endpoints to this app
247
+ def delete(app_id, options = nil)
231
248
  valid_param?(:app_id, app_id, [String, Symbol], true)
232
249
  Application.new(@_client,
233
- resource_id: app_id).delete
250
+ resource_id: app_id).delete(options)
234
251
  end
235
252
  end
236
253
  end
@@ -1,4 +1,4 @@
1
1
  module Plivo
2
- VERSION = '4.5.0'.freeze
2
+ VERSION = '4.6.0'.freeze
3
3
 
4
4
  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.5.0
4
+ version: 4.6.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-30 00:00:00.000000000 Z
11
+ date: 2020-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday