vonage 7.6.0 → 7.7.0

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
  SHA256:
3
- metadata.gz: 0c49e3250bfdfaea4ece849f64f65e3e7820dafb185fc9816ccb5ae7c2a37a7c
4
- data.tar.gz: 402ae1133d19b7a6871642c480b2b2db162e0f560a1179513c088c5209f7e6f1
3
+ metadata.gz: 242b084a9fa7d5182003af91d36beecd17e87067eb857baafea3d3b3e39c249e
4
+ data.tar.gz: 71ac8feb31afc39000b60d06e41b158effa0017dcd88c5dd799f87474c45c873
5
5
  SHA512:
6
- metadata.gz: 1fdb9e9324d0a7c3d41b7670d20bfe16922a41ac97eb15a404a2a69394ee3d6b06fb7d37fbb90cf21dda1b15a35cbe64cfefc2236c2b3e1f0a36438b74e67b75
7
- data.tar.gz: 8d80c1b1aef68c354170a5e906427883ae8c48b931cf845f101a72addee80e397517a5c64046a333585963e4a0fde20e2cc48353f7a64908744bd1b72e887195
6
+ metadata.gz: 2fcd2b8066241a751dbdc7311272e1f5232c0aa740c8b1d6353d28e71295b1393035a8b27801d64503ad34d965b1794c345e3d3753bc7d11109db51222495576
7
+ data.tar.gz: 999ad595cb6efd3e8ac88cb306ffaf4b1267c356744985e107d6b7a8c488f8988b54ee57cc763cb47622587272bdbe9c8d994286b4067c270792b2743611b0e8
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.6.0'
4
+ VERSION = '7.7.0'
5
5
  end
data/lib/vonage/voice.rb CHANGED
@@ -19,8 +19,14 @@ module Vonage
19
19
  # @option params [required, Array<Hash>] :to
20
20
  # Connect to a Phone (PSTN) number, SIP Endpoint, Websocket, or VBC extension.
21
21
  #
22
- # @option params [required, Hash] :from
23
- # Connect to a Phone (PSTN) number.
22
+ # @option params [Hash] :from
23
+ # Connect to a Phone (PSTN) number. Should not be set if **:random_from_number** is **true**
24
+ # If not set, then **:random_from_number** will automatically be set to **true**
25
+ #
26
+ # @option params [Boolean] :random_from_number
27
+ # Set to **true** to use random phone number as **from**. The number will be selected from the list
28
+ # of the numbers assigned to the current application.
29
+ # **random_from_number: true** cannot be used together with **:from**.
24
30
  #
25
31
  # @option params [Array<String>] :ncco
26
32
  # The Vonage Call Control Object to use for this call.
@@ -55,6 +61,14 @@ module Vonage
55
61
  # @see https://developer.nexmo.com/api/voice#createCall
56
62
  #
57
63
  def create(params)
64
+ if params.key?(:from) && params[:random_from_number] == true
65
+ raise ClientError.new("`from` should not be set if `random_from_number` is `true`")
66
+ end
67
+
68
+ if params && !params.key?(:from)
69
+ params.merge!(random_from_number: true)
70
+ end
71
+
58
72
  request('/v1/calls', params: params, type: Post)
59
73
  end
60
74
 
@@ -101,7 +115,7 @@ module Vonage
101
115
  if params && !params.key?(:auto_advance)
102
116
  params.merge!(auto_advance: true)
103
117
  end
104
-
118
+
105
119
  request('/v1/calls', params: params, response_class: ListResponse)
106
120
  end
107
121
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vonage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.0
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-06 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nexmo-jwt