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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public class Example {
public static void main(String[] args) throws URISyntaxException {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

Call call = Call.create(
Call call = Call.creator(
new PhoneNumber("+14155551212"),
new PhoneNumber("+15017250604"),
new URI("http://demo.twilio.com/docs/voice.xml")
)
.setRecord(true)
.execute();
.create();

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

// Create the channel
Channel channel = Channel.create(SERVICE_SID)
Channel channel = Channel.creator(SERVICE_SID)
.setFriendlyName("General")
.setUniqueName("general")
.execute();
.create();

System.out.println(channel.getAttributes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the channel
boolean didDelete = Channel.delete(SERVICE_SID, "CHANNEL_SID").execute();
boolean didDelete = Channel.deleter(SERVICE_SID, "CHANNEL_SID").delete();

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

// Retrieve the list of channels
ResourceSet<Channel> channels = Channel.read(SERVICE_SID).execute();
ResourceSet<Channel> channels = Channel.reader(SERVICE_SID).read();

for (Channel channel : channels) {
System.out.println(channel.getFriendlyName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the channel
Channel channel = Channel.fetch(SERVICE_SID, CHANNEL_SID).execute();
Channel channel = Channel.fetcher(SERVICE_SID, CHANNEL_SID).fetch();

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

// Update the channel
Channel channel = Channel
.update(SERVICE_SID, CHANNEL_SID)
.updater(SERVICE_SID, CHANNEL_SID)
.setFriendlyName("ChannelName")
.execute();
.update();

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

// Create a credential
Credential credential = Credential
.create(Credential.PushService.GCM)
.creator(Credential.PushService.GCM)
.setApiKey("XXX")
.setFriendlyName("NAME")
.execute();
.create();

System.out.println(credential.getFriendlyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the credential
boolean didDelete = Credential.delete(CREDENTIAL_SID).execute();
boolean didDelete = Credential.deleter(CREDENTIAL_SID).delete();

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

// Retrieve the list of credentials
ResourceSet<Credential> credentials = Credential.read().execute();
ResourceSet<Credential> credentials = Credential.reader().read();

for (Credential credential : credentials) {
System.out.println(credential.getSid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the credential
Credential credential = Credential.fetch(CREDENTIAL_SID).execute();
Credential credential = Credential.fetcher(CREDENTIAL_SID).fetch();

System.out.println(credential.getFriendlyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Update the credential
Credential credential = Credential.update(CREDENTIAL_SID)
Credential credential = Credential.updater(CREDENTIAL_SID)
.setApiKey("NewApiKey")
.execute();
.update();

System.out.println(credential.getFriendlyName());
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/members/add-member/add-member.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Add a Member to the channel
Member member = Member.create(SERVICE_SID, CHANNEL_SID, "identity").execute();
Member member = Member.creator(SERVICE_SID, CHANNEL_SID, "identity").create();

System.out.println(member.getDateCreated());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the list of members on that channel
ResourceSet<Member> members = Member.read(SERVICE_SID, CHANNEL_SID).execute();
ResourceSet<Member> members = Member.reader(SERVICE_SID, CHANNEL_SID).read();

for (Member member : members) {
System.out.println(member.getIdentity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete a a member from the channel
boolean deleted = Member.delete(SERVICE_SID, CHANNEL_SID, MEMBER_SID).execute();
boolean deleted = Member.deleter(SERVICE_SID, CHANNEL_SID, MEMBER_SID).delete();

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

// Retrieve the member
Member member = Member.fetch(SERVICE_SID, CHANNEL_SID, MEMBER_SID).execute();
Member member = Member.fetcher(SERVICE_SID, CHANNEL_SID, MEMBER_SID).fetch();

System.out.println(member.getIdentity());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the message
boolean didDelete = Message.delete(SERVICE_SID, CHANNEL_SID, MESSAGE_SID).execute();
boolean didDelete = Message.deleter(SERVICE_SID, CHANNEL_SID, MESSAGE_SID).delete();

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

// List the messages in the channel
ResourceSet<Message> messages = Message.read(SERVICE_SID, CHANNEL_SID).execute();
ResourceSet<Message> messages = Message.reader(SERVICE_SID, CHANNEL_SID).read();

for (Message message : messages) {
System.out.println(message.getBody());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the message
Message message = Message.fetch(SERVICE_SID, CHANNEL_SID, MESSAGE_SID).execute();
Message message = Message.fetcher(SERVICE_SID, CHANNEL_SID, MESSAGE_SID).fetch();

System.out.println(message.getBody());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Create the message
Message message = Message.create(SERVICE_SID, CHANNEL_SID, "MESSAGE").execute();
Message message = Message.creator(SERVICE_SID, CHANNEL_SID, "MESSAGE").create();

System.out.println(message.getFrom());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public static void main(String[] args) {

// Update the message
Message message = Message
.update(SERVICE_SID, CHANNEL_SID, MESSAGE_SID, "New message body!")
.execute();
.updater(SERVICE_SID, CHANNEL_SID, MESSAGE_SID, "New message body!")
.update();

System.out.println(message.getBody());
}
Expand Down
4 changes: 2 additions & 2 deletions ip-messaging/rest/roles/create-role/create-role.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public static void main(String[] args) {

// Create a role
Role role = Role
.create(SERVICE_SID, "RoleName", Role.RoleType.DEPLOYMENT, permissions)
.execute();
.creator(SERVICE_SID, "RoleName", Role.RoleType.DEPLOYMENT, permissions)
.create();

System.out.println(role.getSid());
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/roles/delete-role/delete-role.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the role
boolean didDelete = Role.delete(SERVICE_SID, "ROLE_SID").execute();
boolean didDelete = Role.deleter(SERVICE_SID, "ROLE_SID").delete();
System.out.println(didDelete);
}
}
2 changes: 1 addition & 1 deletion ip-messaging/rest/roles/list-roles/list-roles.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

//List the roles
ResourceSet<Role> roles = Role.read(SERVICE_SID).execute();
ResourceSet<Role> roles = Role.reader(SERVICE_SID).read();

for (Role role : roles) {
System.out.println(role.getFriendlyName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the role
Role role = Role.fetch(SERVICE_SID, "ROLE_SID").execute();
Role role = Role.fetcher(SERVICE_SID, "ROLE_SID").fetch();

System.out.println(role.getFriendlyName());
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/roles/update-role/update-role.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public static void main(String[] args) {
List<String> permissions = Arrays.asList("sendMessage", "leaveChannel");

// Update the role
Role role = Role.update(SERVICE_SID, "ROLE_SID", permissions).execute();
Role role = Role.updater(SERVICE_SID, "ROLE_SID", permissions).update();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Create the service
Service service = Service.create("ServiceName").execute();
Service service = Service.creator("ServiceName").create();

System.out.println(service.getFriendlyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the service
boolean didDelete = Service.delete(SERVICE_SID).execute();
boolean didDelete = Service.deleter(SERVICE_SID).delete();
System.out.println(didDelete);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// List the services
ResourceSet<Service> services = Service.read().execute();
ResourceSet<Service> services = Service.reader().read();

for (Service service : services) {
System.out.println(service.getFriendlyName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the service
Service service = Service.fetch(SERVICE_SID).execute();
Service service = Service.fetcher(SERVICE_SID).fetch();

System.out.println(service.getFriendlyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Update the service
Service service = Service.update(SERVICE_SID).setFriendlyName("NewServiceName").execute();
Service service = Service.updater(SERVICE_SID).setFriendlyName("NewServiceName").update();

System.out.println(service.getFriendlyName());
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/users/create-user/create-user.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Create the user
User user = User.create(SERVICE_SID, "IDENTITY").execute();
User user = User.creator(SERVICE_SID, "IDENTITY").create();

System.out.println(user.getRoleSid());
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/users/delete-user/delete-user.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Delete the user
boolean didDelete = User.delete(SERVICE_SID, USER_SID).execute();
boolean didDelete = User.deleter(SERVICE_SID, USER_SID).delete();

System.out.println(didDelete);
}
Expand Down
2 changes: 1 addition & 1 deletion ip-messaging/rest/users/list-users/list-users.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// List the users
ResourceSet<User> users = User.read(SERVICE_SID).execute();
ResourceSet<User> users = User.reader(SERVICE_SID).read();

for (User user : users) {
System.out.println(user.getIdentity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Retrieve the user
User user = User.fetch(SERVICE_SID, USER_SID).execute();
User user = User.fetcher(SERVICE_SID, USER_SID).fetch();

System.out.println(user.getIdentity());
}
Expand Down
4 changes: 2 additions & 2 deletions ip-messaging/rest/users/update-user/update-user.7.x.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

// Update the user
User user = User.update(SERVICE_SID, USER_SID)
User user = User.updater(SERVICE_SID, USER_SID)
.setRoleSid("new_role_sid")
.execute();
.update();

System.out.println(user.getRoleSid());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public static void main(String[] args) {
addOnData.put("payfone_tcpa_compliance", complianceData);

PhoneNumber number = PhoneNumber
.fetch(new com.twilio.type.PhoneNumber("+15108675309"))
.fetcher(new com.twilio.type.PhoneNumber("+15108675309"))
.setType("carrier")
.setAddOns("payfone_tcpa_compliance")
.setAddOnsData(addOnData)
.execute();
.fetch();

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

PhoneNumber number = PhoneNumber
.fetch(new com.twilio.type.PhoneNumber("+15108675309"))
.fetcher(new com.twilio.type.PhoneNumber("+15108675309"))
.setType("carrier")
.execute();
.fetch();

System.out.println(number.getCarrier().get("name"));
System.out.println(number.getCarrier().get("type"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public static void main(String[] args) throws UnsupportedEncodingException {
String nationalNumber = URLEncoder.encode("(510) 867-5309", "UTF-8").replaceAll("\\+", "%20");

PhoneNumber number = PhoneNumber
.fetch(new com.twilio.type.PhoneNumber(nationalNumber))
.fetcher(new com.twilio.type.PhoneNumber(nationalNumber))
.setType("carrier")
.setCountryCode("US")
.execute();
.fetch();

System.out.println(number.getCarrier().get("name"));
System.out.println(number.getCarrier().get("type"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

PhoneNumber number = PhoneNumber
.fetch(new com.twilio.type.PhoneNumber("+15108675309"))
.fetcher(new com.twilio.type.PhoneNumber("+15108675309"))
.setType(Arrays.asList("caller-name", "carrier"))
.execute();
.fetch();

System.out.println(number.getCallerName());
}
Expand Down
Loading