Package zendeskapi.exception

Examples of zendeskapi.exception.ZendeskApiException


    GroupUserResponse userList = new GroupUserResponse();
    userList.setUsers(users);
    try {
      return genericPost("users/create_many.json", userList, JobStatusResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Faild to bulk create users", e);
    }
  }
View Full Code Here


    IndividualUserResponse userToUpdate = new IndividualUserResponse();
    userToUpdate.setUser(user);
    try {
      return genericPut(getUserIdUri(user.getId()) + ".json", userToUpdate, IndividualUserResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Could not update user id " + user.getId(), e);
    }
  }
View Full Code Here

  public boolean deleteUser(long id) throws ZendeskApiException {
    try {
      return genericDelete("users/" + id + ".json");
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

  public boolean setUsersPassword(long userId, String newPassword) throws ZendeskApiException {
    String request = "users/" + userId + "/password.json";
    try {
      return genericBooleanPost(request, newPassword);
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

    body.setPassword(newPassword);
    try {
      String json = JsonHelper.marshal(body);
      return genericBooleanPost(getUserIdUri(userId) + "/password.json", json);
    } catch (Exception e) {
      throw new ZendeskApiException("Failed to change the password for user id " + userId, e);
    }
  }
View Full Code Here

  public GroupUserIdentityResponse getUserIdentities(long userId) throws ZendeskApiException {
    try {
      return genericGet(getUserIdUri(userId) + "/identities.json", GroupUserIdentityResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Getting identities for user id " + userId + "failed", e);
    }
  }
View Full Code Here

  public IndividualUserIdentityResponse getSpecificUserIdentity(long userId, long identityId) throws ZendeskApiException {
    try {
      return genericGet(getUserIdentityIdUri(userId, identityId) + ".json", IndividualUserIdentityResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Getting identity id " + identityId + " for user id " + userId + "failed", e);
    }
  }
View Full Code Here

  public IndividualUserIdentityResponse addUserIdentity(long userId, UserIdentity identity) throws ZendeskApiException {
    try {
      return genericPost(getUserIdUri(userId) + "/identities.json", identity, IndividualUserIdentityResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Could not add user identity to user id: " + userId, e);
    }
  }
View Full Code Here

  public IndividualUserIdentityResponse setUserIdentityAsVerified(long userId, long identityId) throws ZendeskApiException {
    User nullUser = new User();
    try {
      return genericPut(getUserIdentityIdUri(userId, identityId) + "/verify.json", nullUser, IndividualUserIdentityResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Could not verify identity id " + identityId + " with user id " + userId, e);
    }
  }
View Full Code Here

  public GroupUserIdentityResponse setUserIdentityAsPrimary(long userId, long identityId) throws ZendeskApiException {
    User nullUser = new User();
    try {
      return genericPut(getUserIdentityIdUri(userId, identityId) + "/make_primary.json", nullUser, GroupUserIdentityResponse.class);
    } catch (Exception e) {
      throw new ZendeskApiException("Could not set identity id " + identityId + " for user id " + userId + " as primary", 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.