diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..bd6e674
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,16 @@
+name: Build package using Maven
+on:
+ pull_request:
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up JDK 11
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'adopt'
+ java-version: '11'
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..dc00c67
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,34 @@
+name: Publish package to the Maven Central Repository
+on:
+ release:
+ types:
+ - published
+jobs:
+ publish:
+ if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Apache Maven Central
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'adopt'
+ java-version: '11'
+ server-id: 'ossrh'
+ server-username: OSSRH_USERNAME
+ server-password: OSSRH_PASSWORD
+ gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE
+
+ - name: Get Maven project version
+ run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
+
+ - name: Set Maven project version
+ run: mvn versions:set -DnewVersion=$RELEASE_VERSION
+
+ - name: Publish to Apache Maven Central
+ run: mvn deploy
+ env:
+ OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
diff --git a/.gitignore b/.gitignore
index 14e8853..e3ef3e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
build/
out/
.DS_Store
+target/
+.class
diff --git a/pom.xml b/pom.xml
index 6cee7fe..c4ae569 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,6 +22,10 @@
https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+ 1.8
+ 1.8
+
dx-bandwidth
diff --git a/src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java b/src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java
index f22936d..c37606e 100644
--- a/src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java
+++ b/src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java
@@ -26,4 +26,12 @@ public interface NumbersClient extends AutoCloseable {
* @return {@link OrderResponse} with the details of the results of placing the order
*/
OrderResponse orderTelephoneNumbers(Order order);
+
+ /**
+ * Fetch the details of an order with the given order id.
+ *
+ * @param orderId The id of the order to check the status of
+ * @return {@link OrderResponse} with the details of the results of placing the order
+ */
+ OrderResponse getOrderStatus(String orderId);
}
diff --git a/src/main/java/com/bandwidth/sdk/numbers/NumbersClientImpl.java b/src/main/java/com/bandwidth/sdk/numbers/NumbersClientImpl.java
index 0ec70b4..db43173 100644
--- a/src/main/java/com/bandwidth/sdk/numbers/NumbersClientImpl.java
+++ b/src/main/java/com/bandwidth/sdk/numbers/NumbersClientImpl.java
@@ -91,7 +91,7 @@ private CompletableFuture orderTelephoneNumbersAsync(Order order)
});
}
- private OrderResponse getOrderStatus(String orderId) {
+ public OrderResponse getOrderStatus(String orderId) {
return validateOrderResponse(() -> {
String url = MessageFormat.format("{0}/accounts/{1}/orders/{2}", baseUrl, account, orderId);
return httpClient.prepareGet(url)