Skip to content

Commit

Permalink
Merge pull request #3 from sinch/adding-snippet-skeletons
Browse files Browse the repository at this point in the history
refactor: Enable direct copy/paste snippet source file integration onto client
  • Loading branch information
JPPortier authored Jun 11, 2024
2 parents 1267feb + 76629fd commit 0017f8b
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 17 deletions.
6 changes: 2 additions & 4 deletions templates/client/src/main/java/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ 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 =
new VerificationQuickStart(client.verification());
}

// 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());
Expand Down
9 changes: 6 additions & 3 deletions templates/client/src/main/java/numbers/NumbersQuickStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
14 changes: 14 additions & 0 deletions templates/client/src/main/java/numbers/Snippet.java
Original file line number Diff line number Diff line change
@@ -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");
}
}
11 changes: 7 additions & 4 deletions templates/client/src/main/java/sms/SmsQuickStart.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package sms;

import com.sinch.sdk.domains.sms.SMSService;
import com.sinch.sdk.domains.sms.*;

public class SmsQuickStart {

private final SMSService service;
private final SMSService smsService;

public SmsQuickStart(SMSService service) {
this.service = service;
public SmsQuickStart(SMSService smsService) {
this.smsService = smsService;

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

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

public class Snippet {

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

static void execute(SMSService smsService) {

LOGGER.info("Snippet execution");
}
}
14 changes: 14 additions & 0 deletions templates/client/src/main/java/verification/Snippet.java
Original file line number Diff line number Diff line change
@@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
14 changes: 14 additions & 0 deletions templates/client/src/main/java/voice/Snippet.java
Original file line number Diff line number Diff line change
@@ -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");
}
}
9 changes: 6 additions & 3 deletions templates/client/src/main/java/voice/VoiceQuickStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 0017f8b

Please sign in to comment.