Skip to content

Commit b440fa4

Browse files
authored
refactor! Prepare v2.0.0 based on Java SDK v9.0.0 (#33)
* ci: Bump GH Action digest hashes * refactor!: Update based on Java SDK 9.0.0 * chore(deps): Bump Maven Surefire plugin * chore(deps): Bump JaCoCo version * ci: Post release notification to Slack * chore: Fix security policy mail link
1 parent ba40d9a commit b440fa4

36 files changed

+186
-502
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ updates:
55
- package-ecosystem: "maven"
66
directory: "/"
77
schedule:
8-
interval: "weekly"
8+
interval: "monthly"
99
commit-message:
1010
prefix: "build"

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
os: [ubuntu-latest, macos-latest, windows-latest]
2222
steps:
2323
- name: Checkout the repo
24-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
24+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
2525
- name: Setup Java
26-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
26+
uses: actions/setup-java@3b6c050358614dd082e53cdbc55580431fc4e437
2727
with:
2828
distribution: 'zulu'
2929
java-version: ${{ matrix.java }}
@@ -44,9 +44,9 @@ jobs:
4444
os: [ubuntu-latest, macos-latest, windows-latest]
4545
steps:
4646
- name: Checkout the repo
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
47+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
4848
- name: Setup Java
49-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
49+
uses: actions/setup-java@3b6c050358614dd082e53cdbc55580431fc4e437
5050
with:
5151
distribution: 'corretto'
5252
java-version: ${{ matrix.java }}

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
build-mode: autobuild
3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
40+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a
44+
uses: github/codeql-action/init@486ab5a2922b634015408a83e10f6867efb5922c
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@dd746615b3b9d728a6a37ca2045b68ca76d4841a
54+
uses: github/codeql-action/analyze@486ab5a2922b634015408a83e10f6867efb5922c
5555
with:
5656
category: "/language:${{matrix.language}}"

.github/workflows/publish.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to Central
1+
name: Publish to Maven Central
22
on:
33
release:
44
types: [published]
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout the repo
16-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
16+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
1717
with:
1818
ref: ${{ github.event.release.target_commitish }}
1919
- name: Setup Java
20-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
20+
uses: actions/setup-java@3b6c050358614dd082e53cdbc55580431fc4e437
2121
with:
2222
java-version: 21
2323
distribution: 'temurin'
@@ -33,3 +33,32 @@ jobs:
3333
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }}
3434
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}
3535
run: mvn -e --no-transfer-progress --batch-mode deploy -P release-sign-artifacts
36+
notify-release:
37+
runs-on: ubuntu-latest
38+
name: Notify Release
39+
strategy:
40+
matrix:
41+
url: [SLACK_WEBHOOK_ASK_DEVREL_URL, SLACK_WEBHOOK_DEVREL_TOOLING_URL, SLACK_WEBHOOK_DEVREL_PRIVATE_URL]
42+
steps:
43+
- name: Send to Slack channels
44+
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d
45+
with:
46+
webhook: ${{ secrets[matrix.url] }}
47+
webhook-type: incoming-webhook
48+
errors: true
49+
payload: |
50+
blocks:
51+
- type: "header"
52+
text:
53+
type: "plain_text"
54+
text: ":initial_external_notification_sent: Kotlin Server SDK ${{ github.event.release.name }} has been released."
55+
- type: "section"
56+
text:
57+
type: "mrkdwn"
58+
text: "${{ github.event.release.body }}"
59+
emoji: true
60+
- type: "divider"
61+
- type: "section"
62+
text:
63+
type: "mrkdwn"
64+
text: "View the full change log <${{ github.event.release.html_url }}|here>."

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
35+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
3636
with:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46
40+
uses: ossf/scorecard-action@5e6e801bdc1342ad294f36b91afd06af2e4a0f3b
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
62+
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47
6363
with:
6464
name: SARIF file
6565
path: results.sarif
@@ -68,6 +68,6 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@86b04fb0e47484f7282357688f21d5d0e32175fe
71+
uses: github/codeql-action/upload-sarif@486ab5a2922b634015408a83e10f6867efb5922c
7272
with:
7373
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ 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.0.0] - 2025-04-08
8+
Major release for compatibility with [Java SDK v9.0.0](https://github.com/Vonage/vonage-java-sdk/releases/tag/v9.0.0)
9+
10+
### Changed
11+
- Bumped Java SDK version to 9.0.0 (see Java SDK changelog for details of breaking changes)
12+
- Moved most enums from inner classes
13+
- Stronger typing for response fields
14+
- Removed deprecated methods, constructors, classes, fields, packages etc.
15+
- Internal refactoring
16+
- Refactored `Archive.setLayout` and `Broadcast.setLayout` parameters to take `StreamCompositionLayout` directly
17+
18+
### Removed
19+
- `Verify.whatsappCodeless` workflow
20+
- Pricing API
21+
- `dateStart` and `dateEnd` methods in `CallsFilter` (as previously deprecated)
22+
- `realTimeData` in `NumberInsight.advanced` (as previously deprecated)
23+
724
## [1.2.1] - 2025-03-19
825

926
### Changed

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.2.1/jar).
56+
They're also available from [here](https://search.maven.org/artifact/com.vonage/server-sdk-kotlin/2.0.0/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.2.1")
66+
implementation("com.vonage:server-sdk-kotlin:2.0.0")
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.2.1</version>
77+
<version>2.0.0</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.2.1/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.2.1/).
163+
Alternatively, you can browse the documentation using a service like [Javadoc.io](https://javadoc.io/doc/com.vonage/server-sdk-kotlin/2.0.0/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/2.0.0/).
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

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ a planned release, to allow time for the fix to be included in the next release.
88

99
## Reporting a Vulnerability
1010
To report a security concern, use the "[Report a Vulnerability](https://github.com/Vonage/vonage-kotlin-sdk/security/advisories/new)" tab.
11-
You can also contact the Developer Relations team directly via [email](devrel@vonage.com) for more private disclosure.
11+
You can also contact the Developer Relations team directly via [email](mailto:devrel@vonage.com) for more private disclosure.
1212
You can also [raise an Issue](https://github.com/Vonage/vonage-kotlin-sdk/issues/new/choose) and/or create a [Pull Request](https://github.com/Vonage/vonage-kotlin-sdk/pulls) from your fork of the repo.
1313
Please include as much detail as possible, an indication of severity and, ideally, a minimal reproducible example to demonstrate the issue if possible.

bumpversion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ then
44
exit 1
55
fi
66

7-
mvn versions:set -DnewVersion=$1
7+
mvn versions:set -DnewVersion="$1"
88
mvn validate
99
rm pom.xml.versionsBackup #pom.xml.releaseBackup
1010
#mvn versions:display-plugin-updates

pom.xml

Lines changed: 4 additions & 4 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.2.1</version>
8+
<version>2.0.0</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>8.20.1</version>
58+
<version>9.0.0</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.jetbrains.kotlin</groupId>
@@ -156,12 +156,12 @@
156156
</plugin>
157157
<plugin>
158158
<artifactId>maven-surefire-plugin</artifactId>
159-
<version>3.5.2</version>
159+
<version>3.5.3</version>
160160
</plugin>
161161
<plugin>
162162
<groupId>org.jacoco</groupId>
163163
<artifactId>jacoco-maven-plugin</artifactId>
164-
<version>0.8.12</version>
164+
<version>0.8.13</version>
165165
<executions>
166166
<execution>
167167
<id>jacoco-init</id>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Account internal constructor(private val client: AccountClient) {
8686
fun list(): List<SecretResponse> = (
8787
if (apiKey == null) client.listSecrets()
8888
else client.listSecrets(apiKey)
89-
).secrets
89+
)
9090

9191
/**
9292
* Creates a new secret for the account.

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.vonage.client.application.capabilities.*
2121
import com.vonage.client.application.capabilities.Messages
2222
import com.vonage.client.application.capabilities.Verify
2323
import com.vonage.client.application.capabilities.Voice
24-
import com.vonage.client.common.Webhook
2524
import java.util.*
2625

2726
/**
@@ -108,8 +107,8 @@ class Application internal constructor(private val client: ApplicationClient) {
108107
*/
109108
fun list(page: Int? = null, pageSize: Int? = null): List<Application> {
110109
val filter = ListApplicationRequest.builder()
111-
if (page != null) filter.page(page.toLong())
112-
if (pageSize != null) filter.pageSize(pageSize.toLong())
110+
if (page != null) filter.page(page)
111+
if (pageSize != null) filter.pageSize(pageSize)
113112
return client.listApplications(filter.build()).applications
114113
}
115114

@@ -147,7 +146,7 @@ fun Webhook.Builder.url(url: String): Webhook.Builder = address(url)
147146
* @return The Voice capability builder.
148147
*/
149148
fun Voice.Builder.answer(properties: Webhook.Builder.() -> Unit): Voice.Builder =
150-
addWebhook(Webhook.Type.ANSWER, webhookBuilder(properties))
149+
answer(webhookBuilder(properties))
151150

152151
/**
153152
* Adds an `fallback_answer_url` webhook to the [Voice] capability.
@@ -157,7 +156,7 @@ fun Voice.Builder.answer(properties: Webhook.Builder.() -> Unit): Voice.Builder
157156
* @return The Voice capability builder.
158157
*/
159158
fun Voice.Builder.fallbackAnswer(properties: Webhook.Builder.() -> Unit): Voice.Builder =
160-
addWebhook(Webhook.Type.FALLBACK_ANSWER, webhookBuilder(properties))
159+
fallbackAnswer(webhookBuilder(properties))
161160

162161
/**
163162
* Adds an `event_url` webhook to the [Voice] capability.
@@ -167,7 +166,7 @@ fun Voice.Builder.fallbackAnswer(properties: Webhook.Builder.() -> Unit): Voice.
167166
* @return The Voice capability builder.
168167
*/
169168
fun Voice.Builder.event(properties: Webhook.Builder.() -> Unit): Voice.Builder =
170-
addWebhook(Webhook.Type.EVENT, webhookBuilder(properties))
169+
event(webhookBuilder(properties))
171170

172171
/**
173172
* Adds an `event_url` webhook to the [Rtc] capability.
@@ -177,7 +176,7 @@ fun Voice.Builder.event(properties: Webhook.Builder.() -> Unit): Voice.Builder =
177176
* @return The RTC capability builder.
178177
*/
179178
fun Rtc.Builder.event(properties: Webhook.Builder.() -> Unit): Rtc.Builder =
180-
addWebhook(Webhook.Type.EVENT, webhookBuilder(properties))
179+
event(webhookBuilder(properties))
181180

182181
/**
183182
* Adds a `status_url` webhook to the [Verify] capability.
@@ -187,7 +186,7 @@ fun Rtc.Builder.event(properties: Webhook.Builder.() -> Unit): Rtc.Builder =
187186
* @return The Verify capability builder.
188187
*/
189188
fun Verify.Builder.status(properties: Webhook.Builder.() -> Unit): Verify.Builder =
190-
addWebhook(Webhook.Type.STATUS, webhookBuilder(properties))
189+
status(webhookBuilder(properties))
191190

192191
/**
193192
* Adds an `inbound_url` webhook to the [Messages] capability.
@@ -197,7 +196,7 @@ fun Verify.Builder.status(properties: Webhook.Builder.() -> Unit): Verify.Builde
197196
* @return The Messages capability builder.
198197
*/
199198
fun Messages.Builder.inbound(properties: Webhook.Builder.() -> Unit): Messages.Builder =
200-
addWebhook(Webhook.Type.INBOUND, webhookBuilder(properties))
199+
inbound(webhookBuilder(properties))
201200

202201
/**
203202
* Adds an `status_url` webhook to the [Messages] capability.
@@ -207,7 +206,7 @@ fun Messages.Builder.inbound(properties: Webhook.Builder.() -> Unit): Messages.B
207206
* @return The Messages capability builder.
208207
*/
209208
fun Messages.Builder.status(properties: Webhook.Builder.() -> Unit): Messages.Builder =
210-
addWebhook(Webhook.Type.STATUS, webhookBuilder(properties))
209+
status(webhookBuilder(properties))
211210

212211
/**
213212
* Adds the [Voice] capability to the application.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import java.util.*
2626
*/
2727
class Conversion internal constructor(private val client: ConversionClient) {
2828

29-
private fun convert(type: ConversionRequest.Type,
30-
messageId: String, delivered: Boolean, timestamp: Instant?): Unit =
29+
private fun convert(type: Type, messageId: String, delivered: Boolean, timestamp: Instant?): Unit =
3130
client.submitConversion(type, messageId, delivered,
3231
if (timestamp != null) Date.from(timestamp) else null
3332
)
@@ -40,7 +39,7 @@ class Conversion internal constructor(private val client: ConversionClient) {
4039
* @param timestamp (OPTIONAL) Timestamp of the conversion.
4140
*/
4241
fun convertSms(messageId: String, delivered: Boolean, timestamp: Instant? = null): Unit =
43-
convert(ConversionRequest.Type.SMS, messageId, delivered, timestamp)
42+
convert(Type.SMS, messageId, delivered, timestamp)
4443

4544
/**
4645
* Submit conversion for a voice call.
@@ -50,5 +49,5 @@ class Conversion internal constructor(private val client: ConversionClient) {
5049
* @param timestamp (OPTIONAL) Timestamp of the conversion.
5150
*/
5251
fun convertVoice(callId: String, delivered: Boolean, timestamp: Instant? = null): Unit =
53-
convert(ConversionRequest.Type.VOICE, callId, delivered, timestamp)
52+
convert(Type.VOICE, callId, delivered, timestamp)
5453
}

0 commit comments

Comments
 (0)