-
Notifications
You must be signed in to change notification settings - Fork 1
DEVEXP-1309: use event destinations and sinch events (Conversation) #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JPPortier
merged 5 commits into
feat/V2.0-next
from
jpportier/DEVEXP-1309-use-event-destinations-and-sinch-events-conversation
Mar 19, 2026
+1,665
−1,543
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
72ec331
feat (Conversation): Refactor to 'Event Destinations' and 'Sinch Events'
JPPortier 9dfb015
feat (Conversation): API contract
JPPortier bdf0827
Merge branch 'feat/V2.0-next' into jpportier/DEVEXP-1309-use-event-de…
JPPortier cca6910
PR comments
JPPortier 30cf6aa
Merge branch 'feat/V2.0-next' into jpportier/DEVEXP-1309-use-event-de…
JPPortier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
client/src/main/com/sinch/sdk/domains/conversation/api/v1/SinchEventsService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| package com.sinch.sdk.domains.conversation.api.v1; | ||
|
|
||
| import com.sinch.sdk.core.exceptions.ApiMappingException; | ||
| import com.sinch.sdk.domains.conversation.models.v1.sinchevents.ConversationSinchEvent; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Sinch Events service | ||
| * | ||
| * <p>Callback events are used to get notified about Conversation usage according to your configured | ||
| * callback URL | ||
| * | ||
| * <p>see <a | ||
| * href="https://developers.sinch.com/docs/numbers/api-reference/numbers/tag/Numbers-Callbacks/#tag/Numbers-Callbacks/operation/ImportedNumberService_EventsCallback">online | ||
| * documentation</a> | ||
| * | ||
| * @since 2.0 | ||
| */ | ||
| public interface SinchEventsService { | ||
|
|
||
| /** | ||
| * The Sinch Platform can initiate callback requests to a URL you define (Callback URL) on request | ||
| * and result events. All callback requests are signed and the signature is included in the | ||
| * Authorization header of the request | ||
| * | ||
| * <p>By using following function, you can ensure authentication according to received payload | ||
| * from your backend | ||
| * | ||
| * @param secret Secret token to be used to validate received request. See <a href= | ||
| * "https://dashboard.sinch.com/convapi/apps">App's webhook configuration onto dashboard</a> | ||
| * @param headers Received headers | ||
| * @param jsonPayload Received payload | ||
| * @return Is authentication validated (true) or not (false) | ||
| * <p>see <a | ||
| * href="https://developers.sinch.com/docs/conversation/callbacks/#validating-callbacks">online | ||
| * documentation</a> | ||
| * @since 2.0 | ||
| */ | ||
| boolean validateAuthenticationHeader( | ||
| String secret, Map<String, String> headers, String jsonPayload); | ||
|
|
||
| /** | ||
| * This function can be called to deserialize received payload onto callback onto proper java | ||
| * verification event class | ||
| * | ||
| * @param jsonPayload Received payload to be deserialized | ||
| * @return The verification event instance class | ||
| * <p>see <a | ||
| * href="https://developers.sinch.com/docs/conversation/callbacks/#webhook-triggers">triggered | ||
| * events</a> | ||
| * @since 2.0 | ||
| */ | ||
| ConversationSinchEvent parseEvent(String jsonPayload) throws ApiMappingException; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
client/src/main/com/sinch/sdk/domains/conversation/api/v1/adapters/SinchEventsService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.sinch.sdk.domains.conversation.api.v1.adapters; | ||
|
|
||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import com.sinch.sdk.auth.HmacAuthenticationValidation; | ||
| import com.sinch.sdk.core.exceptions.ApiMappingException; | ||
| import com.sinch.sdk.core.utils.databind.Mapper; | ||
| import com.sinch.sdk.domains.conversation.models.v1.sinchevents.ConversationSinchEvent; | ||
| import com.sinch.sdk.domains.conversation.models.v1.sinchevents.internal.ConversationSinchEventInternalImpl; | ||
| import java.util.Map; | ||
|
|
||
| public class SinchEventsService | ||
| implements com.sinch.sdk.domains.conversation.api.v1.SinchEventsService { | ||
|
|
||
| private final HmacAuthenticationValidation authenticationChecker; | ||
|
|
||
| public SinchEventsService(HmacAuthenticationValidation authenticationChecker) { | ||
| this.authenticationChecker = authenticationChecker; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean validateAuthenticationHeader( | ||
| String secret, Map<String, String> headers, String jsonPayload) { | ||
|
|
||
| return authenticationChecker.validateAuthenticationHeader(secret, headers, jsonPayload); | ||
| } | ||
|
|
||
| @Override | ||
| public ConversationSinchEvent parseEvent(String jsonPayload) throws ApiMappingException { | ||
| try { | ||
| ConversationSinchEventInternalImpl dto = | ||
| Mapper.getInstance().readValue(jsonPayload, ConversationSinchEventInternalImpl.class); | ||
| return (ConversationSinchEvent) dto.getActualInstance(); | ||
| } catch (JsonProcessingException e) { | ||
| throw new ApiMappingException(jsonPayload, e); | ||
| } | ||
| } | ||
| } |
4 changes: 2 additions & 2 deletions
4
...els/v1/webhooks/request/package-info.java → ...ls/v1/eventdestinations/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| /** | ||
| * <code>Webhooks</code> request models | ||
| * Conversation models for <code>Event Destinations</code> | ||
| * | ||
| * @see <a | ||
| * href="https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Webhooks">Webhooks</a> | ||
| * @since 1.3 | ||
| */ | ||
| package com.sinch.sdk.domains.conversation.models.v1.webhooks.request; | ||
| package com.sinch.sdk.domains.conversation.models.v1.eventdestinations; |
4 changes: 2 additions & 2 deletions
4
...tion/models/v1/webhooks/package-info.java → ...entdestinations/request/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| /** | ||
| * Conversation models for <code>Webhooks</code> | ||
| * <code>Event Destinations</code> request models | ||
| * | ||
| * @see <a | ||
| * href="https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Webhooks">Webhooks</a> | ||
| * @since 1.3 | ||
| */ | ||
| package com.sinch.sdk.domains.conversation.models.v1.webhooks; | ||
| package com.sinch.sdk.domains.conversation.models.v1.eventdestinations.request; |
4 changes: 2 additions & 2 deletions
4
...ls/v1/webhooks/response/package-info.java → ...ntdestinations/response/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| /** | ||
| * <code>Webhooks</code> response models | ||
| * <code>Event Destinations</code> response models | ||
| * | ||
| * @see <a | ||
| * href="https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Webhooks">Webhooks</a> | ||
| * @since 1.3 | ||
| */ | ||
| package com.sinch.sdk.domains.conversation.models.v1.webhooks.response; | ||
| package com.sinch.sdk.domains.conversation.models.v1.eventdestinations.response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
client/src/main/com/sinch/sdk/domains/conversation/models/v1/sinchevents/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * Conversation models for <code>Sinch Events</code> sent onto callbacks | ||
| * | ||
| * @see <a href="https://developers.sinch.com/docs/conversation/callbacks">callbacks</a> | ||
| * @since 1.3 | ||
| */ | ||
| package com.sinch.sdk.domains.conversation.models.v1.sinchevents; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
...t/src/main/com/sinch/sdk/domains/conversation/models/v1/webhooks/events/package-info.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.