Skip to content

Commit

Permalink
Merge pull request #25 from Bandwidth/SWI-6631
Browse files Browse the repository at this point in the history
SWI-6631 Make `getOrderStatus` public
  • Loading branch information
ajrice6713 authored Nov 27, 2024
2 parents 27671b5 + 0ace29a commit 8f4538e
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
build/
out/
.DS_Store
target/
.class
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<developers>
<developer>
<id>dx-bandwidth</id>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private CompletableFuture<OrderResponse> 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)
Expand Down

0 comments on commit 8f4538e

Please sign in to comment.