atrium-ruby 2.8.3 → 2.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -2
  3. data/docs/AccountNumber.md +2 -0
  4. data/docs/ConnectWidgetRequestBody.md +3 -0
  5. data/docs/Member.md +1 -0
  6. data/docs/MemberCreateRequest.md +4 -1
  7. data/docs/MembersApi.md +44 -0
  8. data/docs/MerchantLocation.md +17 -0
  9. data/docs/MerchantLocationResponseBody.md +8 -0
  10. data/docs/MerchantLocationsResponseBody.md +9 -0
  11. data/docs/MerchantsApi.md +107 -2
  12. data/docs/MerchantsResponseBody.md +9 -0
  13. data/docs/TransactionCleanseAndCategorizeRequest.md +1 -0
  14. data/docs/TransactionCleanseAndCategorizeResponse.md +3 -0
  15. data/lib/atrium-ruby.rb +4 -0
  16. data/lib/atrium-ruby/api/members_api.rb +64 -0
  17. data/lib/atrium-ruby/api/merchants_api.rb +156 -0
  18. data/lib/atrium-ruby/models/account_number.rb +19 -1
  19. data/lib/atrium-ruby/models/connect_widget_request_body.rb +28 -1
  20. data/lib/atrium-ruby/models/member.rb +10 -1
  21. data/lib/atrium-ruby/models/member_create_request.rb +31 -9
  22. data/lib/atrium-ruby/models/merchant_location.rb +260 -0
  23. data/lib/atrium-ruby/models/merchant_location_response_body.rb +179 -0
  24. data/lib/atrium-ruby/models/merchant_locations_response_body.rb +190 -0
  25. data/lib/atrium-ruby/models/merchants_response_body.rb +190 -0
  26. data/lib/atrium-ruby/models/transaction_cleanse_and_categorize_request.rb +10 -1
  27. data/lib/atrium-ruby/models/transaction_cleanse_and_categorize_response.rb +31 -4
  28. data/lib/atrium-ruby/version.rb +1 -1
  29. data/spec/api/members_api_spec.rb +15 -0
  30. data/spec/api/merchants_api_spec.rb +36 -0
  31. data/spec/models/account_number_spec.rb +12 -0
  32. data/spec/models/connect_widget_request_body_spec.rb +18 -0
  33. data/spec/models/member_create_request_spec.rb +18 -0
  34. data/spec/models/member_spec.rb +6 -0
  35. data/spec/models/merchant_location_response_body_spec.rb +36 -0
  36. data/spec/models/merchant_location_spec.rb +90 -0
  37. data/spec/models/merchant_locations_response_body_spec.rb +42 -0
  38. data/spec/models/merchants_response_body_spec.rb +42 -0
  39. data/spec/models/transaction_cleanse_and_categorize_request_spec.rb +6 -0
  40. data/spec/models/transaction_cleanse_and_categorize_response_spec.rb +18 -0
  41. metadata +18 -2
@@ -0,0 +1,190 @@
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 MerchantsResponseBody
13
+ attr_accessor :merchants
14
+
15
+ attr_accessor :pagination
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'merchants' => :'merchants',
21
+ :'pagination' => :'pagination'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.mx_types
27
+ {
28
+ :'merchants' => :'Array<Merchant>',
29
+ :'pagination' => :'Pagination'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'merchants')
42
+ if (value = attributes[:'merchants']).is_a?(Array)
43
+ self.merchants = value
44
+ end
45
+ end
46
+
47
+ if attributes.has_key?(:'pagination')
48
+ self.pagination = attributes[:'pagination']
49
+ end
50
+ end
51
+
52
+ # Show invalid properties with the reasons. Usually used together with valid?
53
+ # @return Array for valid properties with the reasons
54
+ def list_invalid_properties
55
+ invalid_properties = Array.new
56
+ invalid_properties
57
+ end
58
+
59
+ # Check to see if the all the properties in the model are valid
60
+ # @return true if the model is valid
61
+ def valid?
62
+ true
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ merchants == o.merchants &&
71
+ pagination == o.pagination
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Fixnum] Hash code
82
+ def hash
83
+ [merchants, pagination].hash
84
+ end
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+ self.class.mx_types.each_pair do |key, type|
92
+ if type =~ /\AArray<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Deserializes the data based on type
107
+ # @param string type Data type
108
+ # @param string value Value to be deserialized
109
+ # @return [Object] Deserialized data
110
+ def _deserialize(type, value)
111
+ case type.to_sym
112
+ when :DateTime
113
+ DateTime.parse(value)
114
+ when :Date
115
+ Date.parse(value)
116
+ when :String
117
+ value.to_s
118
+ when :Integer
119
+ value.to_i
120
+ when :Float
121
+ value.to_f
122
+ when :BOOLEAN
123
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
124
+ true
125
+ else
126
+ false
127
+ end
128
+ when :Object
129
+ # generic object (usually a Hash), return directly
130
+ value
131
+ when /\AArray<(?<inner_type>.+)>\z/
132
+ inner_type = Regexp.last_match[:inner_type]
133
+ value.map { |v| _deserialize(inner_type, v) }
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
+ k_type = Regexp.last_match[:k_type]
136
+ v_type = Regexp.last_match[:v_type]
137
+ {}.tap do |hash|
138
+ value.each do |k, v|
139
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
140
+ end
141
+ end
142
+ else # model
143
+ temp_model = Atrium.const_get(type).new
144
+ temp_model.build_from_hash(value)
145
+ end
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_hash (backward compatibility)
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_body
157
+ to_hash
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ next if value.nil?
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map { |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+ end
190
+ end
@@ -16,6 +16,8 @@ module Atrium
16
16
 
17
17
  attr_accessor :identifier
18
18
 
19
+ attr_accessor :merchant_category_code
20
+
19
21
  attr_accessor :type
20
22
 
21
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -24,6 +26,7 @@ module Atrium
24
26
  :'amount' => :'amount',
25
27
  :'description' => :'description',
26
28
  :'identifier' => :'identifier',
29
+ :'merchant_category_code' => :'merchant_category_code',
27
30
  :'type' => :'type'
28
31
  }
