Class: WorkspaceAPI
- Inherits:
-
Object
- Object
- WorkspaceAPI
- Defined in:
- lib/zoho_analytics_client.rb
Overview
WorkspaceAPI contains workspace-level operations.
Instance Method Summary collapse
-
#add_admins(email_ids, config = {}) ⇒ Object
Add admins to the workspace.
-
#add_default ⇒ Object
Set the workspace as default.
-
#add_favorite ⇒ Object
Mark the workspace as favorite.
-
#add_group_members(group_id, email_ids, config = {}) ⇒ Object
Add users to a group.
-
#add_workspace_users(email_ids, role, config = {}) ⇒ Object
Add users to the workspace.
-
#change_email_schedule_status(schedule_id, operation) ⇒ Object
Update email schedule status (activate or deactivate).
-
#change_folder_hierarchy(folder_id, hierarchy, config = {}) ⇒ Object
Change folder hierarchy (parent/child).
-
#change_folder_position(folder_id, reference_folder_id, config = {}) ⇒ Object
Reorder folder relative to another folder.
-
#change_workspace_user_role(email_ids, role, config = {}) ⇒ Object
Change role of workspace users.
-
#change_workspace_user_status(email_ids, operation, config = {}) ⇒ Object
Change status (activate/deactivate) of workspace users.
-
#copy(new_workspace_name, config = {}, dest_org_id = nil) ⇒ Integer
Copy the specified workspace to a new one.
-
#copy_views(view_ids, dest_workspace_id, config = {}, dest_org_id = nil) ⇒ Array<Hash>
Copy views to another workspace.
-
#create_email_schedule(schedule_name, view_ids, format, email_ids, schedule_details, config = {}) ⇒ String
Create an email schedule in the specified workspace.
-
#create_folder(folder_name, config = {}) ⇒ Integer
Create a new folder in the workspace.
-
#create_group(group_name, email_ids, config = {}) ⇒ Integer
Create a group.
-
#create_query_table(sql_query, query_table_name, config = {}) ⇒ Integer
Create a new query table in the workspace.
-
#create_report(config = {}) ⇒ Integer
Create a report in the specified workspace.
-
#create_slideshow(slide_name, view_ids, config = {}) ⇒ Integer
Create a slideshow in the workspace.
-
#create_table(table_design) ⇒ Integer
Create a new table in the workspace.
-
#create_variable(variable_name, variable_datatype, variable_type, config = {}) ⇒ Integer
Create a variable in the workspace.
-
#delete ⇒ Object
Delete the specified workspace.
-
#delete_email_schedule(schedule_id) ⇒ Object
Delete the specified email schedule.
-
#delete_folder(folder_id) ⇒ Object
Delete a folder.
-
#delete_group(group_id) ⇒ Object
Delete a group.
-
#delete_slideshow(slide_id) ⇒ Object
Delete a slideshow.
-
#delete_trash_views(view_id, config = {}) ⇒ Object
Permanently delete a view from trash.
-
#delete_variable(variable_id) ⇒ Object
Delete a variable from the workspace.
-
#disable_domain_access ⇒ Object
Disable white-label domain access for the workspace.
-
#edit_query_table(view_id, sql_query, config = {}) ⇒ Object
Update an existing query table.
-
#enable_domain_access ⇒ Object
Enable the workspace for white-label domain access.
-
#export_as_template(view_ids, file_path, config = {}) ⇒ Object
Export views as a template file.
-
#get_admins ⇒ Array<Hash>
Get list of admins for the workspace.
-
#get_aggregate_formula_dependents(formula_id) ⇒ Hash
Returns dependents for a specified aggregate formula.
-
#get_aggregate_formula_value(formula_id) ⇒ String
Returns the value of the aggregate formula.
-
#get_aggregate_formulas(config = {}) ⇒ Array
Returns list of all aggregate formulas for the specified workspace.
-
#get_datasources ⇒ Array<Hash>
Get list of data sources.
-
#get_email_schedules ⇒ Array
Returns list of email schedules available in the specified workspace.
-
#get_folders ⇒ Array<Hash>
Returns a list of all accessible folders in the workspace.
-
#get_group_details(group_id) ⇒ Hash
Get details for a group.
-
#get_groups ⇒ Array<Hash>
Get groups in the workspace.
-
#get_secret_key(config = {}) ⇒ String
Get the secret key for the workspace.
-
#get_share_info ⇒ Hash
Get workspace share info.
-
#get_shared_details_for_views(view_ids) ⇒ Array<Hash>
Get shared details for the given views.
-
#get_slideshow_details(slide_id) ⇒ Hash
Get slideshow details.
-
#get_slideshow_url(slide_id, config = {}) ⇒ String
Get URL to access a slideshow.
-
#get_slideshows ⇒ Array<Hash>
Get all slideshows in the workspace.
-
#get_trash_views ⇒ Array<Hash>
Get list of trash views.
-
#get_variable_details(variable_id) ⇒ Hash
Get details of a specific variable.
-
#get_variables ⇒ Array<Hash>
Get list of variables in the workspace.
-
#get_views(config = {}) ⇒ Array<Hash>
Get list of all views in the workspace.
-
#get_workspace_users ⇒ Array<Hash>
Get users in the workspace.
-
#initialize(ac, org_id, workspace_id) ⇒ WorkspaceAPI
constructor
Initializes a new instance of WorkspaceAPI.
-
#make_default_folder(folder_id) ⇒ Object
Mark a folder as default.
-
#move_views_to_folder(folder_id, view_ids, config = {}) ⇒ Object
Move views into a folder.
-
#remove_admins(email_ids, config = {}) ⇒ Object
Remove admins from the workspace.
-
#remove_default ⇒ Object
Unset the workspace from default.
-
#remove_favorite ⇒ Object
Unmark the workspace as favorite.
-
#remove_group_members(group_id, email_ids, config = {}) ⇒ Object
Remove users from a group.
-
#remove_share(view_ids, email_ids, config = {}) ⇒ Object
Remove shared views for specific users.
-
#remove_workspace_users(email_ids, config = {}) ⇒ Object
Remove users from the workspace.
-
#rename(workspace_name, config = {}) ⇒ Object
Rename the specified workspace.
-
#rename_folder(folder_id, folder_name, config = {}) ⇒ Object
Rename a folder.
-
#rename_group(group_id, group_name, config = {}) ⇒ Object
Rename a group.
-
#restore_trash_views(view_id, config = {}) ⇒ Object
Restore a view from trash.
-
#share_views(view_ids, email_ids, permissions, config = {}) ⇒ Object
Share views to users.
-
#sync_data(datasource_id, config = {}) ⇒ Object
Trigger data sync for a data source.
-
#trigger_email_schedule(schedule_id) ⇒ Object
Trigger the configured email schedule instantly.
-
#update_datasource_connection(datasource_id, config = {}) ⇒ Object
Update data source connection.
-
#update_email_schedule(schedule_id, config) ⇒ String
Update configurations of the specified email schedule.
-
#update_report(view_id, config = {}) ⇒ Object
Update the design and configuration of the specified report.
-
#update_slideshow(slide_id, config = {}) ⇒ Object
Update a slideshow.
-
#update_variable(variable_id, variable_name, variable_datatype, variable_type, config = {}) ⇒ Object
Update a variable in the workspace.
Constructor Details
#initialize(ac, org_id, workspace_id) ⇒ WorkspaceAPI
Initializes a new instance of WorkspaceAPI.
892 893 894 895 896 |
# File 'lib/zoho_analytics_client.rb', line 892 def initialize(ac, org_id, workspace_id) @ac = ac @endpoint = "/restapi/v2/workspaces/#{workspace_id}" @request_headers = { 'ZANALYTICS-ORGID' => org_id } end |
Instance Method Details
#add_admins(email_ids, config = {}) ⇒ Object
Add admins to the workspace.
973 974 975 976 977 |
# File 'lib/zoho_analytics_client.rb', line 973 def add_admins(email_ids, config = {}) config['emailIds'] = email_ids endpoint = "#{@endpoint}/admins" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#add_default ⇒ Object
Set the workspace as default.
949 950 951 952 |
# File 'lib/zoho_analytics_client.rb', line 949 def add_default endpoint = "#{@endpoint}/default" @ac.send_api_request('POST', endpoint, nil, @request_headers) end |
#add_favorite ⇒ Object
Mark the workspace as favorite.
937 938 939 940 |
# File 'lib/zoho_analytics_client.rb', line 937 def add_favorite endpoint = "#{@endpoint}/favorite" @ac.send_api_request('POST', endpoint, nil, @request_headers) end |
#add_group_members(group_id, email_ids, config = {}) ⇒ Object
Add users to a group.
1207 1208 1209 1210 1211 |
# File 'lib/zoho_analytics_client.rb', line 1207 def add_group_members(group_id, email_ids, config = {}) config['emailIds'] = email_ids endpoint = "#{@endpoint}/groups/#{group_id}/members" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#add_workspace_users(email_ids, role, config = {}) ⇒ Object
Add users to the workspace.
1426 1427 1428 1429 1430 1431 |
# File 'lib/zoho_analytics_client.rb', line 1426 def add_workspace_users(email_ids, role, config = {}) config['emailIds'] = email_ids config['role'] = role endpoint = "#{@endpoint}/users" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#change_email_schedule_status(schedule_id, operation) ⇒ Object
Update email schedule status (activate or deactivate).
1506 1507 1508 1509 1510 |
# File 'lib/zoho_analytics_client.rb', line 1506 def change_email_schedule_status(schedule_id, operation) endpoint = "#{@endpoint}/emailschedules/#{schedule_id}/status" config = { "operation" => operation } @ac.send_api_request("PUT", endpoint, config, @request_headers) end |
#change_folder_hierarchy(folder_id, hierarchy, config = {}) ⇒ Object
Change folder hierarchy (parent/child).
1384 1385 1386 1387 1388 |
# File 'lib/zoho_analytics_client.rb', line 1384 def change_folder_hierarchy(folder_id, hierarchy, config = {}) endpoint = "#{@endpoint}/folders/#{folder_id}/move" config['hierarchy'] = hierarchy @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#change_folder_position(folder_id, reference_folder_id, config = {}) ⇒ Object
Reorder folder relative to another folder.
1391 1392 1393 1394 1395 |
# File 'lib/zoho_analytics_client.rb', line 1391 def change_folder_position(folder_id, reference_folder_id, config = {}) endpoint = "#{@endpoint}/folders/#{folder_id}/reorder" config['referenceFolderId'] = reference_folder_id @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#change_workspace_user_role(email_ids, role, config = {}) ⇒ Object
Change role of workspace users.
1449 1450 1451 1452 1453 1454 |
# File 'lib/zoho_analytics_client.rb', line 1449 def change_workspace_user_role(email_ids, role, config = {}) config['emailIds'] = email_ids config['role'] = role endpoint = "#{@endpoint}/users/role" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#change_workspace_user_status(email_ids, operation, config = {}) ⇒ Object
Change status (activate/deactivate) of workspace users.
1441 1442 1443 1444 1445 1446 |
# File 'lib/zoho_analytics_client.rb', line 1441 def change_workspace_user_status(email_ids, operation, config = {}) config['emailIds'] = email_ids config['operation'] = operation endpoint = "#{@endpoint}/users/status" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#copy(new_workspace_name, config = {}, dest_org_id = nil) ⇒ Integer
Copy the specified workspace to a new one.
904 905 906 907 908 909 910 |
# File 'lib/zoho_analytics_client.rb', line 904 def copy(new_workspace_name, config = {}, dest_org_id = nil) config['newWorkspaceName'] = new_workspace_name headers = @request_headers.dup headers['ZANALYTICS-DEST-ORGID'] = dest_org_id if dest_org_id response = @ac.send_api_request('POST', @endpoint, config, headers) response['workspaceId'].to_i end |
#copy_views(view_ids, dest_workspace_id, config = {}, dest_org_id = nil) ⇒ Array<Hash>
Copy views to another workspace.
1109 1110 1111 1112 1113 1114 1115 1116 1117 |
# File 'lib/zoho_analytics_client.rb', line 1109 def copy_views(view_ids, dest_workspace_id, config = {}, dest_org_id = nil) config['viewIds'] = view_ids config['destWorkspaceId'] = dest_workspace_id endpoint = "#{@endpoint}/views/copy" headers = @request_headers.dup headers['ZANALYTICS-DEST-ORGID'] = dest_org_id if dest_org_id response = @ac.send_api_request('POST', endpoint, config, headers) response['views'] end |
#create_email_schedule(schedule_name, view_ids, format, email_ids, schedule_details, config = {}) ⇒ String
Create an email schedule in the specified workspace.
1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 |
# File 'lib/zoho_analytics_client.rb', line 1474 def create_email_schedule(schedule_name, view_ids, format, email_ids, schedule_details, config = {}) config["scheduleName"] = schedule_name config["viewIds"] = view_ids config["exportType"] = format config["emailIds"] = email_ids config["scheduleDetails"] = schedule_details endpoint = "#{@endpoint}/emailschedules" response = @ac.send_api_request("POST", endpoint, config, @request_headers) response["scheduleId"].to_s end |
#create_folder(folder_name, config = {}) ⇒ Integer
Create a new folder in the workspace.
1049 1050 1051 1052 1053 1054 |
# File 'lib/zoho_analytics_client.rb', line 1049 def create_folder(folder_name, config = {}) config['folderName'] = folder_name endpoint = "#{@endpoint}/folders" response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['folderId'].to_i end |
#create_group(group_name, email_ids, config = {}) ⇒ Integer
Create a group.
1165 1166 1167 1168 1169 1170 1171 |
# File 'lib/zoho_analytics_client.rb', line 1165 def create_group(group_name, email_ids, config = {}) config['groupName'] = group_name config['emailIds'] = email_ids endpoint = "#{@endpoint}/groups" response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['groupId'].to_i end |
#create_query_table(sql_query, query_table_name, config = {}) ⇒ Integer
Create a new query table in the workspace.
1083 1084 1085 1086 1087 1088 1089 |
# File 'lib/zoho_analytics_client.rb', line 1083 def create_query_table(sql_query, query_table_name, config = {}) config['sqlQuery'] = sql_query config['queryTableName'] = query_table_name endpoint = "#{@endpoint}/querytables" response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['viewId'].to_i end |
#create_report(config = {}) ⇒ Integer
Create a report in the specified workspace.
1549 1550 1551 1552 1553 |
# File 'lib/zoho_analytics_client.rb', line 1549 def create_report(config = {}) endpoint = "#{@endpoint}/reports" response = @ac.send_api_request("POST", endpoint, config, @request_headers) response["viewId"].to_i end |
#create_slideshow(slide_name, view_ids, config = {}) ⇒ Integer
Create a slideshow in the workspace.
1230 1231 1232 1233 1234 1235 1236 |
# File 'lib/zoho_analytics_client.rb', line 1230 def (, view_ids, config = {}) config['slideName'] = config['viewIds'] = view_ids endpoint = "#{@endpoint}/slides" response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['slideId'].to_i end |
#create_table(table_design) ⇒ Integer
Create a new table in the workspace.
1070 1071 1072 1073 1074 1075 |
# File 'lib/zoho_analytics_client.rb', line 1070 def create_table(table_design) config = { 'tableDesign' => table_design } endpoint = "#{@endpoint}/tables" response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['viewId'].to_i end |
#create_variable(variable_name, variable_datatype, variable_type, config = {}) ⇒ Integer
Create a variable in the workspace.
1292 1293 1294 1295 1296 1297 1298 1299 |
# File 'lib/zoho_analytics_client.rb', line 1292 def create_variable(variable_name, variable_datatype, variable_type, config = {}) endpoint = "#{@endpoint}/variables" config['variableName'] = variable_name config['variableDataType'] = variable_datatype config['variableType'] = variable_type response = @ac.send_api_request('POST', endpoint, config, @request_headers) response['variableId'].to_i end |
#delete ⇒ Object
Delete the specified workspace.
922 923 924 |
# File 'lib/zoho_analytics_client.rb', line 922 def delete @ac.send_api_request('DELETE', @endpoint, nil, @request_headers) end |
#delete_email_schedule(schedule_id) ⇒ Object
Delete the specified email schedule.
1514 1515 1516 1517 |
# File 'lib/zoho_analytics_client.rb', line 1514 def delete_email_schedule(schedule_id) endpoint = "#{@endpoint}/emailschedules/#{schedule_id}" @ac.send_api_request("DELETE", endpoint, nil, @request_headers) end |
#delete_folder(folder_id) ⇒ Object
Delete a folder.
1145 1146 1147 1148 |
# File 'lib/zoho_analytics_client.rb', line 1145 def delete_folder(folder_id) endpoint = "#{@endpoint}/folders/#{folder_id}" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#delete_group(group_id) ⇒ Object
Delete a group.
1197 1198 1199 1200 |
# File 'lib/zoho_analytics_client.rb', line 1197 def delete_group(group_id) endpoint = "#{@endpoint}/groups/#{group_id}" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#delete_slideshow(slide_id) ⇒ Object
Delete a slideshow.
1250 1251 1252 1253 |
# File 'lib/zoho_analytics_client.rb', line 1250 def () endpoint = "#{@endpoint}/slides/#{}" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#delete_trash_views(view_id, config = {}) ⇒ Object
Permanently delete a view from trash.
1378 1379 1380 1381 |
# File 'lib/zoho_analytics_client.rb', line 1378 def delete_trash_views(view_id, config = {}) endpoint = "#{@endpoint}/trash/#{view_id}" @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |
#delete_variable(variable_id) ⇒ Object
Delete a variable from the workspace.
1311 1312 1313 1314 |
# File 'lib/zoho_analytics_client.rb', line 1311 def delete_variable(variable_id) endpoint = "#{@endpoint}/variables/#{variable_id}" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#disable_domain_access ⇒ Object
Disable white-label domain access for the workspace.
1126 1127 1128 1129 |
# File 'lib/zoho_analytics_client.rb', line 1126 def disable_domain_access endpoint = "#{@endpoint}/wlaccess" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#edit_query_table(view_id, sql_query, config = {}) ⇒ Object
Update an existing query table.
1096 1097 1098 1099 1100 |
# File 'lib/zoho_analytics_client.rb', line 1096 def edit_query_table(view_id, sql_query, config = {}) config['sqlQuery'] = sql_query endpoint = "#{@endpoint}/querytables/#{view_id}" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#enable_domain_access ⇒ Object
Enable the workspace for white-label domain access.
1120 1121 1122 1123 |
# File 'lib/zoho_analytics_client.rb', line 1120 def enable_domain_access endpoint = "#{@endpoint}/wlaccess" @ac.send_api_request('POST', endpoint, nil, @request_headers) end |
#export_as_template(view_ids, file_path, config = {}) ⇒ Object
Export views as a template file.
1410 1411 1412 1413 1414 |
# File 'lib/zoho_analytics_client.rb', line 1410 def export_as_template(view_ids, file_path, config = {}) endpoint = "#{@endpoint}/template/data" config['viewIds'] = view_ids @ac.send_export_api_request(endpoint, config, @request_headers, file_path) end |
#get_admins ⇒ Array<Hash>
Get list of admins for the workspace.
963 964 965 966 967 |
# File 'lib/zoho_analytics_client.rb', line 963 def get_admins endpoint = "#{@endpoint}/admins" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['workspaceAdmins'] end |
#get_aggregate_formula_dependents(formula_id) ⇒ Hash
Returns dependents for a specified aggregate formula.
1531 1532 1533 1534 1535 |
# File 'lib/zoho_analytics_client.rb', line 1531 def get_aggregate_formula_dependents(formula_id) endpoint = "#{@endpoint}/aggregateformulas/#{formula_id}/dependents" response = @ac.send_api_request("GET", endpoint, nil, @request_headers) response end |
#get_aggregate_formula_value(formula_id) ⇒ String
Returns the value of the aggregate formula.
1540 1541 1542 1543 1544 |
# File 'lib/zoho_analytics_client.rb', line 1540 def get_aggregate_formula_value(formula_id) endpoint = "#{@endpoint}/aggregateformulas/#{formula_id}/value" response = @ac.send_api_request("GET", endpoint, nil, @request_headers) response["formulaValue"] end |
#get_aggregate_formulas(config = {}) ⇒ Array
Returns list of all aggregate formulas for the specified workspace.
1522 1523 1524 1525 1526 |
# File 'lib/zoho_analytics_client.rb', line 1522 def get_aggregate_formulas(config = {}) endpoint = "#{@endpoint}/aggregateformulas" response = @ac.send_api_request("GET", endpoint, config, @request_headers) response["aggregateFormulas"] end |
#get_datasources ⇒ Array<Hash>
Get list of data sources.
1344 1345 1346 1347 1348 |
# File 'lib/zoho_analytics_client.rb', line 1344 def get_datasources endpoint = "#{@endpoint}/datasources" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['dataSources'] end |
#get_email_schedules ⇒ Array
Returns list of email schedules available in the specified workspace.
1460 1461 1462 1463 1464 |
# File 'lib/zoho_analytics_client.rb', line 1460 def get_email_schedules endpoint = "#{@endpoint}/emailschedules" response = @ac.send_api_request("GET", endpoint, nil, @request_headers) response["emailSchedules"] end |
#get_folders ⇒ Array<Hash>
Returns a list of all accessible folders in the workspace.
1038 1039 1040 1041 1042 |
# File 'lib/zoho_analytics_client.rb', line 1038 def get_folders endpoint = "#{@endpoint}/folders" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['folders'] end |
#get_group_details(group_id) ⇒ Hash
Get details for a group.
1177 1178 1179 1180 1181 |
# File 'lib/zoho_analytics_client.rb', line 1177 def get_group_details(group_id) endpoint = "#{@endpoint}/groups/#{group_id}" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['groups'] end |
#get_groups ⇒ Array<Hash>
Get groups in the workspace.
1153 1154 1155 1156 1157 |
# File 'lib/zoho_analytics_client.rb', line 1153 def get_groups endpoint = "#{@endpoint}/groups" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['groups'] end |
#get_secret_key(config = {}) ⇒ String
Get the secret key for the workspace.
930 931 932 933 934 |
# File 'lib/zoho_analytics_client.rb', line 930 def get_secret_key(config = {}) endpoint = "#{@endpoint}/secretkey" response = @ac.send_api_request('GET', endpoint, config, @request_headers) response['workspaceKey'] end |
#get_share_info ⇒ Hash
Get workspace share info.
992 993 994 995 996 |
# File 'lib/zoho_analytics_client.rb', line 992 def get_share_info endpoint = "#{@endpoint}/share" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response end |
#get_shared_details_for_views(view_ids) ⇒ Array<Hash>
Get shared details for the given views.
1028 1029 1030 1031 1032 1033 |
# File 'lib/zoho_analytics_client.rb', line 1028 def get_shared_details_for_views(view_ids) config = { 'viewIds' => view_ids } endpoint = "#{@endpoint}/share/shareddetails" response = @ac.send_api_request('GET', endpoint, config, @request_headers) response['sharedDetails'] end |
#get_slideshow_details(slide_id) ⇒ Hash
Get slideshow details.
1279 1280 1281 1282 1283 |
# File 'lib/zoho_analytics_client.rb', line 1279 def () endpoint = "#{@endpoint}/slides/#{}" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['slideInfo'] end |
#get_slideshow_url(slide_id, config = {}) ⇒ String
Get URL to access a slideshow.
1269 1270 1271 1272 1273 |
# File 'lib/zoho_analytics_client.rb', line 1269 def (, config = {}) endpoint = "#{@endpoint}/slides/#{}/publish" response = @ac.send_api_request('GET', endpoint, config, @request_headers) response['slideUrl'] end |
#get_slideshows ⇒ Array<Hash>
Get all slideshows in the workspace.
1258 1259 1260 1261 1262 |
# File 'lib/zoho_analytics_client.rb', line 1258 def endpoint = "#{@endpoint}/slides" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['slideshows'] end |
#get_trash_views ⇒ Array<Hash>
Get list of trash views.
1365 1366 1367 1368 1369 |
# File 'lib/zoho_analytics_client.rb', line 1365 def get_trash_views endpoint = "#{@endpoint}/trash" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['views'] end |
#get_variable_details(variable_id) ⇒ Hash
Get details of a specific variable.
1329 1330 1331 1332 1333 |
# File 'lib/zoho_analytics_client.rb', line 1329 def get_variable_details(variable_id) endpoint = "#{@endpoint}/variables/#{variable_id}" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response end |
#get_variables ⇒ Array<Hash>
Get list of variables in the workspace.
1319 1320 1321 1322 1323 |
# File 'lib/zoho_analytics_client.rb', line 1319 def get_variables endpoint = "#{@endpoint}/variables" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['variables'] end |
#get_views(config = {}) ⇒ Array<Hash>
Get list of all views in the workspace.
1060 1061 1062 1063 1064 |
# File 'lib/zoho_analytics_client.rb', line 1060 def get_views(config = {}) endpoint = "#{@endpoint}/views" response = @ac.send_api_request('GET', endpoint, config, @request_headers) response['views'] end |
#get_workspace_users ⇒ Array<Hash>
Get users in the workspace.
1419 1420 1421 1422 1423 |
# File 'lib/zoho_analytics_client.rb', line 1419 def get_workspace_users endpoint = "#{@endpoint}/users" response = @ac.send_api_request('GET', endpoint, nil, @request_headers) response['users'] end |
#make_default_folder(folder_id) ⇒ Object
Mark a folder as default.
1336 1337 1338 1339 |
# File 'lib/zoho_analytics_client.rb', line 1336 def make_default_folder(folder_id) endpoint = "#{@endpoint}/folders/#{folder_id}/default" @ac.send_api_request('PUT', endpoint, nil, @request_headers) end |
#move_views_to_folder(folder_id, view_ids, config = {}) ⇒ Object
Move views into a folder.
1398 1399 1400 1401 1402 1403 |
# File 'lib/zoho_analytics_client.rb', line 1398 def move_views_to_folder(folder_id, view_ids, config = {}) endpoint = "#{@endpoint}/views/movetofolder" config['folderId'] = folder_id config['viewIds'] = view_ids @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#remove_admins(email_ids, config = {}) ⇒ Object
Remove admins from the workspace.
983 984 985 986 987 |
# File 'lib/zoho_analytics_client.rb', line 983 def remove_admins(email_ids, config = {}) config['emailIds'] = email_ids endpoint = "#{@endpoint}/admins" @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |
#remove_default ⇒ Object
Unset the workspace from default.
955 956 957 958 |
# File 'lib/zoho_analytics_client.rb', line 955 def remove_default endpoint = "#{@endpoint}/default" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#remove_favorite ⇒ Object
Unmark the workspace as favorite.
943 944 945 946 |
# File 'lib/zoho_analytics_client.rb', line 943 def remove_favorite endpoint = "#{@endpoint}/favorite" @ac.send_api_request('DELETE', endpoint, nil, @request_headers) end |
#remove_group_members(group_id, email_ids, config = {}) ⇒ Object
Remove users from a group.
1218 1219 1220 1221 1222 |
# File 'lib/zoho_analytics_client.rb', line 1218 def remove_group_members(group_id, email_ids, config = {}) config['emailIds'] = email_ids endpoint = "#{@endpoint}/groups/#{group_id}/members" @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |
#remove_share(view_ids, email_ids, config = {}) ⇒ Object
Remove shared views for specific users.
1017 1018 1019 1020 1021 1022 |
# File 'lib/zoho_analytics_client.rb', line 1017 def remove_share(view_ids, email_ids, config = {}) config['emailIds'] = email_ids config['viewIds'] = view_ids if view_ids endpoint = "#{@endpoint}/share" @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |
#remove_workspace_users(email_ids, config = {}) ⇒ Object
Remove users from the workspace.
1434 1435 1436 1437 1438 |
# File 'lib/zoho_analytics_client.rb', line 1434 def remove_workspace_users(email_ids, config = {}) config['emailIds'] = email_ids endpoint = "#{@endpoint}/users" @ac.send_api_request('DELETE', endpoint, config, @request_headers) end |
#rename(workspace_name, config = {}) ⇒ Object
Rename the specified workspace.
916 917 918 919 |
# File 'lib/zoho_analytics_client.rb', line 916 def rename(workspace_name, config = {}) config['workspaceName'] = workspace_name @ac.send_api_request('PUT', @endpoint, config, @request_headers) end |
#rename_folder(folder_id, folder_name, config = {}) ⇒ Object
Rename a folder.
1136 1137 1138 1139 1140 |
# File 'lib/zoho_analytics_client.rb', line 1136 def rename_folder(folder_id, folder_name, config = {}) config['folderName'] = folder_name endpoint = "#{@endpoint}/folders/#{folder_id}" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#rename_group(group_id, group_name, config = {}) ⇒ Object
Rename a group.
1188 1189 1190 1191 1192 |
# File 'lib/zoho_analytics_client.rb', line 1188 def rename_group(group_id, group_name, config = {}) config['groupName'] = group_name endpoint = "#{@endpoint}/groups/#{group_id}" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#restore_trash_views(view_id, config = {}) ⇒ Object
Restore a view from trash.
1372 1373 1374 1375 |
# File 'lib/zoho_analytics_client.rb', line 1372 def restore_trash_views(view_id, config = {}) endpoint = "#{@endpoint}/trash/#{view_id}" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#share_views(view_ids, email_ids, permissions, config = {}) ⇒ Object
Share views to users.
1004 1005 1006 1007 1008 1009 1010 |
# File 'lib/zoho_analytics_client.rb', line 1004 def share_views(view_ids, email_ids, , config = {}) config['viewIds'] = view_ids config['emailIds'] = email_ids config['permissions'] = endpoint = "#{@endpoint}/share" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#sync_data(datasource_id, config = {}) ⇒ Object
Trigger data sync for a data source.
1351 1352 1353 1354 |
# File 'lib/zoho_analytics_client.rb', line 1351 def sync_data(datasource_id, config = {}) endpoint = "#{@endpoint}/datasources/#{datasource_id}/sync" @ac.send_api_request('POST', endpoint, config, @request_headers) end |
#trigger_email_schedule(schedule_id) ⇒ Object
Trigger the configured email schedule instantly.
1498 1499 1500 1501 |
# File 'lib/zoho_analytics_client.rb', line 1498 def trigger_email_schedule(schedule_id) endpoint = "#{@endpoint}/emailschedules/#{schedule_id}" @ac.send_api_request("POST", endpoint, nil, @request_headers) end |
#update_datasource_connection(datasource_id, config = {}) ⇒ Object
Update data source connection.
1357 1358 1359 1360 |
# File 'lib/zoho_analytics_client.rb', line 1357 def update_datasource_connection(datasource_id, config = {}) endpoint = "#{@endpoint}/datasources/#{datasource_id}" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#update_email_schedule(schedule_id, config) ⇒ String
Update configurations of the specified email schedule.
1490 1491 1492 1493 1494 |
# File 'lib/zoho_analytics_client.rb', line 1490 def update_email_schedule(schedule_id, config) endpoint = "#{@endpoint}/emailschedules/#{schedule_id}" response = @ac.send_api_request("PUT", endpoint, config, @request_headers) response["scheduleId"].to_s end |
#update_report(view_id, config = {}) ⇒ Object
Update the design and configuration of the specified report.
1558 1559 1560 1561 |
# File 'lib/zoho_analytics_client.rb', line 1558 def update_report(view_id, config = {}) endpoint = "#{@endpoint}/reports/#{view_id}" @ac.send_api_request("PUT", endpoint, config, @request_headers) end |
#update_slideshow(slide_id, config = {}) ⇒ Object
Update a slideshow.
1242 1243 1244 1245 |
# File 'lib/zoho_analytics_client.rb', line 1242 def (, config = {}) endpoint = "#{@endpoint}/slides/#{}" @ac.send_api_request('PUT', endpoint, config, @request_headers) end |
#update_variable(variable_id, variable_name, variable_datatype, variable_type, config = {}) ⇒ Object
Update a variable in the workspace.
1302 1303 1304 1305 1306 1307 1308 |
# File 'lib/zoho_analytics_client.rb', line 1302 def update_variable(variable_id, variable_name, variable_datatype, variable_type, config = {}) endpoint = "#{@endpoint}/variables/#{variable_id}" config['variableName'] = variable_name config['variableDataType'] = variable_datatype config['variableType'] = variable_type @ac.send_api_request('PUT', endpoint, config, @request_headers) end |