Package com.twilio.sdk

Examples of com.twilio.sdk.TwilioRestResponse


     *             if setting the friendly name fails
     */
    public void setFriendlyName(String friendlyName) throws TwilioRestException {
        Map<String, String> vars = new HashMap<String, String>();
        vars.put(Queue.FRIENDLY_NAME, friendlyName);
        TwilioRestResponse response = this.getClient().safeRequest(this.getResourceLocation(), "POST", vars);
        if (response.isError()) {
            throw new IllegalStateException("Response indicated error:" + response.getResponseText());
        }
        this.setProperty(Queue.FRIENDLY_NAME, friendlyName);
    }
View Full Code Here


     */
    public void setMaxSize(int maxSize) throws TwilioRestException {
        Map<String, String> vars = new HashMap<String, String>();
        String maxSizeString = Integer.toString(maxSize);
        vars.put(Queue.MAX_SIZE, maxSizeString);
        TwilioRestResponse response = this.getClient().safeRequest(this.getResourceLocation(), "POST", vars);
        if (response.isError()) {
            throw new IllegalStateException("Response indicated error:" + response.getResponseText());
        }
        // if we reached this point, store it in our own set of properties, i.e. we don't have to load the instance
        // just to get to this property
        this.setProperty(Queue.MAX_SIZE, maxSize);
    }
View Full Code Here

   *             if there is an error in the request
   * @return true, if successful
   *
   */
  public boolean delete() throws TwilioRestException {
    TwilioRestResponse response = this.getClient().safeRequest(
        this.getResourceLocation(), "DELETE", (Map) null);

    return !response.isError();
  }
View Full Code Here

     *             if there is an error in the request
     * @return true, if successful
     *
     */
    public boolean delete() throws TwilioRestException {
        TwilioRestResponse response = this.getClient().safeRequest(
                this.getResourceLocation(), "DELETE", (Map) null);

        return !response.isError();
    }
View Full Code Here

    stub(
        client.safeRequest(Matchers.eq("/2010-04-01/Accounts/" + accountSid + "/Queues/" + queueSid
            + ".json"), Matchers.eq("GET"), Matchers.any(Map.class)))
      .toReturn(resp);

    TwilioRestResponse memberresp = mock(TwilioRestResponse.class);
    HashMap<String, Object> map = new HashMap<String, Object>();
    stub(memberresp.toMap()).toReturn(map);
    formattedDate = dateFormat.format(new Date());
    map.put("call_sid", callSid);
    map.put("queue_sid", queueSid);
    map.put("position", "1");
    map.put("date_enqueued", formattedDate);
View Full Code Here

    stub(
        client.safeRequest(Matchers.eq("/2010-04-01/Accounts/" + accountSid + "/Queues/" + queueSid
            + ".json"), Matchers.eq("GET"), Matchers.any(Map.class)))
      .toReturn(resp);

    TwilioRestResponse membersresp = mock(TwilioRestResponse.class);
    HashMap<String, Object> map = new HashMap<String, Object>();
    stub(membersresp.toMap()).toReturn(map);
    stub(membersresp.getParser()).toReturn(new JsonResponseParser());


    formattedDate = dateFormat.format(new Date());
    map.put("next_page_uri", "http://next.page.uri/");
    map.put("start", "1");
View Full Code Here

TOP

Related Classes of com.twilio.sdk.TwilioRestResponse

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.