Examples of IndividualGroupResponse


Examples of zendeskapi.models.groups.IndividualGroupResponse

   * @param groupName
   * @return
   * @throws ZendeskApiException
   */
  public IndividualGroupResponse createGroup(String groupName) throws ZendeskApiException {
    IndividualGroupResponse individualGroupResponse = new IndividualGroupResponse();
    Group group = new Group();
    group.setName(groupName);
    individualGroupResponse.setGroup(group);
    try {
      return genericPost("groups.json", individualGroupResponse, IndividualGroupResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Failed to create group " + groupName, e);
    }
View Full Code Here

Examples of zendeskapi.models.groups.IndividualGroupResponse

   * @param group
   * @return
   * @throws ZendeskApiException
   */
  public IndividualGroupResponse updateGroup(Group group) throws ZendeskApiException {
    IndividualGroupResponse individualGroupResponse = new IndividualGroupResponse();
    individualGroupResponse.setGroup(group);
    try {
      return genericPut("groups/" + group.getId(), individualGroupResponse, IndividualGroupResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Update of group " + group.getName() + " failed", e);
    }
View Full Code Here

Examples of zendeskapi.models.groups.IndividualGroupResponse

  }

  @Test
  public void testCreateGroup() throws Exception {
    LOG.info("Create group");
    IndividualGroupResponse igr = API.getGroups().createGroup("Test Group 1");
    Assert.assertEquals(igr.getGroup().getName(), "Test Group 1");
    groupIds.add(igr.getGroup().getId());
  }
View Full Code Here

Examples of zendeskapi.models.groups.IndividualGroupResponse

  }

  @Test
  public void testUpdateGroup() throws Exception {
    LOG.info("Update Group");
    IndividualGroupResponse igr = API.getGroups().createGroup("Test Group 1");
    Assert.assertEquals(igr.getGroup().getName(), "Test Group 1");
    groupIds.add(igr.getGroup().getId());
    igr.getGroup().setName("Test Group 1 updated");
    IndividualGroupResponse updated = API.getGroups().updateGroup(igr.getGroup());
    Assert.assertEquals(updated.getGroup().getName(), "Test Group 1 updated");
    Assert.assertEquals(updated.getGroup().getId(), igr.getGroup().getId());
  }
View Full Code Here

Examples of zendeskapi.models.groups.IndividualGroupResponse

  }

  @Test
  public void testDeleteGroup() throws Exception {
    LOG.info("Delete group");
    IndividualGroupResponse igr = API.getGroups().createGroup("Test Group 1");
    Assert.assertEquals(igr.getGroup().getName(), "Test Group 1");
    Assert.assertTrue(API.getGroups().deleteGroup(igr.getGroup().getId()));
  }
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.