Skip to content

Commit

Permalink
feat: update Updater to take in Twilio (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonOsnes committed Mar 4, 2022
1 parent 5ec80d1 commit 082921d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main/java/com/twilio/base/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public abstract class Updater<T extends Resource> {
*
* @return future that resolves to requested object
*/
public CompletableFuture<T> updateAsync() {
return updateAsync(Twilio.getRestClient());
public CompletableFuture<T> updateAsync(Twilio tw) {
return updateAsync(tw.getRestClient());
}

/**
Expand All @@ -35,9 +35,10 @@ public CompletableFuture<T> updateAsync(final TwilioRestClient client) {
* Execute a request using default client.
*
* @return Requested object
* @param tw
*/
public T update() {
return update(Twilio.getRestClient());
public T update(Twilio tw) {
return update(tw.getRestClient());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void main(final String[] args) {
"AC123",
call.getSid()
).setUrl(new URI("http://twimlbin.com/4397e62f"));
Call updated = updater.update();
Call updated = updater.update(tw);

System.out.println(updated.getSid());
System.out.println(updated.getStatus());
Expand Down

0 comments on commit 082921d

Please # to comment.