Skip to content

Commit f23bfc8

Browse files
authored
feat: Support Messages API failover (#40)
* feat: Messages API failover * docs: Deprecate NV, SimSwap, Verify v1
1 parent 3c98e76 commit f23bfc8

File tree

18 files changed

+83
-20
lines changed

18 files changed

+83
-20
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ 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+
## [2.1.1] - 2025-05-08
8+
Adds support for failovers in Messages API
9+
10+
### Changed
11+
- Bumped Java SDK version to 9.3.1
12+
13+
### Fixed
14+
- Type inference behaviour of `Custom` client
15+
16+
### Deprecated
17+
- SIM Swap API
18+
- Number Verification API
19+
- Verify legacy (v1) API
20+
721
## [2.1.0] - 2025-04-30
822

923
### Added

README.md

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

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

6363
```groovy
6464
dependencies {
65-
implementation("com.vonage:server-sdk-kotlin:2.1.0")
65+
implementation("com.vonage:server-sdk-kotlin:2.1.1")
6666
}
6767
```
6868

@@ -73,7 +73,7 @@ Add the following to the `<dependencies>` section of your `pom.xml` file:
7373
<dependency>
7474
<groupId>com.vonage</groupId>
7575
<artifactId>server-sdk-kotlin</artifactId>
76-
<version>2.1.0</version>
76+
<version>2.1.1</version>
7777
</dependency>
7878
```
7979

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

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

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

pom.xml

Lines changed: 2 additions & 2 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>2.1.0</version>
8+
<version>2.1.1</version>
99

1010
<name>Vonage Kotlin Server SDK</name>
1111
<description>Kotlin client for Vonage APIs</description>
@@ -55,7 +55,7 @@
5555
<dependency>
5656
<groupId>com.vonage</groupId>
5757
<artifactId>server-sdk</artifactId>
58-
<version>9.2.0</version>
58+
<version>9.3.1</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.jetbrains.kotlin</groupId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.vonage.client.account.*
2020
/**
2121
* Implementation of the [Account API](https://developer.vonage.com/en/api/account).
2222
*
23-
* *Authentication method:* API key & secret.
23+
* *Authentication method:* API key and secret.
2424
*/
2525
class Account internal constructor(private val client: AccountClient) {
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import java.util.*
2626
/**
2727
* Implementation of the [Application API](https://developer.vonage.com/en/api/application.v2).
2828
*
29-
* *Authentication method:* API key & secret.
29+
* *Authentication method:* API key and secret.
3030
*/
3131
class Application internal constructor(private val client: ApplicationClient) {
3232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import java.util.*
2222
/**
2323
* Implementation of the [Conversion API](https://developer.vonage.com/en/api/Conversion).
2424
*
25-
* *Authentication method:* API key & secret.
25+
* *Authentication method:* API key and secret.
2626
*/
2727
class Conversion internal constructor(private val client: ConversionClient) {
2828

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import java.util.UUID
2828
/**
2929
* Implementation of the [Messages API](https://developer.vonage.com/en/api/messages-olympus).
3030
*
31-
* *Authentication method:* JWT (recommended), API key & secret (limited functionality).
31+
* *Authentication method:* JWT (recommended), API key and secret (limited functionality).
3232
*/
3333
class Messages internal constructor(private val client: MessagesClient) {
3434

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.vonage.client.insight.*
2020
/**
2121
* Implementation of the [Number Insight API](https://developer.vonage.com/en/api/number-insight).
2222
*
23-
* *Authentication method:* API key & secret.
23+
* *Authentication method:* API key and secret.
2424
*/
2525
class NumberInsight internal constructor(private val client: InsightClient) {
2626

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import java.net.URI
2424
* Implementation of the [Number Verification API](https://developer.vonage.com/en/api/camara/number-verification).
2525
*
2626
* *Authentication method:* JWT.
27+
*
28+
* @deprecated This API will be moved in a future major release.
2729
*/
30+
@Deprecated("This API will be moved in a future release.")
2831
class NumberVerification internal constructor(private val client: NumberVerificationClient) {
2932
private var redirectUri: URI? = null
3033

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.vonage.client.numbers.*
2020
/**
2121
* Implementation of the [Numbers API](https://developer.vonage.com/en/api/numbers).
2222
*
23-
* *Authentication method:* API key & secret.
23+
* *Authentication method:* API key and secret.
2424
*/
2525
class Numbers internal constructor(private val client: NumbersClient) {
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.vonage.client.redact.*
2020
/**
2121
* Implementation of the [Redact API](https://developer.vonage.com/en/api/redact).
2222
*
23-
* *Authentication method:* API key & secret.
23+
* *Authentication method:* API key and secret.
2424
*/
2525
class Redact internal constructor(private val client: RedactClient) {
2626

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import java.time.Instant
2424
* Implementation of the [Sim Swap API](https://developer.vonage.com/en/api/camara/sim-swap).
2525
*
2626
* *Authentication method:* JWT.
27+
*
28+
* @deprecated This API will be moved in a future major release.
2729
*/
30+
@Deprecated("This API will be moved in a future release.")
2831
class SimSwap internal constructor(private val client: SimSwapClient) {
2932

3033
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.vonage.client.sms.messages.*
2121
/**
2222
* Implementation of the [SMS API](https://developer.vonage.com/en/api/sms).
2323
*
24-
* *Authentication method:* API key & secret or signature secret.
24+
* *Authentication method:* API key and secret or signature secret.
2525
*/
2626
class Sms internal constructor(private val client: SmsClient) {
2727

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import java.time.Instant
2222
/**
2323
* Implementation of the [Subaccounts API](https://developer.vonage.com/en/api/subaccounts).
2424
*
25-
* *Authentication method:* API key & secret.
25+
* *Authentication method:* API key and secret.
2626
*/
2727
class Subaccounts internal constructor(private val client: SubaccountsClient) {
2828

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import java.util.*
2121
/**
2222
* Implementation of the [Verify v2 API](https://developer.vonage.com/en/api/verify.v2).
2323
*
24-
* *Authentication method:* JWT (recommended) and API key & secret (limited functionality).
24+
* *Authentication method:* JWT (recommended), API key and secret (limited functionality).
2525
*/
2626
class Verify(private val client: Verify2Client) {
2727

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ import com.vonage.client.verify.*
2020
/**
2121
* Implementation of the [Verify v1 API](https://developer.vonage.com/en/api/verify).
2222
*
23-
* *Authentication method:* API key & secret or signature secret.
23+
* *Authentication method:* API key and secret or signature secret.
24+
*
25+
* @deprecated Please migrate to [Verify].
2426
*/
27+
@Deprecated("Please migrate to Verify v2.")
2528
class VerifyLegacy internal constructor(private val client: VerifyClient) {
2629

2730
/**

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

Lines changed: 10 additions & 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 = "2.1.0"
24+
const val VONAGE_KOTLIN_SDK_VERSION = "2.1.1"
2525

2626
/**
2727
* The non-overridable user agent string used by the SDK.
@@ -102,7 +102,10 @@ class Vonage(config: VonageClient.Builder.() -> Unit) {
102102
* Access to the CAMARA Number Verification API.
103103
*
104104
* @return The [NumberVerification] client.
105+
*
106+
* @deprecated This API will be moved in a future major release.
105107
*/
108+
@Deprecated("This API will be removed in a future release.")
106109
val numberVerification = NumberVerification(client.numberVerificationClient)
107110

108111
/**
@@ -116,7 +119,10 @@ class Vonage(config: VonageClient.Builder.() -> Unit) {
116119
* Access to the CAMARA SIM Swap API.
117120
*
118121
* @return The [SimSwap] client.
122+
*
123+
* @deprecated This API will be moved in a future major release.
119124
*/
125+
@Deprecated("This API will be removed in a future release.")
120126
val simSwap = SimSwap(client.simSwapClient)
121127

122128
/**
@@ -152,7 +158,10 @@ class Vonage(config: VonageClient.Builder.() -> Unit) {
152158
* Access to the Vonage Verify v1 API.
153159
*
154160
* @return The [VerifyLegacy] client.
161+
*
162+
* @deprecated Please migrate to [verify].
155163
*/
164+
@Deprecated("Please migrate to Verify v2.")
156165
val verifyLegacy = VerifyLegacy(client.verifyClient)
157166

158167
/**

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

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,32 @@ class MessagesTest : AbstractTest() {
100100
"ttl" to ttl,
101101
"webhook_url" to webhookUrl,
102102
"webhook_version" to "v0.1",
103+
"failover" to listOf(
104+
textBody("rcs", mapOf(
105+
"client_ref" to clientRef,
106+
"webhook_url" to webhookUrl,
107+
"webhook_version" to "v1"
108+
)),
109+
textBody("whatsapp")
110+
),
103111
"sms" to mapOf(
104112
"content_id" to contentId,
105113
"entity_id" to entityId
106-
)
114+
),
107115
)), smsText {
108116
from(altNumber); to(toNumber); text(text); ttl(ttl)
109117
clientRef(clientRef); contentId(contentId); entityId(entityId)
110118
webhookUrl(webhookUrl); webhookVersion(MessagesVersion.V0_1)
119+
failover(
120+
rcsText {
121+
from(altNumber); to(toNumber); text(text)
122+
clientRef(clientRef); webhookUrl(webhookUrl);
123+
webhookVersion(MessagesVersion.V1)
124+
},
125+
whatsappText {
126+
from(altNumber); to(toNumber); text(text)
127+
}
128+
)
111129
})
112130
}
113131

@@ -665,6 +683,9 @@ class MessagesTest : AbstractTest() {
665683
val amount = 0.0333
666684
val channel = Channel.SMS
667685
val smsCount = 2
686+
val workflowId = "3TcNjgZZVM5SwCSSuqHNNDR1cSLnqA2Uik3gAonxNiLgAsUggBEzw2n"
687+
val workflowItemNumber = 3
688+
val workflowItemsTotal = 5
668689
val parsed = MessageStatus.fromJson(
669690
"""
670691
{
@@ -681,6 +702,11 @@ class MessagesTest : AbstractTest() {
681702
"instance": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
682703
}
683704
},
705+
"workflow": {
706+
"id": "$workflowId",
707+
"item_number": "$workflowItemNumber",
708+
"items_total": "$workflowItemsTotal"
709+
},
684710
"client_ref": "$clientRef",
685711
"usage": {
686712
"currency": "$currency",
@@ -710,6 +736,11 @@ class MessagesTest : AbstractTest() {
710736
assertEquals(channel, parsed.channel)
711737
assertEquals(networkCode, parsed.destinationNetworkCode)
712738
assertEquals(smsCount, parsed.smsTotalCount)
739+
val workflow = parsed.workflow
740+
assertNotNull(workflow)
741+
assertEquals(workflowId, workflow.id)
742+
assertEquals(workflowItemNumber, workflow.itemNumber)
743+
assertEquals(workflowItemsTotal, workflow.totalItems)
713744
}
714745

715746
@Test

0 commit comments

Comments
 (0)