Package zendeskapi.exception

Examples of zendeskapi.exception.ZendeskApiException


      while ((line = rd.readLine()) != null) {
        sb.append(line);
      }
      return sb.toString();
    } catch (IOException e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here


   */
  public GroupForumSubcriptionResponse getForumSubscriptions() throws ZendeskApiException {
    try {
      return genericGet("forum_subscriptions.json", GroupForumSubcriptionResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

   */
  public GroupForumSubcriptionResponse getForumSubscriptionsByForumId(long forumId) throws ZendeskApiException {
    try {
      return genericGet("forums/" + forumId + "/subscriptions.json", GroupForumSubcriptionResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

  public <T extends ZendeskObject> T runRequest(String resource, RequestMethod requestMethod, Class<T> body) throws Exception {
    String payload = JsonHelper.marshal(body);
    RequestResult response = runRequest(resource, requestMethod, payload);

    if (response.isNotCreated() && response.isNotOk()) {
      throw new ZendeskApiException(response.getContent());
    }
    return JsonHelper.unmarshal(response.getContent(), body);
  }
View Full Code Here

   */
  public IndividualForumSubcriptionResponse getForumSubscriptionsById(long subscriptionId) throws ZendeskApiException {
    try {
      return genericGet("forum_subscriptions/" + subscriptionId + ".json", IndividualForumSubcriptionResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

  public <T, U extends ZendeskObject> U runRequest(String resource, RequestMethod requestMethod, T body, Class<U> returnType) throws Exception {
    String payload = JsonHelper.marshal(body);
    RequestResult response = runRequest(resource, requestMethod, payload);

    if (response.isNotCreated() && response.isNotOk()) {
      throw new ZendeskApiException(response.getContent());
    }
    return JsonHelper.unmarshal(response.getContent(), returnType);
  }
View Full Code Here

    IndividualForumSubcriptionResponse forumSubcriptionToCreate = new IndividualForumSubcriptionResponse();
    forumSubcriptionToCreate.setForumSubscription(forumSubscription);
    try {
      return genericPost("forum_subscriptions.json", forumSubcriptionToCreate, IndividualForumSubcriptionResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Creation of forum subscription failed", e);
    }
  }
View Full Code Here

   */
  public boolean deleteForumSubscription(long subscriptionId) throws ZendeskApiException {
    try {
      return genericDelete("forum_subscriptions/" + subscriptionId + ".json");
    } catch (Exception e) {
      throw new ZendeskApiException("Deletion of forum subscription with id " + subscriptionId + " failed", e);
    }
  }
View Full Code Here

   */
  public GroupOrganizationResponse getOrganizations() throws ZendeskApiException {
    try {
      return genericGet("organizations.json", GroupOrganizationResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Getting all organizations failed", e);
    }
  }
View Full Code Here

   */
  public GroupOrganizationResponse getOrganizationsStartingWith(String name) throws ZendeskApiException {
    try {
      return genericPost("organizations/autocomplete.json?name=" + name, null, GroupOrganizationResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Getting all organizations starting with " + name + " failed", e);
    }
  }
View Full Code Here

TOP

Related Classes of zendeskapi.exception.ZendeskApiException

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.