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

SWI-6631 Make getOrderStatus public #25

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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