vonage 7.24.0 → 7.25.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
  SHA256:
3
- metadata.gz: dd59189827b061987ec3ef8e6b580ed7a0d5dba1513fd19a16bd01b223c64a88
4
- data.tar.gz: beb8f428da0682a0a4342ecbde7e9ef0113137afa904ec4a70d1bc2d18ceae9c
3
+ metadata.gz: 508c457f8278aae1d8cc3951a8b4c38423ab63307917c4bbc09960f45cbafa9f
4
+ data.tar.gz: '00329df94f3ab44d6ab8d2552931438358f92ad59c121db87e1668bd1c336814'
5
5
  SHA512:
6
- metadata.gz: 7d2d13f1f765ad39173e55c8f029308bba5d4fade7a30458828dd4c2dcddb9c2f6207dca291e7497af744d70f85471cf46de4d86ad103b871963989c624285d8
7
- data.tar.gz: 0ca1d89cea36c1e71fe136b86b83de92b7d719fc06c4559caef3b5393df20c40155e28a0666b126382694bbdf8d4a544a784a5844f22311b939c6cde7d2f682d
6
+ metadata.gz: 80d9743779edc4dca5c4c9babb6a8591d616e4ac2f393ca4932a5a8640574561b28c61c803dc7c397c99221f0a086bd4604f62e8b36b97c7fd2b7da85ddc88d0
7
+ data.tar.gz: 40756daa0add532dead58f6d7d057e5bfc8f5d39a9bd84515bcdc08f9a6686eb983b6859f45b71fde9e11b8f474dbecb8a2973ff7270fe8256d813e281783341
@@ -20,6 +20,7 @@ module Vonage
20
20
  end
21
21
 
22
22
  def from=(from)
23
+ validate_from(from)
23
24
  @from = from
24
25
  end
25
26
 
@@ -49,5 +50,14 @@ module Vonage
49
50
  private
50
51
 
51
52
  attr_writer :channel
53
+
54
+ def validate_from(from)
55
+ if from.match?(/\D/)
56
+ raise ArgumentError, "Invalid alpha-numeric 'from' value #{from}. Length must be between 3 and 11 characters." unless from.length.between?(3, 11)
57
+ else
58
+ raise ArgumentError, "Invalid numeric 'from' value #{from}. Length must be between 11 and 15 characters." unless from.length.between?(11, 15)
59
+ raise ArgumentError, "Invalid 'from' value #{from}. Expected to be in E.164 format" unless Phonelib.parse(from).valid?
60
+ end
61
+ end
52
62
  end
53
63
  end
@@ -19,6 +19,7 @@ module Vonage
19
19
  end
20
20
 
21
21
  def from=(from)
22
+ raise ArgumentError, "Invalid 'from' value #{from}. Length must be between 11 and 15 characters." unless from.length.between?(11, 15)
22
23
  raise ArgumentError, "Invalid 'from' value #{from}. Expected to be in E.164 format" unless Phonelib.parse(from.to_i).valid?
23
24
  @from = from
24
25
  end
@@ -17,6 +17,7 @@ module Vonage
17
17
  # )
18
18
  #
19
19
  # @param [required, String] :brand The brand that is sending the verification request
20
+ # - Must be between 1 and 16 characters in length
20
21
  #
21
22
  # @param [required, Array<Hash>] :workflow An array of hashes for channels in the workflow
22
23
  #
@@ -32,6 +33,8 @@ module Vonage
32
33
  # @see https://developer.vonage.com/en/api/verify.v2#newRequest
33
34
  #
34
35
  def start_verification(brand:, workflow:, **opts)
36
+ raise ArgumentError, ':brand must be a String' unless brand.is_a?(String)
37
+ raise ArgumentError, "Invalid 'brand' value #{brand}. Length must be between 1 and 16 characters." unless brand.length.between?(1, 16)
35
38
  raise ArgumentError, ':workflow must be an Array' unless workflow.is_a?(Array)
36
39
  raise ArgumentError, ':workflow must not be empty' if workflow.empty?
37
40
 
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module Vonage
4
- VERSION = '7.24.0'
4
+ VERSION = '7.25.0'
5
5
  end
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.24.0
4
+ version: 7.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-23 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vonage-jwt
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  - !ruby/object:Gem::Version
288
288
  version: '0'
289
289
  requirements: []
290
- rubygems_version: 3.5.3
290
+ rubygems_version: 3.5.11
291
291
  signing_key:
292
292
  specification_version: 4
293
293
  summary: This is the Ruby Server SDK for Vonage APIs. To use it you'll need a Vonage