Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
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
9 changes: 4 additions & 5 deletions rest/access-tokens/video-example/video-example.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import com.twilio.jwt.accesstoken.VideoGrant;

public class TokenGenerator {

public static void main(String[] args) {
// Required for all types of tokens
String twilioAccountSid = "ACxxxxxxxxxxxx";
Expand All @@ -11,11 +11,10 @@ public static void main(String[] args) {

// Required for Video
String identity = "user";

// Create Video grant
VideoGrant grant = new VideoGrant();
grant.setRoom("cool room");

VideoGrant grant = new VideoGrant().setRoom("cool room");

// Create access token
AccessToken token = new AccessToken.Builder(
twilioAccountSid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public static void main(String[] args) {

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Call call = Call.updater("CAe1644a7eed5088b159577c5802d8be38").setStatus(Call.UpdateStatus.COMPLETED)
.update();
Call call = Call.updater("CAe1644a7eed5088b159577c5802d8be38")
.setStatus(Call.UpdateStatus.COMPLETED)
.update();

System.out.println(call.getDateUpdated());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ public static void main(String[] args) {

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Message message = Message.updater("MM5ef8732a3c49700934481addd5ce1659").setBody("").update();
String messageSid = "MM5ef8732a3c49700934481addd5ce1659";
String body = "";
Message message = Message.updater(messageSid, body).update();

System.out.println(message.getBody()); // will be empty string
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Example {
public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

Queue queue = Queue.creator().setFriendlyName("newqueue").create();
Queue queue = Queue.creator("newqueue").create();

System.out.println(queue.getSid());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public class Example {
public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

Activity activity =
Activity.updater(WORKSPACE_SID, ACTIVITY_SID, "NewAvailableFriendlyName").update();
Activity activity = Activity.updater(WORKSPACE_SID, ACTIVITY_SID)
.setFriendlyName("NewAvailableFriendlyName")
.update();

}
}
4 changes: 3 additions & 1 deletion rest/taskrouter/tasks/list/get/example-2/example-2.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public static void main(String[] args) {
System.out.println(task.getAttributes());
}

tasks = Task.reader(WORKSPACE_SID).setAssignmentStatus(Task.Status.PENDING).read();
tasks = Task.reader(WORKSPACE_SID)
.setAssignmentStatus(Task.Status.PENDING.toString())
.read();

for (Task task : tasks) {
System.out.println(task.getAttributes());
Expand Down
5 changes: 4 additions & 1 deletion rest/taskrouter/tasks/list/post/example-1/example-1.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ public class Example {
public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

Task task = Task.creator(WORKSPACE_SID, "{\"type\":\"support\"}", WORKFLOW_SID).create();
Task task = Task.creator(WORKSPACE_SID)
.setWorkflowSid( WORKFLOW_SID)
.setAttributes("{\"type\":\"support\"}")
.create();

System.out.println(task.getAttributes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {
}

dependencies {
compile group: 'com.twilio.sdk', name: 'twilio', version: '7.1.0-alpha-1'
compile group: 'com.twilio.sdk', name: 'twilio', version: '7.9.1-alpha-1'
}

task wrapper(type: Wrapper) {
Expand Down