29
32
  end
@@ -34,6 +37,7 @@ module Atrium
34
37
  :'amount' => :'Float',
35
38
  :'description' => :'String',
36
39
  :'identifier' => :'String',
40
+ :'merchant_category_code' => :'Float',
37
41
  :'type' => :'String'
38
42
  }
39
43
  end
@@ -58,6 +62,10 @@ module Atrium
58
62
  self.identifier = attributes[:'identifier']
59
63
  end
60
64
 
65
+ if attributes.has_key?(:'merchant_category_code')
66
+ self.merchant_category_code = attributes[:'merchant_category_code']
67
+ end
68
+
61
69
  if attributes.has_key?(:'type')
62
70
  self.type = attributes[:'type']
63
71
  end
@@ -84,6 +92,7 @@ module Atrium
84
92
  amount == o.amount &&
85
93
  description == o.description &&
86
94
  identifier == o.identifier &&
95
+ merchant_category_code == o.merchant_category_code &&
87
96
  type == o.type
88
97
  end
89
98
 
@@ -96,7 +105,7 @@ module Atrium
96
105
  # Calculates hash code according to all attributes.
97
106
  # @return [Fixnum] Hash code
98
107
  def hash
99
- [amount, description, identifier, type].hash
108
+ [amount, description, identifier, merchant_category_code, type].hash
100
109
  end
101
110
 
102
111
  # Builds the object from hash
@@ -36,6 +36,12 @@ module Atrium
36
36
 
37
37
  attr_accessor :is_payroll_advance
38
38
 
39
+ attr_accessor :merchant_category_code
40
+
41
+ attr_accessor :merchant_guid
42
+
43
+ attr_accessor :original_description
44
+
39
45
  # Attribute mapping from ruby-style variable name to JSON key.
40
46
  def self.attribute_map
41
47
  {
@@ -51,7 +57,10 @@ module Atrium
51
57
  :'is_income' => :'is_income',
52
58
  :'is_international' => :'is_international',
53
59
  :'is_overdraft_fee' => :'is_overdraft_fee',
54
- :'is_payroll_advance' => :'is_payroll_advance'
60
+ :'is_payroll_advance' => :'is_payroll_advance',
61
+ :'merchant_category_code' => :'merchant_category_code',
62
+ :'merchant_guid' => :'merchant_guid',
63
+ :'original_description' => :'original_description'
55
64
  }
56
65
  end
57
66
 
@@ -70,7 +79,10 @@ module Atrium
70
79
  :'is_income' => :'BOOLEAN',
71
80
  :'is_international' => :'BOOLEAN',
72
81
  :'is_overdraft_fee' => :'BOOLEAN',
73
- :'is_payroll_advance' => :'BOOLEAN'
82
+ :'is_payroll_advance' => :'BOOLEAN',
83
+ :'merchant_category_code' => :'Float',
84
+ :'merchant_guid' => :'String',
85
+ :'original_description' => :'String'
74
86
  }
75
87
  end
76
88
 
@@ -133,6 +145,18 @@ module Atrium
133
145
  if attributes.has_key?(:'is_payroll_advance')
134
146
  self.is_payroll_advance = attributes[:'is_payroll_advance']
135
147
  end
148
+
149
+ if attributes.has_key?(:'merchant_category_code')
150
+ self.merchant_category_code = attributes[:'merchant_category_code']
151
+ end
152
+
153
+ if attributes.has_key?(:'merchant_guid')
154
+ self.merchant_guid = attributes[:'merchant_guid']
155
+ end
156
+
157
+ if attributes.has_key?(:'original_description')
158
+ self.original_description = attributes[:'original_description']
159
+ end
136
160
  end
137
161
 
138
162
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -165,7 +189,10 @@ module Atrium
165
189
  is_income == o.is_income &&
