Skip to content

Commit

Permalink
Adding Conversation material
Browse files Browse the repository at this point in the history
  • Loading branch information
samwil-sinch committed Oct 8, 2024
1 parent 25b823b commit e562a15
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions templates/client/src/main/java/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sms.SmsQuickStart;
import verification.VerificationQuickStart;
import voice.VoiceQuickStart;
import conversation.ConversationQuickStart;

public abstract class Application {

Expand All @@ -19,6 +20,13 @@ public static void main(String[] args) {
SinchClient client = SinchClientHelper.initSinchClient();
LOGGER.info("Application initiated. SinchClient ready.");

// Conversation service dedicated business logic processing
// (see https://developers.sinch.com/docs/conversation)
// comment if unused
if (client.getConfiguration().getUnifiedCredentials().isPresent()) {
ConversationQuickStart conversation = new ConversationQuickStart(client.conversation().v1());
}

// Numbers service dedicated business logic processing
// (see https://developers.sinch.com/categories/numbersandconnectivity)
// comment if unused
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package conversation;

import com.sinch.sdk.domains.conversation.api.v1.ConversationService;

public class ConversationQuickStart {

private final ConversationService conversationService;

public ConversationQuickStart(ConversationService conversationService) {
this.conversationService = conversationService;

// replace by your code and business logic
Snippet.execute(this.conversationService);
}
}
14 changes: 14 additions & 0 deletions templates/client/src/main/java/conversation/Snippet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package conversation;

import com.sinch.sdk.domains.conversation.*;
import java.util.logging.Logger;

public class Snippet {

private static final Logger LOGGER = Logger.getLogger(Snippet.class.getName());

static void execute(ConversationService conversationService) {

LOGGER.info("Snippet execution");
}
}

0 comments on commit e562a15

Please sign in to comment.