Package com.twilio.sdk.resource.list

Examples of com.twilio.sdk.resource.list.AccountList


    // Get the main account (The one we used to authenticate the client)
    Account mainAccount = client.getAccount();

    // Get all accounts including sub accounts
    AccountList accountList = client.getAccounts();

    // All lists implement an iterable interface, you can use the foreach
    // syntax on them
    for (Account a : accountList) {
      System.out.println(a.getFriendlyName());
    }

    // You can also iterate manually...
    Iterator<Account> itr = accountList.iterator();
    while (itr.hasNext()) {
      Account a = itr.next();
      System.out.println(a.getFriendlyName());
    }

    // You can also get just the first page of data
    accountList = client.getAccounts();
    List<Account> accounts = accountList.getPageData();

    // Make a call
    CallFactory callFactory = mainAccount.getCallFactory();
    Map<String, String> callParams = new HashMap<String, String>();
    callParams.put("To", "5105551212"); // Replace with a valid phone number
View Full Code Here


   *
   * @param params Filter the list with the given params. See the Twilio docs for available filters.
   * @return the list of accounts.
   */
  public AccountList getAccounts(final Map<String, String> params) {
    AccountList list = new AccountList(this, params);
    list.setRequestAccountSid(accountSid);
    return list;
  }
View Full Code Here

TOP

Related Classes of com.twilio.sdk.resource.list.AccountList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.