ultracart_api 3.3.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -4
  3. data/docs/ConfigurationApi.md +756 -0
  4. data/docs/DelayAutoOrdersResponse.md +12 -0
  5. data/docs/PaymentsConfiguration.md +23 -0
  6. data/docs/PaymentsConfigurationAffirm.md +15 -0
  7. data/docs/PaymentsConfigurationAmazon.md +15 -0
  8. data/docs/PaymentsConfigurationCOD.md +13 -0
  9. data/docs/PaymentsConfigurationCash.md +9 -0
  10. data/docs/PaymentsConfigurationCheck.md +25 -0
  11. data/docs/PaymentsConfigurationCreditCard.md +16 -0
  12. data/docs/PaymentsConfigurationLoanHero.md +12 -0
  13. data/docs/PaymentsConfigurationPayPal.md +36 -0
  14. data/docs/PaymentsConfigurationPurchaseOrder.md +11 -0
  15. data/docs/PaymentsConfigurationQuoteRequest.md +10 -0
  16. data/docs/PaymentsConfigurationResponse.md +12 -0
  17. data/docs/PaymentsConfigurationRestrictions.md +19 -0
  18. data/docs/PaymentsConfigurationSezzle.md +15 -0
  19. data/docs/PaymentsConfigurationWePay.md +35 -0
  20. data/docs/PaymentsConfigurationWireTransfer.md +18 -0
  21. data/docs/PaymentsThemeTransactionType.md +10 -0
  22. data/docs/PaymentsWepayEnroll.md +22 -0
  23. data/docs/RotatingTransactionGateway.md +50 -0
  24. data/docs/RtgCurrency.md +10 -0
  25. data/docs/RtgDayOfMonthRestriction.md +9 -0
  26. data/docs/RtgDayOfWeekRestriction.md +10 -0
  27. data/docs/RtgThemeRestriction.md +10 -0
  28. data/docs/StripeConnectResponse.md +12 -0
  29. data/docs/TransactionGateway.md +71 -0
  30. data/docs/TransactionGatewaysRequest.md +10 -0
  31. data/docs/TransactionGatewaysResponse.md +12 -0
  32. data/lib/ultracart_api.rb +29 -0
  33. data/lib/ultracart_api/api/configuration_api.rb +843 -0
  34. data/lib/ultracart_api/models/delay_auto_orders_response.rb +221 -0
  35. data/lib/ultracart_api/models/payments_configuration.rb +319 -0
  36. data/lib/ultracart_api/models/payments_configuration_affirm.rb +247 -0
  37. data/lib/ultracart_api/models/payments_configuration_amazon.rb +247 -0
  38. data/lib/ultracart_api/models/payments_configuration_cash.rb +193 -0
  39. data/lib/ultracart_api/models/payments_configuration_check.rb +337 -0
  40. data/lib/ultracart_api/models/payments_configuration_cod.rb +229 -0
  41. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +256 -0
  42. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +220 -0
  43. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +436 -0
  44. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +211 -0
  45. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +202 -0
  46. data/lib/ultracart_api/models/payments_configuration_response.rb +221 -0
  47. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +283 -0
  48. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +247 -0
  49. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +427 -0
  50. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +274 -0
  51. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +239 -0
  52. data/lib/ultracart_api/models/payments_wepay_enroll.rb +310 -0
  53. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +665 -0
  54. data/lib/ultracart_api/models/rtg_currency.rb +205 -0
  55. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +195 -0
  56. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +205 -0
  57. data/lib/ultracart_api/models/rtg_theme_restriction.rb +239 -0
  58. data/lib/ultracart_api/models/stripe_connect_response.rb +221 -0
  59. data/lib/ultracart_api/models/transaction_gateway.rb +823 -0
  60. data/lib/ultracart_api/models/transaction_gateways_request.rb +242 -0
  61. data/lib/ultracart_api/models/transaction_gateways_response.rb +223 -0
  62. data/lib/ultracart_api/version.rb +1 -1
  63. metadata +60 -2
