mx-platform-ruby 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/docs/AccountResponse.md +2 -2
- data/docs/InsightResponse.md +56 -0
- data/docs/InsightResponseBody.md +18 -0
- data/docs/InsightUpdateRequest.md +20 -0
- data/docs/InsightsApi.md +706 -0
- data/docs/InsightsResponseBody.md +20 -0
- data/docs/MxPlatformApi.md +1 -1
- data/docs/ScheduledPaymentResponse.md +42 -0
- data/docs/ScheduledPaymentsResponseBody.md +20 -0
- data/docs/WidgetRequest.md +1 -1
- data/lib/mx-platform-ruby/api/insights_api.rb +690 -0
- data/lib/mx-platform-ruby/api/mx_platform_api.rb +2 -2
- data/lib/mx-platform-ruby/models/account_response.rb +11 -11
- data/lib/mx-platform-ruby/models/insight_response.rb +404 -0
- data/lib/mx-platform-ruby/models/insight_response_body.rb +216 -0
- data/lib/mx-platform-ruby/models/insight_update_request.rb +223 -0
- data/lib/mx-platform-ruby/models/insights_response_body.rb +225 -0
- data/lib/mx-platform-ruby/models/scheduled_payment_response.rb +322 -0
- data/lib/mx-platform-ruby/models/scheduled_payments_response_body.rb +225 -0
- data/lib/mx-platform-ruby/version.rb +1 -1
- data/lib/mx-platform-ruby.rb +7 -0
- data/openapi/config.yml +1 -1
- data/spec/api/insights_api_spec.rb +166 -0
- data/spec/api/mx_platform_api_spec.rb +1 -1
- data/spec/models/account_response_spec.rb +3 -3
- data/spec/models/insight_response_body_spec.rb +34 -0
- data/spec/models/insight_response_spec.rb +148 -0
- data/spec/models/insight_update_request_spec.rb +40 -0
- data/spec/models/insights_response_body_spec.rb +40 -0
- data/spec/models/scheduled_payment_response_spec.rb +106 -0
- data/spec/models/scheduled_payments_response_body_spec.rb +40 -0
- metadata +30 -2
@@ -0,0 +1,690 @@
|
|
1
|
+
=begin
|
2
|
+
#MX Platform API
|
3
|
+
|
4
|
+
#The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module MxPlatformRuby
|
16
|
+
class InsightsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List all accounts associated with an insight.
|
23
|
+
# Use this endpoint to list all the accounts associated with the insight.
|
24
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
25
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [Integer] :page Specify current page.
|
28
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
29
|
+
# @return [AccountsResponseBody]
|
30
|
+
def list_accounts_insight(user_guid, insight_guid, opts = {})
|
31
|
+
data, _status_code, _headers = list_accounts_insight_with_http_info(user_guid, insight_guid, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# List all accounts associated with an insight.
|
36
|
+
# Use this endpoint to list all the accounts associated with the insight.
|
37
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
38
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [Integer] :page Specify current page.
|
41
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
42
|
+
# @return [Array<(AccountsResponseBody, Integer, Hash)>] AccountsResponseBody data, response status code and response headers
|
43
|
+
def list_accounts_insight_with_http_info(user_guid, insight_guid, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_accounts_insight ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'user_guid' is set
|
48
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_accounts_insight"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'insight_guid' is set
|
52
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_accounts_insight"
|
54
|
+
end
|
55
|
+
# resource path
|
56
|
+
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))
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = opts[:query_params] || {}
|
60
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
61
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
62
|
+
|
63
|
+
# header parameters
|
64
|
+
header_params = opts[:header_params] || {}
|
65
|
+
# HTTP header 'Accept' (if needed)
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
67
|
+
|
68
|
+
# form parameters
|
69
|
+
form_params = opts[:form_params] || {}
|
70
|
+
|
71
|
+
# http body (model)
|
72
|
+
post_body = opts[:debug_body]
|
73
|
+
|
74
|
+
# return_type
|
75
|
+
return_type = opts[:debug_return_type] || 'AccountsResponseBody'
|
76
|
+
|
77
|
+
# auth_names
|
78
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
79
|
+
|
80
|
+
new_options = opts.merge(
|
81
|
+
:operation => :"InsightsApi.list_accounts_insight",
|
82
|
+
:header_params => header_params,
|
83
|
+
:query_params => query_params,
|
84
|
+
:form_params => form_params,
|
85
|
+
:body => post_body,
|
86
|
+
:auth_names => auth_names,
|
87
|
+
:return_type => return_type
|
88
|
+
)
|
89
|
+
|
90
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_accounts_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# List all categories associated with an insight.
|
98
|
+
# Use this endpoint to list all the categories associated with the insight.
|
99
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
100
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @option opts [Integer] :page Specify current page.
|
103
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
104
|
+
# @return [CategoriesResponseBody]
|
105
|
+
def list_categories_insight(user_guid, insight_guid, opts = {})
|
106
|
+
data, _status_code, _headers = list_categories_insight_with_http_info(user_guid, insight_guid, opts)
|
107
|
+
data
|
108
|
+
end
|
109
|
+
|
110
|
+
# List all categories associated with an insight.
|
111
|
+
# Use this endpoint to list all the categories associated with the insight.
|
112
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
113
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
114
|
+
# @param [Hash] opts the optional parameters
|
115
|
+
# @option opts [Integer] :page Specify current page.
|
116
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
117
|
+
# @return [Array<(CategoriesResponseBody, Integer, Hash)>] CategoriesResponseBody data, response status code and response headers
|
118
|
+
def list_categories_insight_with_http_info(user_guid, insight_guid, opts = {})
|
119
|
+
if @api_client.config.debugging
|
120
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_categories_insight ...'
|
121
|
+
end
|
122
|
+
# verify the required parameter 'user_guid' is set
|
123
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_categories_insight"
|
125
|
+
end
|
126
|
+
# verify the required parameter 'insight_guid' is set
|
127
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
128
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_categories_insight"
|
129
|
+
end
|
130
|
+
# resource path
|
131
|
+
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))
|
132
|
+
|
133
|
+
# query parameters
|
134
|
+
query_params = opts[:query_params] || {}
|
135
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
136
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
137
|
+
|
138
|
+
# header parameters
|
139
|
+
header_params = opts[:header_params] || {}
|
140
|
+
# HTTP header 'Accept' (if needed)
|
141
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
142
|
+
|
143
|
+
# form parameters
|
144
|
+
form_params = opts[:form_params] || {}
|
145
|
+
|
146
|
+
# http body (model)
|
147
|
+
post_body = opts[:debug_body]
|
148
|
+
|
149
|
+
# return_type
|
150
|
+
return_type = opts[:debug_return_type] || 'CategoriesResponseBody'
|
151
|
+
|
152
|
+
# auth_names
|
153
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
154
|
+
|
155
|
+
new_options = opts.merge(
|
156
|
+
:operation => :"InsightsApi.list_categories_insight",
|
157
|
+
:header_params => header_params,
|
158
|
+
:query_params => query_params,
|
159
|
+
:form_params => form_params,
|
160
|
+
:body => post_body,
|
161
|
+
:auth_names => auth_names,
|
162
|
+
:return_type => return_type
|
163
|
+
)
|
164
|
+
|
165
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_categories_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
168
|
+
end
|
169
|
+
return data, status_code, headers
|
170
|
+
end
|
171
|
+
|
172
|
+
# List insights by account
|
173
|
+
# Use this endpoint to list all insights associated with a specified account GUID.
|
174
|
+
# @param account_guid [String] The unique id for the `account`.
|
175
|
+
# @param user_guid [String] The unique id for the `user`.
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @option opts [Integer] :page Specify current page.
|
178
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
179
|
+
# @return [InsightsResponseBody]
|
180
|
+
def list_insights_by_account(account_guid, user_guid, opts = {})
|
181
|
+
data, _status_code, _headers = list_insights_by_account_with_http_info(account_guid, user_guid, opts)
|
182
|
+
data
|
183
|
+
end
|
184
|
+
|
185
|
+
# List insights by account
|
186
|
+
# Use this endpoint to list all insights associated with a specified account GUID.
|
187
|
+
# @param account_guid [String] The unique id for the `account`.
|
188
|
+
# @param user_guid [String] The unique id for the `user`.
|
189
|
+
# @param [Hash] opts the optional parameters
|
190
|
+
# @option opts [Integer] :page Specify current page.
|
191
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
192
|
+
# @return [Array<(InsightsResponseBody, Integer, Hash)>] InsightsResponseBody data, response status code and response headers
|
193
|
+
def list_insights_by_account_with_http_info(account_guid, user_guid, opts = {})
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_insights_by_account ...'
|
196
|
+
end
|
197
|
+
# verify the required parameter 'account_guid' is set
|
198
|
+
if @api_client.config.client_side_validation && account_guid.nil?
|
199
|
+
fail ArgumentError, "Missing the required parameter 'account_guid' when calling InsightsApi.list_insights_by_account"
|
200
|
+
end
|
201
|
+
# verify the required parameter 'user_guid' is set
|
202
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
203
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_insights_by_account"
|
204
|
+
end
|
205
|
+
# resource path
|
206
|
+
local_var_path = '/users/{user_guid}/accounts/{account_guid}/insights'.sub('{' + 'account_guid' + '}', CGI.escape(account_guid.to_s)).sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
207
|
+
|
208
|
+
# query parameters
|
209
|
+
query_params = opts[:query_params] || {}
|
210
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
211
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
212
|
+
|
213
|
+
# header parameters
|
214
|
+
header_params = opts[:header_params] || {}
|
215
|
+
# HTTP header 'Accept' (if needed)
|
216
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
217
|
+
|
218
|
+
# form parameters
|
219
|
+
form_params = opts[:form_params] || {}
|
220
|
+
|
221
|
+
# http body (model)
|
222
|
+
post_body = opts[:debug_body]
|
223
|
+
|
224
|
+
# return_type
|
225
|
+
return_type = opts[:debug_return_type] || 'InsightsResponseBody'
|
226
|
+
|
227
|
+
# auth_names
|
228
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
229
|
+
|
230
|
+
new_options = opts.merge(
|
231
|
+
:operation => :"InsightsApi.list_insights_by_account",
|
232
|
+
:header_params => header_params,
|
233
|
+
:query_params => query_params,
|
234
|
+
:form_params => form_params,
|
235
|
+
:body => post_body,
|
236
|
+
:auth_names => auth_names,
|
237
|
+
:return_type => return_type
|
238
|
+
)
|
239
|
+
|
240
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
241
|
+
if @api_client.config.debugging
|
242
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_insights_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
243
|
+
end
|
244
|
+
return data, status_code, headers
|
245
|
+
end
|
246
|
+
|
247
|
+
# List all insights for a user.
|
248
|
+
# Use this endpoint to list all the insights associated with the user.
|
249
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @option opts [Integer] :page Specify current page.
|
252
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
253
|
+
# @return [InsightsResponseBody]
|
254
|
+
def list_insights_user(user_guid, opts = {})
|
255
|
+
data, _status_code, _headers = list_insights_user_with_http_info(user_guid, opts)
|
256
|
+
data
|
257
|
+
end
|
258
|
+
|
259
|
+
# List all insights for a user.
|
260
|
+
# Use this endpoint to list all the insights associated with the user.
|
261
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
262
|
+
# @param [Hash] opts the optional parameters
|
263
|
+
# @option opts [Integer] :page Specify current page.
|
264
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
265
|
+
# @return [Array<(InsightsResponseBody, Integer, Hash)>] InsightsResponseBody data, response status code and response headers
|
266
|
+
def list_insights_user_with_http_info(user_guid, opts = {})
|
267
|
+
if @api_client.config.debugging
|
268
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_insights_user ...'
|
269
|
+
end
|
270
|
+
# verify the required parameter 'user_guid' is set
|
271
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
272
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_insights_user"
|
273
|
+
end
|
274
|
+
# resource path
|
275
|
+
local_var_path = '/users/{user_guid}/insights'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
276
|
+
|
277
|
+
# query parameters
|
278
|
+
query_params = opts[:query_params] || {}
|
279
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
280
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
281
|
+
|
282
|
+
# header parameters
|
283
|
+
header_params = opts[:header_params] || {}
|
284
|
+
# HTTP header 'Accept' (if needed)
|
285
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
286
|
+
|
287
|
+
# form parameters
|
288
|
+
form_params = opts[:form_params] || {}
|
289
|
+
|
290
|
+
# http body (model)
|
291
|
+
post_body = opts[:debug_body]
|
292
|
+
|
293
|
+
# return_type
|
294
|
+
return_type = opts[:debug_return_type] || 'InsightsResponseBody'
|
295
|
+
|
296
|
+
# auth_names
|
297
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
298
|
+
|
299
|
+
new_options = opts.merge(
|
300
|
+
:operation => :"InsightsApi.list_insights_user",
|
301
|
+
:header_params => header_params,
|
302
|
+
:query_params => query_params,
|
303
|
+
:form_params => form_params,
|
304
|
+
:body => post_body,
|
305
|
+
:auth_names => auth_names,
|
306
|
+
:return_type => return_type
|
307
|
+
)
|
308
|
+
|
309
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
310
|
+
if @api_client.config.debugging
|
311
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_insights_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
312
|
+
end
|
313
|
+
return data, status_code, headers
|
314
|
+
end
|
315
|
+
|
316
|
+
# List all merchants associated with an insight.
|
317
|
+
# Use this endpoint to list all the merchants associated with the insight.
|
318
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
319
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
320
|
+
# @param [Hash] opts the optional parameters
|
321
|
+
# @option opts [Integer] :page Specify current page.
|
322
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
323
|
+
# @return [MerchantsResponseBody]
|
324
|
+
def list_merchants_insight(user_guid, insight_guid, opts = {})
|
325
|
+
data, _status_code, _headers = list_merchants_insight_with_http_info(user_guid, insight_guid, opts)
|
326
|
+
data
|
327
|
+
end
|
328
|
+
|
329
|
+
# List all merchants associated with an insight.
|
330
|
+
# Use this endpoint to list all the merchants associated with the insight.
|
331
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
332
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
333
|
+
# @param [Hash] opts the optional parameters
|
334
|
+
# @option opts [Integer] :page Specify current page.
|
335
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
336
|
+
# @return [Array<(MerchantsResponseBody, Integer, Hash)>] MerchantsResponseBody data, response status code and response headers
|
337
|
+
def list_merchants_insight_with_http_info(user_guid, insight_guid, opts = {})
|
338
|
+
if @api_client.config.debugging
|
339
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_merchants_insight ...'
|
340
|
+
end
|
341
|
+
# verify the required parameter 'user_guid' is set
|
342
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
343
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_merchants_insight"
|
344
|
+
end
|
345
|
+
# verify the required parameter 'insight_guid' is set
|
346
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
347
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_merchants_insight"
|
348
|
+
end
|
349
|
+
# resource path
|
350
|
+
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))
|
351
|
+
|
352
|
+
# query parameters
|
353
|
+
query_params = opts[:query_params] || {}
|
354
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
355
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
356
|
+
|
357
|
+
# header parameters
|
358
|
+
header_params = opts[:header_params] || {}
|
359
|
+
# HTTP header 'Accept' (if needed)
|
360
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
361
|
+
|
362
|
+
# form parameters
|
363
|
+
form_params = opts[:form_params] || {}
|
364
|
+
|
365
|
+
# http body (model)
|
366
|
+
post_body = opts[:debug_body]
|
367
|
+
|
368
|
+
# return_type
|
369
|
+
return_type = opts[:debug_return_type] || 'MerchantsResponseBody'
|
370
|
+
|
371
|
+
# auth_names
|
372
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
373
|
+
|
374
|
+
new_options = opts.merge(
|
375
|
+
:operation => :"InsightsApi.list_merchants_insight",
|
376
|
+
:header_params => header_params,
|
377
|
+
:query_params => query_params,
|
378
|
+
:form_params => form_params,
|
379
|
+
:body => post_body,
|
380
|
+
:auth_names => auth_names,
|
381
|
+
:return_type => return_type
|
382
|
+
)
|
383
|
+
|
384
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
385
|
+
if @api_client.config.debugging
|
386
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_merchants_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
387
|
+
end
|
388
|
+
return data, status_code, headers
|
389
|
+
end
|
390
|
+
|
391
|
+
# List all scheduled payments associated with an insight
|
392
|
+
# Use this endpoint to list all the scheduled payments associated with the insight.
|
393
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
394
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
395
|
+
# @param [Hash] opts the optional parameters
|
396
|
+
# @option opts [Integer] :page Specify current page.
|
397
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
398
|
+
# @return [ScheduledPaymentsResponseBody]
|
399
|
+
def list_scheduled_payments_insight(user_guid, insight_guid, opts = {})
|
400
|
+
data, _status_code, _headers = list_scheduled_payments_insight_with_http_info(user_guid, insight_guid, opts)
|
401
|
+
data
|
402
|
+
end
|
403
|
+
|
404
|
+
# List all scheduled payments associated with an insight
|
405
|
+
# Use this endpoint to list all the scheduled payments associated with the insight.
|
406
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
407
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
408
|
+
# @param [Hash] opts the optional parameters
|
409
|
+
# @option opts [Integer] :page Specify current page.
|
410
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
411
|
+
# @return [Array<(ScheduledPaymentsResponseBody, Integer, Hash)>] ScheduledPaymentsResponseBody data, response status code and response headers
|
412
|
+
def list_scheduled_payments_insight_with_http_info(user_guid, insight_guid, opts = {})
|
413
|
+
if @api_client.config.debugging
|
414
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_scheduled_payments_insight ...'
|
415
|
+
end
|
416
|
+
# verify the required parameter 'user_guid' is set
|
417
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
418
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_scheduled_payments_insight"
|
419
|
+
end
|
420
|
+
# verify the required parameter 'insight_guid' is set
|
421
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
422
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_scheduled_payments_insight"
|
423
|
+
end
|
424
|
+
# resource path
|
425
|
+
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))
|
426
|
+
|
427
|
+
# query parameters
|
428
|
+
query_params = opts[:query_params] || {}
|
429
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
430
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
431
|
+
|
432
|
+
# header parameters
|
433
|
+
header_params = opts[:header_params] || {}
|
434
|
+
# HTTP header 'Accept' (if needed)
|
435
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
436
|
+
|
437
|
+
# form parameters
|
438
|
+
form_params = opts[:form_params] || {}
|
439
|
+
|
440
|
+
# http body (model)
|
441
|
+
post_body = opts[:debug_body]
|
442
|
+
|
443
|
+
# return_type
|
444
|
+
return_type = opts[:debug_return_type] || 'ScheduledPaymentsResponseBody'
|
445
|
+
|
446
|
+
# auth_names
|
447
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
448
|
+
|
449
|
+
new_options = opts.merge(
|
450
|
+
:operation => :"InsightsApi.list_scheduled_payments_insight",
|
451
|
+
:header_params => header_params,
|
452
|
+
:query_params => query_params,
|
453
|
+
:form_params => form_params,
|
454
|
+
:body => post_body,
|
455
|
+
:auth_names => auth_names,
|
456
|
+
:return_type => return_type
|
457
|
+
)
|
458
|
+
|
459
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
460
|
+
if @api_client.config.debugging
|
461
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_scheduled_payments_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
462
|
+
end
|
463
|
+
return data, status_code, headers
|
464
|
+
end
|
465
|
+
|
466
|
+
# List all transactions associated with an insight.
|
467
|
+
# Use this endpoint to list all the transactions associated with the insight.
|
468
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
469
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
470
|
+
# @param [Hash] opts the optional parameters
|
471
|
+
# @option opts [Integer] :page Specify current page.
|
472
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
473
|
+
# @return [TransactionsResponseBody]
|
474
|
+
def list_transactions_insight(user_guid, insight_guid, opts = {})
|
475
|
+
data, _status_code, _headers = list_transactions_insight_with_http_info(user_guid, insight_guid, opts)
|
476
|
+
data
|
477
|
+
end
|
478
|
+
|
479
|
+
# List all transactions associated with an insight.
|
480
|
+
# Use this endpoint to list all the transactions associated with the insight.
|
481
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
482
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
483
|
+
# @param [Hash] opts the optional parameters
|
484
|
+
# @option opts [Integer] :page Specify current page.
|
485
|
+
# @option opts [Integer] :records_per_page Specify records per page.
|
486
|
+
# @return [Array<(TransactionsResponseBody, Integer, Hash)>] TransactionsResponseBody data, response status code and response headers
|
487
|
+
def list_transactions_insight_with_http_info(user_guid, insight_guid, opts = {})
|
488
|
+
if @api_client.config.debugging
|
489
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.list_transactions_insight ...'
|
490
|
+
end
|
491
|
+
# verify the required parameter 'user_guid' is set
|
492
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
493
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.list_transactions_insight"
|
494
|
+
end
|
495
|
+
# verify the required parameter 'insight_guid' is set
|
496
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
497
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.list_transactions_insight"
|
498
|
+
end
|
499
|
+
# resource path
|
500
|
+
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))
|
501
|
+
|
502
|
+
# query parameters
|
503
|
+
query_params = opts[:query_params] || {}
|
504
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
505
|
+
query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
|
506
|
+
|
507
|
+
# header parameters
|
508
|
+
header_params = opts[:header_params] || {}
|
509
|
+
# HTTP header 'Accept' (if needed)
|
510
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
511
|
+
|
512
|
+
# form parameters
|
513
|
+
form_params = opts[:form_params] || {}
|
514
|
+
|
515
|
+
# http body (model)
|
516
|
+
post_body = opts[:debug_body]
|
517
|
+
|
518
|
+
# return_type
|
519
|
+
return_type = opts[:debug_return_type] || 'TransactionsResponseBody'
|
520
|
+
|
521
|
+
# auth_names
|
522
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
523
|
+
|
524
|
+
new_options = opts.merge(
|
525
|
+
:operation => :"InsightsApi.list_transactions_insight",
|
526
|
+
:header_params => header_params,
|
527
|
+
:query_params => query_params,
|
528
|
+
:form_params => form_params,
|
529
|
+
:body => post_body,
|
530
|
+
:auth_names => auth_names,
|
531
|
+
:return_type => return_type
|
532
|
+
)
|
533
|
+
|
534
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
535
|
+
if @api_client.config.debugging
|
536
|
+
@api_client.config.logger.debug "API called: InsightsApi#list_transactions_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
537
|
+
end
|
538
|
+
return data, status_code, headers
|
539
|
+
end
|
540
|
+
|
541
|
+
# Read a specific insight.
|
542
|
+
# Use this endpoint to read the attributes of a specific insight according to its unique GUID.
|
543
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
544
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
545
|
+
# @param [Hash] opts the optional parameters
|
546
|
+
# @return [InsightResponseBody]
|
547
|
+
def read_insights_user(user_guid, insight_guid, opts = {})
|
548
|
+
data, _status_code, _headers = read_insights_user_with_http_info(user_guid, insight_guid, opts)
|
549
|
+
data
|
550
|
+
end
|
551
|
+
|
552
|
+
# Read a specific insight.
|
553
|
+
# Use this endpoint to read the attributes of a specific insight according to its unique GUID.
|
554
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
555
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
556
|
+
# @param [Hash] opts the optional parameters
|
557
|
+
# @return [Array<(InsightResponseBody, Integer, Hash)>] InsightResponseBody data, response status code and response headers
|
558
|
+
def read_insights_user_with_http_info(user_guid, insight_guid, opts = {})
|
559
|
+
if @api_client.config.debugging
|
560
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.read_insights_user ...'
|
561
|
+
end
|
562
|
+
# verify the required parameter 'user_guid' is set
|
563
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
564
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.read_insights_user"
|
565
|
+
end
|
566
|
+
# verify the required parameter 'insight_guid' is set
|
567
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
568
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.read_insights_user"
|
569
|
+
end
|
570
|
+
# resource path
|
571
|
+
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))
|
572
|
+
|
573
|
+
# query parameters
|
574
|
+
query_params = opts[:query_params] || {}
|
575
|
+
|
576
|
+
# header parameters
|
577
|
+
header_params = opts[:header_params] || {}
|
578
|
+
# HTTP header 'Accept' (if needed)
|
579
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
580
|
+
|
581
|
+
# form parameters
|
582
|
+
form_params = opts[:form_params] || {}
|
583
|
+
|
584
|
+
# http body (model)
|
585
|
+
post_body = opts[:debug_body]
|
586
|
+
|
587
|
+
# return_type
|
588
|
+
return_type = opts[:debug_return_type] || 'InsightResponseBody'
|
589
|
+
|
590
|
+
# auth_names
|
591
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
592
|
+
|
593
|
+
new_options = opts.merge(
|
594
|
+
:operation => :"InsightsApi.read_insights_user",
|
595
|
+
:header_params => header_params,
|
596
|
+
:query_params => query_params,
|
597
|
+
:form_params => form_params,
|
598
|
+
:body => post_body,
|
599
|
+
:auth_names => auth_names,
|
600
|
+
:return_type => return_type
|
601
|
+
)
|
602
|
+
|
603
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
604
|
+
if @api_client.config.debugging
|
605
|
+
@api_client.config.logger.debug "API called: InsightsApi#read_insights_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
606
|
+
end
|
607
|
+
return data, status_code, headers
|
608
|
+
end
|
609
|
+
|
610
|
+
# Update insight
|
611
|
+
# Use this endpoint to update the attributes of a particular insight according to its unique GUID.
|
612
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
613
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
614
|
+
# @param insight_update_request [InsightUpdateRequest] The insight to be updated (None of these parameters are required, but the user object cannot be empty.)
|
615
|
+
# @param [Hash] opts the optional parameters
|
616
|
+
# @return [InsightResponse]
|
617
|
+
def update_insight(user_guid, insight_guid, insight_update_request, opts = {})
|
618
|
+
data, _status_code, _headers = update_insight_with_http_info(user_guid, insight_guid, insight_update_request, opts)
|
619
|
+
data
|
620
|
+
end
|
621
|
+
|
622
|
+
# Update insight
|
623
|
+
# Use this endpoint to update the attributes of a particular insight according to its unique GUID.
|
624
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
625
|
+
# @param insight_guid [String] The unique identifier for the insight. Defined by MX.
|
626
|
+
# @param insight_update_request [InsightUpdateRequest] The insight to be updated (None of these parameters are required, but the user object cannot be empty.)
|
627
|
+
# @param [Hash] opts the optional parameters
|
628
|
+
# @return [Array<(InsightResponse, Integer, Hash)>] InsightResponse data, response status code and response headers
|
629
|
+
def update_insight_with_http_info(user_guid, insight_guid, insight_update_request, opts = {})
|
630
|
+
if @api_client.config.debugging
|
631
|
+
@api_client.config.logger.debug 'Calling API: InsightsApi.update_insight ...'
|
632
|
+
end
|
633
|
+
# verify the required parameter 'user_guid' is set
|
634
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
635
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling InsightsApi.update_insight"
|
636
|
+
end
|
637
|
+
# verify the required parameter 'insight_guid' is set
|
638
|
+
if @api_client.config.client_side_validation && insight_guid.nil?
|
639
|
+
fail ArgumentError, "Missing the required parameter 'insight_guid' when calling InsightsApi.update_insight"
|
640
|
+
end
|
641
|
+
# verify the required parameter 'insight_update_request' is set
|
642
|
+
if @api_client.config.client_side_validation && insight_update_request.nil?
|
643
|
+
fail ArgumentError, "Missing the required parameter 'insight_update_request' when calling InsightsApi.update_insight"
|
644
|
+
end
|
645
|
+
# resource path
|
646
|
+
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))
|
647
|
+
|
648
|
+
# query parameters
|
649
|
+
query_params = opts[:query_params] || {}
|
650
|
+
|
651
|
+
# header parameters
|
652
|
+
header_params = opts[:header_params] || {}
|
653
|
+
# HTTP header 'Accept' (if needed)
|
654
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
|
655
|
+
# HTTP header 'Content-Type'
|
656
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
657
|
+
if !content_type.nil?
|
658
|
+
header_params['Content-Type'] = content_type
|
659
|
+
end
|
660
|
+
|
661
|
+
# form parameters
|
662
|
+
form_params = opts[:form_params] || {}
|
663
|
+
|
664
|
+
# http body (model)
|
665
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(insight_update_request)
|
666
|
+
|
667
|
+
# return_type
|
668
|
+
return_type = opts[:debug_return_type] || 'InsightResponse'
|
669
|
+
|
670
|
+
# auth_names
|
671
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
672
|
+
|
673
|
+
new_options = opts.merge(
|
674
|
+
:operation => :"InsightsApi.update_insight",
|
675
|
+
:header_params => header_params,
|
676
|
+
:query_params => query_params,
|
677
|
+
:form_params => form_params,
|
678
|
+
:body => post_body,
|
679
|
+
:auth_names => auth_names,
|
680
|
+
:return_type => return_type
|
681
|
+
)
|
682
|
+
|
683
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
684
|
+
if @api_client.config.debugging
|
685
|
+
@api_client.config.logger.debug "API called: InsightsApi#update_insight\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
686
|
+
end
|
687
|
+
return data, status_code, headers
|
688
|
+
end
|
689
|
+
end
|
690
|
+
end
|