Class: MxPlatformRuby::InsightsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mx-platform-ruby/api/insights_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InsightsApi

Returns a new instance of InsightsApi.



19
20
21
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#list_accounts_insight(user_guid, insight_guid, opts = {}) ⇒ AccountsResponseBody

List all accounts associated with an insight. Use this endpoint to list all the accounts associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



30
31
32
33
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 30

def list_accounts_insight(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = list_accounts_insight_with_http_info(user_guid, insight_guid, opts)
  data
end

#list_accounts_insight_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(AccountsResponseBody, Integer, Hash)>

List all accounts associated with an insight. Use this endpoint to list all the accounts associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(AccountsResponseBody, Integer, Hash)>)

    AccountsResponseBody data, response status code and response headers



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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 43

def list_accounts_insight_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_accounts_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_accounts_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_accounts_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights/{insight_guid}/accounts'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AccountsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_accounts_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_accounts_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_categories_insight(user_guid, insight_guid, opts = {}) ⇒ CategoriesResponseBody

List all categories associated with an insight. Use this endpoint to list all the categories associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



105
106
107
108
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 105

def list_categories_insight(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = list_categories_insight_with_http_info(user_guid, insight_guid, opts)
  data
end

#list_categories_insight_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(CategoriesResponseBody, Integer, Hash)>

List all categories associated with an insight. Use this endpoint to list all the categories associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(CategoriesResponseBody, Integer, Hash)>)

    CategoriesResponseBody data, response status code and response headers



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 118

def list_categories_insight_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_categories_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_categories_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_categories_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights/{insight_guid}/categories'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CategoriesResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_categories_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_categories_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_insights_by_account(account_guid, user_guid, opts = {}) ⇒ InsightsResponseBody

List insights by account Use this endpoint to list all insights associated with a specified account GUID.

Parameters:

  • account_guid (String)

    The unique id for the &#x60;account&#x60;.

  • user_guid (String)

    The unique id for the &#x60;user&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



180
181
182
183
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 180

def (, user_guid, opts = {})
  data, _status_code, _headers = (, user_guid, opts)
  data
end

#list_insights_by_account_with_http_info(account_guid, user_guid, opts = {}) ⇒ Array<(InsightsResponseBody, Integer, Hash)>

List insights by account Use this endpoint to list all insights associated with a specified account GUID.

Parameters:

  • account_guid (String)

    The unique id for the &#x60;account&#x60;.

  • user_guid (String)

    The unique id for the &#x60;user&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(InsightsResponseBody, Integer, Hash)>)

    InsightsResponseBody data, response status code and response headers



193
194
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 193

def (, user_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_insights_by_account ...'
  end
  # verify the required parameter 'account_guid' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_guid' when calling InsightsApi.list_insights_by_account"
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_insights_by_account"
  end
  # resource path
  local_var_path = '/users/{user_guid}/accounts/{account_guid}/insights'.sub('{' + 'account_guid' + '}', CGI.escape(.to_s)).sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InsightsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_insights_by_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_insights_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_insights_user(user_guid, opts = {}) ⇒ InsightsResponseBody

List all insights for a user. Use this endpoint to list all the insights associated with the user.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



254
255
256
257
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 254

def list_insights_user(user_guid, opts = {})
  data, _status_code, _headers = list_insights_user_with_http_info(user_guid, opts)
  data
end

#list_insights_user_with_http_info(user_guid, opts = {}) ⇒ Array<(InsightsResponseBody, Integer, Hash)>

List all insights for a user. Use this endpoint to list all the insights associated with the user.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(InsightsResponseBody, Integer, Hash)>)

    InsightsResponseBody data, response status code and response headers



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 266

