Skip to content

Commit ad5aebe

Browse files
authored
fix: Deprecate NI realTimeData (#20)
* chore: Bump versions * fix: Deprecate NumberInsight realTimeData * chore: Update changelog
1 parent 4f29b94 commit ad5aebe

File tree

10 files changed

+61
-17
lines changed

10 files changed

+61
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout the repo
2424
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2525
- name: Setup Java
26-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
26+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
2727
with:
2828
distribution: 'zulu'
2929
java-version: ${{ matrix.java }}

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@cbe18979603527f12c7871a6eb04833ecf1548c7
44+
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a
4545
with:
4646
languages: ${{ matrix.language }}
4747
build-mode: ${{ matrix.build-mode }}
@@ -51,6 +51,6 @@ jobs:
5151
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5252
# queries: security-extended,security-and-quality
5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@cbe18979603527f12c7871a6eb04833ecf1548c7
54+
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a
5555
with:
5656
category: "/language:${{matrix.language}}"

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
ref: ${{ github.event.release.target_commitish }}
1919
- name: Setup Java
20-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
20+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
2121
with:
2222
java-version: 21
2323
distribution: 'temurin'

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6060
# format to the repository Actions tab.
6161
- name: "Upload artifact"
62-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
62+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
6363
with:
6464
name: SARIF file
6565
path: results.sarif

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.1.3] - 2025-01-31
8+
9+
### Added
10+
- `NumberInsight.advanced` overload without `realTimeData` parameter
11+
12+
### Changed
13+
- Bumped Java SDK version to 8.16.0
14+
15+
### Deprecated
16+
- `realTimeData` in `NumberInsight.advanced`
17+
718
## [1.1.2] - 2024-12-12
819

