Package com.zoho.analytics.client
Class OrgAPI
- java.lang.Object
-
- com.zoho.analytics.client.OrgAPI
-
public class OrgAPI extends java.lang.ObjectOrgAPI contains organization level operations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOrgAPI(AnalyticsClient ac, long orgId)Creates a newOrgAPIinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config)Activate users in the specified organization.voidaddUsers(org.json.JSONArray emailIds, org.json.JSONObject config)Add users to the specified organization.voidchangeUserRole(org.json.JSONArray emailIds, java.lang.String role, org.json.JSONObject config)Change role for the specified users.java.lang.StringcreateCustomRole(java.lang.String roleName, java.lang.String accessType, org.json.JSONObject permissions, org.json.JSONObject config)Create a new custom role in the specified organization.longcreateWorkspace(java.lang.String workspaceName, org.json.JSONObject config)Create a blank workspace in the specified organization.voiddeactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config)Deactivate users in the specified organization.voiddeleteCustomRole(java.lang.String roleId)Delete the specified custom role from the organization.org.json.JSONArraygetAdmins()Returns list of admins for a specified organization.org.json.JSONArraygetAutoMLAnalysis()Returns all AutoML analysis available in the organization.org.json.JSONArraygetCustomRoles()Returns list of custom roles for the specified organization.org.json.JSONObjectgetMetaDetails(java.lang.String workspaceName, java.lang.String viewName)Returns details of the specified workspace/view.org.json.JSONArraygetOrgWorkspaces()Returns list of all accessible workspaces in the specified organization.org.json.JSONArraygetResourceDetails()Returns resource usage details of the specified organization.org.json.JSONObjectgetSubscriptionDetails()Returns subscription details of the specified organization.org.json.JSONArraygetUsers()Returns list of users for the specified organization.voidremoveUsers(org.json.JSONArray emailIds, org.json.JSONObject config)Remove users from the specified organization.voidupdateCustomRole(java.lang.String roleId, java.lang.String roleName, java.lang.String accessType, org.json.JSONObject permissions, org.json.JSONObject config)Update the specified custom role in the organization.
-
-
-
Constructor Detail
-
OrgAPI
protected OrgAPI(AnalyticsClient ac, long orgId)
Creates a newOrgAPIinstance.- Parameters:
ac-AnalyticsClientinstance.orgId- The ID of the organization.
-
-
Method Detail
-
createWorkspace
public long createWorkspace(java.lang.String workspaceName, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionCreate a blank workspace in the specified organization.- Parameters:
workspaceName- Name of the workspace.config- Contains any additional control configurations. Can be null.- Returns:
- A
longof new workspace id. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getAdmins
public org.json.JSONArray getAdmins() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns list of admins for a specified organization.- Returns:
- A
JSONArrayof organization admins. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getUsers
public org.json.JSONArray getUsers() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns list of users for the specified organization.- Returns:
- A
JSONArrayof users. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
addUsers
public void addUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionAdd users to the specified organization.- Parameters:
emailIds- The email address of the users to be added.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
removeUsers
public void removeUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionRemove users from the specified organization.- Parameters:
emailIds- The email address of the users to be removed.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
activateUsers
public void activateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionActivate users in the specified organization.- Parameters:
emailIds- The email address of the users to be activated.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
deactivateUsers
public void deactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionDeactivate users in the specified organization.- Parameters:
emailIds- The email address of the users to be deactivated.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
changeUserRole
public void changeUserRole(org.json.JSONArray emailIds, java.lang.String role, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionChange role for the specified users.- Parameters:
emailIds- The email address of the users.role- Name of the role to be updated. Can be one of "USER"/"VIEWER"/"ORGADMIN".config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getMetaDetails
public org.json.JSONObject getMetaDetails(java.lang.String workspaceName, java.lang.String viewName) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns details of the specified workspace/view.- Parameters:
workspaceName- The name of the workspace.viewName- The name of the view.- Returns:
- A
JSONObjectof workspace/view details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getSubscriptionDetails
public org.json.JSONObject getSubscriptionDetails() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns subscription details of the specified organization.- Returns:
- A
JSONObjectof subscription details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getResourceDetails
public org.json.JSONArray getResourceDetails() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns resource usage details of the specified organization.- Returns:
- A
JSONArrayof resource details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getOrgWorkspaces
public org.json.JSONArray getOrgWorkspaces() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns list of all accessible workspaces in the specified organization.- Returns:
- A
JSONArrayof workspace list. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getAutoMLAnalysis
public org.json.JSONArray getAutoMLAnalysis() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns all AutoML analysis available in the organization.- Returns:
- AutoML analysis list.
- Throws:
ServerException- If the server failed to process the request.ParseException- If the response could not be parsed.java.io.IOException- If communication errors occur.org.json.JSONException- If JSON processing fails.
-
getCustomRoles
public org.json.JSONArray getCustomRoles() throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns list of custom roles for the specified organization.- Returns:
- A
JSONArrayof custom roles. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
createCustomRole
public java.lang.String createCustomRole(java.lang.String roleName, java.lang.String accessType, org.json.JSONObject permissions, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionCreate a new custom role in the specified organization.- Parameters:
roleName- Name of the custom role to be created.accessType- Access type for the custom role.permissions- Contains the permission details for the custom role.config- Contains any additional control configurations. Can be null.- Returns:
- A
Stringof the created custom role id. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
updateCustomRole
public void updateCustomRole(java.lang.String roleId, java.lang.String roleName, java.lang.String accessType, org.json.JSONObject permissions, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionUpdate the specified custom role in the organization.- Parameters:
roleId- Id of the custom role.roleName- New name for the custom role.accessType- Access type for the custom role.permissions- Contains the permission details for the custom role.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
deleteCustomRole
public void deleteCustomRole(java.lang.String roleId) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionDelete the specified custom role from the organization.- Parameters:
roleId- Id of the custom role.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.java.io.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
-