mx-platform-ruby 0.22.1 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1076 @@
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 SpendingPlanApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create spending plan
23
+ # This endpoint creates a new `spending_plan` for the user.
24
+ # @param user_guid [String] The unique id for a `user`.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [SpendingPlanResponse]
27
+ def create_spending_plan(user_guid, opts = {})
28
+ data, _status_code, _headers = create_spending_plan_with_http_info(user_guid, opts)
29
+ data
30
+ end
31
+
32
+ # Create spending plan
33
+ # This endpoint creates a new `spending_plan` for the user.
34
+ # @param user_guid [String] The unique id for a `user`.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(SpendingPlanResponse, Integer, Hash)>] SpendingPlanResponse data, response status code and response headers
37
+ def create_spending_plan_with_http_info(user_guid, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.create_spending_plan ...'
40
+ end
41
+ # verify the required parameter 'user_guid' is set
42
+ if @api_client.config.client_side_validation && user_guid.nil?
43
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.create_spending_plan"
44
+ end
45
+ # resource path
46
+ local_var_path = '/users/{user_guid}/spending_plans'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'SpendingPlanResponse'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"SpendingPlanApi.create_spending_plan",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: SpendingPlanApi#create_spending_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Create spending plan iteration item
86
+ # This endpoint creates a new `spending_plan_iteration_item`.
87
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
88
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
89
+ # @param spending_plan_iteration_item_create_request_body [SpendingPlanIterationItemCreateRequestBody] Iteration item to be created with required parameters (planned_amount)
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [SpendingPlanIterationItemResponse]
92
+ def create_spending_plan_iteration_item(spending_plan_guid, user_guid, spending_plan_iteration_item_create_request_body, opts = {})
93
+ data, _status_code, _headers = create_spending_plan_iteration_item_with_http_info(spending_plan_guid, user_guid, spending_plan_iteration_item_create_request_body, opts)
94
+ data
95
+ end
96
+
97
+ # Create spending plan iteration item
98
+ # This endpoint creates a new &#x60;spending_plan_iteration_item&#x60;.
99
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
100
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
101
+ # @param spending_plan_iteration_item_create_request_body [SpendingPlanIterationItemCreateRequestBody] Iteration item to be created with required parameters (planned_amount)
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [Array<(SpendingPlanIterationItemResponse, Integer, Hash)>] SpendingPlanIterationItemResponse data, response status code and response headers
104
+ def create_spending_plan_iteration_item_with_http_info(spending_plan_guid, user_guid, spending_plan_iteration_item_create_request_body, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.create_spending_plan_iteration_item ...'
107
+ end
108
+ # verify the required parameter 'spending_plan_guid' is set
109
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
110
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.create_spending_plan_iteration_item"
111
+ end
112
+ # verify the required parameter 'user_guid' is set
113
+ if @api_client.config.client_side_validation && user_guid.nil?
114
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.create_spending_plan_iteration_item"
115
+ end
116
+ # verify the required parameter 'spending_plan_iteration_item_create_request_body' is set
117
+ if @api_client.config.client_side_validation && spending_plan_iteration_item_create_request_body.nil?
118
+ fail ArgumentError, "Missing the required parameter 'spending_plan_iteration_item_create_request_body' when calling SpendingPlanApi.create_spending_plan_iteration_item"
119
+ end
120
+ # resource path
121
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items'.sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+
126
+ # header parameters
127
+ header_params = opts[:header_params] || {}
128
+ # HTTP header 'Accept' (if needed)
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
130
+ # HTTP header 'Content-Type'
131
+ content_type = @api_client.select_header_content_type(['application/json'])
132
+ if !content_type.nil?
133
+ header_params['Content-Type'] = content_type
134
+ end
135
+
136
+ # form parameters
137
+ form_params = opts[:form_params] || {}
138
+
139
+ # http body (model)
140
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(spending_plan_iteration_item_create_request_body)
141
+
142
+ # return_type
143
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationItemResponse'
144
+
145
+ # auth_names
146
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
147
+
148
+ new_options = opts.merge(
149
+ :operation => :"SpendingPlanApi.create_spending_plan_iteration_item",
150
+ :header_params => header_params,
151
+ :query_params => query_params,
152
+ :form_params => form_params,
153
+ :body => post_body,
154
+ :auth_names => auth_names,
155
+ :return_type => return_type
156
+ )
157
+
158
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug "API called: SpendingPlanApi#create_spending_plan_iteration_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
+ end
162
+ return data, status_code, headers
163
+ end
164
+
165
+ # Delete spending plan
166
+ # Use this endpoint to delete a user's `spending_plan`.
167
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
168
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
169
+ # @param [Hash] opts the optional parameters
170
+ # @return [nil]
171
+ def delete_spending_plan(user_guid, spending_plan_guid, opts = {})
172
+ delete_spending_plan_with_http_info(user_guid, spending_plan_guid, opts)
173
+ nil
174
+ end
175
+
176
+ # Delete spending plan
177
+ # Use this endpoint to delete a user&#39;s &#x60;spending_plan&#x60;.
178
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
179
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
180
+ # @param [Hash] opts the optional parameters
181
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
182
+ def delete_spending_plan_with_http_info(user_guid, spending_plan_guid, opts = {})
183
+ if @api_client.config.debugging
184
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.delete_spending_plan ...'
185
+ end
186
+ # verify the required parameter 'user_guid' is set
187
+ if @api_client.config.client_side_validation && user_guid.nil?
188
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.delete_spending_plan"
189
+ end
190
+ # verify the required parameter 'spending_plan_guid' is set
191
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
192
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.delete_spending_plan"
193
+ end
194
+ # resource path
195
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s))
196
+
197
+ # query parameters
198
+ query_params = opts[:query_params] || {}
199
+
200
+ # header parameters
201
+ header_params = opts[:header_params] || {}
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body]
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type]
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"SpendingPlanApi.delete_spending_plan",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: SpendingPlanApi#delete_spending_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # Delete spending plan account
233
+ # Use this endpoint to delete a `spending_plan_account`.
234
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
235
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
236
+ # @param spending_plan_account_guid [String] The unique ID for the specified account.
237
+ # @param [Hash] opts the optional parameters
238
+ # @return [nil]
239
+ def delete_spending_plan_account(user_guid, spending_plan_guid, spending_plan_account_guid, opts = {})
240
+ delete_spending_plan_account_with_http_info(user_guid, spending_plan_guid, spending_plan_account_guid, opts)
241
+ nil
242
+ end
243
+
244
+ # Delete spending plan account
245
+ # Use this endpoint to delete a &#x60;spending_plan_account&#x60;.
246
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
247
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
248
+ # @param spending_plan_account_guid [String] The unique ID for the specified account.
249
+ # @param [Hash] opts the optional parameters
250
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
251
+ def delete_spending_plan_account_with_http_info(user_guid, spending_plan_guid, spending_plan_account_guid, opts = {})
252
+ if @api_client.config.debugging
253
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.delete_spending_plan_account ...'
254
+ end
255
+ # verify the required parameter 'user_guid' is set
256
+ if @api_client.config.client_side_validation && user_guid.nil?
257
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.delete_spending_plan_account"
258
+ end
259
+ # verify the required parameter 'spending_plan_guid' is set
260
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
261
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.delete_spending_plan_account"
262
+ end
263
+ # verify the required parameter 'spending_plan_account_guid' is set
264
+ if @api_client.config.client_side_validation && spending_plan_account_guid.nil?
265
+ fail ArgumentError, "Missing the required parameter 'spending_plan_account_guid' when calling SpendingPlanApi.delete_spending_plan_account"
266
+ end
267
+ # resource path
268
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/spending_plan_accounts/{spending_plan_account_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'spending_plan_account_guid' + '}', CGI.escape(spending_plan_account_guid.to_s))
269
+
270
+ # query parameters
271
+ query_params = opts[:query_params] || {}
272
+
273
+ # header parameters
274
+ header_params = opts[:header_params] || {}
275
+
276
+ # form parameters
277
+ form_params = opts[:form_params] || {}
278
+
279
+ # http body (model)
280
+ post_body = opts[:debug_body]
281
+
282
+ # return_type
283
+ return_type = opts[:debug_return_type]
284
+
285
+ # auth_names
286
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
287
+
288
+ new_options = opts.merge(
289
+ :operation => :"SpendingPlanApi.delete_spending_plan_account",
290
+ :header_params => header_params,
291
+ :query_params => query_params,
292
+ :form_params => form_params,
293
+ :body => post_body,
294
+ :auth_names => auth_names,
295
+ :return_type => return_type
296
+ )
297
+
298
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug "API called: SpendingPlanApi#delete_spending_plan_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
301
+ end
302
+ return data, status_code, headers
303
+ end
304
+
305
+ # Delete spending plan iteration item
306
+ # Use this endpoint to delete a spending plan `iteration_item`.
307
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
308
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
309
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
310
+ # @param [Hash] opts the optional parameters
311
+ # @return [nil]
312
+ def delete_spending_plan_iteration_item(user_guid, spending_plan_guid, iteration_item_guid, opts = {})
313
+ delete_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, opts)
314
+ nil
315
+ end
316
+
317
+ # Delete spending plan iteration item
318
+ # Use this endpoint to delete a spending plan &#x60;iteration_item&#x60;.
319
+ # @param user_guid [String] The unique ID for a &#x60;user&#x60;.
320
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
321
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
322
+ # @param [Hash] opts the optional parameters
323
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
324
+ def delete_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, opts = {})
325
+ if @api_client.config.debugging
326
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.delete_spending_plan_iteration_item ...'
327
+ end
328
+ # verify the required parameter 'user_guid' is set
329
+ if @api_client.config.client_side_validation && user_guid.nil?
330
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.delete_spending_plan_iteration_item"
331
+ end
332
+ # verify the required parameter 'spending_plan_guid' is set
333
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
334
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.delete_spending_plan_iteration_item"
335
+ end
336
+ # verify the required parameter 'iteration_item_guid' is set
337
+ if @api_client.config.client_side_validation && iteration_item_guid.nil?
338
+ fail ArgumentError, "Missing the required parameter 'iteration_item_guid' when calling SpendingPlanApi.delete_spending_plan_iteration_item"
339
+ end
340
+ # resource path
341
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items/{iteration_item_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'iteration_item_guid' + '}', CGI.escape(iteration_item_guid.to_s))
342
+
343
+ # query parameters
344
+ query_params = opts[:query_params] || {}
345
+
346
+ # header parameters
347
+ header_params = opts[:header_params] || {}
348
+
349
+ # form parameters
350
+ form_params = opts[:form_params] || {}
351
+
352
+ # http body (model)
353
+ post_body = opts[:debug_body]
354
+
355
+ # return_type
356
+ return_type = opts[:debug_return_type]
357
+
358
+ # auth_names
359
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
360
+
361
+ new_options = opts.merge(
362
+ :operation => :"SpendingPlanApi.delete_spending_plan_iteration_item",
363
+ :header_params => header_params,
364
+ :query_params => query_params,
365
+ :form_params => form_params,
366
+ :body => post_body,
367
+ :auth_names => auth_names,
368
+ :return_type => return_type
369
+ )
370
+
371
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
372
+ if @api_client.config.debugging
373
+ @api_client.config.logger.debug "API called: SpendingPlanApi#delete_spending_plan_iteration_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
374
+ end
375
+ return data, status_code, headers
376
+ end
377
+
378
+ # List spending plan accounts
379
+ # Use this endpoint to list all the spending plan accounts associated with the spending plan.
380
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
381
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
382
+ # @param [Hash] opts the optional parameters
383
+ # @option opts [Integer] :page Specify current page.
384
+ # @option opts [Integer] :records_per_page Specify records per page.
385
+ # @return [SpendingPlanAccountsResponse]
386
+ def list_spending_plan_accounts(user_guid, spending_plan_guid, opts = {})
387
+ data, _status_code, _headers = list_spending_plan_accounts_with_http_info(user_guid, spending_plan_guid, opts)
388
+ data
389
+ end
390
+
391
+ # List spending plan accounts
392
+ # Use this endpoint to list all the spending plan accounts associated with the spending plan.
393
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
394
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
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 [Array<(SpendingPlanAccountsResponse, Integer, Hash)>] SpendingPlanAccountsResponse data, response status code and response headers
399
+ def list_spending_plan_accounts_with_http_info(user_guid, spending_plan_guid, opts = {})
400
+ if @api_client.config.debugging
401
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.list_spending_plan_accounts ...'
402
+ end
403
+ # verify the required parameter 'user_guid' is set
404
+ if @api_client.config.client_side_validation && user_guid.nil?
405
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.list_spending_plan_accounts"
406
+ end
407
+ # verify the required parameter 'spending_plan_guid' is set
408
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
409
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.list_spending_plan_accounts"
410
+ end
411
+ # resource path
412
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/spending_plan_accounts'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s))
413
+
414
+ # query parameters
415
+ query_params = opts[:query_params] || {}
416
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
417
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
418
+
419
+ # header parameters
420
+ header_params = opts[:header_params] || {}
421
+ # HTTP header 'Accept' (if needed)
422
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
423
+
424
+ # form parameters
425
+ form_params = opts[:form_params] || {}
426
+
427
+ # http body (model)
428
+ post_body = opts[:debug_body]
429
+
430
+ # return_type
431
+ return_type = opts[:debug_return_type] || 'SpendingPlanAccountsResponse'
432
+
433
+ # auth_names
434
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
435
+
436
+ new_options = opts.merge(
437
+ :operation => :"SpendingPlanApi.list_spending_plan_accounts",
438
+ :header_params => header_params,
439
+ :query_params => query_params,
440
+ :form_params => form_params,
441
+ :body => post_body,
442
+ :auth_names => auth_names,
443
+ :return_type => return_type
444
+ )
445
+
446
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
447
+ if @api_client.config.debugging
448
+ @api_client.config.logger.debug "API called: SpendingPlanApi#list_spending_plan_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
449
+ end
450
+ return data, status_code, headers
451
+ end
452
+
453
+ # List spending plan iteration items
454
+ # Use this endpoint to list all the spending plan `iteration_items` associated with the `iteration`.
455
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
456
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
457
+ # @param [Hash] opts the optional parameters
458
+ # @option opts [Integer] :page Specify current page.
459
+ # @option opts [Integer] :records_per_page Specify records per page.
460
+ # @return [SpendingPlanIterationItemsResponseBody]
461
+ def list_spending_plan_iteration_items(user_guid, spending_plan_guid, opts = {})
462
+ data, _status_code, _headers = list_spending_plan_iteration_items_with_http_info(user_guid, spending_plan_guid, opts)
463
+ data
464
+ end
465
+
466
+ # List spending plan iteration items
467
+ # Use this endpoint to list all the spending plan &#x60;iteration_items&#x60; associated with the &#x60;iteration&#x60;.
468
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
469
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
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 [Array<(SpendingPlanIterationItemsResponseBody, Integer, Hash)>] SpendingPlanIterationItemsResponseBody data, response status code and response headers
474
+ def list_spending_plan_iteration_items_with_http_info(user_guid, spending_plan_guid, opts = {})
475
+ if @api_client.config.debugging
476
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.list_spending_plan_iteration_items ...'
477
+ end
478
+ # verify the required parameter 'user_guid' is set
479
+ if @api_client.config.client_side_validation && user_guid.nil?
480
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.list_spending_plan_iteration_items"
481
+ end
482
+ # verify the required parameter 'spending_plan_guid' is set
483
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
484
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.list_spending_plan_iteration_items"
485
+ end
486
+ # resource path
487
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s))
488
+
489
+ # query parameters
490
+ query_params = opts[:query_params] || {}
491
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
492
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
493
+
494
+ # header parameters
495
+ header_params = opts[:header_params] || {}
496
+ # HTTP header 'Accept' (if needed)
497
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
498
+
499
+ # form parameters
500
+ form_params = opts[:form_params] || {}
501
+
502
+ # http body (model)
503
+ post_body = opts[:debug_body]
504
+
505
+ # return_type
506
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationItemsResponseBody'
507
+
508
+ # auth_names
509
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
510
+
511
+ new_options = opts.merge(
512
+ :operation => :"SpendingPlanApi.list_spending_plan_iteration_items",
513
+ :header_params => header_params,
514
+ :query_params => query_params,
515
+ :form_params => form_params,
516
+ :body => post_body,
517
+ :auth_names => auth_names,
518
+ :return_type => return_type
519
+ )
520
+
521
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
522
+ if @api_client.config.debugging
523
+ @api_client.config.logger.debug "API called: SpendingPlanApi#list_spending_plan_iteration_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
524
+ end
525
+ return data, status_code, headers
526
+ end
527
+
528
+ # List spending plan iterations
529
+ # Use this endpoint to list all the spending plan `iterations` associated with the `spending_plan`.
530
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
531
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
532
+ # @param [Hash] opts the optional parameters
533
+ # @option opts [Integer] :page Specify current page.
534
+ # @option opts [Integer] :records_per_page Specify records per page.
535
+ # @return [SpendingPlanIterationsResponse]
536
+ def list_spending_plan_iterations(user_guid, spending_plan_guid, opts = {})
537
+ data, _status_code, _headers = list_spending_plan_iterations_with_http_info(user_guid, spending_plan_guid, opts)
538
+ data
539
+ end
540
+
541
+ # List spending plan iterations
542
+ # Use this endpoint to list all the spending plan &#x60;iterations&#x60; associated with the &#x60;spending_plan&#x60;.
543
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
544
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
545
+ # @param [Hash] opts the optional parameters
546
+ # @option opts [Integer] :page Specify current page.
547
+ # @option opts [Integer] :records_per_page Specify records per page.
548
+ # @return [Array<(SpendingPlanIterationsResponse, Integer, Hash)>] SpendingPlanIterationsResponse data, response status code and response headers
549
+ def list_spending_plan_iterations_with_http_info(user_guid, spending_plan_guid, opts = {})
550
+ if @api_client.config.debugging
551
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.list_spending_plan_iterations ...'
552
+ end
553
+ # verify the required parameter 'user_guid' is set
554
+ if @api_client.config.client_side_validation && user_guid.nil?
555
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.list_spending_plan_iterations"
556
+ end
557
+ # verify the required parameter 'spending_plan_guid' is set
558
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
559
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.list_spending_plan_iterations"
560
+ end
561
+ # resource path
562
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s))
563
+
564
+ # query parameters
565
+ query_params = opts[:query_params] || {}
566
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
567
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
568
+
569
+ # header parameters
570
+ header_params = opts[:header_params] || {}
571
+ # HTTP header 'Accept' (if needed)
572
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
573
+
574
+ # form parameters
575
+ form_params = opts[:form_params] || {}
576
+
577
+ # http body (model)
578
+ post_body = opts[:debug_body]
579
+
580
+ # return_type
581
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationsResponse'
582
+
583
+ # auth_names
584
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
585
+
586
+ new_options = opts.merge(
587
+ :operation => :"SpendingPlanApi.list_spending_plan_iterations",
588
+ :header_params => header_params,
589
+ :query_params => query_params,
590
+ :form_params => form_params,
591
+ :body => post_body,
592
+ :auth_names => auth_names,
593
+ :return_type => return_type
594
+ )
595
+
596
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
597
+ if @api_client.config.debugging
598
+ @api_client.config.logger.debug "API called: SpendingPlanApi#list_spending_plan_iterations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
599
+ end
600
+ return data, status_code, headers
601
+ end
602
+
603
+ # List spending plans
604
+ # Use this endpoint to list all the spending plans associated with the user.
605
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
606
+ # @param [Hash] opts the optional parameters
607
+ # @option opts [Integer] :page Specify current page.
608
+ # @option opts [Integer] :records_per_page Specify records per page.
609
+ # @return [SpendingPlansResponseBody]
610
+ def list_spending_plans(user_guid, opts = {})
611
+ data, _status_code, _headers = list_spending_plans_with_http_info(user_guid, opts)
612
+ data
613
+ end
614
+
615
+ # List spending plans
616
+ # Use this endpoint to list all the spending plans associated with the user.
617
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
618
+ # @param [Hash] opts the optional parameters
619
+ # @option opts [Integer] :page Specify current page.
620
+ # @option opts [Integer] :records_per_page Specify records per page.
621
+ # @return [Array<(SpendingPlansResponseBody, Integer, Hash)>] SpendingPlansResponseBody data, response status code and response headers
622
+ def list_spending_plans_with_http_info(user_guid, opts = {})
623
+ if @api_client.config.debugging
624
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.list_spending_plans ...'
625
+ end
626
+ # verify the required parameter 'user_guid' is set
627
+ if @api_client.config.client_side_validation && user_guid.nil?
628
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.list_spending_plans"
629
+ end
630
+ # resource path
631
+ local_var_path = '/users/{user_guid}/spending_plans'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
632
+
633
+ # query parameters
634
+ query_params = opts[:query_params] || {}
635
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
636
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
637
+
638
+ # header parameters
639
+ header_params = opts[:header_params] || {}
640
+ # HTTP header 'Accept' (if needed)
641
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
642
+
643
+ # form parameters
644
+ form_params = opts[:form_params] || {}
645
+
646
+ # http body (model)
647
+ post_body = opts[:debug_body]
648
+
649
+ # return_type
650
+ return_type = opts[:debug_return_type] || 'SpendingPlansResponseBody'
651
+
652
+ # auth_names
653
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
654
+
655
+ new_options = opts.merge(
656
+ :operation => :"SpendingPlanApi.list_spending_plans",
657
+ :header_params => header_params,
658
+ :query_params => query_params,
659
+ :form_params => form_params,
660
+ :body => post_body,
661
+ :auth_names => auth_names,
662
+ :return_type => return_type
663
+ )
664
+
665
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
666
+ if @api_client.config.debugging
667
+ @api_client.config.logger.debug "API called: SpendingPlanApi#list_spending_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
668
+ end
669
+ return data, status_code, headers
670
+ end
671
+
672
+ # Read spending plan account
673
+ # Use this endpoint to read the attributes of a specific spending plan account according to its unique GUID.
674
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
675
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
676
+ # @param spending_plan_account_guid [String] The unique ID for the specified account.
677
+ # @param [Hash] opts the optional parameters
678
+ # @option opts [Integer] :page Specify current page.
679
+ # @option opts [Integer] :records_per_page Specify records per page.
680
+ # @return [SpendingPlanAccountResponse]
681
+ def read_spending_plan_account(user_guid, spending_plan_guid, spending_plan_account_guid, opts = {})
682
+ data, _status_code, _headers = read_spending_plan_account_with_http_info(user_guid, spending_plan_guid, spending_plan_account_guid, opts)
683
+ data
684
+ end
685
+
686
+ # Read spending plan account
687
+ # Use this endpoint to read the attributes of a specific spending plan account according to its unique GUID.
688
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
689
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
690
+ # @param spending_plan_account_guid [String] The unique ID for the specified account.
691
+ # @param [Hash] opts the optional parameters
692
+ # @option opts [Integer] :page Specify current page.
693
+ # @option opts [Integer] :records_per_page Specify records per page.
694
+ # @return [Array<(SpendingPlanAccountResponse, Integer, Hash)>] SpendingPlanAccountResponse data, response status code and response headers
695
+ def read_spending_plan_account_with_http_info(user_guid, spending_plan_guid, spending_plan_account_guid, opts = {})
696
+ if @api_client.config.debugging
697
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.read_spending_plan_account ...'
698
+ end
699
+ # verify the required parameter 'user_guid' is set
700
+ if @api_client.config.client_side_validation && user_guid.nil?
701
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.read_spending_plan_account"
702
+ end
703
+ # verify the required parameter 'spending_plan_guid' is set
704
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
705
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.read_spending_plan_account"
706
+ end
707
+ # verify the required parameter 'spending_plan_account_guid' is set
708
+ if @api_client.config.client_side_validation && spending_plan_account_guid.nil?
709
+ fail ArgumentError, "Missing the required parameter 'spending_plan_account_guid' when calling SpendingPlanApi.read_spending_plan_account"
710
+ end
711
+ # resource path
712
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/spending_plan_accounts/{spending_plan_account_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'spending_plan_account_guid' + '}', CGI.escape(spending_plan_account_guid.to_s))
713
+
714
+ # query parameters
715
+ query_params = opts[:query_params] || {}
716
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
717
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
718
+
719
+ # header parameters
720
+ header_params = opts[:header_params] || {}
721
+ # HTTP header 'Accept' (if needed)
722
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
723
+
724
+ # form parameters
725
+ form_params = opts[:form_params] || {}
726
+
727
+ # http body (model)
728
+ post_body = opts[:debug_body]
729
+
730
+ # return_type
731
+ return_type = opts[:debug_return_type] || 'SpendingPlanAccountResponse'
732
+
733
+ # auth_names
734
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
735
+
736
+ new_options = opts.merge(
737
+ :operation => :"SpendingPlanApi.read_spending_plan_account",
738
+ :header_params => header_params,
739
+ :query_params => query_params,
740
+ :form_params => form_params,
741
+ :body => post_body,
742
+ :auth_names => auth_names,
743
+ :return_type => return_type
744
+ )
745
+
746
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
747
+ if @api_client.config.debugging
748
+ @api_client.config.logger.debug "API called: SpendingPlanApi#read_spending_plan_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
749
+ end
750
+ return data, status_code, headers
751
+ end
752
+
753
+ # Read a spending plan iteration
754
+ # Use this endpoint to read the attributes of a specific spending plan `iteration` according to its `iteration_number`.
755
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
756
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
757
+ # @param iteration_number [Integer] The current iteration number for the spending plan &#x60;iteration&#x60;&#x60;.
758
+ # @param [Hash] opts the optional parameters
759
+ # @option opts [Integer] :page Specify current page.
760
+ # @option opts [Integer] :records_per_page Specify records per page.
761
+ # @return [SpendingPlanIterationResponse]
762
+ def read_spending_plan_iteration(user_guid, spending_plan_guid, iteration_number, opts = {})
763
+ data, _status_code, _headers = read_spending_plan_iteration_with_http_info(user_guid, spending_plan_guid, iteration_number, opts)
764
+ data
765
+ end
766
+
767
+ # Read a spending plan iteration
768
+ # Use this endpoint to read the attributes of a specific spending plan &#x60;iteration&#x60; according to its &#x60;iteration_number&#x60;.
769
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
770
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
771
+ # @param iteration_number [Integer] The current iteration number for the spending plan &#x60;iteration&#x60;&#x60;.
772
+ # @param [Hash] opts the optional parameters
773
+ # @option opts [Integer] :page Specify current page.
774
+ # @option opts [Integer] :records_per_page Specify records per page.
775
+ # @return [Array<(SpendingPlanIterationResponse, Integer, Hash)>] SpendingPlanIterationResponse data, response status code and response headers
776
+ def read_spending_plan_iteration_with_http_info(user_guid, spending_plan_guid, iteration_number, opts = {})
777
+ if @api_client.config.debugging
778
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.read_spending_plan_iteration ...'
779
+ end
780
+ # verify the required parameter 'user_guid' is set
781
+ if @api_client.config.client_side_validation && user_guid.nil?
782
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.read_spending_plan_iteration"
783
+ end
784
+ # verify the required parameter 'spending_plan_guid' is set
785
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
786
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.read_spending_plan_iteration"
787
+ end
788
+ # verify the required parameter 'iteration_number' is set
789
+ if @api_client.config.client_side_validation && iteration_number.nil?
790
+ fail ArgumentError, "Missing the required parameter 'iteration_number' when calling SpendingPlanApi.read_spending_plan_iteration"
791
+ end
792
+ # resource path
793
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/{iteration_number}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'iteration_number' + '}', CGI.escape(iteration_number.to_s))
794
+
795
+ # query parameters
796
+ query_params = opts[:query_params] || {}
797
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
798
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
799
+
800
+ # header parameters
801
+ header_params = opts[:header_params] || {}
802
+ # HTTP header 'Accept' (if needed)
803
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
804
+
805
+ # form parameters
806
+ form_params = opts[:form_params] || {}
807
+
808
+ # http body (model)
809
+ post_body = opts[:debug_body]
810
+
811
+ # return_type
812
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationResponse'
813
+
814
+ # auth_names
815
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
816
+
817
+ new_options = opts.merge(
818
+ :operation => :"SpendingPlanApi.read_spending_plan_iteration",
819
+ :header_params => header_params,
820
+ :query_params => query_params,
821
+ :form_params => form_params,
822
+ :body => post_body,
823
+ :auth_names => auth_names,
824
+ :return_type => return_type
825
+ )
826
+
827
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
828
+ if @api_client.config.debugging
829
+ @api_client.config.logger.debug "API called: SpendingPlanApi#read_spending_plan_iteration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
830
+ end
831
+ return data, status_code, headers
832
+ end
833
+
834
+ # Read a spending plan iteration item
835
+ # Use this endpoint to read the attributes of a specific spending plan `iteration_item` according to its unique GUID.
836
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
837
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
838
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
839
+ # @param [Hash] opts the optional parameters
840
+ # @option opts [Integer] :page Specify current page.
841
+ # @option opts [Integer] :records_per_page Specify records per page.
842
+ # @return [SpendingPlanIterationItemResponse]
843
+ def read_spending_plan_iteration_item(user_guid, spending_plan_guid, iteration_item_guid, opts = {})
844
+ data, _status_code, _headers = read_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, opts)
845
+ data
846
+ end
847
+
848
+ # Read a spending plan iteration item
849
+ # Use this endpoint to read the attributes of a specific spending plan &#x60;iteration_item&#x60; according to its unique GUID.
850
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
851
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
852
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
853
+ # @param [Hash] opts the optional parameters
854
+ # @option opts [Integer] :page Specify current page.
855
+ # @option opts [Integer] :records_per_page Specify records per page.
856
+ # @return [Array<(SpendingPlanIterationItemResponse, Integer, Hash)>] SpendingPlanIterationItemResponse data, response status code and response headers
857
+ def read_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, opts = {})
858
+ if @api_client.config.debugging
859
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.read_spending_plan_iteration_item ...'
860
+ end
861
+ # verify the required parameter 'user_guid' is set
862
+ if @api_client.config.client_side_validation && user_guid.nil?
863
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.read_spending_plan_iteration_item"
864
+ end
865
+ # verify the required parameter 'spending_plan_guid' is set
866
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
867
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.read_spending_plan_iteration_item"
868
+ end
869
+ # verify the required parameter 'iteration_item_guid' is set
870
+ if @api_client.config.client_side_validation && iteration_item_guid.nil?
871
+ fail ArgumentError, "Missing the required parameter 'iteration_item_guid' when calling SpendingPlanApi.read_spending_plan_iteration_item"
872
+ end
873
+ # resource path
874
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items/{iteration_item_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'iteration_item_guid' + '}', CGI.escape(iteration_item_guid.to_s))
875
+
876
+ # query parameters
877
+ query_params = opts[:query_params] || {}
878
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
879
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
880
+
881
+ # header parameters
882
+ header_params = opts[:header_params] || {}
883
+ # HTTP header 'Accept' (if needed)
884
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
885
+
886
+ # form parameters
887
+ form_params = opts[:form_params] || {}
888
+
889
+ # http body (model)
890
+ post_body = opts[:debug_body]
891
+
892
+ # return_type
893
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationItemResponse'
894
+
895
+ # auth_names
896
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
897
+
898
+ new_options = opts.merge(
899
+ :operation => :"SpendingPlanApi.read_spending_plan_iteration_item",
900
+ :header_params => header_params,
901
+ :query_params => query_params,
902
+ :form_params => form_params,
903
+ :body => post_body,
904
+ :auth_names => auth_names,
905
+ :return_type => return_type
906
+ )
907
+
908
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
909
+ if @api_client.config.debugging
910
+ @api_client.config.logger.debug "API called: SpendingPlanApi#read_spending_plan_iteration_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
911
+ end
912
+ return data, status_code, headers
913
+ end
914
+
915
+ # Read a spending plan for a user
916
+ # Use this endpoint to read the attributes of a specific spending plan according to its unique GUID.
917
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
918
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
919
+ # @param [Hash] opts the optional parameters
920
+ # @option opts [Integer] :page Specify current page.
921
+ # @option opts [Integer] :records_per_page Specify records per page.
922
+ # @return [SpendingPlanResponse]
923
+ def read_spending_plan_user(user_guid, spending_plan_guid, opts = {})
924
+ data, _status_code, _headers = read_spending_plan_user_with_http_info(user_guid, spending_plan_guid, opts)
925
+ data
926
+ end
927
+
928
+ # Read a spending plan for a user
929
+ # Use this endpoint to read the attributes of a specific spending plan according to its unique GUID.
930
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
931
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
932
+ # @param [Hash] opts the optional parameters
933
+ # @option opts [Integer] :page Specify current page.
934
+ # @option opts [Integer] :records_per_page Specify records per page.
935
+ # @return [Array<(SpendingPlanResponse, Integer, Hash)>] SpendingPlanResponse data, response status code and response headers
936
+ def read_spending_plan_user_with_http_info(user_guid, spending_plan_guid, opts = {})
937
+ if @api_client.config.debugging
938
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.read_spending_plan_user ...'
939
+ end
940
+ # verify the required parameter 'user_guid' is set
941
+ if @api_client.config.client_side_validation && user_guid.nil?
942
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.read_spending_plan_user"
943
+ end
944
+ # verify the required parameter 'spending_plan_guid' is set
945
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
946
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.read_spending_plan_user"
947
+ end
948
+ # resource path
949
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s))
950
+
951
+ # query parameters
952
+ query_params = opts[:query_params] || {}
953
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
954
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
955
+
956
+ # header parameters
957
+ header_params = opts[:header_params] || {}
958
+ # HTTP header 'Accept' (if needed)
959
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
960
+
961
+ # form parameters
962
+ form_params = opts[:form_params] || {}
963
+
964
+ # http body (model)
965
+ post_body = opts[:debug_body]
966
+
967
+ # return_type
968
+ return_type = opts[:debug_return_type] || 'SpendingPlanResponse'
969
+
970
+ # auth_names
971
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
972
+
973
+ new_options = opts.merge(
974
+ :operation => :"SpendingPlanApi.read_spending_plan_user",
975
+ :header_params => header_params,
976
+ :query_params => query_params,
977
+ :form_params => form_params,
978
+ :body => post_body,
979
+ :auth_names => auth_names,
980
+ :return_type => return_type
981
+ )
982
+
983
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
984
+ if @api_client.config.debugging
985
+ @api_client.config.logger.debug "API called: SpendingPlanApi#read_spending_plan_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
986
+ end
987
+ return data, status_code, headers
988
+ end
989
+
990
+ # Update a spending plan iteration item
991
+ # Use this endpoint to update an existing `spending_plan_iteration_item`.
992
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
993
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
994
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
995
+ # @param spending_plan_iteration_item_create_request_body [SpendingPlanIterationItemCreateRequestBody] Iteration item object to be updated with required parameter (iteration_item_guid)
996
+ # @param [Hash] opts the optional parameters
997
+ # @return [SpendingPlanIterationItemResponse]
998
+ def update_spending_plan_iteration_item(user_guid, spending_plan_guid, iteration_item_guid, spending_plan_iteration_item_create_request_body, opts = {})
999
+ data, _status_code, _headers = update_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, spending_plan_iteration_item_create_request_body, opts)
1000
+ data
1001
+ end
1002
+
1003
+ # Update a spending plan iteration item
1004
+ # Use this endpoint to update an existing &#x60;spending_plan_iteration_item&#x60;.
1005
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
1006
+ # @param spending_plan_guid [String] The unique ID for the &#x60;spending_plan&#x60;.
1007
+ # @param iteration_item_guid [String] The unique ID for the &#x60;iteration_item&#x60;.
1008
+ # @param spending_plan_iteration_item_create_request_body [SpendingPlanIterationItemCreateRequestBody] Iteration item object to be updated with required parameter (iteration_item_guid)
1009
+ # @param [Hash] opts the optional parameters
1010
+ # @return [Array<(SpendingPlanIterationItemResponse, Integer, Hash)>] SpendingPlanIterationItemResponse data, response status code and response headers
1011
+ def update_spending_plan_iteration_item_with_http_info(user_guid, spending_plan_guid, iteration_item_guid, spending_plan_iteration_item_create_request_body, opts = {})
1012
+ if @api_client.config.debugging
1013
+ @api_client.config.logger.debug 'Calling API: SpendingPlanApi.update_spending_plan_iteration_item ...'
1014
+ end
1015
+ # verify the required parameter 'user_guid' is set
1016
+ if @api_client.config.client_side_validation && user_guid.nil?
1017
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling SpendingPlanApi.update_spending_plan_iteration_item"
1018
+ end
1019
+ # verify the required parameter 'spending_plan_guid' is set
1020
+ if @api_client.config.client_side_validation && spending_plan_guid.nil?
1021
+ fail ArgumentError, "Missing the required parameter 'spending_plan_guid' when calling SpendingPlanApi.update_spending_plan_iteration_item"
1022
+ end
1023
+ # verify the required parameter 'iteration_item_guid' is set
1024
+ if @api_client.config.client_side_validation && iteration_item_guid.nil?
1025
+ fail ArgumentError, "Missing the required parameter 'iteration_item_guid' when calling SpendingPlanApi.update_spending_plan_iteration_item"
1026
+ end
1027
+ # verify the required parameter 'spending_plan_iteration_item_create_request_body' is set
1028
+ if @api_client.config.client_side_validation && spending_plan_iteration_item_create_request_body.nil?
1029
+ fail ArgumentError, "Missing the required parameter 'spending_plan_iteration_item_create_request_body' when calling SpendingPlanApi.update_spending_plan_iteration_item"
1030
+ end
1031
+ # resource path
1032
+ local_var_path = '/users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items/{iteration_item_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'spending_plan_guid' + '}', CGI.escape(spending_plan_guid.to_s)).sub('{' + 'iteration_item_guid' + '}', CGI.escape(iteration_item_guid.to_s))
1033
+
1034
+ # query parameters
1035
+ query_params = opts[:query_params] || {}
1036
+
1037
+ # header parameters
1038
+ header_params = opts[:header_params] || {}
1039
+ # HTTP header 'Accept' (if needed)
1040
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
1041
+ # HTTP header 'Content-Type'
1042
+ content_type = @api_client.select_header_content_type(['application/json'])
1043
+ if !content_type.nil?
1044
+ header_params['Content-Type'] = content_type
1045
+ end
1046
+
1047
+ # form parameters
1048
+ form_params = opts[:form_params] || {}
1049
+
1050
+ # http body (model)
1051
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(spending_plan_iteration_item_create_request_body)
1052
+
1053
+ # return_type
1054
+ return_type = opts[:debug_return_type] || 'SpendingPlanIterationItemResponse'
1055
+
1056
+ # auth_names
1057
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
1058
+
1059
+ new_options = opts.merge(
1060
+ :operation => :"SpendingPlanApi.update_spending_plan_iteration_item",
1061
+ :header_params => header_params,
1062
+ :query_params => query_params,
1063
+ :form_params => form_params,
1064
+ :body => post_body,
1065
+ :auth_names => auth_names,
1066
+ :return_type => return_type
1067
+ )
1068
+
1069
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1070
+ if @api_client.config.debugging
1071
+ @api_client.config.logger.debug "API called: SpendingPlanApi#update_spending_plan_iteration_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1072
+ end
1073
+ return data, status_code, headers
1074
+ end
1075
+ end
1076
+ end