166
190
  is_international == o.is_international &&
167
191
  is_overdraft_fee == o.is_overdraft_fee &&
168
- is_payroll_advance == o.is_payroll_advance
192
+ is_payroll_advance == o.is_payroll_advance &&
193
+ merchant_category_code == o.merchant_category_code &&
194
+ merchant_guid == o.merchant_guid &&
195
+ original_description == o.original_description
169
196
  end
170
197
 
171
198
  # @see the `==` method
@@ -177,7 +204,7 @@ module Atrium
177
204
  # Calculates hash code according to all attributes.
178
205
  # @return [Fixnum] Hash code
179
206
  def hash
180
- [amount, category, description, identifier, type, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance].hash
207
+ [amount, category, description, identifier, type, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, merchant_category_code, merchant_guid, original_description].hash
181
208
  end
182
209
 
183
210
  # Builds the object from hash
@@ -7,5 +7,5 @@
7
7
  =end
8
8
 
9
9
  module Atrium
10
- VERSION = '2.8.3'
10
+ VERSION = '2.10.1'
11
11
  end
@@ -190,6 +190,21 @@ describe 'MembersApi' do
190
190
  end
191
191
  end
192
192
 
193
+ # unit tests for read_o_auth_window_uri
194
+ # Read OAuth Window URI
195
+ # This endpoint will generate an &#x60;oauth_window_uri&#x60; for the specified &#x60;member&#x60;.
196
+ # @param member_guid The unique identifier for a &#x60;member&#x60;.
197
+ # @param user_guid The unique identifier for a &#x60;user&#x60;.
198
+ # @param [Hash] opts the optional parameters
199
+ # @option opts [String] :referral_source Should be either BROWSER or APP depending on the implementation.
200
+ # @option opts [String] :ui_message_webview_url_scheme A scheme for routing the user back to the application state they were previously in.
201
+ # @return [MemberResponseBody]
202
+ describe 'read_o_auth_window_uri test' do
203
+ it 'should work' do
204
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
205
+ end
206
+ end
207
+
193
208
  # unit tests for resume_member
194
209
  # Resume aggregation from MFA
195
210
  # This endpoint answers the challenges needed when a member has been challenged by multi-factor authentication.
@@ -27,6 +27,29 @@ describe 'MerchantsApi' do
27
27
  end
28
28
  end
29
29
 
30
+ # unit tests for list_merchant_locations
31
+ # List merchant locations
32
+ # Returns a list of all the merchant locations associated with a merchant, including physical location, latitude, longitude, etc.
33
+ # @param merchant_guid The unique identifier for a &#x60;merchant&#x60;.
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [MerchantLocationsResponseBody]
36
+ describe 'list_merchant_locations test' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
39
+ end
40
+ end
41
+
42
+ # unit tests for list_merchants
43
+ # List merchants
44
+ # Returns a list of merchnants.
45
+ # @param [Hash] opts the optional parameters
46
+ # @return [MerchantsResponseBody]
47
+ describe 'list_merchants test' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
30
53
  # unit tests for read_merchant
31
54
  # Read merchant
32
55
  # Returns information about a particular merchant, such as a logo, name, and website.
@@ -39,4 +62,17 @@ describe 'MerchantsApi' do
39
62
  end
40
63
  end
41
64
 
65
+ # unit tests for read_merchant_location
66
+ # Read merchant location
67
+ # Retuns a specific location associated with a merchant, including physical location, latitude, longitude, etc.
68
+ # @param merchant_guid The unique identifier for a &#x60;merchant&#x60;.
69
+ # @param merchant_location_guid The unique identifier for a &#x60;merchant_location&#x60;.
70
+ # @param [Hash] opts the optional parameters
71
+ # @return [MerchantLocationResponseBody]
72
+ describe 'read_merchant_location test' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
75
+ end
76
+ end
77
+
42
78
  end
@@ -39,6 +39,12 @@ describe 'AccountNumber' do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'test attribute "institution_number"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
42
48
  describe 'test attribute "member_guid"' do
43
49
  it 'should work' do
44
50
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -51,6 +57,12 @@ describe 'AccountNumber' do
51
57
  end
52
58
  end
53
59
 
60
+ describe 'test attribute "transit_number"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
63
+ end
64
+ end
65
+
54
66
  describe 'test attribute "user_guid"' do
55
67
  it 'should work' do
56
68
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -45,12 +45,30 @@ describe 'ConnectWidgetRequestBody' do
45
45
  end
46
46
  end
47
47
 
48
+ describe 'test attribute "disable_institution_search"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "mode"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
+ end
58
+ end
59
+
48
60
  describe 'test attribute "ui_message_version"' do
49
61
  it 'should work' do
50
62
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
63
  end
52
64
  end
53
65
 
66
+ describe 'test attribute "ui_message_webview_url_scheme"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
69
+ end
70
+ end
71
+
54
72
  describe 'test attribute "update_credentials"' do
55
73
  it 'should work' do
56
74
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers