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.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.org.json.JSONArraygetAdmins()Returns list of admins for a specified organization.org.json.JSONArraygetAutoMLAnalysis()Returns all AutoML analysis available in the 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.
-
-
-
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.
-
-