atrium-ruby 1.3.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +5 -2
  3. data/README.md +132 -66
  4. data/Rakefile +7 -4
  5. data/atrium-ruby.gemspec +40 -32
  6. data/docs/Account.md +35 -0
  7. data/docs/AccountNumber.md +12 -0
  8. data/docs/AccountNumbersResponseBody.md +8 -0
  9. data/docs/AccountOwner.md +18 -0
  10. data/docs/AccountOwnersResponseBody.md +8 -0
  11. data/docs/AccountResponseBody.md +8 -0
  12. data/docs/AccountsApi.md +174 -0
  13. data/docs/AccountsResponseBody.md +9 -0
  14. data/docs/Challenge.md +13 -0
  15. data/docs/ChallengeOption.md +10 -0
  16. data/docs/ChallengesResponseBody.md +8 -0
  17. data/docs/ConnectWidget.md +9 -0
  18. data/docs/ConnectWidgetApi.md +44 -0
  19. data/docs/ConnectWidgetRequestBody.md +11 -0
  20. data/docs/ConnectWidgetResponseBody.md +8 -0
  21. data/docs/CredentialOption.md +9 -0
  22. data/docs/CredentialRequest.md +9 -0
  23. data/docs/CredentialResponse.md +12 -0
  24. data/docs/CredentialsResponseBody.md +8 -0
  25. data/docs/IdentityApi.md +82 -0
  26. data/docs/Institution.md +14 -0
  27. data/docs/InstitutionResponseBody.md +8 -0
  28. data/docs/InstitutionsApi.md +120 -0
  29. data/docs/InstitutionsResponseBody.md +9 -0
  30. data/docs/Member.md +18 -0
  31. data/docs/MemberConnectionStatus.md +16 -0
  32. data/docs/MemberConnectionStatusResponseBody.md +8 -0
  33. data/docs/MemberCreateRequest.md +11 -0
  34. data/docs/MemberCreateRequestBody.md +8 -0
  35. data/docs/MemberResponseBody.md +8 -0
  36. data/docs/MemberResumeRequest.md +8 -0
  37. data/docs/MemberResumeRequestBody.md +8 -0
  38. data/docs/MemberUpdateRequest.md +10 -0
  39. data/docs/MemberUpdateRequestBody.md +8 -0
  40. data/docs/MembersApi.md +487 -0
  41. data/docs/MembersResponseBody.md +9 -0
  42. data/docs/Pagination.md +11 -0
  43. data/docs/Transaction.md +38 -0
  44. data/docs/TransactionCleanseAndCategorizeRequest.md +11 -0
  45. data/docs/TransactionCleanseAndCategorizeResponse.md +20 -0
  46. data/docs/TransactionResponseBody.md +8 -0
  47. data/docs/TransactionsApi.md +126 -0
  48. data/docs/TransactionsCleanseAndCategorizeRequestBody.md +8 -0
  49. data/docs/TransactionsCleanseAndCategorizeResponseBody.md +8 -0
  50. data/docs/TransactionsResponseBody.md +9 -0
  51. data/docs/User.md +11 -0
  52. data/docs/UserCreateRequestBody.md +8 -0
  53. data/docs/UserResponseBody.md +8 -0
  54. data/docs/UserUpdateRequestBody.md +8 -0
  55. data/docs/UsersApi.md +193 -0
  56. data/docs/UsersResponseBody.md +9 -0
  57. data/docs/VerificationApi.md +120 -0
  58. data/git_push.sh +49 -0
  59. data/lib/atrium-ruby.rb +88 -0
  60. data/lib/atrium-ruby/api/accounts_api.rb +272 -0
  61. data/lib/atrium-ruby/api/atrium_client.rb +28 -0
  62. data/lib/atrium-ruby/api/connect_widget_api.rb +82 -0
  63. data/lib/atrium-ruby/api/identity_api.rb +140 -0
  64. data/lib/atrium-ruby/api/institutions_api.rb +181 -0
  65. data/lib/atrium-ruby/api/members_api.rb +749 -0
  66. data/lib/atrium-ruby/api/transactions_api.rb +198 -0
  67. data/lib/atrium-ruby/api/users_api.rb +287 -0
  68. data/lib/atrium-ruby/api/verification_api.rb +198 -0
  69. data/lib/atrium-ruby/api_client.rb +384 -0
  70. data/lib/atrium-ruby/api_error.rb +34 -0
  71. data/lib/atrium-ruby/configuration.rb +212 -0
  72. data/lib/atrium-ruby/models/account.rb +422 -0
  73. data/lib/atrium-ruby/models/account_number.rb +215 -0
  74. data/lib/atrium-ruby/models/account_numbers_response_body.rb +181 -0
  75. data/lib/atrium-ruby/models/account_owner.rb +269 -0
  76. data/lib/atrium-ruby/models/account_owners_response_body.rb +181 -0
  77. data/lib/atrium-ruby/models/account_response_body.rb +179 -0
  78. data/lib/atrium-ruby/models/accounts_response_body.rb +190 -0
  79. data/lib/atrium-ruby/models/challenge.rb +226 -0
  80. data/lib/atrium-ruby/models/challenge_option.rb +197 -0
  81. data/lib/atrium-ruby/models/challenges_response_body.rb +181 -0
  82. data/lib/atrium-ruby/models/connect_widget.rb +188 -0
  83. data/lib/atrium-ruby/models/connect_widget_request_body.rb +206 -0
  84. data/lib/atrium-ruby/models/connect_widget_response_body.rb +179 -0
  85. data/lib/atrium-ruby/models/credential_option.rb +188 -0
  86. data/lib/atrium-ruby/models/credential_request.rb +188 -0
  87. data/lib/atrium-ruby/models/credential_response.rb +217 -0
  88. data/lib/atrium-ruby/models/credentials_response_body.rb +181 -0
  89. data/lib/atrium-ruby/models/institution.rb +233 -0
  90. data/lib/atrium-ruby/models/institution_response_body.rb +179 -0
  91. data/lib/atrium-ruby/models/institutions_response_body.rb +190 -0
  92. data/lib/atrium-ruby/models/member.rb +269 -0
  93. data/lib/atrium-ruby/models/member_connection_status.rb +253 -0
  94. data/lib/atrium-ruby/models/member_connection_status_response_body.rb +179 -0
  95. data/lib/atrium-ruby/models/member_create_request.rb +218 -0
  96. data/lib/atrium-ruby/models/member_create_request_body.rb +179 -0
  97. data/lib/atrium-ruby/models/member_response_body.rb +179 -0
  98. data/lib/atrium-ruby/models/member_resume_request.rb +181 -0
  99. data/lib/atrium-ruby/models/member_resume_request_body.rb +179 -0
  100. data/lib/atrium-ruby/models/member_update_request.rb +199 -0
  101. data/lib/atrium-ruby/models/member_update_request_body.rb +179 -0
  102. data/lib/atrium-ruby/models/members_response_body.rb +190 -0
  103. data/lib/atrium-ruby/models/pagination.rb +206 -0
  104. data/lib/atrium-ruby/models/transaction.rb +449 -0
  105. data/lib/atrium-ruby/models/transaction_cleanse_and_categorize_request.rb +206 -0
  106. data/lib/atrium-ruby/models/transaction_cleanse_and_categorize_response.rb +287 -0
  107. data/lib/atrium-ruby/models/transaction_response_body.rb +179 -0
  108. data/lib/atrium-ruby/models/transactions_cleanse_and_categorize_request_body.rb +181 -0
  109. data/lib/atrium-ruby/models/transactions_cleanse_and_categorize_response_body.rb +181 -0
  110. data/lib/atrium-ruby/models/transactions_response_body.rb +190 -0
  111. data/lib/atrium-ruby/models/user.rb +206 -0
  112. data/lib/atrium-ruby/models/user_create_request_body.rb +179 -0
  113. data/lib/atrium-ruby/models/user_response_body.rb +179 -0
  114. data/lib/atrium-ruby/models/user_update_request_body.rb +179 -0
  115. data/lib/atrium-ruby/models/users_response_body.rb +190 -0
  116. data/lib/atrium-ruby/version.rb +11 -0
  117. data/spec/api/accounts_api_spec.rb +88 -0
  118. data/spec/api/connect_widget_api_spec.rb +43 -0
  119. data/spec/api/identity_api_spec.rb +56 -0
  120. data/spec/api/institutions_api_spec.rb +68 -0
  121. data/spec/api/members_api_spec.rb +195 -0
  122. data/spec/api/transactions_api_spec.rb +71 -0
  123. data/spec/api/users_api_spec.rb +92 -0
  124. data/spec/api/verification_api_spec.rb +69 -0
  125. data/spec/api_client_spec.rb +222 -0
  126. data/spec/configuration_spec.rb +38 -0
  127. data/spec/models/account_number_spec.rb +60 -0
  128. data/spec/models/account_numbers_response_body_spec.rb +36 -0
  129. data/spec/models/account_owner_spec.rb +96 -0
  130. data/spec/models/account_owners_response_body_spec.rb +36 -0
  131. data/spec/models/account_response_body_spec.rb +36 -0
  132. data/spec/models/account_spec.rb +198 -0
  133. data/spec/models/accounts_response_body_spec.rb +42 -0
  134. data/spec/models/challenge_option_spec.rb +48 -0
  135. data/spec/models/challenge_spec.rb +66 -0
  136. data/spec/models/challenges_response_body_spec.rb +36 -0
  137. data/spec/models/connect_widget_request_body_spec.rb +54 -0
  138. data/spec/models/connect_widget_response_body_spec.rb +36 -0
  139. data/spec/models/connect_widget_spec.rb +42 -0
  140. data/spec/models/credential_option_spec.rb +42 -0
  141. data/spec/models/credential_request_spec.rb +42 -0
  142. data/spec/models/credential_response_spec.rb +60 -0
  143. data/spec/models/credentials_response_body_spec.rb +36 -0
  144. data/spec/models/institution_response_body_spec.rb +36 -0
  145. data/spec/models/institution_spec.rb +72 -0
  146. data/spec/models/institutions_response_body_spec.rb +42 -0
  147. data/spec/models/member_connection_status_response_body_spec.rb +36 -0
  148. data/spec/models/member_connection_status_spec.rb +84 -0
  149. data/spec/models/member_create_request_body_spec.rb +36 -0
  150. data/spec/models/member_create_request_spec.rb +54 -0
  151. data/spec/models/member_response_body_spec.rb +36 -0
  152. data/spec/models/member_resume_request_body_spec.rb +36 -0
  153. data/spec/models/member_resume_request_spec.rb +36 -0
  154. data/spec/models/member_spec.rb +96 -0
  155. data/spec/models/member_update_request_body_spec.rb +36 -0
  156. data/spec/models/member_update_request_spec.rb +48 -0
  157. data/spec/models/members_response_body_spec.rb +42 -0
  158. data/spec/models/pagination_spec.rb +54 -0
  159. data/spec/models/transaction_cleanse_and_categorize_request_spec.rb +54 -0
  160. data/spec/models/transaction_cleanse_and_categorize_response_spec.rb +108 -0
  161. data/spec/models/transaction_response_body_spec.rb +36 -0
  162. data/spec/models/transaction_spec.rb +216 -0
  163. data/spec/models/transactions_cleanse_and_categorize_request_body_spec.rb +36 -0
  164. data/spec/models/transactions_cleanse_and_categorize_response_body_spec.rb +36 -0
  165. data/spec/models/transactions_response_body_spec.rb +42 -0
  166. data/spec/models/user_create_request_body_spec.rb +36 -0
  167. data/spec/models/user_response_body_spec.rb +36 -0
  168. data/spec/models/user_spec.rb +54 -0
  169. data/spec/models/user_update_request_body_spec.rb +36 -0
  170. data/spec/models/users_response_body_spec.rb +42 -0
  171. data/spec/spec_helper.rb +107 -0
  172. metadata +323 -91
  173. data/.gitignore +0 -10
  174. data/.rubocop.yml +0 -12
  175. data/.travis.yml +0 -12
  176. data/bin/console +0 -14
  177. data/bin/demo +0 -49
  178. data/bin/setup +0 -8
  179. data/examples/accounts_and_transactions.rb +0 -49
  180. data/examples/all_endpoints.rb +0 -226
  181. data/examples/example_workflow.rb +0 -176
  182. data/examples/multi_factor_authentication.rb +0 -57
  183. data/examples/update_credentials.rb +0 -58
  184. data/examples/user_and_member_creation.rb +0 -53
  185. data/lib/atrium.rb +0 -40
  186. data/lib/atrium/account.rb +0 -100
  187. data/lib/atrium/account_number.rb +0 -13
  188. data/lib/atrium/account_owner.rb +0 -19
  189. data/lib/atrium/challenge.rb +0 -13
  190. data/lib/atrium/client.rb +0 -51
  191. data/lib/atrium/connect.rb +0 -34
  192. data/lib/atrium/credential.rb +0 -11
  193. data/lib/atrium/error.rb +0 -4
  194. data/lib/atrium/institution.rb +0 -38
  195. data/lib/atrium/member.rb +0 -264
  196. data/lib/atrium/pageable.rb +0 -74
  197. data/lib/atrium/paginate.rb +0 -92
  198. data/lib/atrium/ruby.rb +0 -3
  199. data/lib/atrium/transaction.rb +0 -74
  200. data/lib/atrium/user.rb +0 -150
  201. data/lib/atrium/version.rb +0 -3
