Examples of UsageRecordList


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

   *
   * @param filters the filters
   * @return the usage records
   */
  public UsageRecordList getUsageRecords(Map<String, String> filters) {
    UsageRecordList list = new UsageRecordList(this.getClient(), filters);
    list.setRequestAccountSid(this.getRequestAccountSid());
    return list;
  }
View Full Code Here

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

  @Test
  public void testListingUsageRecords() throws Exception {

    try {
      setExpectedServerAnswer("recordtestanswer.xml");
      UsageRecordList usageRecords = client.getAccount().getUsageRecords();

      TreeSet<UsageRecord> answers = new TreeSet<UsageRecord>(new Comparator<UsageRecord>() {
        @Override
        public int compare(UsageRecord o1, UsageRecord o2) {
          UsageCategory o1_category = o1.getCategory();
          UsageCategory o2_category = o2.getCategory();
          if (o1_category == null) {
            return 1;
          } else if (o2_category == null) {
            return -1;
          } else {
            return o1_category.compareTo(o2_category);
          }
        }
      });
      Iterator<UsageRecord> usageRecordsIter = usageRecords.iterator();

      while (usageRecordsIter.hasNext()) { // iter is of type Iterator<String>
        answers.add(usageRecordsIter.next());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.