ultracart_api 3.10.12 → 3.10.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -96
  3. data/docs/ChannelPartnerApi.md +51 -0
  4. data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
  5. data/docs/CustomerApi.md +5 -5
  6. data/docs/EmailDomain.md +1 -0
  7. data/docs/Mailgun.md +8 -0
  8. data/docs/StorefrontApi.md +101 -0
  9. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  10. data/lib/ultracart_api/api/customer_api.rb +6 -6
  11. data/lib/ultracart_api/api/storefront_api.rb +112 -0
  12. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  13. data/lib/ultracart_api/models/email_domain.rb +10 -1
  14. data/lib/ultracart_api/models/{payments_configuration_cash.rb → mailgun.rb} +8 -18
  15. data/lib/ultracart_api/version.rb +1 -1
  16. data/lib/ultracart_api.rb +2 -39
  17. metadata +6 -80
  18. data/docs/ConfigurationApi.md +0 -756
  19. data/docs/PaymentsConfiguration.md +0 -24
  20. data/docs/PaymentsConfigurationAffirm.md +0 -15
  21. data/docs/PaymentsConfigurationAmazon.md +0 -15
  22. data/docs/PaymentsConfigurationCOD.md +0 -13
  23. data/docs/PaymentsConfigurationCash.md +0 -9
  24. data/docs/PaymentsConfigurationCheck.md +0 -19
  25. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  26. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  27. data/docs/PaymentsConfigurationEcheck.md +0 -12
  28. data/docs/PaymentsConfigurationInsurance.md +0 -9
  29. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  30. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  31. data/docs/PaymentsConfigurationPayPal.md +0 -36
  32. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  33. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  34. data/docs/PaymentsConfigurationResponse.md +0 -12
  35. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  36. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  37. data/docs/PaymentsConfigurationSezzle.md +0 -15
  38. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  39. data/docs/PaymentsConfigurationWePay.md +0 -35
  40. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  41. data/docs/PaymentsThemeTransactionType.md +0 -10
  42. data/docs/PaymentsWepayEnroll.md +0 -22
  43. data/docs/RotatingTransactionGateway.md +0 -51
  44. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  45. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  46. data/docs/RtgCurrency.md +0 -10
  47. data/docs/RtgDayOfMonthRestriction.md +0 -9
  48. data/docs/RtgDayOfWeekRestriction.md +0 -10
  49. data/docs/RtgSummaryGateway.md +0 -24
  50. data/docs/RtgSummaryResponse.md +0 -14
  51. data/docs/RtgThemeRestriction.md +0 -10
  52. data/docs/StripeConnectResponse.md +0 -12
  53. data/docs/TransactionGateway.md +0 -71
  54. data/docs/TransactionGatewaysRequest.md +0 -10
  55. data/docs/TransactionGatewaysResponse.md +0 -12
  56. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  57. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  58. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  59. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  60. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  61. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  62. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  63. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  64. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  65. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  66. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  67. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  68. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  69. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  70. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  71. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  72. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  73. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  74. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  75. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  76. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  77. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  78. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  79. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  80. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  81. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  82. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  83. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  84. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  85. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  86. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  87. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  88. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  89. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  90. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  91. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  92. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,226 +0,0 @@
1
- =begin
2
- #UltraCart Rest API V2
3
-
4
- #UltraCart REST API Version 2
5
-
6
- OpenAPI spec version: 2.0.0
7
- Contact: support@ultracart.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module UltracartClient
16
- class PaymentsConfigurationEcheck
17
- # Master flag indicating this merchant accepts eChecks
18
- attr_accessor :accept_echeck
19
-
20
- # Optional Quickbooks accounting code
21
- attr_accessor :accounting_code
22
-
23
- # Optional Quickbooks deposit to account
24
- attr_accessor :deposit_to_account
25
-
26
- attr_accessor :restrictions
27
-
28
- # Test methods for this payment method
29
- attr_accessor :test_methods
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'accept_echeck' => :'accept_echeck',
35
- :'accounting_code' => :'accounting_code',
36
- :'deposit_to_account' => :'deposit_to_account',
37
- :'restrictions' => :'restrictions',
38
- :'test_methods' => :'test_methods'
39
- }
40
- end
41
-
42
- # Attribute type mapping.
43
- def self.swagger_types
44
- {
45
- :'accept_echeck' => :'BOOLEAN',
46
- :'accounting_code' => :'String',
47
- :'deposit_to_account' => :'String',
48
- :'restrictions' => :'PaymentsConfigurationRestrictions',
49
- :'test_methods' => :'Array<PaymentsConfigurationTestMethod>'
50
- }
51
- end
52
-
53
- # Initializes the object
54
- # @param [Hash] attributes Model attributes in the form of hash
55
- def initialize(attributes = {})
56
- return unless attributes.is_a?(Hash)
57
-
58
- # convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
-
61
- if attributes.has_key?(:'accept_echeck')
62
- self.accept_echeck = attributes[:'accept_echeck']
63
- end
64
-
65
- if attributes.has_key?(:'accounting_code')
66
- self.accounting_code = attributes[:'accounting_code']
67
- end
68
-
69
- if attributes.has_key?(:'deposit_to_account')
70
- self.deposit_to_account = attributes[:'deposit_to_account']
71
- end
72
-
73
- if attributes.has_key?(:'restrictions')
74
- self.restrictions = attributes[:'restrictions']
75
- end
76
-
77
- if attributes.has_key?(:'test_methods')
78
- if (value = attributes[:'test_methods']).is_a?(Array)
79
- self.test_methods = value
80
- end
81
- end
82
- end
83
-
84
- # Show invalid properties with the reasons. Usually used together with valid?
85
- # @return Array for valid properties with the reasons
86
- def list_invalid_properties
87
- invalid_properties = Array.new
88
- invalid_properties
89
- end
90
-
91
- # Check to see if the all the properties in the model are valid
92
- # @return true if the model is valid
93
- def valid?
94
- true
95
- end
96
-
97
- # Checks equality by comparing each attribute.
98
- # @param [Object] Object to be compared
99
- def ==(o)
100
- return true if self.equal?(o)
101
- self.class == o.class &&
102
- accept_echeck == o.accept_echeck &&
103
- accounting_code == o.accounting_code &&
104
- deposit_to_account == o.deposit_to_account &&
105
- restrictions == o.restrictions &&
106
- test_methods == o.test_methods
107
- end
108
-
109
- # @see the `==` method
110
- # @param [Object] Object to be compared
111
- def eql?(o)
112
- self == o
113
- end
114
-
115
- # Calculates hash code according to all attributes.
116
- # @return [Fixnum] Hash code
117
- def hash
118
- [accept_echeck, accounting_code, deposit_to_account, restrictions, test_methods].hash
119
- end
120
-
121
- # Builds the object from hash
122
- # @param [Hash] attributes Model attributes in the form of hash
123
- # @return [Object] Returns the model itself
124
- def build_from_hash(attributes)
125
- return nil unless attributes.is_a?(Hash)
126
- self.class.swagger_types.each_pair do |key, type|
127
- if type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the attribute
129
- # is documented as an array but the input is not
130
- if attributes[self.class.attribute_map[key]].is_a?(Array)
131
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
- end
133
- elsif !attributes[self.class.attribute_map[key]].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
- end # or else data not found in attributes(hash), not an issue as the data can be optional
136
- end
137
-
138
- self
139
- end
140
-
141
- # Deserializes the data based on type
142
- # @param string type Data type
143
- # @param string value Value to be deserialized
144
- # @return [Object] Deserialized data
145
- def _deserialize(type, value)
146
- case type.to_sym
147
- when :DateTime
148
- DateTime.parse(value)
149
- when :Date
150
- Date.parse(value)
151
- when :String
152
- value.to_s
153
- when :Integer
154
- value.to_i
155
- when :Float
156
- value.to_f
157
- when :BOOLEAN
158
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
- true
160
- else
161
- false
162
- end
163
- when :Object
164
- # generic object (usually a Hash), return directly
165
- value
166
- when /\AArray<(?<inner_type>.+)>\z/
167
- inner_type = Regexp.last_match[:inner_type]
168
- value.map { |v| _deserialize(inner_type, v) }
169
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
- k_type = Regexp.last_match[:k_type]
171
- v_type = Regexp.last_match[:v_type]
172
- {}.tap do |hash|
173
- value.each do |k, v|
174
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
- end
176
- end
177
- else # model
178
- temp_model = UltracartClient.const_get(type).new
179
- temp_model.build_from_hash(value)
180
- end
181
- end
182
-
183
- # Returns the string representation of the object
184
- # @return [String] String presentation of the object
185
- def to_s
186
- to_hash.to_s
187
- end
188
-
189
- # to_body is an alias to to_hash (backward compatibility)
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_body
192
- to_hash
193
- end
194
-
195
- # Returns the object in the form of hash
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_hash
198
- hash = {}
199
- self.class.attribute_map.each_pair do |attr, param|
200
- value = self.send(attr)
201
- next if value.nil?
202
- hash[param] = _to_hash(value)
203
- end
204
- hash
205
- end
206
-
207
- # Outputs non-array value in the form of hash
208
- # For object, use to_hash. Otherwise, just return the value
209
- # @param [Object] value Any valid value
210
- # @return [Hash] Returns the value in the form of hash
211
- def _to_hash(value)
212
- if value.is_a?(Array)
213
- value.compact.map { |v| _to_hash(v) }
214
- elsif value.is_a?(Hash)
215
- {}.tap do |hash|
216
- value.each { |k, v| hash[k] = _to_hash(v) }
217
- end
218
- elsif value.respond_to? :to_hash
219
- value.to_hash
220
- else
221
- value
222
- end
223
- end
224
-
225
- end
226
- end
@@ -1,194 +0,0 @@
1
- =begin
2
- #UltraCart Rest API V2
3
-
4
- #UltraCart REST API Version 2
5
-
6
- OpenAPI spec version: 2.0.0
7
- Contact: support@ultracart.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module UltracartClient
16
- class PaymentsConfigurationInsurance
17
- # Master flag indicating this merchant accepts insurance
18
- attr_accessor :accept_insurance
19
-
20
- attr_accessor :restrictions
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'accept_insurance' => :'accept_insurance',
26
- :'restrictions' => :'restrictions'
27
- }
28
- end
29
-
30
- # Attribute type mapping.
31
- def self.swagger_types
32
- {
33
- :'accept_insurance' => :'BOOLEAN',
34
- :'restrictions' => :'PaymentsConfigurationRestrictions'
35
- }
36
- end
37
-
38
- # Initializes the object
39
- # @param [Hash] attributes Model attributes in the form of hash
40
- def initialize(attributes = {})
41
- return unless attributes.is_a?(Hash)
42
-
43
- # convert string to symbol for hash key
44
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
-
46
- if attributes.has_key?(:'accept_insurance')
47
- self.accept_insurance = attributes[:'accept_insurance']
48
- end
49
-
50
- if attributes.has_key?(:'restrictions')
51
- self.restrictions = attributes[:'restrictions']
52
- end
53
- end
54
-
55
- # Show invalid properties with the reasons. Usually used together with valid?
56
- # @return Array for valid properties with the reasons
57
- def list_invalid_properties
58
- invalid_properties = Array.new
59
- invalid_properties
60
- end
61
-
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- true
66
- end
67
-
68
- # Checks equality by comparing each attribute.
69
- # @param [Object] Object to be compared
70
- def ==(o)
71
- return true if self.equal?(o)
72
- self.class == o.class &&
73
- accept_insurance == o.accept_insurance &&
74
- restrictions == o.restrictions
75
- end
76
-
77
- # @see the `==` method
78
- # @param [Object] Object to be compared
79
- def eql?(o)
80
- self == o
81
- end
82
-
83
- # Calculates hash code according to all attributes.
84
- # @return [Fixnum] Hash code
85
- def hash
86
- [accept_insurance, restrictions].hash
87
- end
88
-
89
- # Builds the object from hash
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- # @return [Object] Returns the model itself
92
- def build_from_hash(attributes)
93
- return nil unless attributes.is_a?(Hash)
94
- self.class.swagger_types.each_pair do |key, type|
95
- if type =~ /\AArray<(.*)>/i
96
- # check to ensure the input is an array given that the attribute
97
- # is documented as an array but the input is not
98
- if attributes[self.class.attribute_map[key]].is_a?(Array)
99
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
- end
101
- elsif !attributes[self.class.attribute_map[key]].nil?
102
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
- end # or else data not found in attributes(hash), not an issue as the data can be optional
104
- end
105
-
106
- self
107
- end
108
-
109
- # Deserializes the data based on type
110
- # @param string type Data type
111
- # @param string value Value to be deserialized
112
- # @return [Object] Deserialized data
113
- def _deserialize(type, value)
114
- case type.to_sym
115
- when :DateTime
116
- DateTime.parse(value)
117
- when :Date
118
- Date.parse(value)
119
- when :String
120
- value.to_s
121
- when :Integer
122
- value.to_i
123
- when :Float
124
- value.to_f
125
- when :BOOLEAN
126
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
- true
128
- else
129
- false
130
- end
131
- when :Object
132
- # generic object (usually a Hash), return directly
133
- value
134
- when /\AArray<(?<inner_type>.+)>\z/
135
- inner_type = Regexp.last_match[:inner_type]
136
- value.map { |v| _deserialize(inner_type, v) }
137
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
- k_type = Regexp.last_match[:k_type]
139
- v_type = Regexp.last_match[:v_type]
140
- {}.tap do |hash|
141
- value.each do |k, v|
142
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
- end
144
- end
145
- else # model
146
- temp_model = UltracartClient.const_get(type).new
147
- temp_model.build_from_hash(value)
148
- end
149
- end
150
-
151
- # Returns the string representation of the object
152
- # @return [String] String presentation of the object
153
- def to_s
154
- to_hash.to_s
155
- end
156
-
157
- # to_body is an alias to to_hash (backward compatibility)
158
- # @return [Hash] Returns the object in the form of hash
159
- def to_body
160
- to_hash
161
- end
162
-
163
- # Returns the object in the form of hash
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_hash
166
- hash = {}
167
- self.class.attribute_map.each_pair do |attr, param|
168
- value = self.send(attr)
169
- next if value.nil?
170
- hash[param] = _to_hash(value)
171
- end
172
- hash
173
- end
174
-
175
- # Outputs non-array value in the form of hash
176
- # For object, use to_hash. Otherwise, just return the value
177
- # @param [Object] value Any valid value
178
- # @return [Hash] Returns the value in the form of hash
179
- def _to_hash(value)
180
- if value.is_a?(Array)
181
- value.compact.map { |v| _to_hash(v) }
182
- elsif value.is_a?(Hash)
183
- {}.tap do |hash|
184
- value.each { |k, v| hash[k] = _to_hash(v) }
185
- end
186
- elsif value.respond_to? :to_hash
187
- value.to_hash
188
- else
189
- value
190
- end
191
- end
192
-
193
- end
194
- end
@@ -1,224 +0,0 @@
1
- =begin
2
- #UltraCart Rest API V2
3
-
4
- #UltraCart REST API Version 2
5
-
6
- OpenAPI spec version: 2.0.0
7
- Contact: support@ultracart.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module UltracartClient
16
- class PaymentsConfigurationLoanHero
17
- # Master flag indicating this merchant accepts Loan Hero
18
- attr_accessor :accept_loan_hero
19
-
20
- # Optional Quickbooks accounting code
21
- attr_accessor :accounting_code
22
-
23
- # Optional Quickbooks deposit to account
24
- attr_accessor :deposit_to_account
25
-
26
- attr_accessor :restrictions
27
-
28
- # Internal field to aid UI
29
- attr_accessor :show_loan_hero
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'accept_loan_hero' => :'accept_loan_hero',
35
- :'accounting_code' => :'accounting_code',
36
- :'deposit_to_account' => :'deposit_to_account',
37
- :'restrictions' => :'restrictions',
38
- :'show_loan_hero' => :'show_loan_hero'
39
- }
40
- end
41
-
42
- # Attribute type mapping.
43
- def self.swagger_types
44
- {
45
- :'accept_loan_hero' => :'BOOLEAN',
46
- :'accounting_code' => :'String',
47
- :'deposit_to_account' => :'String',
48
- :'restrictions' => :'PaymentsConfigurationRestrictions',
49
- :'show_loan_hero' => :'BOOLEAN'
50
- }
51
- end
52
-
53
- # Initializes the object
54
- # @param [Hash] attributes Model attributes in the form of hash
55
- def initialize(attributes = {})
56
- return unless attributes.is_a?(Hash)
57
-
58
- # convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
-
61
- if attributes.has_key?(:'accept_loan_hero')
62
- self.accept_loan_hero = attributes[:'accept_loan_hero']
63
- end
64
-
65
- if attributes.has_key?(:'accounting_code')
66
- self.accounting_code = attributes[:'accounting_code']
67
- end
68
-
69
- if attributes.has_key?(:'deposit_to_account')
70
- self.deposit_to_account = attributes[:'deposit_to_account']
71
- end
72
-
73
- if attributes.has_key?(:'restrictions')
74
- self.restrictions = attributes[:'restrictions']
75
- end
76
-
77
- if attributes.has_key?(:'show_loan_hero')
78
- self.show_loan_hero = attributes[:'show_loan_hero']
79
- end
80
- end
81
-
82
- # Show invalid properties with the reasons. Usually used together with valid?
83
- # @return Array for valid properties with the reasons
84
- def list_invalid_properties
85
- invalid_properties = Array.new
86
- invalid_properties
87
- end
88
-
89
- # Check to see if the all the properties in the model are valid
90
- # @return true if the model is valid
91
- def valid?
92
- true
93
- end
94
-
95
- # Checks equality by comparing each attribute.
96
- # @param [Object] Object to be compared
97
- def ==(o)
98
- return true if self.equal?(o)
99
- self.class == o.class &&
100
- accept_loan_hero == o.accept_loan_hero &&
101
- accounting_code == o.accounting_code &&
102
- deposit_to_account == o.deposit_to_account &&
103
- restrictions == o.restrictions &&
104
- show_loan_hero == o.show_loan_hero
105
- end
106
-
107
- # @see the `==` method
108
- # @param [Object] Object to be compared
109
- def eql?(o)
110
- self == o
111
- end
112
-
113
- # Calculates hash code according to all attributes.
114
- # @return [Fixnum] Hash code
115
- def hash
116
- [accept_loan_hero, accounting_code, deposit_to_account, restrictions, show_loan_hero].hash
117
- end
118
-
119
- # Builds the object from hash
120
- # @param [Hash] attributes Model attributes in the form of hash
121
- # @return [Object] Returns the model itself
122
- def build_from_hash(attributes)
123
- return nil unless attributes.is_a?(Hash)
124
- self.class.swagger_types.each_pair do |key, type|
125
- if type =~ /\AArray<(.*)>/i
126
- # check to ensure the input is an array given that the attribute
127
- # is documented as an array but the input is not
128
- if attributes[self.class.attribute_map[key]].is_a?(Array)
129
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
- end
131
- elsif !attributes[self.class.attribute_map[key]].nil?
132
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
- end # or else data not found in attributes(hash), not an issue as the data can be optional
134
- end
135
-
136
- self
137
- end
138
-
139
- # Deserializes the data based on type
140
- # @param string type Data type
141
- # @param string value Value to be deserialized
142
- # @return [Object] Deserialized data
143
- def _deserialize(type, value)
144
- case type.to_sym
145
- when :DateTime
146
- DateTime.parse(value)
147
- when :Date
148
- Date.parse(value)
149
- when :String
150
- value.to_s
151
- when :Integer
152
- value.to_i
153
- when :Float
154
- value.to_f
155
- when :BOOLEAN
156
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
- true
158
- else
159
- false
160
- end
161
- when :Object
162
- # generic object (usually a Hash), return directly
163
- value
164
- when /\AArray<(?<inner_type>.+)>\z/
165
- inner_type = Regexp.last_match[:inner_type]
166
- value.map { |v| _deserialize(inner_type, v) }
167
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
- k_type = Regexp.last_match[:k_type]
169
- v_type = Regexp.last_match[:v_type]
170
- {}.tap do |hash|
171
- value.each do |k, v|
172
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
- end
174
- end
175
- else # model
176
- temp_model = UltracartClient.const_get(type).new
177
- temp_model.build_from_hash(value)
178
- end
179
- end
180
-
181
- # Returns the string representation of the object
182
- # @return [String] String presentation of the object
183
- def to_s
184
- to_hash.to_s
185
- end
186
-
187
- # to_body is an alias to to_hash (backward compatibility)
188
- # @return [Hash] Returns the object in the form of hash
189
- def to_body
190
- to_hash
191
- end
192
-
193
- # Returns the object in the form of hash
194
- # @return [Hash] Returns the object in the form of hash
195
- def to_hash
196
- hash = {}
197
- self.class.attribute_map.each_pair do |attr, param|
198
- value = self.send(attr)
199
- next if value.nil?
200
- hash[param] = _to_hash(value)
201
- end
202
- hash
203
- end
204
-
205
- # Outputs non-array value in the form of hash
206
- # For object, use to_hash. Otherwise, just return the value
207
- # @param [Object] value Any valid value
208
- # @return [Hash] Returns the value in the form of hash
209
- def _to_hash(value)
210
- if value.is_a?(Array)
211
- value.compact.map { |v| _to_hash(v) }
212
- elsif value.is_a?(Hash)
213
- {}.tap do |hash|
214
- value.each { |k, v| hash[k] = _to_hash(v) }
215
- end
216
- elsif value.respond_to? :to_hash
217
- value.to_hash
218
- else
219
- value
220
- end
221
- end
222
-
223
- end
224
- end