920
### Fixed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ See all of our SDKs and integrations on the [Vonage Developer portal](https://de
5353
## Installation
5454
Releases are published to [Maven Central](https://central.sonatype.com/artifact/com.vonage/server-sdk-kotlin).
5555
Instructions for your build system can be found in the snippets section.
56-
They're also available from [here](https://search.maven.org/artifact/com.vonage/server-sdk-kotlin/1.1.2/jar).
56+
They're also available from [here](https://search.maven.org/artifact/com.vonage/server-sdk-kotlin/1.1.3/jar).
5757
Release notes for each version can be found in the [changelog](CHANGELOG.md).
5858

5959
Here are the instructions for including the SDK in your project:
@@ -63,7 +63,7 @@ Add the following to your `build.gradle` or `build.gradle.kts` file:
6363

6464
```groovy
6565
dependencies {
66-
implementation("com.vonage:server-sdk-kotlin:1.1.2")
66+
implementation("com.vonage:server-sdk-kotlin:1.1.3")
6767
}
6868
```
6969

@@ -74,7 +74,7 @@ Add the following to the `<dependencies>` section of your `pom.xml` file:
7474
<dependency>
7575
<groupId>com.vonage</groupId>
7676
<artifactId>server-sdk-kotlin</artifactId>
77-
<version>1.1.2</version>
77+
<version>1.1.3</version>
7878
</dependency>
7979
```
8080

@@ -160,8 +160,8 @@ including [**a searchable list of snippets**](https://github.com/Vonage/vonage-k
160160

161161
The SDK is fully documented with [KDocs](https://kotlinlang.org/docs/kotlin-doc.html), so you should have complete
162162
documentation from your IDE. You may need to click "Download Sources" in IntelliJ to get the full documentation.
163-
Alternatively, you can browse the documentation using a service like [Javadoc.io](https://javadoc.io/doc/com.vonage/server-sdk-kotlin/1.1.2/index.html),
164-
which renders the documentation for you from [the artifacts on Maven Central](https://repo.maven.apache.org/maven2/com/vonage/server-sdk-kotlin/1.1.2/).
163+
Alternatively, you can browse the documentation using a service like [Javadoc.io](https://javadoc.io/doc/com.vonage/server-sdk-kotlin/1.1.3/index.html),
164+
which renders the documentation for you from [the artifacts on Maven Central](https://repo.maven.apache.org/maven2/com/vonage/server-sdk-kotlin/1.1.3/).
165165

166166
For help with any specific APIs, refer to the relevant documentation on our [developer portal](https://developer.vonage.com/en/documentation),
167167
using the links provided in the [Supported APIs](#supported-apis) section. For completeness, you can also consult the

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.vonage</groupId>
77
<artifactId>server-sdk-kotlin</artifactId>
8-
<version>1.1.2</version>
8+
<version>1.1.3</version>
99

1010
<name>Vonage Kotlin Server SDK</name>
1111
<description>Kotlin client for Vonage APIs</description>
@@ -47,15 +47,15 @@
4747
<kotlin.compiler.languageVersion>2.0</kotlin.compiler.languageVersion>
4848
<kotlin.compiler.apiVersion>${kotlin.compiler.languageVersion}</kotlin.compiler.apiVersion>
4949
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
50-
<kotlin.lib.version>2.1.0</kotlin.lib.version>
50+
<kotlin.lib.version>2.1.10</kotlin.lib.version>
5151
<java.version>8</java.version>
5252
</properties>
5353

5454
<dependencies>
5555
<dependency>
5656
<groupId>com.vonage</groupId>
5757
<artifactId>server-sdk</artifactId>
58-
<version>8.15.1</version>
58+
<version>8.16.0</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.jetbrains.kotlin</groupId>

src/main/kotlin/com/vonage/client/kt/NumberInsight.kt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,33 @@ class NumberInsight internal constructor(private val client: InsightClient) {
6969
*
7070
* @return Advanced details about the number and insight metadata.
7171
*/
72+
@Deprecated("`realTimeData` is deprecated and will be removed in a future release.")
7273
fun advanced(number: String, countryCode: String? = null, cnam: Boolean = false,
73-
realTimeData: Boolean = false): AdvancedInsightResponse =
74+
realTimeData: Boolean): AdvancedInsightResponse =
7475
client.getAdvancedNumberInsight(AdvancedInsightRequest.builder().async(false)
7576
.number(number).country(countryCode).cnam(cnam).realTimeData(realTimeData).build()
7677
)
7778

79+
/**
80+
* Obtain advanced insight about a number synchronously. This is not recommended due to potential timeouts.
81+
*
82+
* @param number The phone number to look up in E.164 format.
83+
*
84+
* @param countryCode (OPTIONAL) The two-character country code in ISO 3166-1 alpha-2 format.
85+
*
86+
* @param cnam (OPTIONAL) Whether the name of the person who owns the phone number should be looked up
87+
* and returned in the response. Set to true to receive phone number owner name in the response. This
88+
* feature is available for US numbers only and incurs an additional charge.
89+
*
90+
* @return Advanced details about the number and insight metadata.
91+
*
92+
* @since 1.1.3
93+
*/
94+
fun advanced(number: String, countryCode: String? = null, cnam: Boolean = false): AdvancedInsightResponse =
95+
client.getAdvancedNumberInsight(AdvancedInsightRequest.builder().async(false)
96+
.number(number).country(countryCode).cnam(cnam).build()
97+
)
98+
7899
/**
79100
* Obtain advanced insight about a number asynchronously. This is recommended to avoid timeouts.
80101
*

src/main/kotlin/com/vonage/client/kt/Vonage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.vonage.client.VonageClient
2121
/**
2222
* Denotes the version of the Vonage Kotlin SDK being used, in SemVer format.
2323
*/
24-
const val VONAGE_KOTLIN_SDK_VERSION = "1.1.2"
24+
const val VONAGE_KOTLIN_SDK_VERSION = "1.1.3"
2525

2626
/**
2727
* The non-overridable user agent string used by the SDK.

src/test/kotlin/com/vonage/client/kt/NumberInsightTest.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ class NumberInsightTest : AbstractTest() {
6262
BASIC, STANDARD, ADVANCED, ADVANCED_ASYNC
6363
}
6464

65-
private fun mockInsight(type: InsightType, optionalParams: Boolean = false) {
65+
private fun mockInsight(type: InsightType, optionalParams: Boolean = false, includeRtd: Boolean = false) {
6666
val expectedRequestParams = mutableMapOf<String, Any>("number" to toNumber)
6767
if (optionalParams) {
6868
expectedRequestParams["country"] = countryCode
6969
if (type != InsightType.BASIC) {
7070
expectedRequestParams["cnam"] = cnam
7171
}
72-
if (type == InsightType.ADVANCED) {
72+
if (includeRtd) {
7373
expectedRequestParams["real_time_data"] = realTimeData
7474
}
7575
}
@@ -262,9 +262,21 @@ class NumberInsightTest : AbstractTest() {
262262
@Test
263263
fun `advanced insight all params`() {
264264
mockInsight(InsightType.ADVANCED, true)
265+
assertAdvancedResponse(client.advanced(toNumber, countryCode, cnam))
266+
}
267+
268+
@Test
269+
fun `advanced insight real time data all params`() {
270+
mockInsight(InsightType.ADVANCED, true, true)
265271
assertAdvancedResponse(client.advanced(toNumber, countryCode, cnam, realTimeData))
266272
}
267273

274+
@Test
275+
fun `advanced insight real time data required params`() {
276+
mockInsight(InsightType.ADVANCED, false, true)
277+
assertAdvancedResponse(client.advanced(toNumber, realTimeData = realTimeData))
278+
}
279+
268280
@Test
269281
fun `advanced async insight required params`() {
270282
mockInsight(InsightType.ADVANCED_ASYNC, false)

0 commit comments

Comments
 (0)