require "uri" module PureCloud class AnalyticsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get a list of alerts. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by title, startTime, endTime, description or unread # @option opts [String] :sort_order ascending or descending # @return [AlertEntityListing] def get_alerting_alerts(opts = {}) data, status_code, headers = get_alerting_alerts_with_http_info(opts) return data end # Get a list of alerts. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by title, startTime, endTime, description or unread # @option opts [String] :sort_order ascending or descending # @return [Array<(AlertEntityListing, Fixnum, Hash)>] AlertEntityListing data, response status code and response headers def get_alerting_alerts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_alerting_alerts ..." end # resource path path = "/api/v1/analytics/alerting/alerts".sub('{format}','json') # query parameters query_params = {} query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AlertEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_alerting_alerts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # A count of unread alerts. # # @param [Hash] opts the optional parameters # @return [UnreadMetric] def get_alerting_alerts_unread(opts = {}) data, status_code, headers = get_alerting_alerts_unread_with_http_info(opts) return data end # A count of unread alerts. # # @param [Hash] opts the optional parameters # @return [Array<(UnreadMetric, Fixnum, Hash)>] UnreadMetric data, response status code and response headers def get_alerting_alerts_unread_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_alerting_alerts_unread ..." end # resource path path = "/api/v1/analytics/alerting/alerts/unread".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UnreadMetric') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_alerting_alerts_unread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an alert. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @return [Alert] def get_alerting_alert(alert_id, opts = {}) data, status_code, headers = get_alerting_alert_with_http_info(alert_id, opts) return data end # Get an alert. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @return [Array<(Alert, Fixnum, Hash)>] Alert data, response status code and response headers def get_alerting_alert_with_http_info(alert_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_alerting_alert ..." end # verify the required parameter 'alert_id' is set fail "Missing the required parameter 'alert_id' when calling get_alerting_alert" if alert_id.nil? # resource path path = "/api/v1/analytics/alerting/alerts/{alertId}".sub('{format}','json').sub('{' + 'alertId' + '}', alert_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Alert') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_alerting_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an alerts unread status. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @option opts [Alert] :body Alert # @return [Alert] def update_alerting_alert(alert_id, opts = {}) data, status_code, headers = update_alerting_alert_with_http_info(alert_id, opts) return data end # Update an alerts unread status. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @option opts [Alert] :body Alert # @return [Array<(Alert, Fixnum, Hash)>] Alert data, response status code and response headers def update_alerting_alert_with_http_info(alert_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#update_alerting_alert ..." end # verify the required parameter 'alert_id' is set fail "Missing the required parameter 'alert_id' when calling update_alerting_alert" if alert_id.nil? # resource path path = "/api/v1/analytics/alerting/alerts/{alertId}".sub('{format}','json').sub('{' + 'alertId' + '}', alert_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Alert') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#update_alerting_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an alert. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @return [nil] def delete_alerting_alert(alert_id, opts = {}) delete_alerting_alert_with_http_info(alert_id, opts) return nil end # Delete an alert. # # @param alert_id Alert ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_alerting_alert_with_http_info(alert_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#delete_alerting_alert ..." end # verify the required parameter 'alert_id' is set fail "Missing the required parameter 'alert_id' when calling delete_alerting_alert" if alert_id.nil? # resource path path = "/api/v1/analytics/alerting/alerts/{alertId}".sub('{format}','json').sub('{' + 'alertId' + '}', alert_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#delete_alerting_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of rules. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by title, description, inAlarm or enabled # @option opts [String] :sort_order ascending or descending # @return [RuleEntityListing] def get_alerting_rules(opts = {}) data, status_code, headers = get_alerting_rules_with_http_info(opts) return data end # Get a list of rules. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by title, description, inAlarm or enabled # @option opts [String] :sort_order ascending or descending # @return [Array<(RuleEntityListing, Fixnum, Hash)>] RuleEntityListing data, response status code and response headers def get_alerting_rules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_alerting_rules ..." end # resource path path = "/api/v1/analytics/alerting/rules".sub('{format}','json') # query parameters query_params = {} query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RuleEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_alerting_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an alerting rule. # # @param [Hash] opts the optional parameters # @option opts [Rule] :body Rule # @return [Rule] def create_alerting_rules(opts = {}) data, status_code, headers = create_alerting_rules_with_http_info(opts) return data end # Create an alerting rule. # # @param [Hash] opts the optional parameters # @option opts [Rule] :body Rule # @return [Array<(Rule, Fixnum, Hash)>] Rule data, response status code and response headers def create_alerting_rules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#create_alerting_rules ..." end # resource path path = "/api/v1/analytics/alerting/rules".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Rule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#create_alerting_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @return [Rule] def get_alerting_rule(rule_id, opts = {}) data, status_code, headers = get_alerting_rule_with_http_info(rule_id, opts) return data end # Get an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @return [Array<(Rule, Fixnum, Hash)>] Rule data, response status code and response headers def get_alerting_rule_with_http_info(rule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_alerting_rule ..." end # verify the required parameter 'rule_id' is set fail "Missing the required parameter 'rule_id' when calling get_alerting_rule" if rule_id.nil? # resource path path = "/api/v1/analytics/alerting/rules/{ruleId}".sub('{format}','json').sub('{' + 'ruleId' + '}', rule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Rule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_alerting_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @option opts [Rule] :body Rule # @return [Rule] def update_alerting_rule(rule_id, opts = {}) data, status_code, headers = update_alerting_rule_with_http_info(rule_id, opts) return data end # Update an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @option opts [Rule] :body Rule # @return [Array<(Rule, Fixnum, Hash)>] Rule data, response status code and response headers def update_alerting_rule_with_http_info(rule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#update_alerting_rule ..." end # verify the required parameter 'rule_id' is set fail "Missing the required parameter 'rule_id' when calling update_alerting_rule" if rule_id.nil? # resource path path = "/api/v1/analytics/alerting/rules/{ruleId}".sub('{format}','json').sub('{' + 'ruleId' + '}', rule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Rule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#update_alerting_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @return [nil] def delete_alerting_rule(rule_id, opts = {}) delete_alerting_rule_with_http_info(rule_id, opts) return nil end # Delete an alerting rule. # # @param rule_id Rule ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_alerting_rule_with_http_info(rule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#delete_alerting_rule ..." end # verify the required parameter 'rule_id' is set fail "Missing the required parameter 'rule_id' when calling delete_alerting_rule" if rule_id.nil? # resource path path = "/api/v1/analytics/alerting/rules/{ruleId}".sub('{format}','json').sub('{' + 'ruleId' + '}', rule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#delete_alerting_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Executes a metrics query against the analytics service # # @param [Hash] opts the optional parameters # @option opts [Body] :body queryObject # @return [nil] def create_metrics_query(opts = {}) create_metrics_query_with_http_info(opts) return nil end # Executes a metrics query against the analytics service # # @param [Hash] opts the optional parameters # @option opts [Body] :body queryObject # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def create_metrics_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#create_metrics_query ..." end # resource path path = "/api/v1/analytics/metrics/query".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#create_metrics_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get list of reporting metadata. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :accept_language Accepted language # @option opts [String] :locale Locale # @return [ReportMetaDataEntityListing] def get_reporting_metadata(opts = {}) data, status_code, headers = get_reporting_metadata_with_http_info(opts) return data end # Get list of reporting metadata. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :accept_language Accepted language # @option opts [String] :locale Locale # @return [Array<(ReportMetaDataEntityListing, Fixnum, Hash)>] ReportMetaDataEntityListing data, response status code and response headers def get_reporting_metadata_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_metadata ..." end # resource path path = "/api/v1/analytics/reporting/metadata".sub('{format}','json') # query parameters query_params = {} query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'locale'] = opts[:'locale'] if opts[:'locale'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'Accept-Language'] = opts[:'accept_language'] if opts[:'accept_language'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportMetaDataEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of report formats # Get a list of report formats. # @param [Hash] opts the optional parameters # @return [Array] def get_reporting_reportformats(opts = {}) data, status_code, headers = get_reporting_reportformats_with_http_info(opts) return data end # Get a list of report formats # Get a list of report formats. # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_reporting_reportformats_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_reportformats ..." end # resource path path = "/api/v1/analytics/reporting/reportformats".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_reportformats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of scheduled report jobs # Get a list of scheduled report jobs. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [ReportScheduleEntityListing] def get_reporting_schedules(opts = {}) data, status_code, headers = get_reporting_schedules_with_http_info(opts) return data end # Get a list of scheduled report jobs # Get a list of scheduled report jobs. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @return [Array<(ReportScheduleEntityListing, Fixnum, Hash)>] ReportScheduleEntityListing data, response status code and response headers def get_reporting_schedules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_schedules ..." end # resource path path = "/api/v1/analytics/reporting/schedules".sub('{format}','json') # query parameters query_params = {} query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportScheduleEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a scheduled report job # Create a scheduled report job. # @param [Hash] opts the optional parameters # @option opts [ReportSchedule] :body ReportSchedule # @return [ReportSchedule] def create_reporting_schedules(opts = {}) data, status_code, headers = create_reporting_schedules_with_http_info(opts) return data end # Create a scheduled report job # Create a scheduled report job. # @param [Hash] opts the optional parameters # @option opts [ReportSchedule] :body ReportSchedule # @return [Array<(ReportSchedule, Fixnum, Hash)>] ReportSchedule data, response status code and response headers def create_reporting_schedules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#create_reporting_schedules ..." end # resource path path = "/api/v1/analytics/reporting/schedules".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportSchedule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#create_reporting_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [ReportSchedule] def get_reporting_schedule(schedule_id, opts = {}) data, status_code, headers = get_reporting_schedule_with_http_info(schedule_id, opts) return data end # Get a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [Array<(ReportSchedule, Fixnum, Hash)>] ReportSchedule data, response status code and response headers def get_reporting_schedule_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_schedule ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling get_reporting_schedule" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportSchedule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @option opts [ReportSchedule] :body ReportSchedule # @return [ReportSchedule] def update_reporting_schedule(schedule_id, opts = {}) data, status_code, headers = update_reporting_schedule_with_http_info(schedule_id, opts) return data end # Update a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @option opts [ReportSchedule] :body ReportSchedule # @return [Array<(ReportSchedule, Fixnum, Hash)>] ReportSchedule data, response status code and response headers def update_reporting_schedule_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#update_reporting_schedule ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling update_reporting_schedule" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportSchedule') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#update_reporting_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [String] def delete_reporting_schedule(schedule_id, opts = {}) data, status_code, headers = delete_reporting_schedule_with_http_info(schedule_id, opts) return data end # Delete a scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def delete_reporting_schedule_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#delete_reporting_schedule ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling delete_reporting_schedule" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#delete_reporting_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get list of completed scheduled report jobs. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number # @option opts [Integer] :page_size # @return [ReportRunEntryEntityDomainListing] def get_reporting_schedule_history(schedule_id, opts = {}) data, status_code, headers = get_reporting_schedule_history_with_http_info(schedule_id, opts) return data end # Get list of completed scheduled report jobs. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_number # @option opts [Integer] :page_size # @return [Array<(ReportRunEntryEntityDomainListing, Fixnum, Hash)>] ReportRunEntryEntityDomainListing data, response status code and response headers def get_reporting_schedule_history_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_schedule_history ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling get_reporting_schedule_history" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}/history".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportRunEntryEntityDomainListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_schedule_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get most recently completed scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [ReportRunEntry] def get_reporting_schedule_history_latest(schedule_id, opts = {}) data, status_code, headers = get_reporting_schedule_history_latest_with_http_info(schedule_id, opts) return data end # Get most recently completed scheduled report job. # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [Array<(ReportRunEntry, Fixnum, Hash)>] ReportRunEntry data, response status code and response headers def get_reporting_schedule_history_latest_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_schedule_history_latest ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling get_reporting_schedule_history_latest" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}/history/latest".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportRunEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_schedule_history_latest\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # A completed scheduled report job # A completed scheduled report job. # @param run_id Run ID # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [ReportRunEntry] def get_reporting_schedule_history_by_run_id(run_id, schedule_id, opts = {}) data, status_code, headers = get_reporting_schedule_history_by_run_id_with_http_info(run_id, schedule_id, opts) return data end # A completed scheduled report job # A completed scheduled report job. # @param run_id Run ID # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [Array<(ReportRunEntry, Fixnum, Hash)>] ReportRunEntry data, response status code and response headers def get_reporting_schedule_history_by_run_id_with_http_info(run_id, schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_schedule_history_by_run_id ..." end # verify the required parameter 'run_id' is set fail "Missing the required parameter 'run_id' when calling get_reporting_schedule_history_by_run_id" if run_id.nil? # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling get_reporting_schedule_history_by_run_id" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}/history/{runId}".sub('{format}','json').sub('{' + 'runId' + '}', run_id.to_s).sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportRunEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_schedule_history_by_run_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Place a scheduled report immediately into the reporting queue # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [RunNowResponse] def create_reporting_schedule_runreport(schedule_id, opts = {}) data, status_code, headers = create_reporting_schedule_runreport_with_http_info(schedule_id, opts) return data end # Place a scheduled report immediately into the reporting queue # # @param schedule_id Schedule ID # @param [Hash] opts the optional parameters # @return [Array<(RunNowResponse, Fixnum, Hash)>] RunNowResponse data, response status code and response headers def create_reporting_schedule_runreport_with_http_info(schedule_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#create_reporting_schedule_runreport ..." end # verify the required parameter 'schedule_id' is set fail "Missing the required parameter 'schedule_id' when calling create_reporting_schedule_runreport" if schedule_id.nil? # resource path path = "/api/v1/analytics/reporting/schedules/{scheduleId}/runreport".sub('{format}','json').sub('{' + 'scheduleId' + '}', schedule_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RunNowResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#create_reporting_schedule_runreport\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of report time periods. # # @param [Hash] opts the optional parameters # @return [Array] def get_reporting_timeperiods(opts = {}) data, status_code, headers = get_reporting_timeperiods_with_http_info(opts) return data end # Get a list of report time periods. # # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_reporting_timeperiods_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_timeperiods ..." end # resource path path = "/api/v1/analytics/reporting/timeperiods".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_timeperiods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a reporting metadata. # # @param report_id Report ID # @param [Hash] opts the optional parameters # @option opts [String] :accept_language Accepted language # @option opts [String] :locale Locale # @return [ReportMetaData] def get_reporting_report_metadata(report_id, opts = {}) data, status_code, headers = get_reporting_report_metadata_with_http_info(report_id, opts) return data end # Get a reporting metadata. # # @param report_id Report ID # @param [Hash] opts the optional parameters # @option opts [String] :accept_language Accepted language # @option opts [String] :locale Locale # @return [Array<(ReportMetaData, Fixnum, Hash)>] ReportMetaData data, response status code and response headers def get_reporting_report_metadata_with_http_info(report_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#get_reporting_report_metadata ..." end # verify the required parameter 'report_id' is set fail "Missing the required parameter 'report_id' when calling get_reporting_report_metadata" if report_id.nil? # resource path path = "/api/v1/analytics/reporting/{reportId}/metadata".sub('{format}','json').sub('{' + 'reportId' + '}', report_id.to_s) # query parameters query_params = {} query_params[:'locale'] = opts[:'locale'] if opts[:'locale'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'Accept-Language'] = opts[:'accept_language'] if opts[:'accept_language'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportMetaData') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#get_reporting_report_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Executes a segments query against the analytics service # # @param [Hash] opts the optional parameters # @option opts [Body1] :body queryObject # @return [nil] def create_segments_query(opts = {}) create_segments_query_with_http_info(opts) return nil end # Executes a segments query against the analytics service # # @param [Hash] opts the optional parameters # @option opts [Body1] :body queryObject # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def create_segments_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AnalyticsApi#create_segments_query ..." end # resource path path = "/api/v1/analytics/segments/query".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnalyticsApi#create_segments_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end