From d70a07dc0565c49a424579682ee9d0997c5067ed Mon Sep 17 00:00:00 2001 From: Jean-Pierre Portier Date: Mon, 18 Mar 2024 09:05:12 +0100 Subject: [PATCH] refactor: Rename voice.applications.getNumbers to voice.applications.listNumbers --- .../sinch/sdk/domains/voice/ApplicationsService.java | 2 +- .../domains/voice/adapters/ApplicationsService.java | 2 +- .../voice/adapters/ApplicationsServiceTest.java | 2 +- sample-app/README.md | 2 +- .../applications/{GetNumbers.java => ListNumbers.java} | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) rename sample-app/src/main/java/com/sinch/sample/voice/applications/{GetNumbers.java => ListNumbers.java} (60%) diff --git a/client/src/main/com/sinch/sdk/domains/voice/ApplicationsService.java b/client/src/main/com/sinch/sdk/domains/voice/ApplicationsService.java index c421fefd..613b0b83 100644 --- a/client/src/main/com/sinch/sdk/domains/voice/ApplicationsService.java +++ b/client/src/main/com/sinch/sdk/domains/voice/ApplicationsService.java @@ -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 diff --git a/client/src/main/com/sinch/sdk/domains/voice/adapters/ApplicationsService.java b/client/src/main/com/sinch/sdk/domains/voice/adapters/ApplicationsService.java index 8f05602f..cd1fb432 100644 --- a/client/src/main/com/sinch/sdk/domains/voice/adapters/ApplicationsService.java +++ b/client/src/main/com/sinch/sdk/domains/voice/adapters/ApplicationsService.java @@ -31,7 +31,7 @@ protected ApplicationsApi getApi() { return this.api; } - public AssignedNumbers getNumbers() { + public AssignedNumbers listNumbers() { return ApplicationsDtoConverter.convert(getApi().configurationGetNumbers()); } diff --git a/client/src/test/java/com/sinch/sdk/domains/voice/adapters/ApplicationsServiceTest.java b/client/src/test/java/com/sinch/sdk/domains/voice/adapters/ApplicationsServiceTest.java index c167390a..3f74dc1f 100644 --- a/client/src/test/java/com/sinch/sdk/domains/voice/adapters/ApplicationsServiceTest.java +++ b/client/src/test/java/com/sinch/sdk/domains/voice/adapters/ApplicationsServiceTest.java @@ -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() diff --git a/sample-app/README.md b/sample-app/README.md index 24382cf2..e81977d7 100644 --- a/sample-app/README.md +++ b/sample-app/README.md @@ -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 | diff --git a/sample-app/src/main/java/com/sinch/sample/voice/applications/GetNumbers.java b/sample-app/src/main/java/com/sinch/sample/voice/applications/ListNumbers.java similarity index 60% rename from sample-app/src/main/java/com/sinch/sample/voice/applications/GetNumbers.java rename to sample-app/src/main/java/com/sinch/sample/voice/applications/ListNumbers.java index eca5bd7b..256bfdd5 100644 --- a/sample-app/src/main/java/com/sinch/sample/voice/applications/GetNumbers.java +++ b/sample-app/src/main/java/com/sinch/sample/voice/applications/ListNumbers.java @@ -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(); @@ -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); }