Skip to content
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

Sync feature branch with main #71

Merged
merged 7 commits into from
Mar 19, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(NumberIdentity identity, VerificationMethodType method);
VerificationReport getByIdentity(NumberIdentity identity, VerificationMethodType method);

/**
* Queries the verification result by sending the verification ID. With this query you can get the
Expand All @@ -38,7 +38,7 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(VerificationId id);
VerificationReport getById(VerificationId id);

/**
* Queries the verification result by sending the verification Reference. With this query you can
Expand All @@ -48,5 +48,5 @@ public interface VerificationStatusService {
* @return Verification report response
* @since 1.0
*/
VerificationReport get(VerificationReference reference);
VerificationReport getByReference(VerificationReference reference);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ protected QueryVerificationsApi getApi() {
return this.api;
}

public VerificationReport get(NumberIdentity identity, VerificationMethodType method) {
public VerificationReport getByIdentity(NumberIdentity identity, VerificationMethodType method) {

return VerificationsDtoConverter.convert(
getApi().verificationStatusByIdentity("number", identity.getEndpoint(), method.value()));
}

public VerificationReport get(VerificationId id) {
public VerificationReport getById(VerificationId id) {

return VerificationsDtoConverter.convert(getApi().verificationStatusById(id.getId()));
}

public VerificationReport get(VerificationReference reference) {
public VerificationReport getByReference(VerificationReference reference) {

return VerificationsDtoConverter.convert(
getApi().verificationStatusByReference(reference.getReference()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface ApplicationsService {
* @return Your numbers
* @since 1.0
*/
AssignedNumbers getNumbers();
AssignedNumbers listNumbers();

/**
* Returns any callback URLs configured for the specified application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected ApplicationsApi getApi() {
return this.api;
}

public AssignedNumbers getNumbers() {
public AssignedNumbers listNumbers() {

return ApplicationsDtoConverter.convert(getApi().configurationGetNumbers());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void getByIdentity() throws ApiException {
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response =
service.get(
service.getByIdentity(
NumberIdentity.builder().setEndpoint("endpoint string").build(),
VerificationMethodType.SMS);

Expand All @@ -63,7 +63,7 @@ void getById() throws ApiException {
when(api.verificationStatusById(eq("the id")))
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response = service.get(VerificationId.valueOf("the id"));
VerificationReport response = service.getById(VerificationId.valueOf("the id"));

Assertions.assertThat(response)
.usingRecursiveComparison()
Expand All @@ -76,7 +76,8 @@ void getByReference() throws ApiException {
when(api.verificationStatusByReference(eq("the reference")))
.thenReturn(VerificationReportDtoTest.expectedVerificationCalloutDto);

VerificationReport response = service.get(VerificationReference.valueOf("the reference"));
VerificationReport response =
service.getByReference(VerificationReference.valueOf("the reference"));

Assertions.assertThat(response)
.usingRecursiveComparison()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void getNumbers() throws ApiException {

when(api.configurationGetNumbers()).thenReturn(ApplicationsGetNumbersResponseDtoTest.expected);

AssignedNumbers response = service.getNumbers();
AssignedNumbers response = service.listNumbers();

Assertions.assertThat(response)
.usingRecursiveComparison()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.sinch.sdk</groupId>
<artifactId>sinch-sdk-java</artifactId>
<version>0.0.6-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>

<name>Sinch Java SDK</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ See https://developers.sinch.com for details about these parameters
| | Update | [com.sinch.sample.voice.calls.Update](src/main/java/com/sinch/sample/voice/calls/Update.java) | Require `CONFERENCE_ID` & `CALL_ID` parameters |
| | ManageWithCallLeg | [com.sinch.sample.voice.calls.ManageWithCallLeg](src/main/java/com/sinch/sample/voice/calls/ManageWithCallLeg.java) | Require `CONFERENCE_ID` & `CALL_ID` parameters |
| Applications | GetCallbackUrls | [com.sinch.sample.voice.applications.GetCallbackUrls](src/main/java/com/sinch/sample/voice/applications/GetCallbackUrls.java) | Require `APPLICATION_API_KEY` parameter |
| | GetNumbers | [com.sinch.sample.voice.applications.GetNumbers](src/main/java/com/sinch/sample/voice/applications/GetNumbers.java) | |
| | GetNumbers | [com.sinch.sample.voice.applications.ListNumbers](src/main/java/com/sinch/sample/voice/applications/GetNumbers.java) | |
| | QueryNumber | [com.sinch.sample.voice.applications.QueryNumber](src/main/java/com/sinch/sample/voice/applications/QueryNumber.java) | Require `PHONE_NUMBER` parameter |
| | UnassignNumber | [com.sinch.sample.voice.applications.UnassignNumber](src/main/java/com/sinch/sample/voice/applications/UnassignNumber.java) | Require `APPLICATION_API_KEY` & `PHONE_NUMBER` parameters |
| | UpdateCallbackUrls | [com.sinch.sample.voice.applications.UpdateCallbackUrls](src/main/java/com/sinch/sample/voice/applications/UpdateCallbackUrls.java) | Require `APPLICATION_API_KEY` parameter |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void run() {

LOGGER.info("Get status by id for : " + id);

VerificationReport response = client.verification().verificationStatus().get(id);
VerificationReport response = client.verification().verificationStatus().getById(id);
LOGGER.info("Response :" + response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public void run() {

VerificationMethodType method = VerificationMethodType.SMS;

VerificationReport response = client.verification().verificationStatus().get(identity, method);
VerificationReport response =
client.verification().verificationStatus().getByIdentity(identity, method);
LOGGER.info("Response :" + response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public void run() {

LOGGER.info("Get status by reference for: '" + reference + "'");

VerificationReport response = client.verification().verificationStatus().get(reference);
VerificationReport response =
client.verification().verificationStatus().getByReference(reference);
LOGGER.info("Response :" + response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import java.io.IOException;
import java.util.logging.Logger;

public class GetNumbers extends BaseApplication {
public class ListNumbers extends BaseApplication {

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

public GetNumbers() throws IOException {}
public ListNumbers() throws IOException {}

public static void main(String[] args) {
try {
new GetNumbers().run();
new ListNumbers().run();
} catch (Exception e) {
LOGGER.severe(e.getMessage());
e.printStackTrace();
Expand All @@ -23,7 +23,7 @@ public void run() {

LOGGER.info("Get assigned numbers");

var response = client.voice().applications().getNumbers();
var response = client.voice().applications().listNumbers();

LOGGER.info("Response: " + response);
}
Expand Down
Loading