Class: OrgAPI
- Inherits:
-
Object
- Object
- OrgAPI
- Defined in:
- lib/zoho_analytics_client.rb
Overview
OrgAPI contains organization-level operations.
Instance Method Summary collapse
-
#activate_users(email_ids, config = {}) ⇒ Object
Activate users in the specified organization.
-
#add_users(email_ids, config = {}) ⇒ Object
Add users to the specified organization.
-
#change_user_role(email_ids, role, config = {}) ⇒ Object
Change role for the specified users.
-
#create_workspace(workspace_name, config = {}) ⇒ Integer
Create a blank workspace in the specified organization.
-
#deactivate_users(email_ids, config = {}) ⇒ Object
Deactivate users in the specified organization.
-
#get_admins ⇒ Array<Hash>
Returns list of admins for a specified organization.
-
#get_automl_analysis ⇒ Array<Hash>
Returns all AutoML analyses available in the organization.
-
#get_meta_details(workspace_name, view_name = nil) ⇒ Hash
Returns metadata details of a workspace or a specific view.
-
#get_resource_details ⇒ Hash
Returns resource usage details of the specified organization.
-
#get_subscription_details ⇒ Hash
Returns subscription details of the specified organization.
-
#get_users ⇒ Array<Hash>
Returns list of users for the specified organization.
-
#initialize(ac, org_id) ⇒ OrgAPI
constructor
Initializes a new instance of OrgAPI.
-
#remove_users(email_ids, config = {}) ⇒ Object
Remove users from the specified organization.
Constructor Details
#initialize(ac, org_id) ⇒ OrgAPI
Initializes a new instance of OrgAPI.
778 779 780 781 |
# File 'lib/zoho_analytics_client.rb', line 778 def initialize(ac, org_id) @ac = ac @request_headers = { 'ZANALYTICS-ORGID' => org_id } end |
Instance Method Details
#activate_users(email_ids, config = {}) ⇒ Object
Activate users in the specified organization.
839 840 841 842 843 |
# File 'lib/zoho_analytics_client.rb', line 839 def activate_users(email_ids, config = {}) config['emailIds'] = email_ids endpoint = '/restapi/v2/users/active' @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#add_users(email_ids, config = {}) ⇒ Object
Add users to the specified organization.
819 820 821 822 823 |
# File 'lib/zoho_analytics_client.rb', line 819 def add_users(email_ids, config = {}) config['emailIds'] = email_ids endpoint = '/restapi/v2/users' @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#change_user_role(email_ids, role, config = {}) ⇒ Object
Change role for the specified users.
860 861 862 863 864 865 |
# File 'lib/zoho_analytics_client.rb', line 860 def change_user_role(email_ids, role, config = {}) config['emailIds'] = email_ids config['role'] = role endpoint = '/restapi/v2/users/role' @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#create_workspace(workspace_name, config = {}) ⇒ Integer
Create a blank workspace in the specified organization.
790 791 792 793 794 795 |
# File 'lib/zoho_analytics_client.rb', line 790 def create_workspace(workspace_name, config = {}) config['workspaceName'] = workspace_name endpoint = '/restapi/v2/workspaces/' response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['workspaceId'].to_i end |
#deactivate_users(email_ids, config = {}) ⇒ Object
Deactivate users in the specified organization.
849 850 851 852 853 |
# File 'lib/zoho_analytics_client.rb', line 849 def deactivate_users(email_ids, config = {}) config['emailIds'] = email_ids endpoint = '/restapi/v2/users/inactive' @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#get_admins ⇒ Array<Hash>
Returns list of admins for a specified organization.
800 801 802 803 804 |
# File 'lib/zoho_analytics_client.rb', line 800 def get_admins endpoint = '/restapi/v2/orgadmins' response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['orgAdmins'] end |
#get_automl_analysis ⇒ Array<Hash>
Returns all AutoML analyses available in the organization.
903 904 905 906 907 |
# File 'lib/zoho_analytics_client.rb', line 903 def get_automl_analysis endpoint = "/restapi/v2/automl/analysis" response = @ac.send_api_request("GET", endpoint, nil, @request_headers) response["analysis"] end |
#get_meta_details(workspace_name, view_name = nil) ⇒ Hash
Returns metadata details of a workspace or a specific view.
890 891 892 893 894 895 896 |
# File 'lib/zoho_analytics_client.rb', line 890 def (workspace_name, view_name = nil) config = { 'workspaceName' => workspace_name } config['viewName'] = view_name unless view_name.nil? endpoint = '/restapi/v2/metadetails' response = @ac.send_api_request('GET', endpoint, config, @request_headers) response end |
#get_resource_details ⇒ Hash
Returns resource usage details of the specified organization.
879 880 881 882 883 |
# File 'lib/zoho_analytics_client.rb', line 879 def get_resource_details endpoint = '/restapi/v2/resources' response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['resourceDetails'] end |
#get_subscription_details ⇒ Hash
Returns subscription details of the specified organization.
870 871 872 873 874 |
# File 'lib/zoho_analytics_client.rb', line 870 def get_subscription_details endpoint = '/restapi/v2/subscription' response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['subscription'] end |
#get_users ⇒ Array<Hash>
Returns list of users for the specified organization.
809 810 811 812 813 |
# File 'lib/zoho_analytics_client.rb', line 809 def get_users endpoint = '/restapi/v2/users' response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['users'] end |
#remove_users(email_ids, config = {}) ⇒ Object
Remove users from the specified organization.
829 830 831 832 833 |
# File 'lib/zoho_analytics_client.rb', line 829 def remove_users(email_ids, config = {}) config['emailIds'] = email_ids endpoint = '/restapi/v2/users' @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |