masspay_ruby_sdk 1.0.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.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +8 -0
  3. data/CONTRIBUTING.md +13 -0
  4. data/Gemfile +9 -0
  5. data/README.md +197 -0
  6. data/Rakefile +10 -0
  7. data/docs/AccountApi.md +150 -0
  8. data/docs/ApiResponse.md +22 -0
  9. data/docs/AttrTxn.md +20 -0
  10. data/docs/AttrValue.md +20 -0
  11. data/docs/AttrVelocityRequestInner.md +20 -0
  12. data/docs/AttributeApi.md +168 -0
  13. data/docs/AttrsRequirement.md +36 -0
  14. data/docs/AutopayResp.md +22 -0
  15. data/docs/AutopayRule.md +20 -0
  16. data/docs/AvailableBalanceTxnResp.md +22 -0
  17. data/docs/CardApi.md +160 -0
  18. data/docs/CatalogApi.md +469 -0
  19. data/docs/CompaniesResp.md +18 -0
  20. data/docs/Company.md +26 -0
  21. data/docs/Country.md +22 -0
  22. data/docs/Exception.md +20 -0
  23. data/docs/FoundUser.md +24 -0
  24. data/docs/GetAccountStatement200Response.md +18 -0
  25. data/docs/GetTransactionConfirmationDetails200Response.md +18 -0
  26. data/docs/GetUserAgreement200Response.md +26 -0
  27. data/docs/GetUserAgreementsNames200ResponseInner.md +24 -0
  28. data/docs/GetUserUserTokenKycAu10tix200Response.md +18 -0
  29. data/docs/GetUserUserTokenKycVeriff200Response.md +18 -0
  30. data/docs/GetWalletCardInfo200Response.md +30 -0
  31. data/docs/IDUpload.md +20 -0
  32. data/docs/KYCApi.md +305 -0
  33. data/docs/LoadApi.md +621 -0
  34. data/docs/LoadTxn.md +32 -0
  35. data/docs/LoadTxnResp.md +20 -0
  36. data/docs/Loads.md +36 -0
  37. data/docs/PayoutApi.md +403 -0
  38. data/docs/PayoutTxn.md +36 -0
  39. data/docs/PayoutTxnCommitResp.md +24 -0
  40. data/docs/PayoutTxnResp.md +60 -0
  41. data/docs/ResendBalanceNotification200Response.md +18 -0
  42. data/docs/Service.md +22 -0
  43. data/docs/ServicePayersInner.md +38 -0
  44. data/docs/ServicePayersInnerExchangeRateInner.md +20 -0
  45. data/docs/SpendBackApi.md +161 -0
  46. data/docs/SpendBackTxn.md +28 -0
  47. data/docs/SpendBackTxnResp.md +22 -0
  48. data/docs/SpendBacks.md +34 -0
  49. data/docs/StoredUser.md +56 -0
  50. data/docs/TaxApi.md +81 -0
  51. data/docs/TaxYearUserResp.md +48 -0
  52. data/docs/TxnHistoryResp.md +52 -0
  53. data/docs/UpdateUser.md +52 -0
  54. data/docs/User.md +50 -0
  55. data/docs/UserApi.md +403 -0
  56. data/docs/WalletApi.md +463 -0
  57. data/docs/WalletTxnResp.md +34 -0
  58. data/docs/logo.webp +0 -0
  59. data/lib/masspay_ruby_sdk/api/account_api.rb +149 -0
  60. data/lib/masspay_ruby_sdk/api/attribute_api.rb +214 -0
  61. data/lib/masspay_ruby_sdk/api/card_api.rb +174 -0
  62. data/lib/masspay_ruby_sdk/api/catalog_api.rb +443 -0
  63. data/lib/masspay_ruby_sdk/api/kyc_api.rb +290 -0
  64. data/lib/masspay_ruby_sdk/api/load_api.rb +598 -0
  65. data/lib/masspay_ruby_sdk/api/payout_api.rb +397 -0
  66. data/lib/masspay_ruby_sdk/api/spend_back_api.rb +160 -0
  67. data/lib/masspay_ruby_sdk/api/tax_api.rb +82 -0
  68. data/lib/masspay_ruby_sdk/api/user_api.rb +418 -0
  69. data/lib/masspay_ruby_sdk/api/wallet_api.rb +461 -0
  70. data/lib/masspay_ruby_sdk/api_client.rb +391 -0
  71. data/lib/masspay_ruby_sdk/api_error.rb +57 -0
  72. data/lib/masspay_ruby_sdk/configuration.rb +315 -0
  73. data/lib/masspay_ruby_sdk/models/api_response.rb +236 -0
  74. data/lib/masspay_ruby_sdk/models/attr_txn.rb +235 -0
  75. data/lib/masspay_ruby_sdk/models/attr_value.rb +239 -0
  76. data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +273 -0
  77. data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +372 -0
  78. data/lib/masspay_ruby_sdk/models/autopay_resp.rb +256 -0
  79. data/lib/masspay_ruby_sdk/models/autopay_rule.rb +241 -0
  80. data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +254 -0
  81. data/lib/masspay_ruby_sdk/models/companies_resp.rb +225 -0
  82. data/lib/masspay_ruby_sdk/models/company.rb +285 -0
  83. data/lib/masspay_ruby_sdk/models/country.rb +296 -0
  84. data/lib/masspay_ruby_sdk/models/exception.rb +241 -0
  85. data/lib/masspay_ruby_sdk/models/found_user.rb +270 -0
  86. data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +225 -0
  87. data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +218 -0
  88. data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +280 -0
  89. data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +270 -0
  90. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +224 -0
  91. data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +224 -0
  92. data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +460 -0
  93. data/lib/masspay_ruby_sdk/models/id_upload.rb +273 -0
  94. data/lib/masspay_ruby_sdk/models/load_txn.rb +321 -0
  95. data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +273 -0
  96. data/lib/masspay_ruby_sdk/models/loads.rb +388 -0
  97. data/lib/masspay_ruby_sdk/models/payout_txn.rb +328 -0
  98. data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +293 -0
  99. data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +613 -0
  100. data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +225 -0
  101. data/lib/masspay_ruby_sdk/models/service.rb +318 -0
  102. data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +373 -0
  103. data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +239 -0
  104. data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +325 -0
  105. data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +307 -0
  106. data/lib/masspay_ruby_sdk/models/spend_backs.rb +340 -0
  107. data/lib/masspay_ruby_sdk/models/stored_user.rb +500 -0
  108. data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +388 -0
  109. data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +571 -0
  110. data/lib/masspay_ruby_sdk/models/update_user.rb +490 -0
  111. data/lib/masspay_ruby_sdk/models/user.rb +423 -0
  112. data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +375 -0
  113. data/lib/masspay_ruby_sdk/version.rb +14 -0
  114. data/lib/masspay_ruby_sdk.rb +89 -0
  115. data/masspay_ruby_sdk.gemspec +37 -0
  116. data/spec/api_client_spec.rb +227 -0
  117. data/spec/configuration_spec.rb +41 -0
  118. data/spec/spec_helper.rb +110 -0
  119. metadata +203 -0
@@ -0,0 +1,418 @@
1
+ =begin
2
+ #MassPay API
3
+
4
+ #MassPay API
5
+
6
+ The version of the OpenAPI document: 0.1.4
7
+ Contact: support@masspay.io
8
+ Generated by: MassPay Inc.
9
+ OpenAPI Generator version: 6.5.0
10
+ =end
11
+
12
+ require 'cgi'
13
+
14
+ module MassPayRubySdk
15
+ class UserApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default)
19
+ @api_client = api_client
20
+ end
21
+ # Create a user
22
+ # This **POST** endpoint is used to create a new user in MassPay. <br> You can use this endpoint to create a new user with the specified user details in JSON format in the request Body. <br> To use this endpoint, you need to provide the `internal_user_id`, `country`, `first_name`, `last_name`, and `email` as required parameters in the Request Body. <br> The response will include details about the newly created user.
23
+ # @param user [User] Created user object
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [StoredUser]
26
+ def create_user(user, opts = {})
27
+ data, _status_code, _headers = create_user_with_http_info(user, opts)
28
+ data
29
+ end
30
+
31
+ # Create a user
32
+ # This **POST** endpoint is used to create a new user in MassPay. &lt;br&gt; You can use this endpoint to create a new user with the specified user details in JSON format in the request Body. &lt;br&gt; To use this endpoint, you need to provide the &#x60;internal_user_id&#x60;, &#x60;country&#x60;, &#x60;first_name&#x60;, &#x60;last_name&#x60;, and &#x60;email&#x60; as required parameters in the Request Body. &lt;br&gt; The response will include details about the newly created user.
33
+ # @param user [User] Created user object
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(StoredUser, Integer, Hash)>] StoredUser data, response status code and response headers
36
+ def create_user_with_http_info(user, opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: UserApi.create_user ...'
39
+ end
40
+ # verify the required parameter 'user' is set
41
+ if @api_client.config.client_side_validation && user.nil?
42
+ fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user"
43
+ end
44
+ # resource path
45
+ local_var_path = '/user'
46
+
47
+ # query parameters
48
+ query_params = opts[:query_params] || {}
49
+
50
+ # header parameters
51
+ header_params = opts[:header_params] || {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+ # HTTP header 'Content-Type'
55
+ content_type = @api_client.select_header_content_type(['application/json'])
56
+ if !content_type.nil?
57
+ header_params['Content-Type'] = content_type
58
+ end
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'StoredUser'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"UserApi.create_user",
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(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Get user by user token
90
+ # This **GET** endpoint is used to retrieve a user's profile by their user token in MassPay. <br> You can use this endpoint to obtain a user profile for a specified user token. <br> To use this endpoint, you need to provide the `user_token` as a required parameter in the URL Path. <br> The response will include all available details for the user.
91
+ # @param user_token [String] The user token that needs to be fetched.
92
+ # @param [Hash] opts the optional parameters
93
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
94
+ # @return [StoredUser]
95
+ def get_user_by_token(user_token, opts = {})
96
+ data, _status_code, _headers = get_user_by_token_with_http_info(user_token, opts)
97
+ data
98
+ end
99
+
100
+ # Get user by user token
101
+ # This **GET** endpoint is used to retrieve a user&#39;s profile by their user token in MassPay. &lt;br&gt; You can use this endpoint to obtain a user profile for a specified user token. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a required parameter in the URL Path. &lt;br&gt; The response will include all available details for the user.
102
+ # @param user_token [String] The user token that needs to be fetched.
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
105
+ # @return [Array<(StoredUser, Integer, Hash)>] StoredUser data, response status code and response headers
106
+ def get_user_by_token_with_http_info(user_token, opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_token ...'
109
+ end
110
+ # verify the required parameter 'user_token' is set
111
+ if @api_client.config.client_side_validation && user_token.nil?
112
+ fail ArgumentError, "Missing the required parameter 'user_token' when calling UserApi.get_user_by_token"
113
+ end
114
+ # resource path
115
+ local_var_path = '/user/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
116
+
117
+ # query parameters
118
+ query_params = opts[:query_params] || {}
119
+
120
+ # header parameters
121
+ header_params = opts[:header_params] || {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
124
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body]
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'StoredUser'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"UserApi.get_user_by_token",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: UserApi#get_user_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Transactions history
156
+ # This **GET** endpoint is used to retrieve a list of all transactions, including payouts, loads, and spendbacks, for a provider user with the provided user token. <br> You can use this endpoint to obtain a comprehensive history of transactions for the provider user, allowing you to track and analyze their payment activities over time. <br> To use this endpoint, you need to provide the `user_token` as a parameter in the URL Path. <br> The response will contain a JSON array of transaction objects, each including transactions details.
157
+ # @param user_token [String] Token representing the user to get transactions history for
158
+ # @param [Hash] opts the optional parameters
159
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
160
+ # @option opts [Float] :number_of_records Number of records to return (default to 10)
161
+ # @option opts [Date] :start_date Starting date
162
+ # @option opts [Date] :end_date Ending date
163
+ # @option opts [Integer] :page Page number (default to 1)
164
+ # @option opts [String] :type Filter particular types of transactions. Comma separated to include multiple types
165
+ # @option opts [String] :wallet_token Filter transactions to include only provided wallet token.
166
+ # @option opts [Boolean] :show_all_clients Wether to show transactions from all clients (default to false)
167
+ # @return [Array<TxnHistoryResp>]
168
+ def get_user_history(user_token, opts = {})
169
+ data, _status_code, _headers = get_user_history_with_http_info(user_token, opts)
170
+ data
171
+ end
172
+
173
+ # Transactions history
174
+ # This **GET** endpoint is used to retrieve a list of all transactions, including payouts, loads, and spendbacks, for a provider user with the provided user token. &lt;br&gt; You can use this endpoint to obtain a comprehensive history of transactions for the provider user, allowing you to track and analyze their payment activities over time. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a parameter in the URL Path. &lt;br&gt; The response will contain a JSON array of transaction objects, each including transactions details.
175
+ # @param user_token [String] Token representing the user to get transactions history for
176
+ # @param [Hash] opts the optional parameters
177
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
178
+ # @option opts [Float] :number_of_records Number of records to return (default to 10)
179
+ # @option opts [Date] :start_date Starting date
180
+ # @option opts [Date] :end_date Ending date
181
+ # @option opts [Integer] :page Page number (default to 1)
182
+ # @option opts [String] :type Filter particular types of transactions. Comma separated to include multiple types
183
+ # @option opts [String] :wallet_token Filter transactions to include only provided wallet token.
184
+ # @option opts [Boolean] :show_all_clients Wether to show transactions from all clients (default to false)
185
+ # @return [Array<(Array<TxnHistoryResp>, Integer, Hash)>] Array<TxnHistoryResp> data, response status code and response headers
186
+ def get_user_history_with_http_info(user_token, opts = {})
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug 'Calling API: UserApi.get_user_history ...'
189
+ end
190
+ # verify the required parameter 'user_token' is set
191
+ if @api_client.config.client_side_validation && user_token.nil?
192
+ fail ArgumentError, "Missing the required parameter 'user_token' when calling UserApi.get_user_history"
193
+ end
194
+ pattern = Regexp.new(/^[\d]{4}-[\d]{2}-[\d]{2}$/)
195
+ if @api_client.config.client_side_validation && !opts[:'start_date'].nil? && opts[:'start_date'] !~ pattern
196
+ fail ArgumentError, "invalid value for 'opts[:\"start_date\"]' when calling UserApi.get_user_history, must conform to the pattern #{pattern}."
197
+ end
198
+
199
+ pattern = Regexp.new(/^[\d]{4}-[\d]{2}-[\d]{2}$/)
200
+ if @api_client.config.client_side_validation && !opts[:'end_date'].nil? && opts[:'end_date'] !~ pattern
201
+ fail ArgumentError, "invalid value for 'opts[:\"end_date\"]' when calling UserApi.get_user_history, must conform to the pattern #{pattern}."
202
+ end
203
+
204
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
205
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling UserApi.get_user_history, must be greater than or equal to 1.'
206
+ end
207
+
208
+ allowable_values = ["payout", "load", "spendback"]
209
+ if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
210
+ fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
211
+ end
212
+ # resource path
213
+ local_var_path = '/user/{user_token}/history'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
214
+
215
+ # query parameters
216
+ query_params = opts[:query_params] || {}
217
+ query_params[:'number_of_records'] = opts[:'number_of_records'] if !opts[:'number_of_records'].nil?
218
+ query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
219
+ query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
220
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
221
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
222
+ query_params[:'wallet_token'] = opts[:'wallet_token'] if !opts[:'wallet_token'].nil?
223
+ query_params[:'show_all_clients'] = opts[:'show_all_clients'] if !opts[:'show_all_clients'].nil?
224
+
225
+ # header parameters
226
+ header_params = opts[:header_params] || {}
227
+ # HTTP header 'Accept' (if needed)
228
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
229
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
230
+
231
+ # form parameters
232
+ form_params = opts[:form_params] || {}
233
+
234
+ # http body (model)
235
+ post_body = opts[:debug_body]
236
+
237
+ # return_type
238
+ return_type = opts[:debug_return_type] || 'Array<TxnHistoryResp>'
239
+
240
+ # auth_names
241
+ auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
242
+
243
+ new_options = opts.merge(
244
+ :operation => :"UserApi.get_user_history",
245
+ :header_params => header_params,
246
+ :query_params => query_params,
247
+ :form_params => form_params,
248
+ :body => post_body,
249
+ :auth_names => auth_names,
250
+ :return_type => return_type
251
+ )
252
+
253
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug "API called: UserApi#get_user_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
256
+ end
257
+ return data, status_code, headers
258
+ end
259
+
260
+ # Updated user
261
+ # This **PUT** endpoint is used to update the profile information of a user with the provided user token. <br> You need to provide the `user_token` in the URL path to identify the user whose information you want to update. The updated information should be provided in the request Body as a JSON object. This endpoint can be used to update various profile information, such as the user's name, email address, phone number, and more. <br> The response will contain the updated user information in a JSON format.
262
+ # @param user_token [String] user token that need to be updated
263
+ # @param update_user [UpdateUser] Updated user object
264
+ # @param [Hash] opts the optional parameters
265
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
266
+ # @return [StoredUser]
267
+ def update_user(user_token, update_user, opts = {})
268
+ data, _status_code, _headers = update_user_with_http_info(user_token, update_user, opts)
269
+ data
270
+ end
271
+
272
+ # Updated user
273
+ # This **PUT** endpoint is used to update the profile information of a user with the provided user token. &lt;br&gt; You need to provide the &#x60;user_token&#x60; in the URL path to identify the user whose information you want to update. The updated information should be provided in the request Body as a JSON object. This endpoint can be used to update various profile information, such as the user&#39;s name, email address, phone number, and more. &lt;br&gt; The response will contain the updated user information in a JSON format.
274
+ # @param user_token [String] user token that need to be updated
275
+ # @param update_user [UpdateUser] Updated user object
276
+ # @param [Hash] opts the optional parameters
277
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
278
+ # @return [Array<(StoredUser, Integer, Hash)>] StoredUser data, response status code and response headers
279
+ def update_user_with_http_info(user_token, update_user, opts = {})
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug 'Calling API: UserApi.update_user ...'
282
+ end
283
+ # verify the required parameter 'user_token' is set
284
+ if @api_client.config.client_side_validation && user_token.nil?
285
+ fail ArgumentError, "Missing the required parameter 'user_token' when calling UserApi.update_user"
286
+ end
287
+ # verify the required parameter 'update_user' is set
288
+ if @api_client.config.client_side_validation && update_user.nil?
289
+ fail ArgumentError, "Missing the required parameter 'update_user' when calling UserApi.update_user"
290
+ end
291
+ # resource path
292
+ local_var_path = '/user/{user_token}'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s))
293
+
294
+ # query parameters
295
+ query_params = opts[:query_params] || {}
296
+
297
+ # header parameters
298
+ header_params = opts[:header_params] || {}
299
+ # HTTP header 'Accept' (if needed)
300
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
301
+ # HTTP header 'Content-Type'
302
+ content_type = @api_client.select_header_content_type(['application/json'])
303
+ if !content_type.nil?
304
+ header_params['Content-Type'] = content_type
305
+ end
306
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
307
+
308
+ # form parameters
309
+ form_params = opts[:form_params] || {}
310
+
311
+ # http body (model)
312
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user)
313
+
314
+ # return_type
315
+ return_type = opts[:debug_return_type] || 'StoredUser'
316
+
317
+ # auth_names
318
+ auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
319
+
320
+ new_options = opts.merge(
321
+ :operation => :"UserApi.update_user",
322
+ :header_params => header_params,
323
+ :query_params => query_params,
324
+ :form_params => form_params,
325
+ :body => post_body,
326
+ :auth_names => auth_names,
327
+ :return_type => return_type
328
+ )
329
+
330
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
333
+ end
334
+ return data, status_code, headers
335
+ end
336
+
337
+ # Lookup an existing user
338
+ # This **GET** endpoint is used to lookup whether a user with the provided email and first name exists in the MassPay system. <br> To use this endpoint, you need to provide the `email`, `first_name`, and `internal_user_id` as Query parameters in the URL. <br> The endpoint will then search for the user based on the provided information and return a JSON response indicating whether the user exists or not. If the user exists, the response will also contain the user's details, `user_token`, `first_name`, `last_name` and `internal_user_id`.
339
+ # @param email [String] User&#39;s email address. Required if First Name is provided
340
+ # @param first_name [String] User&#39;s first name. Required if email is provided
341
+ # @param internal_user_id [String] A client-defined identifier for the user. This is the unique ID assigned to the user on your system. Max 75 characters. Allows letters, numbers, and + , - . / _ ~ |. Required if email and first name are not provided
342
+ # @param [Hash] opts the optional parameters
343
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
344
+ # @return [FoundUser]
345
+ def user_lookup(email, first_name, internal_user_id, opts = {})
346
+ data, _status_code, _headers = user_lookup_with_http_info(email, first_name, internal_user_id, opts)
347
+ data
348
+ end
349
+
350
+ # Lookup an existing user
351
+ # This **GET** endpoint is used to lookup whether a user with the provided email and first name exists in the MassPay system. &lt;br&gt; To use this endpoint, you need to provide the &#x60;email&#x60;, &#x60;first_name&#x60;, and &#x60;internal_user_id&#x60; as Query parameters in the URL. &lt;br&gt; The endpoint will then search for the user based on the provided information and return a JSON response indicating whether the user exists or not. If the user exists, the response will also contain the user&#39;s details, &#x60;user_token&#x60;, &#x60;first_name&#x60;, &#x60;last_name&#x60; and &#x60;internal_user_id&#x60;.
352
+ # @param email [String] User&#39;s email address. Required if First Name is provided
353
+ # @param first_name [String] User&#39;s first name. Required if email is provided
354
+ # @param internal_user_id [String] A client-defined identifier for the user. This is the unique ID assigned to the user on your system. Max 75 characters. Allows letters, numbers, and + , - . / _ ~ |. Required if email and first name are not provided
355
+ # @param [Hash] opts the optional parameters
356
+ # @option opts [String] :idempotency_key Unique key to prevent duplicate processing
357
+ # @return [Array<(FoundUser, Integer, Hash)>] FoundUser data, response status code and response headers
358
+ def user_lookup_with_http_info(email, first_name, internal_user_id, opts = {})
359
+ if @api_client.config.debugging
360
+ @api_client.config.logger.debug 'Calling API: UserApi.user_lookup ...'
361
+ end
362
+ # verify the required parameter 'email' is set
363
+ if @api_client.config.client_side_validation && email.nil?
364
+ fail ArgumentError, "Missing the required parameter 'email' when calling UserApi.user_lookup"
365
+ end
366
+ # verify the required parameter 'first_name' is set
367
+ if @api_client.config.client_side_validation && first_name.nil?
368
+ fail ArgumentError, "Missing the required parameter 'first_name' when calling UserApi.user_lookup"
369
+ end
370
+ # verify the required parameter 'internal_user_id' is set
371
+ if @api_client.config.client_side_validation && internal_user_id.nil?
372
+ fail ArgumentError, "Missing the required parameter 'internal_user_id' when calling UserApi.user_lookup"
373
+ end
374
+ # resource path
375
+ local_var_path = '/user/lookup'
376
+
377
+ # query parameters
378
+ query_params = opts[:query_params] || {}
379
+ query_params[:'email'] = email
380
+ query_params[:'first_name'] = first_name
381
+ query_params[:'internal_user_id'] = internal_user_id
382
+
383
+ # header parameters
384
+ header_params = opts[:header_params] || {}
385
+ # HTTP header 'Accept' (if needed)
386
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
387
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+
392
+ # http body (model)
393
+ post_body = opts[:debug_body]
394
+
395
+ # return_type
396
+ return_type = opts[:debug_return_type] || 'FoundUser'
397
+
398
+ # auth_names
399
+ auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']
400
+
401
+ new_options = opts.merge(
402
+ :operation => :"UserApi.user_lookup",
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => return_type
409
+ )
410
+
411
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: UserApi#user_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+ end
418
+ end