Class: ArtikCloud::ExportApi

Inherits:
Object
  • Object
show all
Defined in:
lib/artikcloud/api/export_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExportApi

Returns a new instance of ExportApi.



18
19
20
# File 'lib/artikcloud/api/export_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/artikcloud/api/export_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#export_request(export_request_info, opts = {}) ⇒ ExportRequestResponse

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>

Parameters:

  • export_request_info

    ExportRequest object that is passed in the body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/artikcloud/api/export_api.rb', line 27

def export_request(export_request_info, opts = {})
  data, _status_code, _headers = export_request_with_http_info(export_request_info, opts)
  return data
end

#export_request_with_http_info(export_request_info, opts = {}) ⇒ Array<(ExportRequestResponse, Fixnum, Hash)>

Create Export Request Export normalized messages. The following input combinations are supported:&lt;br/&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;Combination&lt;/th&gt;&lt;th&gt;Parameters&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by users&lt;/td&gt;&lt;td&gt;uids&lt;/td&gt;&lt;td&gt;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.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by devices&lt;/td&gt;&lt;td&gt;sdids&lt;/td&gt;&lt;td&gt;Search by Source Device IDs.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by device types&lt;/td&gt;&lt;td&gt;uids,sdtids&lt;/td&gt;&lt;td&gt;Search by list of Source Device Type IDs for the given list of users.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by trial&lt;/td&gt;&lt;td&gt;trialId&lt;/td&gt;&lt;td&gt;Search by Trial ID.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by combination of parameters&lt;/td&gt;&lt;td&gt;uids,sdids,sdtids&lt;/td&gt;&lt;td&gt;Search by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Common&lt;/td&gt;&lt;td&gt;startDate,endDate,order,format,url,csvHeaders&lt;/td&gt;&lt;td&gt;Parameters that can be used with the above combinations.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

Parameters:

  • export_request_info

    ExportRequest object that is passed in the body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ExportRequestResponse, Fixnum, Hash)>)

    ExportRequestResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/artikcloud/api/export_api.rb', line 37

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(opts = {}) ⇒ ExportHistoryResponse

Get Export History Get the history of export requests.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :trial_id (String)

    Filter by trialId.

  • :count (Integer)

    Pagination count.

  • :offset (Integer)

    Pagination offset.

Returns:



80
81
82
83
# File 'lib/artikcloud/api/export_api.rb', line 80

def get_export_history(opts = {})
  data, _status_code, _headers = get_export_history_with_http_info(opts)
  return data
end

#get_export_history_with_http_info(opts = {}) ⇒ Array<(ExportHistoryResponse, Fixnum, Hash)>

Get Export History Get the history of export requests.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :trial_id (String)

    Filter by trialId.

  • :count (Integer)

    Pagination count.

  • :offset (Integer)

    Pagination offset.

Returns:

  • (Array<(ExportHistoryResponse, Fixnum, Hash)>)

    ExportHistoryResponse data, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/artikcloud/api/export_api.rb', line 92

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(export_id, opts = {}) ⇒ String

Get Export Result Retrieve result of the export query in tgz format. The tar file may contain one or more files with the results.

Parameters:

  • export_id

    Export ID of the export query.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


134
135
136
137
# File 'lib/artikcloud/api/export_api.rb', line 134

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_with_http_info(export_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get Export Result Retrieve result of the export query in tgz format. The tar file may contain one or more files with the results.

Parameters:

  • export_id

    Export ID of the export query.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/artikcloud/api/export_api.rb', line 144

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

#get_export_status(export_id, opts = {}) ⇒ ExportStatusResponse

Check Export Status Check status of the export query.

Parameters:

  • export_id

    Export ID of the export query.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



185
186
187
188
# File 'lib/artikcloud/api/export_api.rb', line 185

def get_export_status(export_id, opts = {})
  data, _status_code, _headers = get_export_status_with_http_info(export_id, opts)
  return data
end

#get_export_status_with_http_info(export_id, opts = {}) ⇒ Array<(ExportStatusResponse, Fixnum, Hash)>

Check Export Status Check status of the export query.

Parameters:

  • export_id

    Export ID of the export query.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ExportStatusResponse, Fixnum, Hash)>)

    ExportStatusResponse data, response status code and response headers



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/artikcloud/api/export_api.rb', line 195

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