=begin #ARTIK Cloud API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module ArtikCloud class ExportApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create Export Request # Export normalized messages. The following input combinations are supported:
CombinationParametersDescription
Get by usersuidsSearch by a list of User IDs. For each user in the list, the current authenticated user must have read access over the specified user.
Get by devicessdidsSearch by Source Device IDs.
Get by device typesuids,sdtidsSearch by list of Source Device Type IDs for the given list of users.
Get by trialtrialIdSearch by Trial ID.
Get by combination of parametersuids,sdids,sdtidsSearch by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.
CommonstartDate,endDate,order,format,url,csvHeadersParameters that can be used with the above combinations.
# @param export_request_info ExportRequest object that is passed in the body # @param [Hash] opts the optional parameters # @return [ExportRequestResponse] def export_request(export_request_info, opts = {}) data, _status_code, _headers = export_request_with_http_info(export_request_info, opts) return data end # Create Export Request # Export normalized messages. The following input combinations are supported:<br/><table><tr><th>Combination</th><th>Parameters</th><th>Description</th></tr><tr><td>Get by users</td><td>uids</td><td>Search by a list of User IDs. For each user in the list, the current authenticated user must have read access over the specified user.</td></tr><tr><td>Get by devices</td><td>sdids</td><td>Search by Source Device IDs.</td></tr><tr><td>Get by device types</td><td>uids,sdtids</td><td>Search by list of Source Device Type IDs for the given list of users.</td></tr><tr><td>Get by trial</td><td>trialId</td><td>Search by Trial ID.</td></tr><tr><td>Get by combination of parameters</td><td>uids,sdids,sdtids</td><td>Search by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.</td></tr><tr><td>Common</td><td>startDate,endDate,order,format,url,csvHeaders</td><td>Parameters that can be used with the above combinations.</td></tr></table> # @param export_request_info ExportRequest object that is passed in the body # @param [Hash] opts the optional parameters # @return [Array<(ExportRequestResponse, Fixnum, Hash)>] ExportRequestResponse data, response status code and response headers def export_request_with_http_info(export_request_info, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExportApi.export_request ..." end # verify the required parameter 'export_request_info' is set fail ArgumentError, "Missing the required parameter 'export_request_info' when calling ExportApi.export_request" if export_request_info.nil? # resource path local_var_path = "/messages/export".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(export_request_info) auth_names = ['artikcloud_oauth'] 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 => 'ExportRequestResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExportApi#export_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Export History # Get the history of export requests. # @param [Hash] opts the optional parameters # @option opts [String] :trial_id Filter by trialId. # @option opts [Integer] :count Pagination count. # @option opts [Integer] :offset Pagination offset. # @return [ExportHistoryResponse] def get_export_history(opts = {}) data, _status_code, _headers = get_export_history_with_http_info(opts) return data end # Get Export History # Get the history of export requests. # @param [Hash] opts the optional parameters # @option opts [String] :trial_id Filter by trialId. # @option opts [Integer] :count Pagination count. # @option opts [Integer] :offset Pagination offset. # @return [Array<(ExportHistoryResponse, Fixnum, Hash)>] ExportHistoryResponse data, response status code and response headers def get_export_history_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExportApi.get_export_history ..." end # resource path local_var_path = "/messages/export/history".sub('{format}','json') # query parameters query_params = {} query_params[:'trialId'] = opts[:'trial_id'] if !opts[:'trial_id'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_oauth'] 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 => 'ExportHistoryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExportApi#get_export_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Export Result # Retrieve result of the export query in tgz format. The tar file may contain one or more files with the results. # @param export_id Export ID of the export query. # @param [Hash] opts the optional parameters # @return [String] def get_export_result(export_id, opts = {}) data, _status_code, _headers = get_export_result_with_http_info(export_id, opts) return data end # Get Export Result # Retrieve result of the export query in tgz format. The tar file may contain one or more files with the results. # @param export_id Export ID of the export query. # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def get_export_result_with_http_info(export_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExportApi.get_export_result ..." end # verify the required parameter 'export_id' is set fail ArgumentError, "Missing the required parameter 'export_id' when calling ExportApi.get_export_result" if export_id.nil? # resource path local_var_path = "/messages/export/{exportId}/result".sub('{format}','json').sub('{' + 'exportId' + '}', export_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_oauth'] 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 => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExportApi#get_export_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Check Export Status # Check status of the export query. # @param export_id Export ID of the export query. # @param [Hash] opts the optional parameters # @return [ExportStatusResponse] def get_export_status(export_id, opts = {}) data, _status_code, _headers = get_export_status_with_http_info(export_id, opts) return data end # Check Export Status # Check status of the export query. # @param export_id Export ID of the export query. # @param [Hash] opts the optional parameters # @return [Array<(ExportStatusResponse, Fixnum, Hash)>] ExportStatusResponse data, response status code and response headers def get_export_status_with_http_info(export_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExportApi.get_export_status ..." end # verify the required parameter 'export_id' is set fail ArgumentError, "Missing the required parameter 'export_id' when calling ExportApi.get_export_status" if export_id.nil? # resource path local_var_path = "/messages/export/{exportId}/status".sub('{format}','json').sub('{' + 'exportId' + '}', export_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_oauth'] 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 => 'ExportStatusResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExportApi#get_export_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end