@@ -0,0 +1,220 @@
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
+ attr_accessor :accept_loan_hero
18
+
19
+ attr_accessor :loan_hero_accounting_code
20
+
21
+ attr_accessor :loan_hero_deposit_to_account
22
+
23
+ attr_accessor :restrictions
24
+
25
+ attr_accessor :show_loan_hero
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'accept_loan_hero' => :'acceptLoanHero',
31
+ :'loan_hero_accounting_code' => :'loanHeroAccountingCode',
32
+ :'loan_hero_deposit_to_account' => :'loanHeroDepositToAccount',
33
+ :'restrictions' => :'restrictions',
34
+ :'show_loan_hero' => :'showLoanHero'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'accept_loan_hero' => :'BOOLEAN',
42
+ :'loan_hero_accounting_code' => :'String',
43
+ :'loan_hero_deposit_to_account' => :'String',
44
+ :'restrictions' => :'PaymentsConfigurationRestrictions',
45
+ :'show_loan_hero' => :'BOOLEAN'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'acceptLoanHero')
58
+ self.accept_loan_hero = attributes[:'acceptLoanHero']
59
+ end
60
+
61
+ if attributes.has_key?(:'loanHeroAccountingCode')
62
+ self.loan_hero_accounting_code = attributes[:'loanHeroAccountingCode']
63
+ end
64
+
65
+ if attributes.has_key?(:'loanHeroDepositToAccount')
66
+ self.loan_hero_deposit_to_account = attributes[:'loanHeroDepositToAccount']
67
+ end
68
+
69
+ if attributes.has_key?(:'restrictions')
70
+ self.restrictions = attributes[:'restrictions']
71
+ end
72
+
73
+ if attributes.has_key?(:'showLoanHero')
74
+ self.show_loan_hero = attributes[:'showLoanHero']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ accept_loan_hero == o.accept_loan_hero &&
97
+ loan_hero_accounting_code == o.loan_hero_accounting_code &&
98
+ loan_hero_deposit_to_account == o.loan_hero_deposit_to_account &&
99
+ restrictions == o.restrictions &&
100
+ show_loan_hero == o.show_loan_hero
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [accept_loan_hero, loan_hero_accounting_code, loan_hero_deposit_to_account, restrictions, show_loan_hero].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = UltracartClient.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+ end
@@ -0,0 +1,436 @@
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 PaymentsConfigurationPayPal
17
+ attr_accessor :accept_pay_pal
18
+
19
+ attr_accessor :paypal_accounting_code
20
+
21
+ attr_accessor :paypal_api_password
22
+
23
+ attr_accessor :paypal_api_user_name
24
+
25
+ attr_accessor :paypal_certificate_on_file
26
+
27
+ attr_accessor :paypal_deposit_to_account
28
+
29
+ attr_accessor :paypal_email
30
+
31
+ attr_accessor :paypal_environment
32
+
33
+ attr_accessor :paypal_header_image_url
34
+
35
+ attr_accessor :paypal_hide_bill_me_later
36
+
37
+ attr_accessor :paypal_hide_express_checkout_on_view_cart
38
+
39
+ attr_accessor :paypal_hide_for_unshipped_orders
40
+
41
+ attr_accessor :paypal_hold_in_ar
42
+
43
+ attr_accessor :paypal_landing_page
44
+
45
+ attr_accessor :paypal_mode
46
+
47
+ attr_accessor :paypal_private_key_password
48
+
49
+ attr_accessor :paypal_processing_fee
50
+
51
+ attr_accessor :paypal_processing_perc
52
+
53
+ attr_accessor :paypal_send_recurring
54
+
55
+ attr_accessor :paypal_show_card_logos_not_directly_supported
56
+
57
+ attr_accessor :paypal_show_signature
58
+
59
+ attr_accessor :paypal_signature
60
+
61
+ attr_accessor :paypal_solution_type
62
+
63
+ attr_accessor :paypal_summary_email
64
+
65
+ attr_accessor :paypal_summary_mode
66
+
67
+ attr_accessor :paypal_zero_dollar_penny
68
+
69
+ attr_accessor :push_pay_pal
70
+
71
+ attr_accessor :restrictions
72
+
73
+ attr_accessor :short_pay_pal_marketing_text
74
+
75
+ # Attribute mapping from ruby-style variable name to JSON key.
76
+ def self.attribute_map
77
+ {
78
+ :'accept_pay_pal' => :'acceptPayPal',
79
+ :'paypal_accounting_code' => :'paypalAccountingCode',
80
+ :'paypal_api_password' => :'paypalApiPassword',
81
+ :'paypal_api_user_name' => :'paypalApiUserName',
82
+ :'paypal_certificate_on_file' => :'paypalCertificateOnFile',
83
+ :'paypal_deposit_to_account' => :'paypalDepositToAccount',
84
+ :'paypal_email' => :'paypalEmail',
85
+ :'paypal_environment' => :'paypalEnvironment',
86
+ :'paypal_header_image_url' => :'paypalHeaderImageUrl',
87
+ :'paypal_hide_bill_me_later' => :'paypalHideBillMeLater',
88
+ :'paypal_hide_express_checkout_on_view_cart' => :'paypalHideExpressCheckoutOnViewCart',
89
+ :'paypal_hide_for_unshipped_orders' => :'paypalHideForUnshippedOrders',
90
+ :'paypal_hold_in_ar' => :'paypalHoldInAR',
91
+ :'paypal_landing_page' => :'paypalLandingPage',
92
+ :'paypal_mode' => :'paypalMode',
93
+ :'paypal_private_key_password' => :'paypalPrivateKeyPassword',
94
+ :'paypal_processing_fee' => :'paypalProcessingFee',
95
+ :'paypal_processing_perc' => :'paypalProcessingPerc',
96
+ :'paypal_send_recurring' => :'paypalSendRecurring',
97
+ :'paypal_show_card_logos_not_directly_supported' => :'paypalShowCardLogosNotDirectlySupported',
98
+ :'paypal_show_signature' => :'paypalShowSignature',
99
+ :'paypal_signature' => :'paypalSignature',
100
+ :'paypal_solution_type' => :'paypalSolutionType',
101
+ :'paypal_summary_email' => :'paypalSummaryEmail',
102
+ :'paypal_summary_mode' => :'paypalSummaryMode',
103
+ :'paypal_zero_dollar_penny' => :'paypalZeroDollarPenny',
104
+ :'push_pay_pal' => :'pushPayPal',
105
+ :'restrictions' => :'restrictions',
106
+ :'short_pay_pal_marketing_text' => :'shortPayPalMarketingText'
107
+ }
108
+ end
109
+
110
+ # Attribute type mapping.
111
+ def self.swagger_types
112
+ {
113
+ :'accept_pay_pal' => :'BOOLEAN',
114
+ :'paypal_accounting_code' => :'String',
115
+ :'paypal_api_password' => :'String',
116
+ :'paypal_api_user_name' => :'String',
117
+ :'paypal_certificate_on_file' => :'BOOLEAN',
118
+ :'paypal_deposit_to_account' => :'String',
119
+ :'paypal_email' => :'String',
120
+ :'paypal_environment' => :'String',
121
+ :'paypal_header_image_url' => :'String',
122
+ :'paypal_hide_bill_me_later' => :'BOOLEAN',
123
+ :'paypal_hide_express_checkout_on_view_cart' => :'BOOLEAN',
124
+ :'paypal_hide_for_unshipped_orders' => :'BOOLEAN',
125
+ :'paypal_hold_in_ar' => :'BOOLEAN',
126
+ :'paypal_landing_page' => :'String',
127
+ :'paypal_mode' => :'String',
128
+ :'paypal_private_key_password' => :'String',
129
+ :'paypal_processing_fee' => :'String',
130
+ :'paypal_processing_perc' => :'String',
131
+ :'paypal_send_recurring' => :'String',
132
+ :'paypal_show_card_logos_not_directly_supported' => :'BOOLEAN',
133
+ :'paypal_show_signature' => :'BOOLEAN',
134
+ :'paypal_signature' => :'String',
135
+ :'paypal_solution_type' => :'String',
136
+ :'paypal_summary_email' => :'String',
137
+ :'paypal_summary_mode' => :'String',
138
+ :'paypal_zero_dollar_penny' => :'BOOLEAN',
139
+ :'push_pay_pal' => :'BOOLEAN',
140
+ :'restrictions' => :'PaymentsConfigurationRestrictions',
141
+ :'short_pay_pal_marketing_text' => :'BOOLEAN'
142
+ }
143
+ end
144
+
145
+ # Initializes the object
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ def initialize(attributes = {})
148
+ return unless attributes.is_a?(Hash)
149
+
150
+ # convert string to symbol for hash key
151
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
152
+
153
+ if attributes.has_key?(:'acceptPayPal')
154
+ self.accept_pay_pal = attributes[:'acceptPayPal']
155
+ end
156
+
157
+ if attributes.has_key?(:'paypalAccountingCode')
158
+ self.paypal_accounting_code = attributes[:'paypalAccountingCode']
159
+ end
160
+
161
+ if attributes.has_key?(:'paypalApiPassword')
162
+ self.paypal_api_password = attributes[:'paypalApiPassword']
163
+ end
164
+
165
+ if attributes.has_key?(:'paypalApiUserName')
166
+ self.paypal_api_user_name = attributes[:'paypalApiUserName']
167
+ end
168
+
169
+ if attributes.has_key?(:'paypalCertificateOnFile')
170
+ self.paypal_certificate_on_file = attributes[:'paypalCertificateOnFile']
171
+ end
172
+
173
+ if attributes.has_key?(:'paypalDepositToAccount')
174
+ self.paypal_deposit_to_account = attributes[:'paypalDepositToAccount']
175
+ end
176
+
177
+ if attributes.has_key?(:'paypalEmail')
178
+ self.paypal_email = attributes[:'paypalEmail']
179
+ end
180
+
181
+ if attributes.has_key?(:'paypalEnvironment')
182
+ self.paypal_environment = attributes[:'paypalEnvironment']
183
+ end
184
+
185
+ if attributes.has_key?(:'paypalHeaderImageUrl')
186
+ self.paypal_header_image_url = attributes[:'paypalHeaderImageUrl']
187
+ end
188
+
189
+ if attributes.has_key?(:'paypalHideBillMeLater')
190
+ self.paypal_hide_bill_me_later = attributes[:'paypalHideBillMeLater']
191
+ end
192
+
193
+ if attributes.has_key?(:'paypalHideExpressCheckoutOnViewCart')
194
+ self.paypal_hide_express_checkout_on_view_cart = attributes[:'paypalHideExpressCheckoutOnViewCart']
195
+ end
196
+
197
+ if attributes.has_key?(:'paypalHideForUnshippedOrders')
198
+ self.paypal_hide_for_unshipped_orders = attributes[:'paypalHideForUnshippedOrders']
199
+ end
200
+
201
+ if attributes.has_key?(:'paypalHoldInAR')
202
+ self.paypal_hold_in_ar = attributes[:'paypalHoldInAR']
203
+ end
204
+
205
+ if attributes.has_key?(:'paypalLandingPage')
206
+ self.paypal_landing_page = attributes[:'paypalLandingPage']
207
+ end
208
+
209
+ if attributes.has_key?(:'paypalMode')
210
+ self.paypal_mode = attributes[:'paypalMode']
211
+ end
212
+
213
+ if attributes.has_key?(:'paypalPrivateKeyPassword')
214
+ self.paypal_private_key_password = attributes[:'paypalPrivateKeyPassword']
215
+ end
216
+
217
+ if attributes.has_key?(:'paypalProcessingFee')
218
+ self.paypal_processing_fee = attributes[:'paypalProcessingFee']
219
+ end
220
+
221
+ if attributes.has_key?(:'paypalProcessingPerc')
222
+ self.paypal_processing_perc = attributes[:'paypalProcessingPerc']
223
+ end
224
+
225
+ if attributes.has_key?(:'paypalSendRecurring')
226
+ self.paypal_send_recurring = attributes[:'paypalSendRecurring']
227
+ end
228
+
229
+ if attributes.has_key?(:'paypalShowCardLogosNotDirectlySupported')
230
+ self.paypal_show_card_logos_not_directly_supported = attributes[:'paypalShowCardLogosNotDirectlySupported']
231
+ end
232
+
233
+ if attributes.has_key?(:'paypalShowSignature')
234
+ self.paypal_show_signature = attributes[:'paypalShowSignature']
235
+ end
236
+
237
+ if attributes.has_key?(:'paypalSignature')
238
+ self.paypal_signature = attributes[:'paypalSignature']
239
+ end
240
+
241
+ if attributes.has_key?(:'paypalSolutionType')
242
+ self.paypal_solution_type = attributes[:'paypalSolutionType']
243
+ end
244
+
245
+ if attributes.has_key?(:'paypalSummaryEmail')
246
+ self.paypal_summary_email = attributes[:'paypalSummaryEmail']
247
+ end
248
+
249
+ if attributes.has_key?(:'paypalSummaryMode')
250
+ self.paypal_summary_mode = attributes[:'paypalSummaryMode']
251
+ end
252
+
253
+ if attributes.has_key?(:'paypalZeroDollarPenny')
254
+ self.paypal_zero_dollar_penny = attributes[:'paypalZeroDollarPenny']
255
+ end
256
+
257
+ if attributes.has_key?(:'pushPayPal')
258
+ self.push_pay_pal = attributes[:'pushPayPal']
259
+ end
260
+
261
+ if attributes.has_key?(:'restrictions')
262
+ self.restrictions = attributes[:'restrictions']
263
+ end
264
+
265
+ if attributes.has_key?(:'shortPayPalMarketingText')
266
+ self.short_pay_pal_marketing_text = attributes[:'shortPayPalMarketingText']
267
+ end
268
+ end
269
+
270
+ # Show invalid properties with the reasons. Usually used together with valid?
271
+ # @return Array for valid properties with the reasons
272
+ def list_invalid_properties
273
+ invalid_properties = Array.new
274
+ invalid_properties
275
+ end
276
+
277
+ # Check to see if the all the properties in the model are valid
278
+ # @return true if the model is valid
279
+ def valid?
280
+ true
281
+ end
282
+
283
+ # Checks equality by comparing each attribute.
284
+ # @param [Object] Object to be compared
285
+ def ==(o)
286
+ return true if self.equal?(o)
287
+ self.class == o.class &&
288
+ accept_pay_pal == o.accept_pay_pal &&
289
+ paypal_accounting_code == o.paypal_accounting_code &&
290
+ paypal_api_password == o.paypal_api_password &&
291
+ paypal_api_user_name == o.paypal_api_user_name &&
292
+ paypal_certificate_on_file == o.paypal_certificate_on_file &&
293
+ paypal_deposit_to_account == o.paypal_deposit_to_account &&
294
+ paypal_email == o.paypal_email &&
295
+ paypal_environment == o.paypal_environment &&
296
+ paypal_header_image_url == o.paypal_header_image_url &&
297
+ paypal_hide_bill_me_later == o.paypal_hide_bill_me_later &&
298
+ paypal_hide_express_checkout_on_view_cart == o.paypal_hide_express_checkout_on_view_cart &&
299
+ paypal_hide_for_unshipped_orders == o.paypal_hide_for_unshipped_orders &&
300
+ paypal_hold_in_ar == o.paypal_hold_in_ar &&
301
+ paypal_landing_page == o.paypal_landing_page &&
302
+ paypal_mode == o.paypal_mode &&
303
+ paypal_private_key_password == o.paypal_private_key_password &&
304
+ paypal_processing_fee == o.paypal_processing_fee &&
305
+ paypal_processing_perc == o.paypal_processing_perc &&
306
+ paypal_send_recurring == o.paypal_send_recurring &&
307
+ paypal_show_card_logos_not_directly_supported == o.paypal_show_card_logos_not_directly_supported &&
308
+ paypal_show_signature == o.paypal_show_signature &&
309
+ paypal_signature == o.paypal_signature &&
310
+ paypal_solution_type == o.paypal_solution_type &&
311
+ paypal_summary_email == o.paypal_summary_email &&
312
+ paypal_summary_mode == o.paypal_summary_mode &&
313
+ paypal_zero_dollar_penny == o.paypal_zero_dollar_penny &&
314
+ push_pay_pal == o.push_pay_pal &&
315
+ restrictions == o.restrictions &&
316
+ short_pay_pal_marketing_text == o.short_pay_pal_marketing_text
317
+ end
318
+
319
+ # @see the `==` method
320
+ # @param [Object] Object to be compared
321
+ def eql?(o)
322
+ self == o
323
+ end
324
+
325
+ # Calculates hash code according to all attributes.
326
+ # @return [Fixnum] Hash code
327
+ def hash
328
+ [accept_pay_pal, paypal_accounting_code, paypal_api_password, paypal_api_user_name, paypal_certificate_on_file, paypal_deposit_to_account, paypal_email, paypal_environment, paypal_header_image_url, paypal_hide_bill_me_later, paypal_hide_express_checkout_on_view_cart, paypal_hide_for_unshipped_orders, paypal_hold_in_ar, paypal_landing_page, paypal_mode, paypal_private_key_password, paypal_processing_fee, paypal_processing_perc, paypal_send_recurring, paypal_show_card_logos_not_directly_supported, paypal_show_signature, paypal_signature, paypal_solution_type, paypal_summary_email, paypal_summary_mode, paypal_zero_dollar_penny, push_pay_pal, restrictions, short_pay_pal_marketing_text].hash
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ self.class.swagger_types.each_pair do |key, type|
337
+ if type =~ /\AArray<(.*)>/i
338
+ # check to ensure the input is an array given that the attribute
339
+ # is documented as an array but the input is not
340
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
341
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
342
+ end
343
+ elsif !attributes[self.class.attribute_map[key]].nil?
344
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
345
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
346
+ end
347
+
348
+ self
349
+ end
350
+
351
+ # Deserializes the data based on type
352
+ # @param string type Data type
353
+ # @param string value Value to be deserialized
354
+ # @return [Object] Deserialized data
355
+ def _deserialize(type, value)
356
+ case type.to_sym
357
+ when :DateTime
358
+ DateTime.parse(value)
359
+ when :Date
360
+ Date.parse(value)
361
+ when :String
362
+ value.to_s
363
+ when :Integer
364
+ value.to_i
365
+ when :Float
366
+ value.to_f
367
+ when :BOOLEAN
368
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
369
+ true
370
+ else
371
+ false
372
+ end
373
+ when :Object
374
+ # generic object (usually a Hash), return directly
375
+ value
376
+ when /\AArray<(?<inner_type>.+)>\z/
377
+ inner_type = Regexp.last_match[:inner_type]
378
+ value.map { |v| _deserialize(inner_type, v) }
379
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
380
+ k_type = Regexp.last_match[:k_type]
381
+ v_type = Regexp.last_match[:v_type]
382
+ {}.tap do |hash|
383
+ value.each do |k, v|
384
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
385
+ end
386
+ end
387
+ else # model
388
+ temp_model = UltracartClient.const_get(type).new
389
+ temp_model.build_from_hash(value)
390
+ end
391
+ end
392
+
393
+ # Returns the string representation of the object
394
+ # @return [String] String presentation of the object
395
+ def to_s
396
+ to_hash.to_s
397
+ end
398
+
399
+ # to_body is an alias to to_hash (backward compatibility)
400
+ # @return [Hash] Returns the object in the form of hash
401
+ def to_body
402
+ to_hash
403
+ end
404
+
405
+ # Returns the object in the form of hash
406
+ # @return [Hash] Returns the object in the form of hash
407
+ def to_hash
408
+ hash = {}
409
+ self.class.attribute_map.each_pair do |attr, param|
410
+ value = self.send(attr)
411
+ next if value.nil?
412
+ hash[param] = _to_hash(value)
413
+ end
414
+ hash
415
+ end
416
+
417
+ # Outputs non-array value in the form of hash
418
+ # For object, use to_hash. Otherwise, just return the value
419
+ # @param [Object] value Any valid value
420
+ # @return [Hash] Returns the value in the form of hash
421
+ def _to_hash(value)
422
+ if value.is_a?(Array)
423
+ value.compact.map { |v| _to_hash(v) }
424
+ elsif value.is_a?(Hash)
425
+ {}.tap do |hash|
426
+ value.each { |k, v| hash[k] = _to_hash(v) }
427
+ end
428
+ elsif value.respond_to? :to_hash
429
+ value.to_hash
430
+ else
431
+ value
432
+ end
433
+ end
434
+
435
+ end
436
+ end