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,179 @@
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 'date'
10
+
11
+ module Atrium
12
+ class MemberResumeRequestBody
13
+ attr_accessor :member
14
+
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ :'member' => :'member'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.mx_types
24
+ {
25
+ :'member' => :'MemberResumeRequest'
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+
37
+ if attributes.has_key?(:'member')
38
+ self.member = attributes[:'member']
39
+ end
40
+ end
41
+
42
+ # Show invalid properties with the reasons. Usually used together with valid?
43
+ # @return Array for valid properties with the reasons
44
+ def list_invalid_properties
45
+ invalid_properties = Array.new
46
+ invalid_properties
47
+ end
48
+
49
+ # Check to see if the all the properties in the model are valid
50
+ # @return true if the model is valid
51
+ def valid?
52
+ true
53
+ end
54
+
55
+ # Checks equality by comparing each attribute.
56
+ # @param [Object] Object to be compared
57
+ def ==(o)
58
+ return true if self.equal?(o)
59
+ self.class == o.class &&
60
+ member == o.member
61
+ end
62
+
63
+ # @see the `==` method
64
+ # @param [Object] Object to be compared
65
+ def eql?(o)
66
+ self == o
67
+ end
68
+
69
+ # Calculates hash code according to all attributes.
70
+ # @return [Fixnum] Hash code
71
+ def hash
72
+ [member].hash
73
+ end
74
+
75
+ # Builds the object from hash
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ # @return [Object] Returns the model itself
78
+ def build_from_hash(attributes)
79
+ return nil unless attributes.is_a?(Hash)
80
+ self.class.mx_types.each_pair do |key, type|
81
+ if type =~ /\AArray<(.*)>/i
82
+ # check to ensure the input is an array given that the the attribute
83
+ # is documented as an array but the input is not
84
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
85
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
86
+ end
87
+ elsif !attributes[self.class.attribute_map[key]].nil?
88
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
89
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
90
+ end
91
+
92
+ self
93
+ end
94
+
95
+ # Deserializes the data based on type
96
+ # @param string type Data type
97
+ # @param string value Value to be deserialized
98
+ # @return [Object] Deserialized data
99
+ def _deserialize(type, value)
100
+ case type.to_sym
101
+ when :DateTime
102
+ DateTime.parse(value)
103
+ when :Date
104
+ Date.parse(value)
105
+ when :String
106
+ value.to_s
107
+ when :Integer
108
+ value.to_i
109
+ when :Float
110
+ value.to_f
111
+ when :BOOLEAN
112
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
113
+ true
114
+ else
115
+ false
116
+ end
117
+ when :Object
118
+ # generic object (usually a Hash), return directly
119
+ value
120
+ when /\AArray<(?<inner_type>.+)>\z/
121
+ inner_type = Regexp.last_match[:inner_type]
122
+ value.map { |v| _deserialize(inner_type, v) }
123
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
124
+ k_type = Regexp.last_match[:k_type]
125
+ v_type = Regexp.last_match[:v_type]
126
+ {}.tap do |hash|
127
+ value.each do |k, v|
128
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
129
+ end
130
+ end
131
+ else # model
132
+ temp_model = Atrium.const_get(type).new
133
+ temp_model.build_from_hash(value)
134
+ end
135
+ end
136
+
137
+ # Returns the string representation of the object
138
+ # @return [String] String presentation of the object
139
+ def to_s
140
+ to_hash.to_s
141
+ end
142
+
143
+ # to_body is an alias to to_hash (backward compatibility)
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_body
146
+ to_hash
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ next if value.nil?
156
+ hash[param] = _to_hash(value)
157
+ end
158
+ hash
159
+ end
160
+
161
+ # Outputs non-array value in the form of hash
162
+ # For object, use to_hash. Otherwise, just return the value
163
+ # @param [Object] value Any valid value
164
+ # @return [Hash] Returns the value in the form of hash
165
+ def _to_hash(value)
166
+ if value.is_a?(Array)
167
+ value.compact.map { |v| _to_hash(v) }
168
+ elsif value.is_a?(Hash)
169
+ {}.tap do |hash|
170
+ value.each { |k, v| hash[k] = _to_hash(v) }
171
+ end
172
+ elsif value.respond_to? :to_hash
173
+ value.to_hash
174
+ else
175
+ value
176
+ end
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,199 @@
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 'date'
10
+
11
+ module Atrium
12
+ class MemberUpdateRequest
13
+ attr_accessor :credentials
14
+
15
+ attr_accessor :identifier
16
+
17
+ attr_accessor :metadata
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'credentials' => :'credentials',
23
+ :'identifier' => :'identifier',
24
+ :'metadata' => :'metadata'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.mx_types
30
+ {
31
+ :'credentials' => :'Array<CredentialRequest>',
32
+ :'identifier' => :'String',
33
+ :'metadata' => :'String'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'credentials')
46
+ if (value = attributes[:'credentials']).is_a?(Array)
47
+ self.credentials = value
48
+ end
49
+ end
50
+
51
+ if attributes.has_key?(:'identifier')
52
+ self.identifier = attributes[:'identifier']
53
+ end
54
+
55
+ if attributes.has_key?(:'metadata')
56
+ self.metadata = attributes[:'metadata']
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ credentials == o.credentials &&
79
+ identifier == o.identifier &&
80
+ metadata == o.metadata
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [credentials, identifier, metadata].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.mx_types.each_pair do |key, type|
101
+ if type =~ /\AArray<(.*)>/i
102
+ # check to ensure the input is an array given that the the attribute
103
+ # is documented as an array but the input is not
104
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def _deserialize(type, value)
120
+ case type.to_sym
121
+ when :DateTime
122
+ DateTime.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :BOOLEAN
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+ when :Object
138
+ # generic object (usually a Hash), return directly
139
+ value
140
+ when /\AArray<(?<inner_type>.+)>\z/
141
+ inner_type = Regexp.last_match[:inner_type]
142
+ value.map { |v| _deserialize(inner_type, v) }
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
+ k_type = Regexp.last_match[:k_type]
145
+ v_type = Regexp.last_match[:v_type]
146
+ {}.tap do |hash|
147
+ value.each do |k, v|
148
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
+ end
150
+ end
151
+ else # model
152
+ temp_model = Atrium.const_get(type).new
153
+ temp_model.build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Outputs non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
185
+ def _to_hash(value)
186
+ if value.is_a?(Array)
187
+ value.compact.map { |v| _to_hash(v) }
188
+ elsif value.is_a?(Hash)
189
+ {}.tap do |hash|
190
+ value.each { |k, v| hash[k] = _to_hash(v) }
191
+ end
192
+ elsif value.respond_to? :to_hash
193
+ value.to_hash
194
+ else
195
+ value
196
+ end
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,179 @@
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 'date'
10
+
11
+ module Atrium
12
+ class MemberUpdateRequestBody
13
+ attr_accessor :member
14
+
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ :'member' => :'member'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.mx_types
24
+ {
25
+ :'member' => :'MemberUpdateRequest'
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+
37
+ if attributes.has_key?(:'member')
38
+ self.member = attributes[:'member']
39
+ end
40
+ end
41
+
42
+ # Show invalid properties with the reasons. Usually used together with valid?
43
+ # @return Array for valid properties with the reasons
44
+ def list_invalid_properties
45
+ invalid_properties = Array.new
46
+ invalid_properties
47
+ end
48
+
49
+ # Check to see if the all the properties in the model are valid
50
+ # @return true if the model is valid
51
+ def valid?
52
+ true
53
+ end
54
+
55
+ # Checks equality by comparing each attribute.
56
+ # @param [Object] Object to be compared
57
+ def ==(o)
58
+ return true if self.equal?(o)
59
+ self.class == o.class &&
60
+ member == o.member
61
+ end
62
+
63
+ # @see the `==` method
64
+ # @param [Object] Object to be compared
65
+ def eql?(o)
66
+ self == o
67
+ end
68
+
69
+ # Calculates hash code according to all attributes.
70
+ # @return [Fixnum] Hash code
71
+ def hash
72
+ [member].hash
73
+ end
74
+
75
+ # Builds the object from hash
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ # @return [Object] Returns the model itself
78
+ def build_from_hash(attributes)
79
+ return nil unless attributes.is_a?(Hash)
80
+ self.class.mx_types.each_pair do |key, type|
81
+ if type =~ /\AArray<(.*)>/i
82
+ # check to ensure the input is an array given that the the attribute
83
+ # is documented as an array but the input is not
84
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
85
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
86
+ end
87
+ elsif !attributes[self.class.attribute_map[key]].nil?
88
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
89
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
90
+ end
91
+
92
+ self
93
+ end
94
+
95
+ # Deserializes the data based on type
96
+ # @param string type Data type
97
+ # @param string value Value to be deserialized
98
+ # @return [Object] Deserialized data
99
+ def _deserialize(type, value)
100
+ case type.to_sym
101
+ when :DateTime
102
+ DateTime.parse(value)
103
+ when :Date
104
+ Date.parse(value)
105
+ when :String
106
+ value.to_s
107
+ when :Integer
108
+ value.to_i
109
+ when :Float
110
+ value.to_f
111
+ when :BOOLEAN
112
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
113
+ true
114
+ else
115
+ false
116
+ end
117
+ when :Object
118
+ # generic object (usually a Hash), return directly
119
+ value
120
+ when /\AArray<(?<inner_type>.+)>\z/
121
+ inner_type = Regexp.last_match[:inner_type]
122
+ value.map { |v| _deserialize(inner_type, v) }
123
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
124
+ k_type = Regexp.last_match[:k_type]
125
+ v_type = Regexp.last_match[:v_type]
126
+ {}.tap do |hash|
127
+ value.each do |k, v|
128
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
129
+ end
130
+ end
131
+ else # model
132
+ temp_model = Atrium.const_get(type).new
133
+ temp_model.build_from_hash(value)
134
+ end
135
+ end
136
+
137
+ # Returns the string representation of the object
138
+ # @return [String] String presentation of the object
139
+ def to_s
140
+ to_hash.to_s
141
+ end
142
+
143
+ # to_body is an alias to to_hash (backward compatibility)
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_body
146
+ to_hash
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ next if value.nil?
156
+ hash[param] = _to_hash(value)
157
+ end
158
+ hash
159
+ end
160
+
161
+ # Outputs non-array value in the form of hash
162
+ # For object, use to_hash. Otherwise, just return the value
163
+ # @param [Object] value Any valid value
164
+ # @return [Hash] Returns the value in the form of hash
165
+ def _to_hash(value)
166
+ if value.is_a?(Array)
167
+ value.compact.map { |v| _to_hash(v) }
168
+ elsif value.is_a?(Hash)
169
+ {}.tap do |hash|
170
+ value.each { |k, v| hash[k] = _to_hash(v) }
171
+ end
172
+ elsif value.respond_to? :to_hash
173
+ value.to_hash
174
+ else
175
+ value
176
+ end
177
+ end
178
+ end
179
+ end