def list_insights_user_with_http_info(user_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_insights_user ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_insights_user"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InsightsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_insights_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_insights_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_merchants_insight(user_guid, insight_guid, opts = {}) ⇒ MerchantsResponseBody

List all merchants associated with an insight. Use this endpoint to list all the merchants associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



324
325
326
327
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 324

def list_merchants_insight(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = list_merchants_insight_with_http_info(user_guid, insight_guid, opts)
  data
end

#list_merchants_insight_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(MerchantsResponseBody, Integer, Hash)>

List all merchants associated with an insight. Use this endpoint to list all the merchants associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(MerchantsResponseBody, Integer, Hash)>)

    MerchantsResponseBody data, response status code and response headers



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 337

def list_merchants_insight_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_merchants_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_merchants_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_merchants_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights/{insight_guid}/merchants'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MerchantsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_merchants_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_merchants_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_scheduled_payments_insight(user_guid, insight_guid, opts = {}) ⇒ ScheduledPaymentsResponseBody

List all scheduled payments associated with an insight Use this endpoint to list all the scheduled payments associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



399
400
401
402
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 399

def list_scheduled_payments_insight(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = list_scheduled_payments_insight_with_http_info(user_guid, insight_guid, opts)
  data
end

#list_scheduled_payments_insight_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(ScheduledPaymentsResponseBody, Integer, Hash)>

List all scheduled payments associated with an insight Use this endpoint to list all the scheduled payments associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 412

def list_scheduled_payments_insight_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_scheduled_payments_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_scheduled_payments_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_scheduled_payments_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights/{insight_guid}/scheduled_payments'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ScheduledPaymentsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_scheduled_payments_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_scheduled_payments_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_transactions_insight(user_guid, insight_guid, opts = {}) ⇒ TransactionsResponseBody

List all transactions associated with an insight. Use this endpoint to list all the transactions associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:



474
475
476
477
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 474

def list_transactions_insight(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = list_transactions_insight_with_http_info(user_guid, insight_guid, opts)
  data
end

#list_transactions_insight_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(TransactionsResponseBody, Integer, Hash)>

List all transactions associated with an insight. Use this endpoint to list all the transactions associated with the insight.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Specify current page.

  • :records_per_page (Integer)

    Specify records per page.

Returns:

  • (Array<(TransactionsResponseBody, Integer, Hash)>)

    TransactionsResponseBody data, response status code and response headers



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 487

def list_transactions_insight_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.list_transactions_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_transactions_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_transactions_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights/{insight_guid}/transactions'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TransactionsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.list_transactions_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#list_transactions_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read_insights_user(user_guid, insight_guid, opts = {}) ⇒ InsightResponseBody

Read a specific insight. Use this endpoint to read the attributes of a specific insight according to its unique GUID.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Returns:



547
548
549
550
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 547

def read_insights_user(user_guid, insight_guid, opts = {})
  data, _status_code, _headers = read_insights_user_with_http_info(user_guid, insight_guid, opts)
  data
end

#read_insights_user_with_http_info(user_guid, insight_guid, opts = {}) ⇒ Array<(InsightResponseBody, Integer, Hash)>

Read a specific insight. Use this endpoint to read the attributes of a specific insight according to its unique GUID.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

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

    the optional parameters

Returns:

  • (Array<(InsightResponseBody, Integer, Hash)>)

    InsightResponseBody data, response status code and response headers



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 558

def read_insights_user_with_http_info(user_guid, insight_guid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.read_insights_user ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.read_insights_user"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.read_insights_user"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights{insight_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InsightResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.read_insights_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#read_insights_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_insight(user_guid, insight_guid, insight_update_request, opts = {}) ⇒ InsightResponse

Update insight Use this endpoint to update the attributes of a particular insight according to its unique GUID.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

  • insight_update_request (InsightUpdateRequest)

    The insight to be updated (None of these parameters are required, but the user object cannot be empty.)

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

    the optional parameters

Returns:



617
618
619
620
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 617

def update_insight(user_guid, insight_guid, insight_update_request, opts = {})
  data, _status_code, _headers = update_insight_with_http_info(user_guid, insight_guid, insight_update_request, opts)
  data
end

#update_insight_with_http_info(user_guid, insight_guid, insight_update_request, opts = {}) ⇒ Array<(InsightResponse, Integer, Hash)>

Update insight Use this endpoint to update the attributes of a particular insight according to its unique GUID.

Parameters:

  • user_guid (String)

    The unique identifier for the user. Defined by MX.

  • insight_guid (String)

    The unique identifier for the insight. Defined by MX.

  • insight_update_request (InsightUpdateRequest)

    The insight to be updated (None of these parameters are required, but the user object cannot be empty.)

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

    the optional parameters

Returns:

  • (Array<(InsightResponse, Integer, Hash)>)

    InsightResponse data, response status code and response headers



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# File 'lib/mx-platform-ruby/api/insights_api.rb', line 629

def update_insight_with_http_info(user_guid, insight_guid, insight_update_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsApi.update_insight ...'
  end
  # verify the required parameter 'user_guid' is set
  if @api_client.config.client_side_validation && user_guid.nil?
    fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.update_insight"
  end
  # verify the required parameter 'insight_guid' is set
  if @api_client.config.client_side_validation && insight_guid.nil?
    fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.update_insight"
  end
  # verify the required parameter 'insight_update_request' is set
  if @api_client.config.client_side_validation && insight_update_request.nil?
    fail ArgumentError, "Missing the required parameter 'insight_update_request' when calling InsightsApi.update_insight"
  end
  # resource path
  local_var_path = '/users/{user_guid}/insights{insight_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'insight_guid' + '}', CGI.escape(insight_guid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(insight_update_request)

  # return_type
  return_type = opts[:debug_return_type] || 'InsightResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"InsightsApi.update_insight",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsApi#update_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end