Skip to content

Commit 682a80f

Browse files
authored
feat: Number Insight Updates Q3 2025 (#338)
1 parent bab448d commit 682a80f

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

lib/vonage/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def files
7171
end
7272

7373
# @return [Meetings]
74-
#
74+
# @deprecated
7575
sig { returns(T.nilable(Vonage::Meetings)) }
7676
def meetings
7777
@meetings ||= T.let(Meetings.new(config), T.nilable(Vonage::Meetings))
@@ -113,7 +113,7 @@ def number_insight
113113
end
114114

115115
# @return [NumberInsight2]
116-
#
116+
# @deprecated
117117
sig { returns(T.nilable(Vonage::NumberInsight2)) }
118118
def number_insight_2
119119
@number_insight_2 ||= T.let(NumberInsight2.new(config), T.nilable(Vonage::NumberInsight2))
@@ -134,7 +134,7 @@ def pricing
134134
end
135135

136136
# @return [ProactiveConnect]
137-
#
137+
# @deprecated
138138
sig { returns(T.nilable(Vonage::ProactiveConnect)) }
139139
def proactive_connect
140140
@proactive_connect ||= T.let(ProactiveConnect.new(config), T.nilable(Vonage::ProactiveConnect))

lib/vonage/number_insight.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
module Vonage
55
class NumberInsight < Namespace
6+
self.authentication = Basic
67
# Provides basic number insight information about a number.
78
#
89
# @example

lib/vonage/number_insight_2.rb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,10 @@ class NumberInsight2 < Namespace
99

1010
self.request_body = JSON
1111

12-
# Make fraud check requests with a phone number by looking up fraud score and/or by checking sim swap status.
13-
#
14-
# @example
15-
# response = client.number_insight_2.fraud_check(type: 'phone', phone: '447900000000', insights: ['fraud_score'])
16-
#
17-
# @param [required, String] :type The type of number to check.
18-
# Accepted value is “phone” when a phone number is provided.
19-
#
20-
# @param [required, String] :phone A single phone number that you need insight about in the E.164 format.
21-
#
22-
# @param [required, Array] :insights An array of strings indicating the fraud check insights required for the number.
23-
# Must be least one of: `fraud_score`, `sim_swap`
24-
#
25-
# @return [Response]
26-
#
27-
# @see https://developer.vonage.com/en/api/number-insight.v2#fraud_check
28-
#
12+
# @deprecated
2913
sig { params(type: String, phone: String, insights: T::Array[String]).returns(Vonage::Response) }
3014
def fraud_check(type:, phone:, insights:)
15+
logger.info('This method is deprecated and will be removed in a future release.')
3116
raise ArgumentError.new("`insights` must not be an empty") if insights.empty?
3217

3318
request('/v2/ni', params: {type: type, phone: phone, insights: insights}, type: Post)

test/vonage/number_insight_test.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ def params
1010
{number: msisdn}
1111
end
1212

13-
def query
14-
params.merge(api_key_and_secret)
15-
end
16-
1713
def response
1814
{
1915
headers: response_headers,
@@ -31,7 +27,7 @@ def error_response
3127
def test_basic_method
3228
uri = 'https://api.nexmo.com/ni/basic/json'
3329

34-
stub_request(:get, uri).with(query: query).to_return(response, error_response)
30+
stub_request(:get, uri).with(query: params).to_return(response, error_response)
3531

3632
assert_kind_of Vonage::Response, number_insight.basic(params)
3733

@@ -46,7 +42,7 @@ def test_basic_method
4642
def test_standard_method
4743
uri = 'https://api.nexmo.com/ni/standard/json'
4844

49-
stub_request(:get, uri).with(query: query).to_return(response, error_response)
45+
stub_request(:get, uri).with(query: params).to_return(response, error_response)
5046

5147
assert_kind_of Vonage::Response, number_insight.standard(params)
5248

@@ -61,7 +57,7 @@ def test_standard_method
6157
def test_advanced_method
6258
uri = 'https://api.nexmo.com/ni/advanced/json'
6359

64-
stub_request(:get, uri).with(query: query).to_return(response, error_response)
60+
stub_request(:get, uri).with(query: params).to_return(response, error_response)
6561

6662
assert_kind_of Vonage::Response, number_insight.advanced(params)
6763

@@ -76,7 +72,7 @@ def test_advanced_method
7672
def test_advanced_async_method
7773
uri = 'https://api.nexmo.com/ni/advanced/async/json'
7874

79-
stub_request(:get, uri).with(query: query).to_return(response, error_response)
75+
stub_request(:get, uri).with(query: params).to_return(response, error_response)
8076

8177
assert_kind_of Vonage::Response, number_insight.advanced_async(params)
8278

0 commit comments

Comments
 (0)