=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.15-SNAPSHOT =end require 'addressable/uri' module UltracartClient class DatawarehouseApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false) api_config = Configuration.new api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key api_config.api_version = '2017-03-01' api_config.verify_ssl = verify_ssl api_client = ApiClient.new(api_config) api_client.config.debugging = debugging UltracartClient::DatawarehouseApi.new(api_client) end # Delete a report # Delete a report on the UltraCart account. # @param report_oid The report oid to delete. # @param [Hash] opts the optional parameters # @return [nil] def delete_report(report_oid, opts = {}) delete_report_with_http_info(report_oid, opts) nil end # Delete a report # Delete a report on the UltraCart account. # @param report_oid The report oid to delete. # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_report_with_http_info(report_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.delete_report ...' end # verify the required parameter 'report_oid' is set if @api_client.config.client_side_validation && report_oid.nil? fail ArgumentError, "Missing the required parameter 'report_oid' when calling DatawarehouseApi.delete_report" end # resource path local_var_path = '/datawarehouse/reports/{report_oid}'.sub('{' + 'report_oid' + '}', report_oid.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_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: DatawarehouseApi#delete_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Dry run the report queries # Dry run the report queries # @param query_request Dry run request # @param [Hash] opts the optional parameters # @return [ReportDryRunQueriesResponse] def dry_run_report_queries(query_request, opts = {}) data, _status_code, _headers = dry_run_report_queries_with_http_info(query_request, opts) data end # Dry run the report queries # Dry run the report queries # @param query_request Dry run request # @param [Hash] opts the optional parameters # @return [Array<(ReportDryRunQueriesResponse, Fixnum, Hash)>] ReportDryRunQueriesResponse data, response status code and response headers def dry_run_report_queries_with_http_info(query_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.dry_run_report_queries ...' end # verify the required parameter 'query_request' is set if @api_client.config.client_side_validation && query_request.nil? fail ArgumentError, "Missing the required parameter 'query_request' when calling DatawarehouseApi.dry_run_report_queries" end # resource path local_var_path = '/datawarehouse/reports/dryrun' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(query_request) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportDryRunQueriesResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#dry_run_report_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Execute the report queries # Execute the report queries # @param query_request Query request # @param [Hash] opts the optional parameters # @return [nil] def execute_report_queries(query_request, opts = {}) execute_report_queries_with_http_info(query_request, opts) nil end # Execute the report queries # Execute the report queries # @param query_request Query request # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def execute_report_queries_with_http_info(query_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.execute_report_queries ...' end # verify the required parameter 'query_request' is set if @api_client.config.client_side_validation && query_request.nil? fail ArgumentError, "Missing the required parameter 'query_request' when calling DatawarehouseApi.execute_report_queries" end # resource path local_var_path = '/datawarehouse/reports/execute' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(query_request) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:PUT, local_var_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: DatawarehouseApi#execute_report_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a report # Retrieve a report # @param report_oid # @param [Hash] opts the optional parameters # @return [ReportResponse] def get_report(report_oid, opts = {}) data, _status_code, _headers = get_report_with_http_info(report_oid, opts) data end # Get a report # Retrieve a report # @param report_oid # @param [Hash] opts the optional parameters # @return [Array<(ReportResponse, Fixnum, Hash)>] ReportResponse data, response status code and response headers def get_report_with_http_info(report_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.get_report ...' end # verify the required parameter 'report_oid' is set if @api_client.config.client_side_validation && report_oid.nil? fail ArgumentError, "Missing the required parameter 'report_oid' when calling DatawarehouseApi.get_report" end # resource path local_var_path = '/datawarehouse/reports/{report_oid}'.sub('{' + 'report_oid' + '}', report_oid.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a report data set # Retrieve a report data set # @param dataset_uuid # @param [Hash] opts the optional parameters # @return [ReportDataSetResponse] def get_report_data_set(dataset_uuid, opts = {}) data, _status_code, _headers = get_report_data_set_with_http_info(dataset_uuid, opts) data end # Get a report data set # Retrieve a report data set # @param dataset_uuid # @param [Hash] opts the optional parameters # @return [Array<(ReportDataSetResponse, Fixnum, Hash)>] ReportDataSetResponse data, response status code and response headers def get_report_data_set_with_http_info(dataset_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.get_report_data_set ...' end # verify the required parameter 'dataset_uuid' is set if @api_client.config.client_side_validation && dataset_uuid.nil? fail ArgumentError, "Missing the required parameter 'dataset_uuid' when calling DatawarehouseApi.get_report_data_set" end # resource path local_var_path = '/datawarehouse/reports/dataset/{dataset_uuid}'.sub('{' + 'dataset_uuid' + '}', dataset_uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportDataSetResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#get_report_data_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a report data set page # Retrieve a report data set page # @param dataset_uuid # @param page_number # @param [Hash] opts the optional parameters # @return [ReportDataSetPageResponse] def get_report_data_set_page(dataset_uuid, page_number, opts = {}) data, _status_code, _headers = get_report_data_set_page_with_http_info(dataset_uuid, page_number, opts) data end # Get a report data set page # Retrieve a report data set page # @param dataset_uuid # @param page_number # @param [Hash] opts the optional parameters # @return [Array<(ReportDataSetPageResponse, Fixnum, Hash)>] ReportDataSetPageResponse data, response status code and response headers def get_report_data_set_page_with_http_info(dataset_uuid, page_number, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.get_report_data_set_page ...' end # verify the required parameter 'dataset_uuid' is set if @api_client.config.client_side_validation && dataset_uuid.nil? fail ArgumentError, "Missing the required parameter 'dataset_uuid' when calling DatawarehouseApi.get_report_data_set_page" end # verify the required parameter 'page_number' is set if @api_client.config.client_side_validation && page_number.nil? fail ArgumentError, "Missing the required parameter 'page_number' when calling DatawarehouseApi.get_report_data_set_page" end # resource path local_var_path = '/datawarehouse/reports/dataset/{dataset_uuid}/pages/{page_number}'.sub('{' + 'dataset_uuid' + '}', dataset_uuid.to_s).sub('{' + 'page_number' + '}', page_number.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportDataSetPageResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#get_report_data_set_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get report websocket authorization # Retrieve a JWT to authorize a report to make a websocket connection. # @param [Hash] opts the optional parameters # @return [ReportAuthResponse] def get_report_websocket_authorization(opts = {}) data, _status_code, _headers = get_report_websocket_authorization_with_http_info(opts) data end # Get report websocket authorization # Retrieve a JWT to authorize a report to make a websocket connection. # @param [Hash] opts the optional parameters # @return [Array<(ReportAuthResponse, Fixnum, Hash)>] ReportAuthResponse data, response status code and response headers def get_report_websocket_authorization_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.get_report_websocket_authorization ...' end # resource path local_var_path = '/datawarehouse/reports/auth' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportAuthResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#get_report_websocket_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get list of reports available # Retrieve a list of reports available # @param [Hash] opts the optional parameters # @return [ReportsResponse] def get_reports(opts = {}) data, _status_code, _headers = get_reports_with_http_info(opts) data end # Get list of reports available # Retrieve a list of reports available # @param [Hash] opts the optional parameters # @return [Array<(ReportsResponse, Fixnum, Hash)>] ReportsResponse data, response status code and response headers def get_reports_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.get_reports ...' end # resource path local_var_path = '/datawarehouse/reports' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#get_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a report # Create a new report on the UltraCart account. # @param report Report to create # @param [Hash] opts the optional parameters # @return [ReportResponse] def insert_report(report, opts = {}) data, _status_code, _headers = insert_report_with_http_info(report, opts) data end # Create a report # Create a new report on the UltraCart account. # @param report Report to create # @param [Hash] opts the optional parameters # @return [Array<(ReportResponse, Fixnum, Hash)>] ReportResponse data, response status code and response headers def insert_report_with_http_info(report, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.insert_report ...' end # verify the required parameter 'report' is set if @api_client.config.client_side_validation && report.nil? fail ArgumentError, "Missing the required parameter 'report' when calling DatawarehouseApi.insert_report" end # resource path local_var_path = '/datawarehouse/reports' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(report) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#insert_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a report # Update a report on the UltraCart account. # @param report Report to update # @param report_oid The report oid to update. # @param [Hash] opts the optional parameters # @return [ReportResponse] def update_report(report, report_oid, opts = {}) data, _status_code, _headers = update_report_with_http_info(report, report_oid, opts) data end # Update a report # Update a report on the UltraCart account. # @param report Report to update # @param report_oid The report oid to update. # @param [Hash] opts the optional parameters # @return [Array<(ReportResponse, Fixnum, Hash)>] ReportResponse data, response status code and response headers def update_report_with_http_info(report, report_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DatawarehouseApi.update_report ...' end # verify the required parameter 'report' is set if @api_client.config.client_side_validation && report.nil? fail ArgumentError, "Missing the required parameter 'report' when calling DatawarehouseApi.update_report" end # verify the required parameter 'report_oid' is set if @api_client.config.client_side_validation && report_oid.nil? fail ArgumentError, "Missing the required parameter 'report_oid' when calling DatawarehouseApi.update_report" end # resource path local_var_path = '/datawarehouse/reports/{report_oid}'.sub('{' + 'report_oid' + '}', report_oid.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(report) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReportResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DatawarehouseApi#update_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end