@@ -0,0 +1,198 @@
1
+ =begin
2
+ #MX API
3
+
4
+ #The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access.
5
+
6
+
7
+ =end
8
+
9
+ require 'uri'
10
+
11
+ module Atrium
12
+ class TransactionsApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+ # Categorize transactions
19
+ # Use this endpoint to categorize, cleanse, and classify transactions. These transactions are not persisted or stored on the MX platform.
20
+ # @param body User object to be created with optional parameters (amount, type) amd required parameters (description, identifier)
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [TransactionsCleanseAndCategorizeResponseBody]
23
+ def cleanse_and_categorize_transactions(body, opts = {})
24
+ data, _status_code, _headers = cleanse_and_categorize_transactions_with_http_info(body, opts)
25
+ data
26
+ end
27
+
28
+ # List transactions for a user
29
+ # Use this endpoint to get all transactions that belong to a specific user, across all the user's members and accounts.<br> This endpoint accepts optional query parameters, from_date and to_date, which filter transactions according to the date they were posted. If no values are given, from_date will default to 90 days prior to the request, and to_date will default to 5 days from the time of the request.
30
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
31
+ # @param [Hash] opts the optional parameters
32
+ # @option opts [Integer] :page Specify current page.
33
+ # @option opts [String] :from_date Filter transactions from this date.
34
+ # @option opts [Integer] :records_per_page Specify records per page.
35
+ # @option opts [String] :to_date Filter transactions to this date.
36
+ # @return [TransactionsResponseBody]
37
+ def list_user_transactions(user_guid, opts = {})
38
+ data, _status_code, _headers = list_user_transactions_with_http_info(user_guid, opts)
39
+ data
40
+ end
41
+
42
+ # Read a transaction
43
+ # This endpoint allows you to view information about a specific transaction that belongs to a user.<br>
44
+ # @param transaction_guid The unique identifier for a &#x60;transaction&#x60;.
45
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [TransactionResponseBody]
48
+ def read_transaction(transaction_guid, user_guid, opts = {})
49
+ data, _status_code, _headers = read_transaction_with_http_info(transaction_guid, user_guid, opts)
50
+ data
51
+ end
52
+
53
+
54
+ private
55
+
56
+ # Categorize transactions
57
+ # Use this endpoint to categorize, cleanse, and classify transactions. These transactions are not persisted or stored on the MX platform.
58
+ # @param body User object to be created with optional parameters (amount, type) amd required parameters (description, identifier)
59
+ # @param [Hash] opts the optional parameters
60
+ # @return [Array<(TransactionsCleanseAndCategorizeResponseBody, Fixnum, Hash)>] TransactionsCleanseAndCategorizeResponseBody data, response status code and response headers
61
+ def cleanse_and_categorize_transactions_with_http_info(body, opts = {})
62
+ if @api_client.config.debugging
63
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.cleanse_and_categorize_transactions ...'
64
+ end
65
+ # verify the required parameter 'body' is set
66
+ if @api_client.config.client_side_validation && body.nil?
67
+ fail ArgumentError, "Missing the required parameter 'body' when calling TransactionsApi.cleanse_and_categorize_transactions"
68
+ end
69
+ # resource path
70
+ local_var_path = '/cleanse_and_categorize'
71
+
72
+ # query parameters
73
+ query_params = {}
74
+
75
+ # header parameters
76
+ header_params = {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
79
+ # HTTP header 'Content-Type'
80
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
81
+
82
+ # form parameters
83
+ form_params = {}
84
+
85
+ # http body (model)
86
+ post_body = @api_client.object_to_http_body(body)
87
+ auth_names = ['apiKey', 'clientID']
88
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => 'TransactionsCleanseAndCategorizeResponseBody')
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug "API called: TransactionsApi#cleanse_and_categorize_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97
+ end
98
+ return data, status_code, headers
99
+ end
100
+ # List transactions for a user
101
+ # Use this endpoint to get all transactions that belong to a specific user, across all the user&#39;s members and accounts.&lt;br&gt; This endpoint accepts optional query parameters, from_date and to_date, which filter transactions according to the date they were posted. If no values are given, from_date will default to 90 days prior to the request, and to_date will default to 5 days from the time of the request.
102
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [Integer] :page Specify current page.
105
+ # @option opts [String] :from_date Filter transactions from this date.
106
+ # @option opts [Integer] :records_per_page Specify records per page.
107
+ # @option opts [String] :to_date Filter transactions to this date.
108
+ # @return [Array<(TransactionsResponseBody, Fixnum, Hash)>] TransactionsResponseBody data, response status code and response headers
109
+ def list_user_transactions_with_http_info(user_guid, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.list_user_transactions ...'
112
+ end
113
+ # verify the required parameter 'user_guid' is set
114
+ if @api_client.config.client_side_validation && user_guid.nil?
115
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling TransactionsApi.list_user_transactions"
116
+ end
117
+ # resource path
118
+ local_var_path = '/users/{user_guid}/transactions'.sub('{' + 'user_guid' + '}', user_guid.to_s)
119
+
120
+ # query parameters
121
+ query_params = {}
122
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
123
+ query_params[:'from_date'] = opts[:'from_date'] if !opts[:'from_date'].nil?
124
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
125
+ query_params[:'to_date'] = opts[:'to_date'] if !opts[:'to_date'].nil?
126
+
127
+ # header parameters
128
+ header_params = {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
131
+
132
+ # form parameters
133
+ form_params = {}
134
+
135
+ # http body (model)
136
+ post_body = nil
137
+ auth_names = ['apiKey', 'clientID']
138
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => 'TransactionsResponseBody')
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: TransactionsApi#list_user_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+ # Read a transaction
151
+ # This endpoint allows you to view information about a specific transaction that belongs to a user.&lt;br&gt;
152
+ # @param transaction_guid The unique identifier for a &#x60;transaction&#x60;.
153
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
154
+ # @param [Hash] opts the optional parameters
155
+ # @return [Array<(TransactionResponseBody, Fixnum, Hash)>] TransactionResponseBody data, response status code and response headers
156
+ def read_transaction_with_http_info(transaction_guid, user_guid, opts = {})
157
+ if @api_client.config.debugging
158
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.read_transaction ...'
159
+ end
160
+ # verify the required parameter 'transaction_guid' is set
161
+ if @api_client.config.client_side_validation && transaction_guid.nil?
162
+ fail ArgumentError, "Missing the required parameter 'transaction_guid' when calling TransactionsApi.read_transaction"
163
+ end
164
+ # verify the required parameter 'user_guid' is set
165
+ if @api_client.config.client_side_validation && user_guid.nil?
166
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling TransactionsApi.read_transaction"
167
+ end
168
+ # resource path
169
+ local_var_path = '/users/{user_guid}/transactions/{transaction_guid}'.sub('{' + 'transaction_guid' + '}', transaction_guid.to_s).sub('{' + 'user_guid' + '}', user_guid.to_s)
170
+
171
+ # query parameters
172
+ query_params = {}
173
+
174
+ # header parameters
175
+ header_params = {}
176
+ # HTTP header 'Accept' (if needed)
177
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
178
+
179
+ # form parameters
180
+ form_params = {}
181
+
182
+ # http body (model)
183
+ post_body = nil
184
+ auth_names = ['apiKey', 'clientID']
185
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
186
+ :header_params => header_params,
187
+ :query_params => query_params,
188
+ :form_params => form_params,
189
+ :body => post_body,
190
+ :auth_names => auth_names,
191
+ :return_type => 'TransactionResponseBody')
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug "API called: TransactionsApi#read_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
194
+ end
195
+ return data, status_code, headers
196
+ end
197
+ end
198
+ end
@@ -0,0 +1,287 @@
1
+ =begin
2
+ #MX API
3
+
4
+ #The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access.
5
+
6
+
7
+ =end
8
+
9
+ require 'uri'
10
+
11
+ module Atrium
12
+ class UsersApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+ # Create user
19
+ # Call this endpoint to create a new user. Atrium will respond with the newly-created user object if successful. This endpoint accepts several parameters: identifier, metadata, and is_disabled.<br> Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month's bill.
20
+ # @param body User object to be created with optional parameters (identifier, is_disabled, metadata)
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [UserResponseBody]
23
+ def create_user(body, opts = {})
24
+ data, _status_code, _headers = create_user_with_http_info(body, opts)
25
+ data
26
+ end
27
+
28
+ # Delete user
29
+ # Calling this endpoint will permanently delete a user from Atrium. If successful, the API will respond with Status: 204 No Content.
30
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [nil]
33
+ def delete_user(user_guid, opts = {})
34
+ delete_user_with_http_info(user_guid, opts)
35
+ nil
36
+ end
37
+
38
+ # List users
39
+ # Use this endpoint to list every user you've created in Atrium.
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [Integer] :page Specify current page.
42
+ # @option opts [Integer] :records_per_page Specify records per page.
43
+ # @return [UsersResponseBody]
44
+ def list_users(opts = {})
45
+ data, _status_code, _headers = list_users_with_http_info(opts)
46
+ data
47
+ end
48
+
49
+ # Read user
50
+ # Use this endpoint to read the attributes of a specific user.
51
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
52
+ # @param [Hash] opts the optional parameters
53
+ # @return [UserResponseBody]
54
+ def read_user(user_guid, opts = {})
55
+ data, _status_code, _headers = read_user_with_http_info(user_guid, opts)
56
+ data
57
+ end
58
+
59
+ # Update user
60
+ # Use this endpoint to update the attributes of a specific user. Atrium will respond with the updated user object.<br> Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month's bill.<br> To disable a user, update it and set the is_disabled parameter to true. Set it to false to re-enable the user.
61
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
62
+ # @param [Hash] opts the optional parameters
63
+ # @option opts [UserUpdateRequestBody] :body User object to be updated with optional parameters (identifier, is_disabled, metadata)
64
+ # @return [UserResponseBody]
65
+ def update_user(user_guid, opts = {})
66
+ data, _status_code, _headers = update_user_with_http_info(user_guid, opts)
67
+ data
68
+ end
69
+
70
+
71
+ private
72
+
73
+ # Create user
74
+ # Call this endpoint to create a new user. Atrium will respond with the newly-created user object if successful. This endpoint accepts several parameters: identifier, metadata, and is_disabled.&lt;br&gt; Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user&#39;s data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month&#39;s bill.
75
+ # @param body User object to be created with optional parameters (identifier, is_disabled, metadata)
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [Array<(UserResponseBody, Fixnum, Hash)>] UserResponseBody data, response status code and response headers
78
+ def create_user_with_http_info(body, opts = {})
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug 'Calling API: UsersApi.create_user ...'
81
+ end
82
+ # verify the required parameter 'body' is set
83
+ if @api_client.config.client_side_validation && body.nil?
84
+ fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.create_user"
85
+ end
86
+ # resource path
87
+ local_var_path = '/users'
88
+
89
+ # query parameters
90
+ query_params = {}
91
+
92
+ # header parameters
93
+ header_params = {}
94
+ # HTTP header 'Accept' (if needed)
95
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
96
+ # HTTP header 'Content-Type'
97
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
98
+
99
+ # form parameters
100
+ form_params = {}
101
+
102
+ # http body (model)
103
+ post_body = @api_client.object_to_http_body(body)
104
+ auth_names = ['apiKey', 'clientID']
105
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
106
+ :header_params => header_params,
107
+ :query_params => query_params,
108
+ :form_params => form_params,
109
+ :body => post_body,
110
+ :auth_names => auth_names,
111
+ :return_type => 'UserResponseBody')
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called: UsersApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
114
+ end
115
+ return data, status_code, headers
116
+ end
117
+ # Delete user
118
+ # Calling this endpoint will permanently delete a user from Atrium. If successful, the API will respond with Status: 204 No Content.
119
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
120
+ # @param [Hash] opts the optional parameters
121
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
122
+ def delete_user_with_http_info(user_guid, opts = {})
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...'
125
+ end
126
+ # verify the required parameter 'user_guid' is set
127
+ if @api_client.config.client_side_validation && user_guid.nil?
128
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.delete_user"
129
+ end
130
+ # resource path
131
+ local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s)
132
+
133
+ # query parameters
134
+ query_params = {}
135
+
136
+ # header parameters
137
+ header_params = {}
138
+ # HTTP header 'Accept' (if needed)
139
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
140
+
141
+ # form parameters
142
+ form_params = {}
143
+
144
+ # http body (model)
145
+ post_body = nil
146
+ auth_names = ['apiKey', 'clientID']
147
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
148
+ :header_params => header_params,
149
+ :query_params => query_params,
150
+ :form_params => form_params,
151
+ :body => post_body,
152
+ :auth_names => auth_names)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+ # List users
159
+ # Use this endpoint to list every user you&#39;ve created in Atrium.
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [Integer] :page Specify current page.
162
+ # @option opts [Integer] :records_per_page Specify records per page.
163
+ # @return [Array<(UsersResponseBody, Fixnum, Hash)>] UsersResponseBody data, response status code and response headers
164
+ def list_users_with_http_info(opts = {})
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug 'Calling API: UsersApi.list_users ...'
167
+ end
168
+ # resource path
169
+ local_var_path = '/users'
170
+
171
+ # query parameters
172
+ query_params = {}
173
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
174
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
175
+
176
+ # header parameters
177
+ header_params = {}
178
+ # HTTP header 'Accept' (if needed)
179
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
180
+
181
+ # form parameters
182
+ form_params = {}
183
+
184
+ # http body (model)
185
+ post_body = nil
186
+ auth_names = ['apiKey', 'clientID']
187
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
188
+ :header_params => header_params,
189
+ :query_params => query_params,
190
+ :form_params => form_params,
191
+ :body => post_body,
192
+ :auth_names => auth_names,
193
+ :return_type => 'UsersResponseBody')
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug "API called: UsersApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
196
+ end
197
+ return data, status_code, headers
198
+ end
199
+ # Read user
200
+ # Use this endpoint to read the attributes of a specific user.
201
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
202
+ # @param [Hash] opts the optional parameters
203
+ # @return [Array<(UserResponseBody, Fixnum, Hash)>] UserResponseBody data, response status code and response headers
204
+ def read_user_with_http_info(user_guid, opts = {})
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug 'Calling API: UsersApi.read_user ...'
207
+ end
208
+ # verify the required parameter 'user_guid' is set
209
+ if @api_client.config.client_side_validation && user_guid.nil?
210
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.read_user"
211
+ end
212
+ # resource path
213
+ local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s)
214
+
215
+ # query parameters
216
+ query_params = {}
217
+
218
+ # header parameters
219
+ header_params = {}
220
+ # HTTP header 'Accept' (if needed)
221
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
222
+
223
+ # form parameters
224
+ form_params = {}
225
+
226
+ # http body (model)
227
+ post_body = nil
228
+ auth_names = ['apiKey', 'clientID']
229
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
230
+ :header_params => header_params,
231
+ :query_params => query_params,
232
+ :form_params => form_params,
233
+ :body => post_body,
234
+ :auth_names => auth_names,
235
+ :return_type => 'UserResponseBody')
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: UsersApi#read_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+ # Update user
242
+ # Use this endpoint to update the attributes of a specific user. Atrium will respond with the updated user object.&lt;br&gt; Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user&#39;s data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month&#39;s bill.&lt;br&gt; To disable a user, update it and set the is_disabled parameter to true. Set it to false to re-enable the user.
243
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
244
+ # @param [Hash] opts the optional parameters
245
+ # @option opts [UserUpdateRequestBody] :body User object to be updated with optional parameters (identifier, is_disabled, metadata)
246
+ # @return [Array<(UserResponseBody, Fixnum, Hash)>] UserResponseBody data, response status code and response headers
247
+ def update_user_with_http_info(user_guid, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: UsersApi.update_user ...'
250
+ end
251
+ # verify the required parameter 'user_guid' is set
252
+ if @api_client.config.client_side_validation && user_guid.nil?
253
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.update_user"
254
+ end
255
+ # resource path
256
+ local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s)
257
+
258
+ # query parameters
259
+ query_params = {}
260
+
261
+ # header parameters
262
+ header_params = {}
263
+ # HTTP header 'Accept' (if needed)
264
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
265
+ # HTTP header 'Content-Type'
266
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
267
+
268
+ # form parameters
269
+ form_params = {}
270
+
271
+ # http body (model)
272
+ post_body = @api_client.object_to_http_body(opts[:'body'])
273
+ auth_names = ['apiKey', 'clientID']
274
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => 'UserResponseBody')
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
283
+ end
284
+ return data, status_code, headers
285
+ end
286
+ end
287
+ end