Skip to content

Commit 8f4538e

Browse files
authored
Merge pull request #25 from Bandwidth/SWI-6631
SWI-6631 Make `getOrderStatus` public
2 parents 27671b5 + 0ace29a commit 8f4538e

File tree

6 files changed

+65
-1
lines changed

6 files changed

+65
-1
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build package using Maven
2+
on:
3+
pull_request:
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- name: Set up JDK 11
10+
uses: actions/setup-java@v3
11+
with:
12+
distribution: 'adopt'
13+
java-version: '11'
14+
15+
- name: Build with Maven
16+
run: mvn -B package --file pom.xml

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types:
5+
- published
6+
jobs:
7+
publish:
8+
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Apache Maven Central
13+
uses: actions/setup-java@v4
14+
with:
15+
distribution: 'adopt'
16+
java-version: '11'
17+
server-id: 'ossrh'
18+
server-username: OSSRH_USERNAME
19+
server-password: OSSRH_PASSWORD
20+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
21+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
22+
23+
- name: Get Maven project version
24+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
25+
26+
- name: Set Maven project version
27+
run: mvn versions:set -DnewVersion=$RELEASE_VERSION
28+
29+
- name: Publish to Apache Maven Central
30+
run: mvn deploy
31+
env:
32+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
build/
44
out/
55
.DS_Store
6+
target/
7+
.class

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
2323
</repository>
2424
</distributionManagement>
25+
<properties>
26+
<maven.compiler.source>1.8</maven.compiler.source>
27+
<maven.compiler.target>1.8</maven.compiler.target>
28+
</properties>
2529
<developers>
2630
<developer>
2731
<id>dx-bandwidth</id>

src/main/java/com/bandwidth/sdk/numbers/NumbersClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ public interface NumbersClient extends AutoCloseable {
2626
* @return {@link OrderResponse} with the details of the results of placing the order
2727
*/
2828
OrderResponse orderTelephoneNumbers(Order order);
29+
30+
/**
31+
* Fetch the details of an order with the given order id.
32+
*
33+
* @param orderId The id of the order to check the status of
34+
* @return {@link OrderResponse} with the details of the results of placing the order
35+
*/
36+
OrderResponse getOrderStatus(String orderId);
2937
}

src/main/java/com/bandwidth/sdk/numbers/NumbersClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private CompletableFuture<OrderResponse> orderTelephoneNumbersAsync(Order order)
9191
});
9292
}
9393

94-
private OrderResponse getOrderStatus(String orderId) {
94+
public OrderResponse getOrderStatus(String orderId) {
9595
return validateOrderResponse(() -> {
9696
String url = MessageFormat.format("{0}/accounts/{1}/orders/{2}", baseUrl, account, orderId);
9797
return httpClient.prepareGet(url)

0 commit comments

Comments
 (0)