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,9 @@
1
+ # Atrium::UsersResponseBody
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **users** | [**Array<User>**](User.md) | | [optional]
7
+ **pagination** | [**Pagination**](Pagination.md) | | [optional]
8
+
9
+
@@ -0,0 +1,120 @@
1
+ # Atrium::VerificationApi
2
+
3
+ Method | HTTP request | Description
4
+ ------------- | ------------- | -------------
5
+ [**list_account_numbers**](VerificationApi.md#list_account_numbers) | **GET** /users/{user_guid}/members/{member_guid}/account_numbers | Read account numbers
6
+ [**list_account_numbers_by_account**](VerificationApi.md#list_account_numbers_by_account) | **GET** /users/{user_guid}/accounts/{account_guid}/account_numbers | Read account numbers by account GUID
7
+ [**verify_member**](VerificationApi.md#verify_member) | **POST** /users/{user_guid}/members/{member_guid}/verify | Verify
8
+
9
+
10
+ # **list_account_numbers**
11
+ > AccountNumbersResponseBody list_account_numbers(member_guid, user_guid)
12
+
13
+ Read account numbers
14
+
15
+ Use this endpoint to check whether account and routing numbers are available for accounts associated with a particular member. It returns the account_numbers object, which contains account and routing number data for each account associated with the member.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'atrium-ruby'
21
+
22
+ client = Atrium::AtriumClient.new("YOUR_API_KEY", "YOUR_CLIENT_ID")
23
+
24
+ member_guid = "MBR-123" # String | The unique identifier for a `member`.
25
+ user_guid = "USR-123" # String | The unique identifier for a `user`.
26
+
27
+ begin
28
+ #Read account numbers
29
+ response = client.verification.list_account_numbers(member_guid, user_guid)
30
+ p response
31
+ rescue Atrium::ApiError => e
32
+ puts "Exception when calling VerificationApi->list_account_numbers: #{e}"
33
+ end
34
+ ```
35
+
36
+ ### Parameters
37
+
38
+ Name | Type | Description | Notes
39
+ ------------- | ------------- | ------------- | -------------
40
+ **member_guid** | **String**| The unique identifier for a `member`. |
41
+ **user_guid** | **String**| The unique identifier for a `user`. |
42
+
43
+ ### Return type
44
+
45
+ [**AccountNumbersResponseBody**](AccountNumbersResponseBody.md)
46
+
47
+ # **list_account_numbers_by_account**
48
+ > AccountNumbersResponseBody list_account_numbers_by_account(account_guid, user_guid)
49
+
50
+ Read account numbers by account GUID
51
+
52
+ Use this endpoint to check whether account and routing numbers are available for a specific account. It returns the account_numbers object, which contains account and routing number data.
53
+
54
+ ### Example
55
+ ```ruby
56
+ # load the gem
57
+ require 'atrium-ruby'
58
+
59
+ client = Atrium::AtriumClient.new("YOUR_API_KEY", "YOUR_CLIENT_ID")
60
+
61
+ account_guid = "ACT-123" # String | The unique identifier for an `account`.
62
+ user_guid = "USR-123" # String | The unique identifier for a `user`.
63
+
64
+ begin
65
+ #Read account numbers by account GUID
66
+ response = client.verification.list_account_numbers_by_account(account_guid, user_guid)
67
+ p response
68
+ rescue Atrium::ApiError => e
69
+ puts "Exception when calling VerificationApi->list_account_numbers_by_account: #{e}"
70
+ end
71
+ ```
72
+
73
+ ### Parameters
74
+
75
+ Name | Type | Description | Notes
76
+ ------------- | ------------- | ------------- | -------------
77
+ **account_guid** | **String**| The unique identifier for an `account`. |
78
+ **user_guid** | **String**| The unique identifier for a `user`. |
79
+
80
+ ### Return type
81
+
82
+ [**AccountNumbersResponseBody**](AccountNumbersResponseBody.md)
83
+
84
+ # **verify_member**
85
+ > MemberResponseBody verify_member(member_guid, user_guid)
86
+
87
+ Verify
88
+
89
+ The verify endpoint begins a verification process for a member.
90
+
91
+ ### Example
92
+ ```ruby
93
+ # load the gem
94
+ require 'atrium-ruby'
95
+
96
+ client = Atrium::AtriumClient.new("YOUR_API_KEY", "YOUR_CLIENT_ID")
97
+
98
+ member_guid = "MBR-123" # String | The unique identifier for a `member`.
99
+ user_guid = "USR-123" # String | The unique identifier for a `user`.
100
+
101
+ begin
102
+ #Verify
103
+ response = client.verification.verify_member(member_guid, user_guid)
104
+ p response
105
+ rescue Atrium::ApiError => e
106
+ puts "Exception when calling VerificationApi->verify_member: #{e}"
107
+ end
108
+ ```
109
+
110
+ ### Parameters
111
+
112
+ Name | Type | Description | Notes
113
+ ------------- | ------------- | ------------- | -------------
114
+ **member_guid** | **String**| The unique identifier for a `member`. |
115
+ **user_guid** | **String**| The unique identifier for a `user`. |
116
+
117
+ ### Return type
118
+
119
+ [**MemberResponseBody**](MemberResponseBody.md)
120
+
@@ -0,0 +1,49 @@
1
+ #!/bin/sh
2
+ #
3
+
4
+ git_user_id=$1
5
+ git_repo_id=$2
6
+ release_note=$3
7
+
8
+ if [ "$git_user_id" = "" ]; then
9
+ git_user_id="GIT_USER_ID"
10
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
11
+ fi
12
+
13
+ if [ "$git_repo_id" = "" ]; then
14
+ git_repo_id="GIT_REPO_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
16
+ fi
17
+
18
+ if [ "$release_note" = "" ]; then
19
+ release_note="Minor update"
20
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
21
+ fi
22
+
23
+ # Initialize the local directory as a Git repository
24
+ git init
25
+
26
+ # Adds the files in the local repository and stages them for commit.
27
+ git add .
28
+
29
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
30
+ git commit -m "$release_note"
31
+
32
+ # Sets the new remote
33
+ git_remote=`git remote`
34
+ if [ "$git_remote" = "" ]; then # git remote not defined
35
+
36
+ if [ "$GIT_TOKEN" = "" ]; then
37
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
38
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
39
+ else
40
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
41
+ fi
42
+
43
+ fi
44
+
45
+ git pull origin master
46
+
47
+ # Pushes (Forces) the changes in the local repository up to the remote repository
48
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
49
+ git push origin master 2>&1 | grep -v 'To https'
@@ -0,0 +1,88 @@
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
+ # Common files
10
+ require 'atrium-ruby/api_client'
11
+ require 'atrium-ruby/api_error'
12
+ require 'atrium-ruby/version'
13
+ require 'atrium-ruby/configuration'
14
+
15
+ # Models
16
+ require 'atrium-ruby/models/account'
17
+ require 'atrium-ruby/models/account_number'
18
+ require 'atrium-ruby/models/account_numbers_response_body'
19
+ require 'atrium-ruby/models/account_owner'
20
+ require 'atrium-ruby/models/account_owners_response_body'
21
+ require 'atrium-ruby/models/account_response_body'
22
+ require 'atrium-ruby/models/accounts_response_body'
23
+ require 'atrium-ruby/models/challenge'
24
+ require 'atrium-ruby/models/challenge_option'
25
+ require 'atrium-ruby/models/challenges_response_body'
26
+ require 'atrium-ruby/models/connect_widget'
27
+ require 'atrium-ruby/models/connect_widget_request_body'
28
+ require 'atrium-ruby/models/connect_widget_response_body'
29
+ require 'atrium-ruby/models/credential_option'
30
+ require 'atrium-ruby/models/credential_request'
31
+ require 'atrium-ruby/models/credential_response'
32
+ require 'atrium-ruby/models/credentials_response_body'
33
+ require 'atrium-ruby/models/institution'
34
+ require 'atrium-ruby/models/institution_response_body'
35
+ require 'atrium-ruby/models/institutions_response_body'
36
+ require 'atrium-ruby/models/member'
37
+ require 'atrium-ruby/models/member_connection_status'
38
+ require 'atrium-ruby/models/member_connection_status_response_body'
39
+ require 'atrium-ruby/models/member_create_request'
40
+ require 'atrium-ruby/models/member_create_request_body'
41
+ require 'atrium-ruby/models/member_response_body'
42
+ require 'atrium-ruby/models/member_resume_request'
43
+ require 'atrium-ruby/models/member_resume_request_body'
44
+ require 'atrium-ruby/models/member_update_request'
45
+ require 'atrium-ruby/models/member_update_request_body'
46
+ require 'atrium-ruby/models/members_response_body'
47
+ require 'atrium-ruby/models/pagination'
48
+ require 'atrium-ruby/models/transaction'
49
+ require 'atrium-ruby/models/transaction_cleanse_and_categorize_request'
50
+ require 'atrium-ruby/models/transaction_cleanse_and_categorize_response'
51
+ require 'atrium-ruby/models/transaction_response_body'
52
+ require 'atrium-ruby/models/transactions_cleanse_and_categorize_request_body'
53
+ require 'atrium-ruby/models/transactions_cleanse_and_categorize_response_body'
54
+ require 'atrium-ruby/models/transactions_response_body'
55
+ require 'atrium-ruby/models/user'
56
+ require 'atrium-ruby/models/user_create_request_body'
57
+ require 'atrium-ruby/models/user_response_body'
58
+ require 'atrium-ruby/models/user_update_request_body'
59
+ require 'atrium-ruby/models/users_response_body'
60
+
61
+ # APIs
62
+ require 'atrium-ruby/api/accounts_api'
63
+ require 'atrium-ruby/api/connect_widget_api'
64
+ require 'atrium-ruby/api/identity_api'
65
+ require 'atrium-ruby/api/institutions_api'
66
+ require 'atrium-ruby/api/members_api'
67
+ require 'atrium-ruby/api/transactions_api'
68
+ require 'atrium-ruby/api/users_api'
69
+ require 'atrium-ruby/api/verification_api'
70
+ require 'atrium-ruby/api/atrium_client'
71
+
72
+ module Atrium
73
+ class << self
74
+ # Customize default settings for the SDK using block.
75
+ # Atrium.configure do |config|
76
+ # config.username = "xxx"
77
+ # config.password = "xxx"
78
+ # end
79
+ # If no block given, return the default Configuration object.
80
+ def configure
81
+ if block_given?
82
+ yield(Configuration.default)
83
+ else
84
+ Configuration.default
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,272 @@
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 AccountsApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+ # List account transactions
19
+ # This endpoint allows you to see every transaction that belongs to a specific account. The default from_date is 90 days prior to the request, and the default to_date is 5 days from the time of the request.<br> The from_date and to_date parameters can optionally be appended to the request.
20
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
21
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
22
+ # @param [Hash] opts the optional parameters
23
+ # @option opts [String] :from_date Filter transactions from this date.
24
+ # @option opts [String] :to_date Filter transactions to this date.
25
+ # @option opts [Integer] :page Specify current page.
26
+ # @option opts [Integer] :records_per_page Specify records per page.
27
+ # @return [TransactionsResponseBody]
28
+ def list_account_transactions(account_guid, user_guid, opts = {})
29
+ data, _status_code, _headers = list_account_transactions_with_http_info(account_guid, user_guid, opts)
30
+ data
31
+ end
32
+
33
+ # List accounts for a user
34
+ # Use this endpoint to view information about every account that belongs to a user. You'll need the user's GUID to access this list. The information will include the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the account balance, the date the account was started, etc.
35
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [Integer] :page Specify current page.
38
+ # @option opts [Integer] :records_per_page Specify records per page.
39
+ # @return [AccountsResponseBody]
40
+ def list_user_accounts(user_guid, opts = {})
41
+ data, _status_code, _headers = list_user_accounts_with_http_info(user_guid, opts)
42
+ data
43
+ end
44
+
45
+ # Read an account
46
+ # Reading an account allows you to get information about a specific account that belongs to a user. That includes the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the balance, the date the account was started, and much more.<br> There are two endpoints for reading an account. Both will return the same information.<br> It's important to remember that balance and available_balance will normally be positive numbers — for all account types. But this should be interpreted differently for debt accounts and asset accounts.<br> An asset account, e.g., CHECKING, SAVINGS, or INVESTMENT, will have a positive balance unless it is in an overdraft condition, in which case the balance will be negative.<br> On the other hand, a debt account, e.g., CREDIT CARD, LOAN, MORTGAGE, would have a positivebalance when the user owes money on the account. It would have a negative balance if the account has been overpaid.
47
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
48
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
49
+ # @param [Hash] opts the optional parameters
50
+ # @return [AccountResponseBody]
51
+ def read_account(account_guid, user_guid, opts = {})
52
+ data, _status_code, _headers = read_account_with_http_info(account_guid, user_guid, opts)
53
+ data
54
+ end
55
+
56
+ # Read an account
57
+ # Reading an account allows you to get information about a specific account that belongs to a user. That includes the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the balance, the date the account was started, and much more.<br> There are two endpoints for reading an account. Both will return the same information.<br> It's important to remember that balance and available_balance will normally be positive numbers — for all account types. But this should be interpreted differently for debt accounts and asset accounts.<br> An asset account, e.g., CHECKING, SAVINGS, or INVESTMENT, will have a positive balance unless it is in an overdraft condition, in which case the balance will be negative.<br> On the other hand, a debt account, e.g., CREDIT CARD, LOAN, MORTGAGE, would have a positivebalance when the user owes money on the account. It would have a negative balance if the account has been overpaid.
58
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
59
+ # @param member_guid The unique identifier for a &#x60;member&#x60;.
60
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
61
+ # @param [Hash] opts the optional parameters
62
+ # @return [AccountResponseBody]
63
+ def read_account_by_member_guid(account_guid, member_guid, user_guid, opts = {})
64
+ data, _status_code, _headers = read_account_by_member_guid_with_http_info(account_guid, member_guid, user_guid, opts)
65
+ data
66
+ end
67
+
68
+
69
+ private
70
+
71
+ # List account transactions
72
+ # This endpoint allows you to see every transaction that belongs to a specific account. The default from_date is 90 days prior to the request, and the default to_date is 5 days from the time of the request.&lt;br&gt; The from_date and to_date parameters can optionally be appended to the request.
73
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
74
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
75
+ # @param [Hash] opts the optional parameters
76
+ # @option opts [String] :from_date Filter transactions from this date.
77
+ # @option opts [String] :to_date Filter transactions to this date.
78
+ # @option opts [Integer] :page Specify current page.
79
+ # @option opts [Integer] :records_per_page Specify records per page.
80
+ # @return [Array<(TransactionsResponseBody, Fixnum, Hash)>] TransactionsResponseBody data, response status code and response headers
81
+ def list_account_transactions_with_http_info(account_guid, user_guid, opts = {})
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug 'Calling API: AccountsApi.list_account_transactions ...'
84
+ end
85
+ # verify the required parameter 'account_guid' is set
86
+ if @api_client.config.client_side_validation && account_guid.nil?
87
+ fail ArgumentError, "Missing the required parameter 'account_guid' when calling AccountsApi.list_account_transactions"
88
+ end
89
+ # verify the required parameter 'user_guid' is set
90
+ if @api_client.config.client_side_validation && user_guid.nil?
91
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling AccountsApi.list_account_transactions"
92
+ end
93
+ # resource path
94
+ local_var_path = '/users/{user_guid}/accounts/{account_guid}/transactions'.sub('{' + 'account_guid' + '}', account_guid.to_s).sub('{' + 'user_guid' + '}', user_guid.to_s)
95
+
96
+ # query parameters
97
+ query_params = {}
98
+ query_params[:'from_date'] = opts[:'from_date'] if !opts[:'from_date'].nil?
99
+ query_params[:'to_date'] = opts[:'to_date'] if !opts[:'to_date'].nil?
100
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
101
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
102
+
103
+ # header parameters
104
+ header_params = {}
105
+ # HTTP header 'Accept' (if needed)
106
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
107
+
108
+ # form parameters
109
+ form_params = {}
110
+
111
+ # http body (model)
112
+ post_body = nil
113
+ auth_names = ['apiKey', 'clientID']
114
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
115
+ :header_params => header_params,
116
+ :query_params => query_params,
117
+ :form_params => form_params,
118
+ :body => post_body,
119
+ :auth_names => auth_names,
120
+ :return_type => 'TransactionsResponseBody')
121
+ if @api_client.config.debugging
122
+ @api_client.config.logger.debug "API called: AccountsApi#list_account_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
123
+ end
124
+ return data, status_code, headers
125
+ end
126
+ # List accounts for a user
127
+ # Use this endpoint to view information about every account that belongs to a user. You&#39;ll need the user&#39;s GUID to access this list. The information will include the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the account balance, the date the account was started, etc.
128
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
129
+ # @param [Hash] opts the optional parameters
130
+ # @option opts [Integer] :page Specify current page.
131
+ # @option opts [Integer] :records_per_page Specify records per page.
132
+ # @return [Array<(AccountsResponseBody, Fixnum, Hash)>] AccountsResponseBody data, response status code and response headers
133
+ def list_user_accounts_with_http_info(user_guid, opts = {})
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug 'Calling API: AccountsApi.list_user_accounts ...'
136
+ end
137
+ # verify the required parameter 'user_guid' is set
138
+ if @api_client.config.client_side_validation && user_guid.nil?
139
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling AccountsApi.list_user_accounts"
140
+ end
141
+ # resource path
142
+ local_var_path = '/users/{user_guid}/accounts'.sub('{' + 'user_guid' + '}', user_guid.to_s)
143
+
144
+ # query parameters
145
+ query_params = {}
146
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
147
+ query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil?
148
+
149
+ # header parameters
150
+ header_params = {}
151
+ # HTTP header 'Accept' (if needed)
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
153
+
154
+ # form parameters
155
+ form_params = {}
156
+
157
+ # http body (model)
158
+ post_body = nil
159
+ auth_names = ['apiKey', 'clientID']
160
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
161
+ :header_params => header_params,
162
+ :query_params => query_params,
163
+ :form_params => form_params,
164
+ :body => post_body,
165
+ :auth_names => auth_names,
166
+ :return_type => 'AccountsResponseBody')
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug "API called: AccountsApi#list_user_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
169
+ end
170
+ return data, status_code, headers
171
+ end
172
+ # Read an account
173
+ # Reading an account allows you to get information about a specific account that belongs to a user. That includes the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the balance, the date the account was started, and much more.&lt;br&gt; There are two endpoints for reading an account. Both will return the same information.&lt;br&gt; It&#39;s important to remember that balance and available_balance will normally be positive numbers — for all account types. But this should be interpreted differently for debt accounts and asset accounts.&lt;br&gt; An asset account, e.g., CHECKING, SAVINGS, or INVESTMENT, will have a positive balance unless it is in an overdraft condition, in which case the balance will be negative.&lt;br&gt; On the other hand, a debt account, e.g., CREDIT CARD, LOAN, MORTGAGE, would have a positivebalance when the user owes money on the account. It would have a negative balance if the account has been overpaid.
174
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
175
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
176
+ # @param [Hash] opts the optional parameters
177
+ # @return [Array<(AccountResponseBody, Fixnum, Hash)>] AccountResponseBody data, response status code and response headers
178
+ def read_account_with_http_info(account_guid, user_guid, opts = {})
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug 'Calling API: AccountsApi.read_account ...'
181
+ end
182
+ # verify the required parameter 'account_guid' is set
183
+ if @api_client.config.client_side_validation && account_guid.nil?
184
+ fail ArgumentError, "Missing the required parameter 'account_guid' when calling AccountsApi.read_account"
185
+ end
186
+ # verify the required parameter 'user_guid' is set
187
+ if @api_client.config.client_side_validation && user_guid.nil?
188
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling AccountsApi.read_account"
189
+ end
190
+ # resource path
191
+ local_var_path = '/users/{user_guid}/accounts/{account_guid}'.sub('{' + 'account_guid' + '}', account_guid.to_s).sub('{' + 'user_guid' + '}', user_guid.to_s)
192
+
193
+ # query parameters
194
+ query_params = {}
195
+
196
+ # header parameters
197
+ header_params = {}
198
+ # HTTP header 'Accept' (if needed)
199
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
200
+
201
+ # form parameters
202
+ form_params = {}
203
+
204
+ # http body (model)
205
+ post_body = nil
206
+ auth_names = ['apiKey', 'clientID']
207
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
208
+ :header_params => header_params,
209
+ :query_params => query_params,
210
+ :form_params => form_params,
211
+ :body => post_body,
212
+ :auth_names => auth_names,
213
+ :return_type => 'AccountResponseBody')
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "API called: AccountsApi#read_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ return data, status_code, headers
218
+ end
219
+ # Read an account
220
+ # Reading an account allows you to get information about a specific account that belongs to a user. That includes the account type — e.g., CHECKING, MONEY_MARKET, or PROPERTY — the balance, the date the account was started, and much more.&lt;br&gt; There are two endpoints for reading an account. Both will return the same information.&lt;br&gt; It&#39;s important to remember that balance and available_balance will normally be positive numbers — for all account types. But this should be interpreted differently for debt accounts and asset accounts.&lt;br&gt; An asset account, e.g., CHECKING, SAVINGS, or INVESTMENT, will have a positive balance unless it is in an overdraft condition, in which case the balance will be negative.&lt;br&gt; On the other hand, a debt account, e.g., CREDIT CARD, LOAN, MORTGAGE, would have a positivebalance when the user owes money on the account. It would have a negative balance if the account has been overpaid.
221
+ # @param account_guid The unique identifier for an &#x60;account&#x60;.
222
+ # @param member_guid The unique identifier for a &#x60;member&#x60;.
223
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
224
+ # @param [Hash] opts the optional parameters
225
+ # @return [Array<(AccountResponseBody, Fixnum, Hash)>] AccountResponseBody data, response status code and response headers
226
+ def read_account_by_member_guid_with_http_info(account_guid, member_guid, user_guid, opts = {})
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug 'Calling API: AccountsApi.read_account_by_member_guid ...'
229
+ end
230
+ # verify the required parameter 'account_guid' is set
231
+ if @api_client.config.client_side_validation && account_guid.nil?
232
+ fail ArgumentError, "Missing the required parameter 'account_guid' when calling AccountsApi.read_account_by_member_guid"
233
+ end
234
+ # verify the required parameter 'member_guid' is set
235
+ if @api_client.config.client_side_validation && member_guid.nil?
236
+ fail ArgumentError, "Missing the required parameter 'member_guid' when calling AccountsApi.read_account_by_member_guid"
237
+ end
238
+ # verify the required parameter 'user_guid' is set
239
+ if @api_client.config.client_side_validation && user_guid.nil?
240
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling AccountsApi.read_account_by_member_guid"
241
+ end
242
+ # resource path
243
+ local_var_path = '/users/{user_guid}/members/{member_guid}/accounts/{account_guid}'.sub('{' + 'account_guid' + '}', account_guid.to_s).sub('{' + 'member_guid' + '}', member_guid.to_s).sub('{' + 'user_guid' + '}', user_guid.to_s)
244
+
245
+ # query parameters
246
+ query_params = {}
247
+
248
+ # header parameters
249
+ header_params = {}
250
+ # HTTP header 'Accept' (if needed)
251
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json'])
252
+
253
+ # form parameters
254
+ form_params = {}
255
+
256
+ # http body (model)
257
+ post_body = nil
258
+ auth_names = ['apiKey', 'clientID']
259
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
260
+ :header_params => header_params,
261
+ :query_params => query_params,
262
+ :form_params => form_params,
263
+ :body => post_body,
264
+ :auth_names => auth_names,
265
+ :return_type => 'AccountResponseBody')
266
+ if @api_client.config.debugging
267
+ @api_client.config.logger.debug "API called: AccountsApi#read_account_by_member_guid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
268
+ end
269
+ return data, status_code, headers
270
+ end
271
+ end
272
+ end