mx-platform-ruby 0.39.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/docs/BudgetCreateRequest.md +26 -0
- data/docs/BudgetCreateRequestBody.md +18 -0
- data/docs/BudgetResponse.md +48 -0
- data/docs/BudgetResponseBody.md +18 -0
- data/docs/BudgetUpdateRequest.md +22 -0
- data/docs/BudgetUpdateRequestBody.md +18 -0
- data/docs/BudgetsApi.md +444 -0
- data/docs/CreditCardProduct.md +8 -8
- data/docs/CreditCardProductResponse.md +2 -2
- data/docs/GoalRequest.md +38 -0
- data/docs/GoalRequestBody.md +18 -0
- data/docs/GoalResponse.md +48 -0
- data/docs/GoalResponseBody.md +18 -0
- data/docs/GoalsApi.md +450 -0
- data/docs/GoalsResponse.md +48 -0
- data/docs/GoalsResponseBody.md +20 -0
- data/docs/MonthlyCashFlowProfileRequest.md +20 -0
- data/docs/MonthlyCashFlowProfileRequestBody.md +18 -0
- data/docs/MonthlyCashFlowResponse.md +30 -0
- data/docs/MonthlyCashFlowResponseBody.md +18 -0
- data/docs/MxPlatformApi.md +291 -0
- data/docs/RepositionRequest.md +20 -0
- data/docs/RepositionRequestBody.md +18 -0
- data/docs/RepositionResponseBody.md +18 -0
- data/docs/RewardResponse.md +2 -0
- data/docs/RewardsResponse.md +2 -0
- data/docs/SplitTransactionRequest.md +24 -0
- data/docs/SplitTransactionRequestBody.md +18 -0
- data/docs/SplitTransactionsResponseBody.md +18 -0
- data/docs/UpdateGoalRequest.md +38 -0
- data/docs/UpdateGoalRequestBody.md +18 -0
- data/lib/mx-platform-ruby/api/budgets_api.rb +434 -0
- data/lib/mx-platform-ruby/api/goals_api.rb +455 -0
- data/lib/mx-platform-ruby/api/mx_platform_api.rb +278 -0
- data/lib/mx-platform-ruby/models/budget_create_request.rb +269 -0
- data/lib/mx-platform-ruby/models/budget_create_request_body.rb +214 -0
- data/lib/mx-platform-ruby/models/budget_response.rb +373 -0
- data/lib/mx-platform-ruby/models/budget_response_body.rb +214 -0
- data/lib/mx-platform-ruby/models/budget_update_request.rb +235 -0
- data/lib/mx-platform-ruby/models/budget_update_request_body.rb +214 -0
- data/lib/mx-platform-ruby/models/credit_card_product.rb +17 -21
- data/lib/mx-platform-ruby/models/credit_card_product_response.rb +7 -7
- data/lib/mx-platform-ruby/models/goal_request.rb +350 -0
- data/lib/mx-platform-ruby/models/goal_request_body.rb +214 -0
- data/lib/mx-platform-ruby/models/goal_response.rb +364 -0
- data/lib/mx-platform-ruby/models/goal_response_body.rb +214 -0
- data/lib/mx-platform-ruby/models/goals_response.rb +363 -0
- data/lib/mx-platform-ruby/models/goals_response_body.rb +225 -0
- data/lib/mx-platform-ruby/models/monthly_cash_flow_profile_request.rb +225 -0
- data/lib/mx-platform-ruby/models/monthly_cash_flow_profile_request_body.rb +214 -0
- data/lib/mx-platform-ruby/models/monthly_cash_flow_response.rb +274 -0
- data/lib/mx-platform-ruby/models/monthly_cash_flow_response_body.rb +214 -0
- data/lib/mx-platform-ruby/models/reposition_request.rb +239 -0
- data/lib/mx-platform-ruby/models/reposition_request_body.rb +216 -0
- data/lib/mx-platform-ruby/models/reposition_response_body.rb +216 -0
- data/lib/mx-platform-ruby/models/reward_response.rb +10 -1
- data/lib/mx-platform-ruby/models/rewards_response.rb +10 -1
- data/lib/mx-platform-ruby/models/split_transaction_request.rb +252 -0
- data/lib/mx-platform-ruby/models/split_transaction_request_body.rb +221 -0
- data/lib/mx-platform-ruby/models/split_transactions_response_body.rb +216 -0
- data/lib/mx-platform-ruby/models/update_goal_request.rb +315 -0
- data/lib/mx-platform-ruby/models/update_goal_request_body.rb +214 -0
- data/lib/mx-platform-ruby/version.rb +1 -1
- data/lib/mx-platform-ruby.rb +26 -0
- data/openapi/config.yml +1 -1
- data/spec/api/budgets_api_spec.rb +112 -0
- data/spec/api/goals_api_spec.rb +115 -0
- data/spec/api/mx_platform_api_spec.rb +51 -0
- data/spec/models/budget_create_request_body_spec.rb +34 -0
- data/spec/models/budget_create_request_spec.rb +58 -0
- data/spec/models/budget_response_body_spec.rb +34 -0
- data/spec/models/budget_response_spec.rb +124 -0
- data/spec/models/budget_update_request_body_spec.rb +34 -0
- data/spec/models/budget_update_request_spec.rb +46 -0
- data/spec/models/credit_card_product_response_spec.rb +1 -1
- data/spec/models/credit_card_product_spec.rb +2 -2
- data/spec/models/goal_request_body_spec.rb +34 -0
- data/spec/models/goal_request_spec.rb +94 -0
- data/spec/models/goal_response_body_spec.rb +34 -0
- data/spec/models/goal_response_spec.rb +124 -0
- data/spec/models/goals_response_body_spec.rb +40 -0
- data/spec/models/goals_response_spec.rb +124 -0
- data/spec/models/monthly_cash_flow_profile_request_body_spec.rb +34 -0
- data/spec/models/monthly_cash_flow_profile_request_spec.rb +40 -0
- data/spec/models/monthly_cash_flow_response_body_spec.rb +34 -0
- data/spec/models/monthly_cash_flow_response_spec.rb +70 -0
- data/spec/models/reposition_request_body_spec.rb +34 -0
- data/spec/models/reposition_request_spec.rb +40 -0
- data/spec/models/reposition_response_body_spec.rb +34 -0
- data/spec/models/reward_response_spec.rb +6 -0
- data/spec/models/rewards_response_spec.rb +6 -0
- data/spec/models/split_transaction_request_body_spec.rb +34 -0
- data/spec/models/split_transaction_request_spec.rb +52 -0
- data/spec/models/split_transactions_response_body_spec.rb +34 -0
- data/spec/models/update_goal_request_body_spec.rb +34 -0
- data/spec/models/update_goal_request_spec.rb +94 -0
- metadata +106 -2
@@ -0,0 +1,434 @@
|
|
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 BudgetsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete a budget
|
23
|
+
# Delete a budget.
|
24
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
25
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [nil]
|
28
|
+
def users_user_guid_budgets_budget_guid_delete(user_guid, budget_guid, opts = {})
|
29
|
+
users_user_guid_budgets_budget_guid_delete_with_http_info(user_guid, budget_guid, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Delete a budget
|
34
|
+
# Delete a budget.
|
35
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
36
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
39
|
+
def users_user_guid_budgets_budget_guid_delete_with_http_info(user_guid, budget_guid, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_budget_guid_delete ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'user_guid' is set
|
44
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_delete"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'budget_guid' is set
|
48
|
+
if @api_client.config.client_side_validation && budget_guid.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'budget_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_delete"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/users/{user_guid}/budgets/{budget_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'budget_guid' + '}', CGI.escape(budget_guid.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = opts[:form_params] || {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = opts[:debug_body]
|
65
|
+
|
66
|
+
# return_type
|
67
|
+
return_type = opts[:debug_return_type]
|
68
|
+
|
69
|
+
# auth_names
|
70
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
71
|
+
|
72
|
+
new_options = opts.merge(
|
73
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_budget_guid_delete",
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => return_type
|
80
|
+
)
|
81
|
+
|
82
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_budget_guid_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
return data, status_code, headers
|
87
|
+
end
|
88
|
+
|
89
|
+
# Read a specific budget
|
90
|
+
# Read a specific budget.
|
91
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
92
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [BudgetResponseBody]
|
95
|
+
def users_user_guid_budgets_budget_guid_get(budget_guid, user_guid, opts = {})
|
96
|
+
data, _status_code, _headers = users_user_guid_budgets_budget_guid_get_with_http_info(budget_guid, user_guid, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Read a specific budget
|
101
|
+
# Read a specific budget.
|
102
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
103
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
104
|
+
# @param [Hash] opts the optional parameters
|
105
|
+
# @return [Array<(BudgetResponseBody, Integer, Hash)>] BudgetResponseBody data, response status code and response headers
|
106
|
+
def users_user_guid_budgets_budget_guid_get_with_http_info(budget_guid, user_guid, opts = {})
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_budget_guid_get ...'
|
109
|
+
end
|
110
|
+
# verify the required parameter 'budget_guid' is set
|
111
|
+
if @api_client.config.client_side_validation && budget_guid.nil?
|
112
|
+
fail ArgumentError, "Missing the required parameter 'budget_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_get"
|
113
|
+
end
|
114
|
+
# verify the required parameter 'user_guid' is set
|
115
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_get"
|
117
|
+
end
|
118
|
+
# resource path
|
119
|
+
local_var_path = '/users/{user_guid}/budgets/{budget_guid}'.sub('{' + 'budget_guid' + '}', CGI.escape(budget_guid.to_s)).sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
120
|
+
|
121
|
+
# query parameters
|
122
|
+
query_params = opts[:query_params] || {}
|
123
|
+
|
124
|
+
# header parameters
|
125
|
+
header_params = opts[:header_params] || {}
|
126
|
+
# HTTP header 'Accept' (if needed)
|
127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
128
|
+
|
129
|
+
# form parameters
|
130
|
+
form_params = opts[:form_params] || {}
|
131
|
+
|
132
|
+
# http body (model)
|
133
|
+
post_body = opts[:debug_body]
|
134
|
+
|
135
|
+
# return_type
|
136
|
+
return_type = opts[:debug_return_type] || 'BudgetResponseBody'
|
137
|
+
|
138
|
+
# auth_names
|
139
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
140
|
+
|
141
|
+
new_options = opts.merge(
|
142
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_budget_guid_get",
|
143
|
+
:header_params => header_params,
|
144
|
+
:query_params => query_params,
|
145
|
+
:form_params => form_params,
|
146
|
+
:body => post_body,
|
147
|
+
:auth_names => auth_names,
|
148
|
+
:return_type => return_type
|
149
|
+
)
|
150
|
+
|
151
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_budget_guid_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
|
+
end
|
155
|
+
return data, status_code, headers
|
156
|
+
end
|
157
|
+
|
158
|
+
# Update a specific budget
|
159
|
+
# Update a specific budget.
|
160
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
161
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
162
|
+
# @param [Hash] opts the optional parameters
|
163
|
+
# @option opts [BudgetUpdateRequestBody] :budget_update_request_body
|
164
|
+
# @return [BudgetResponseBody]
|
165
|
+
def users_user_guid_budgets_budget_guid_put(user_guid, budget_guid, opts = {})
|
166
|
+
data, _status_code, _headers = users_user_guid_budgets_budget_guid_put_with_http_info(user_guid, budget_guid, opts)
|
167
|
+
data
|
168
|
+
end
|
169
|
+
|
170
|
+
# Update a specific budget
|
171
|
+
# Update a specific budget.
|
172
|
+
# @param user_guid [String] The unique identifier for the budget. Defined by MX.
|
173
|
+
# @param budget_guid [String] The unique identifier for the budget. Defined by MX.
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @option opts [BudgetUpdateRequestBody] :budget_update_request_body
|
176
|
+
# @return [Array<(BudgetResponseBody, Integer, Hash)>] BudgetResponseBody data, response status code and response headers
|
177
|
+
def users_user_guid_budgets_budget_guid_put_with_http_info(user_guid, budget_guid, opts = {})
|
178
|
+
if @api_client.config.debugging
|
179
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_budget_guid_put ...'
|
180
|
+
end
|
181
|
+
# verify the required parameter 'user_guid' is set
|
182
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_put"
|
184
|
+
end
|
185
|
+
# verify the required parameter 'budget_guid' is set
|
186
|
+
if @api_client.config.client_side_validation && budget_guid.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'budget_guid' when calling BudgetsApi.users_user_guid_budgets_budget_guid_put"
|
188
|
+
end
|
189
|
+
# resource path
|
190
|
+
local_var_path = '/users/{user_guid}/budgets/{budget_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'budget_guid' + '}', CGI.escape(budget_guid.to_s))
|
191
|
+
|
192
|
+
# query parameters
|
193
|
+
query_params = opts[:query_params] || {}
|
194
|
+
|
195
|
+
# header parameters
|
196
|
+
header_params = opts[:header_params] || {}
|
197
|
+
# HTTP header 'Accept' (if needed)
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
|
+
# HTTP header 'Content-Type'
|
200
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
201
|
+
if !content_type.nil?
|
202
|
+
header_params['Content-Type'] = content_type
|
203
|
+
end
|
204
|
+
|
205
|
+
# form parameters
|
206
|
+
form_params = opts[:form_params] || {}
|
207
|
+
|
208
|
+
# http body (model)
|
209
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'budget_update_request_body'])
|
210
|
+
|
211
|
+
# return_type
|
212
|
+
return_type = opts[:debug_return_type] || 'BudgetResponseBody'
|
213
|
+
|
214
|
+
# auth_names
|
215
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
216
|
+
|
217
|
+
new_options = opts.merge(
|
218
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_budget_guid_put",
|
219
|
+
:header_params => header_params,
|
220
|
+
:query_params => query_params,
|
221
|
+
:form_params => form_params,
|
222
|
+
:body => post_body,
|
223
|
+
:auth_names => auth_names,
|
224
|
+
:return_type => return_type
|
225
|
+
)
|
226
|
+
|
227
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
228
|
+
if @api_client.config.debugging
|
229
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_budget_guid_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
230
|
+
end
|
231
|
+
return data, status_code, headers
|
232
|
+
end
|
233
|
+
|
234
|
+
# Auto-generate budgets
|
235
|
+
# This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren't enough transactions to automatically create any budgets`.
|
236
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
237
|
+
# @param [Hash] opts the optional parameters
|
238
|
+
# @return [BudgetResponseBody]
|
239
|
+
def users_user_guid_budgets_generate_post(user_guid, opts = {})
|
240
|
+
data, _status_code, _headers = users_user_guid_budgets_generate_post_with_http_info(user_guid, opts)
|
241
|
+
data
|
242
|
+
end
|
243
|
+
|
244
|
+
# Auto-generate budgets
|
245
|
+
# This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren't enough transactions to automatically create any budgets`.
|
246
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
247
|
+
# @param [Hash] opts the optional parameters
|
248
|
+
# @return [Array<(BudgetResponseBody, Integer, Hash)>] BudgetResponseBody data, response status code and response headers
|
249
|
+
def users_user_guid_budgets_generate_post_with_http_info(user_guid, opts = {})
|
250
|
+
if @api_client.config.debugging
|
251
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_generate_post ...'
|
252
|
+
end
|
253
|
+
# verify the required parameter 'user_guid' is set
|
254
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
255
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_generate_post"
|
256
|
+
end
|
257
|
+
# resource path
|
258
|
+
local_var_path = '/users/{user_guid}/budgets/generate'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
259
|
+
|
260
|
+
# query parameters
|
261
|
+
query_params = opts[:query_params] || {}
|
262
|
+
|
263
|
+
# header parameters
|
264
|
+
header_params = opts[:header_params] || {}
|
265
|
+
# HTTP header 'Accept' (if needed)
|
266
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
267
|
+
|
268
|
+
# form parameters
|
269
|
+
form_params = opts[:form_params] || {}
|
270
|
+
|
271
|
+
# http body (model)
|
272
|
+
post_body = opts[:debug_body]
|
273
|
+
|
274
|
+
# return_type
|
275
|
+
return_type = opts[:debug_return_type] || 'BudgetResponseBody'
|
276
|
+
|
277
|
+
# auth_names
|
278
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
279
|
+
|
280
|
+
new_options = opts.merge(
|
281
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_generate_post",
|
282
|
+
:header_params => header_params,
|
283
|
+
:query_params => query_params,
|
284
|
+
:form_params => form_params,
|
285
|
+
:body => post_body,
|
286
|
+
:auth_names => auth_names,
|
287
|
+
:return_type => return_type
|
288
|
+
)
|
289
|
+
|
290
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
291
|
+
if @api_client.config.debugging
|
292
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_generate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
293
|
+
end
|
294
|
+
return data, status_code, headers
|
295
|
+
end
|
296
|
+
|
297
|
+
# List all budgets
|
298
|
+
# List all budgets
|
299
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
300
|
+
# @param [Hash] opts the optional parameters
|
301
|
+
# @return [BudgetResponseBody]
|
302
|
+
def users_user_guid_budgets_get(user_guid, opts = {})
|
303
|
+
data, _status_code, _headers = users_user_guid_budgets_get_with_http_info(user_guid, opts)
|
304
|
+
data
|
305
|
+
end
|
306
|
+
|
307
|
+
# List all budgets
|
308
|
+
# List all budgets
|
309
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
310
|
+
# @param [Hash] opts the optional parameters
|
311
|
+
# @return [Array<(BudgetResponseBody, Integer, Hash)>] BudgetResponseBody data, response status code and response headers
|
312
|
+
def users_user_guid_budgets_get_with_http_info(user_guid, opts = {})
|
313
|
+
if @api_client.config.debugging
|
314
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_get ...'
|
315
|
+
end
|
316
|
+
# verify the required parameter 'user_guid' is set
|
317
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
318
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_get"
|
319
|
+
end
|
320
|
+
# resource path
|
321
|
+
local_var_path = '/users/{user_guid}/budgets'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
322
|
+
|
323
|
+
# query parameters
|
324
|
+
query_params = opts[:query_params] || {}
|
325
|
+
|
326
|
+
# header parameters
|
327
|
+
header_params = opts[:header_params] || {}
|
328
|
+
# HTTP header 'Accept' (if needed)
|
329
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
330
|
+
|
331
|
+
# form parameters
|
332
|
+
form_params = opts[:form_params] || {}
|
333
|
+
|
334
|
+
# http body (model)
|
335
|
+
post_body = opts[:debug_body]
|
336
|
+
|
337
|
+
# return_type
|
338
|
+
return_type = opts[:debug_return_type] || 'BudgetResponseBody'
|
339
|
+
|
340
|
+
# auth_names
|
341
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
342
|
+
|
343
|
+
new_options = opts.merge(
|
344
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_get",
|
345
|
+
:header_params => header_params,
|
346
|
+
:query_params => query_params,
|
347
|
+
:form_params => form_params,
|
348
|
+
:body => post_body,
|
349
|
+
:auth_names => auth_names,
|
350
|
+
:return_type => return_type
|
351
|
+
)
|
352
|
+
|
353
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
354
|
+
if @api_client.config.debugging
|
355
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
356
|
+
end
|
357
|
+
return data, status_code, headers
|
358
|
+
end
|
359
|
+
|
360
|
+
# Create a budget
|
361
|
+
# Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint.
|
362
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
363
|
+
# @param budget_create_request_body [BudgetCreateRequestBody]
|
364
|
+
# @param [Hash] opts the optional parameters
|
365
|
+
# @return [BudgetResponseBody]
|
366
|
+
def users_user_guid_budgets_post(user_guid, budget_create_request_body, opts = {})
|
367
|
+
data, _status_code, _headers = users_user_guid_budgets_post_with_http_info(user_guid, budget_create_request_body, opts)
|
368
|
+
data
|
369
|
+
end
|
370
|
+
|
371
|
+
# Create a budget
|
372
|
+
# Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint.
|
373
|
+
# @param user_guid [String] The unique identifier for the user. Defined by MX.
|
374
|
+
# @param budget_create_request_body [BudgetCreateRequestBody]
|
375
|
+
# @param [Hash] opts the optional parameters
|
376
|
+
# @return [Array<(BudgetResponseBody, Integer, Hash)>] BudgetResponseBody data, response status code and response headers
|
377
|
+
def users_user_guid_budgets_post_with_http_info(user_guid, budget_create_request_body, opts = {})
|
378
|
+
if @api_client.config.debugging
|
379
|
+
@api_client.config.logger.debug 'Calling API: BudgetsApi.users_user_guid_budgets_post ...'
|
380
|
+
end
|
381
|
+
# verify the required parameter 'user_guid' is set
|
382
|
+
if @api_client.config.client_side_validation && user_guid.nil?
|
383
|
+
fail ArgumentError, "Missing the required parameter 'user_guid' when calling BudgetsApi.users_user_guid_budgets_post"
|
384
|
+
end
|
385
|
+
# verify the required parameter 'budget_create_request_body' is set
|
386
|
+
if @api_client.config.client_side_validation && budget_create_request_body.nil?
|
387
|
+
fail ArgumentError, "Missing the required parameter 'budget_create_request_body' when calling BudgetsApi.users_user_guid_budgets_post"
|
388
|
+
end
|
389
|
+
# resource path
|
390
|
+
local_var_path = '/users/{user_guid}/budgets'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
|
391
|
+
|
392
|
+
# query parameters
|
393
|
+
query_params = opts[:query_params] || {}
|
394
|
+
|
395
|
+
# header parameters
|
396
|
+
header_params = opts[:header_params] || {}
|
397
|
+
# HTTP header 'Accept' (if needed)
|
398
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
399
|
+
# HTTP header 'Content-Type'
|
400
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
401
|
+
if !content_type.nil?
|
402
|
+
header_params['Content-Type'] = content_type
|
403
|
+
end
|
404
|
+
|
405
|
+
# form parameters
|
406
|
+
form_params = opts[:form_params] || {}
|
407
|
+
|
408
|
+
# http body (model)
|
409
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(budget_create_request_body)
|
410
|
+
|
411
|
+
# return_type
|
412
|
+
return_type = opts[:debug_return_type] || 'BudgetResponseBody'
|
413
|
+
|
414
|
+
# auth_names
|
415
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
416
|
+
|
417
|
+
new_options = opts.merge(
|
418
|
+
:operation => :"BudgetsApi.users_user_guid_budgets_post",
|
419
|
+
:header_params => header_params,
|
420
|
+
:query_params => query_params,
|
421
|
+
:form_params => form_params,
|
422
|
+
:body => post_body,
|
423
|
+
:auth_names => auth_names,
|
424
|
+
:return_type => return_type
|
425
|
+
)
|
426
|
+
|
427
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug "API called: BudgetsApi#users_user_guid_budgets_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
430
|
+
end
|
431
|
+
return data, status_code, headers
|
432
|
+
end
|
433
|
+
end
|
434
|
+
end
|