From 76629fd427ad3a3ecb7e2e81d1aa26a85f9dd795 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Portier Date: Fri, 31 May 2024 09:21:05 +0200 Subject: [PATCH] feature: Provide Eepty snippets for dedicated services --- templates/client/src/main/java/Application.java | 6 ++---- .../src/main/java/numbers/NumbersQuickStart.java | 9 ++++++--- .../client/src/main/java/numbers/Snippet.java | 14 ++++++++++++++ templates/client/src/main/java/sms/Snippet.java | 1 - .../client/src/main/java/verification/Snippet.java | 14 ++++++++++++++ .../java/verification/VerificationQuickStart.java | 9 ++++++--- templates/client/src/main/java/voice/Snippet.java | 14 ++++++++++++++ .../src/main/java/voice/VoiceQuickStart.java | 9 ++++++--- 8 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 templates/client/src/main/java/numbers/Snippet.java create mode 100644 templates/client/src/main/java/verification/Snippet.java create mode 100644 templates/client/src/main/java/voice/Snippet.java diff --git a/templates/client/src/main/java/Application.java b/templates/client/src/main/java/Application.java index 5a919d9..26c0700 100644 --- a/templates/client/src/main/java/Application.java +++ b/templates/client/src/main/java/Application.java @@ -35,8 +35,7 @@ public static void main(String[] args) { } // Verification service dedicated business logic processing - // (see - // https://developers.sinch.com/docs/verification) + // (see https://developers.sinch.com/docs/verification) // comment if unused if (client.getConfiguration().getApplicationCredentials().isPresent()) { VerificationQuickStart verification = @@ -44,8 +43,7 @@ public static void main(String[] args) { } // Voice service dedicated business logic processing - // (see - // https://developers.sinch.com/docs/voice) + // (see https://developers.sinch.com/docs/voice) // comment if unused if (client.getConfiguration().getApplicationCredentials().isPresent()) { VoiceQuickStart voice = new VoiceQuickStart(client.voice()); diff --git a/templates/client/src/main/java/numbers/NumbersQuickStart.java b/templates/client/src/main/java/numbers/NumbersQuickStart.java index 72b2143..43dfb9f 100644 --- a/templates/client/src/main/java/numbers/NumbersQuickStart.java +++ b/templates/client/src/main/java/numbers/NumbersQuickStart.java @@ -4,9 +4,12 @@ public class NumbersQuickStart { - private final NumbersService service; + private final NumbersService numbersService; - public NumbersQuickStart(NumbersService service) { - this.service = service; + public NumbersQuickStart(NumbersService numbersService) { + this.numbersService = numbersService; + + // replace by your code and business logic + Snippet.execute(this.numbersService); } } diff --git a/templates/client/src/main/java/numbers/Snippet.java b/templates/client/src/main/java/numbers/Snippet.java new file mode 100644 index 0000000..36ec46f --- /dev/null +++ b/templates/client/src/main/java/numbers/Snippet.java @@ -0,0 +1,14 @@ +package numbers; + +import com.sinch.sdk.domains.numbers.NumbersService; +import java.util.logging.Logger; + +public class Snippet { + + private static final Logger LOGGER = Logger.getLogger(Snippet.class.getName()); + + static void execute(NumbersService numbersService) { + + LOGGER.info("Snippet execution"); + } +} diff --git a/templates/client/src/main/java/sms/Snippet.java b/templates/client/src/main/java/sms/Snippet.java index 3b5b645..0bdb6d6 100644 --- a/templates/client/src/main/java/sms/Snippet.java +++ b/templates/client/src/main/java/sms/Snippet.java @@ -10,6 +10,5 @@ public class Snippet { static void execute(SMSService smsService) { LOGGER.info("Snippet execution"); - } } diff --git a/templates/client/src/main/java/verification/Snippet.java b/templates/client/src/main/java/verification/Snippet.java new file mode 100644 index 0000000..5d7f3c8 --- /dev/null +++ b/templates/client/src/main/java/verification/Snippet.java @@ -0,0 +1,14 @@ +package verification; + +import com.sinch.sdk.domains.verification.VerificationService; +import java.util.logging.Logger; + +public class Snippet { + + private static final Logger LOGGER = Logger.getLogger(Snippet.class.getName()); + + static void execute(VerificationService verificationService) { + + LOGGER.info("Snippet execution"); + } +} diff --git a/templates/client/src/main/java/verification/VerificationQuickStart.java b/templates/client/src/main/java/verification/VerificationQuickStart.java index a37061e..4dc4cfe 100644 --- a/templates/client/src/main/java/verification/VerificationQuickStart.java +++ b/templates/client/src/main/java/verification/VerificationQuickStart.java @@ -4,9 +4,12 @@ public class VerificationQuickStart { - private final VerificationService service; + private final VerificationService verificationService; - public VerificationQuickStart(VerificationService service) { - this.service = service; + public VerificationQuickStart(VerificationService verificationService) { + this.verificationService = verificationService; + + // replace by your code and business logic + Snippet.execute(this.verificationService); } } diff --git a/templates/client/src/main/java/voice/Snippet.java b/templates/client/src/main/java/voice/Snippet.java new file mode 100644 index 0000000..4c18df4 --- /dev/null +++ b/templates/client/src/main/java/voice/Snippet.java @@ -0,0 +1,14 @@ +package voice; + +import com.sinch.sdk.domains.voice.VoiceService; +import java.util.logging.Logger; + +public class Snippet { + + private static final Logger LOGGER = Logger.getLogger(Snippet.class.getName()); + + static void execute(VoiceService voiceService) { + + LOGGER.info("Snippet execution"); + } +} diff --git a/templates/client/src/main/java/voice/VoiceQuickStart.java b/templates/client/src/main/java/voice/VoiceQuickStart.java index d644501..294876f 100644 --- a/templates/client/src/main/java/voice/VoiceQuickStart.java +++ b/templates/client/src/main/java/voice/VoiceQuickStart.java @@ -4,9 +4,12 @@ public class VoiceQuickStart { - private final VoiceService service; + private final VoiceService voiceService; - public VoiceQuickStart(VoiceService service) { - this.service = service; + public VoiceQuickStart(VoiceService voiceService) { + this.voiceService = voiceService; + + // replace by your code and business logic + Snippet.execute(this.voiceService); } }