Package zendeskapi.models.requests

Examples of zendeskapi.models.requests.IndividualRequestResponse


    Request request = new Request();
    Comment comment = new Comment();
    comment.setBody("Test comment 1");
    request.setSubject("Test request 1");
    request.setComment(comment);
    IndividualRequestResponse irr = API.getRequests().createRequest(request);
    Assert.assertTrue(irr.getRequest().getId() > 0);
   
    IndividualRequestResponse irrById = API.getRequests().getRequestById(irr.getRequest().getId());
    Assert.assertEquals(irrById.getRequest().getId(), irr.getRequest().getId());
   
    irrById.getRequest().setSubject("New Subject");
    Comment newComment = new Comment();
    newComment.setBody("something more to say");
    irrById.getRequest().setComment(newComment);
   
    API.getRequests().updateRequest(irrById.getRequest());
    GroupCommentResponse gcr = API.getRequests().getRequestCommentsById(irr.getRequest().getId());
    Assert.assertEquals(gcr.getComments().get(gcr.getComments().size()-1).getBody().replace("\n", ""), "something more to say");
   
    IndividualCommentResponse icr = API.getRequests().getSpecificRequestComment(irr.getRequest().getId(), gcr.getComments().get(gcr.getComments().size()-1).getId());
    Assert.assertTrue(icr.getComment().getId().longValue() == gcr.getComments().get(gcr.getComments().size()-1).getId().longValue());
   
    Assert.assertTrue(API.getTickets().delete(irrById.getRequest().getId()));
  }
View Full Code Here


   * @param request
   * @return IndividualRequestResponse
   * @throws ZendeskApiException
   */
  public IndividualRequestResponse createRequest(Request request) throws ZendeskApiException {
    IndividualRequestResponse individualRequestResponse = new IndividualRequestResponse();
    individualRequestResponse.setRequest(request);
    try {
      return genericPost("requests.json", individualRequestResponse, IndividualRequestResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Creation of request " + request.getSubject() + " failed", e);
    }
View Full Code Here

   * @throws ZendeskApiException
   */
  public IndividualRequestResponse updateRequest(long id, Comment comment) throws ZendeskApiException {
    Request request = new Request();
    request.setComment(comment);
    IndividualRequestResponse individualRequestResponse = new IndividualRequestResponse();
    individualRequestResponse.setRequest(request);
    try {
      return genericPut("requests/" + id + ".json", individualRequestResponse, IndividualRequestResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Creation of request " + request.getSubject() + " failed", e);
    }
View Full Code Here

   * @param comment
   * @return IndividualRequestResponse
   * @throws ZendeskApiException
   */
  public IndividualRequestResponse updateRequest(Request request) throws ZendeskApiException {
    IndividualRequestResponse individualRequestResponse = new IndividualRequestResponse();
    individualRequestResponse.setRequest(request);
    try {
      return genericPut("requests/" + request.getId() + ".json", individualRequestResponse, IndividualRequestResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Creation of request " + request.getSubject() + " failed", e);
    }
View Full Code Here

TOP

Related Classes of zendeskapi.models.requests.IndividualRequestResponse

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.