ultracart_api 3.10.14 → 3.10.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -97
  3. data/docs/ChannelPartnerApi.md +51 -0
  4. data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
  5. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  6. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  7. data/lib/ultracart_api/version.rb +1 -1
  8. data/lib/ultracart_api.rb +1 -39
  9. metadata +4 -80
  10. data/docs/ConfigurationApi.md +0 -756
  11. data/docs/PaymentsConfiguration.md +0 -24
  12. data/docs/PaymentsConfigurationAffirm.md +0 -15
  13. data/docs/PaymentsConfigurationAmazon.md +0 -15
  14. data/docs/PaymentsConfigurationCOD.md +0 -13
  15. data/docs/PaymentsConfigurationCash.md +0 -9
  16. data/docs/PaymentsConfigurationCheck.md +0 -19
  17. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  18. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  19. data/docs/PaymentsConfigurationEcheck.md +0 -12
  20. data/docs/PaymentsConfigurationInsurance.md +0 -9
  21. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  22. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  23. data/docs/PaymentsConfigurationPayPal.md +0 -36
  24. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  25. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  26. data/docs/PaymentsConfigurationResponse.md +0 -12
  27. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  28. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  29. data/docs/PaymentsConfigurationSezzle.md +0 -15
  30. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  31. data/docs/PaymentsConfigurationWePay.md +0 -35
  32. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  33. data/docs/PaymentsThemeTransactionType.md +0 -10
  34. data/docs/PaymentsWepayEnroll.md +0 -22
  35. data/docs/RotatingTransactionGateway.md +0 -51
  36. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  37. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  38. data/docs/RtgCurrency.md +0 -10
  39. data/docs/RtgDayOfMonthRestriction.md +0 -9
  40. data/docs/RtgDayOfWeekRestriction.md +0 -10
  41. data/docs/RtgSummaryGateway.md +0 -24
  42. data/docs/RtgSummaryResponse.md +0 -14
  43. data/docs/RtgThemeRestriction.md +0 -10
  44. data/docs/StripeConnectResponse.md +0 -12
  45. data/docs/TransactionGateway.md +0 -71
  46. data/docs/TransactionGatewaysRequest.md +0 -10
  47. data/docs/TransactionGatewaysResponse.md +0 -12
  48. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  49. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  50. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  51. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  52. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  53. data/lib/ultracart_api/models/payments_configuration_cash.rb +0 -194
  54. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  55. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  56. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  57. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  58. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  59. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  60. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  61. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  62. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  63. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  64. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  65. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  66. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  67. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  68. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  69. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  70. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  71. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  72. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  73. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  74. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  75. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  76. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  77. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  78. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  79. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  80. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  81. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  82. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  83. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  84. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  85. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,318 +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 PaymentsConfigurationCreditCardType
17
- # Optional field used for Quickbooks integrations to match this credit card with the corresponding payment type in Quickbooks
18
- attr_accessor :accounting_code
19
-
20
- # Internally used icon information for this card type
21
- attr_accessor :card_type_icon
22
-
23
- # Credit card type
24
- attr_accessor :credit_card
25
-
26
- # The name of the account to deposit funds
27
- attr_accessor :deposit_to_account
28
-
29
- # If true, this card type will be accepted during checkout
30
- attr_accessor :enabled
31
-
32
- # Optional additional fee applied to order for this card
33
- attr_accessor :processing_fee
34
-
35
- # Optional additional fee applied to order for this card
36
- attr_accessor :processing_percentage
37
-
38
- attr_accessor :restrictions
39
-
40
- # Optional field. If integrated with Quickbooks, this code will be used when informing Quickbooks about any surcharges applied to orders
41
- attr_accessor :surcharge_accounting_code
42
-
43
- # An optional additional fee to charge the customer for using this card.
44
- attr_accessor :transaction_fee
45
-
46
- # An optional transaction percentage to charge the customer for using this card
47
- attr_accessor :transaction_percentage
48
-
49
- class EnumAttributeValidator
50
- attr_reader :datatype
51
- attr_reader :allowable_values
52
-
53
- def initialize(datatype, allowable_values)
54
- @allowable_values = allowable_values.map do |value|
55
- case datatype.to_s
56
- when /Integer/i
57
- value.to_i
58
- when /Float/i
59
- value.to_f
60
- else
61
- value
62
- end
63
- end
64
- end
65
-
66
- def valid?(value)
67
- !value || allowable_values.include?(value)
68
- end
69
- end
70
-
71
- # Attribute mapping from ruby-style variable name to JSON key.
72
- def self.attribute_map
73
- {
74
- :'accounting_code' => :'accounting_code',
75
- :'card_type_icon' => :'card_type_icon',
76
- :'credit_card' => :'credit_card',
77
- :'deposit_to_account' => :'deposit_to_account',
78
- :'enabled' => :'enabled',
79
- :'processing_fee' => :'processing_fee',
80
- :'processing_percentage' => :'processing_percentage',
81
- :'restrictions' => :'restrictions',
82
- :'surcharge_accounting_code' => :'surcharge_accounting_code',
83
- :'transaction_fee' => :'transaction_fee',
84
- :'transaction_percentage' => :'transaction_percentage'
85
- }
86
- end
87
-
88
- # Attribute type mapping.
89
- def self.swagger_types
90
- {
91
- :'accounting_code' => :'String',
92
- :'card_type_icon' => :'String',
93
- :'credit_card' => :'String',
94
- :'deposit_to_account' => :'String',
95
- :'enabled' => :'BOOLEAN',
96
- :'processing_fee' => :'Float',
97
- :'processing_percentage' => :'Float',
98
- :'restrictions' => :'PaymentsConfigurationRestrictions',
99
- :'surcharge_accounting_code' => :'String',
100
- :'transaction_fee' => :'Float',
101
- :'transaction_percentage' => :'Float'
102
- }
103
- end
104
-
105
- # Initializes the object
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- def initialize(attributes = {})
108
- return unless attributes.is_a?(Hash)
109
-
110
- # convert string to symbol for hash key
111
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
112
-
113
- if attributes.has_key?(:'accounting_code')
114
- self.accounting_code = attributes[:'accounting_code']
115
- end
116
-
117
- if attributes.has_key?(:'card_type_icon')
118
- self.card_type_icon = attributes[:'card_type_icon']
119
- end
120
-
121
- if attributes.has_key?(:'credit_card')
122
- self.credit_card = attributes[:'credit_card']
123
- end
124
-
125
- if attributes.has_key?(:'deposit_to_account')
126
- self.deposit_to_account = attributes[:'deposit_to_account']
127
- end
128
-
129
- if attributes.has_key?(:'enabled')
130
- self.enabled = attributes[:'enabled']
131
- end
132
-
133
- if attributes.has_key?(:'processing_fee')
134
- self.processing_fee = attributes[:'processing_fee']
135
- end
136
-
137
- if attributes.has_key?(:'processing_percentage')
138
- self.processing_percentage = attributes[:'processing_percentage']
139
- end
140
-
141
- if attributes.has_key?(:'restrictions')
142
- self.restrictions = attributes[:'restrictions']
143
- end
144
-
145
- if attributes.has_key?(:'surcharge_accounting_code')
146
- self.surcharge_accounting_code = attributes[:'surcharge_accounting_code']
147
- end
148
-
149
- if attributes.has_key?(:'transaction_fee')
150
- self.transaction_fee = attributes[:'transaction_fee']
151
- end
152
-
153
- if attributes.has_key?(:'transaction_percentage')
154
- self.transaction_percentage = attributes[:'transaction_percentage']
155
- end
156
- end
157
-
158
- # Show invalid properties with the reasons. Usually used together with valid?
159
- # @return Array for valid properties with the reasons
160
- def list_invalid_properties
161
- invalid_properties = Array.new
162
- invalid_properties
163
- end
164
-
165
- # Check to see if the all the properties in the model are valid
166
- # @return true if the model is valid
167
- def valid?
168
- credit_card_validator = EnumAttributeValidator.new('String', ['AMEX', 'Diners Club', 'Discover', 'MasterCard', 'JCB', 'VISA'])
169
- return false unless credit_card_validator.valid?(@credit_card)
170
- true
171
- end
172
-
173
- # Custom attribute writer method checking allowed values (enum).
174
- # @param [Object] credit_card Object to be assigned
175
- def credit_card=(credit_card)
176
- validator = EnumAttributeValidator.new('String', ['AMEX', 'Diners Club', 'Discover', 'MasterCard', 'JCB', 'VISA'])
177
- unless validator.valid?(credit_card)
178
- fail ArgumentError, 'invalid value for "credit_card", must be one of #{validator.allowable_values}.'
179
- end
180
- @credit_card = credit_card
181
- end
182
-
183
- # Checks equality by comparing each attribute.
184
- # @param [Object] Object to be compared
185
- def ==(o)
186
- return true if self.equal?(o)
187
- self.class == o.class &&
188
- accounting_code == o.accounting_code &&
189
- card_type_icon == o.card_type_icon &&
190
- credit_card == o.credit_card &&
191
- deposit_to_account == o.deposit_to_account &&
192
- enabled == o.enabled &&
193
- processing_fee == o.processing_fee &&
194
- processing_percentage == o.processing_percentage &&
195
- restrictions == o.restrictions &&
196
- surcharge_accounting_code == o.surcharge_accounting_code &&
197
- transaction_fee == o.transaction_fee &&
198
- transaction_percentage == o.transaction_percentage
199
- end
200
-
201
- # @see the `==` method
202
- # @param [Object] Object to be compared
203
- def eql?(o)
204
- self == o
205
- end
206
-
207
- # Calculates hash code according to all attributes.
208
- # @return [Fixnum] Hash code
209
- def hash
210
- [accounting_code, card_type_icon, credit_card, deposit_to_account, enabled, processing_fee, processing_percentage, restrictions, surcharge_accounting_code, transaction_fee, transaction_percentage].hash
211
- end
212
-
213
- # Builds the object from hash
214
- # @param [Hash] attributes Model attributes in the form of hash
215
- # @return [Object] Returns the model itself
216
- def build_from_hash(attributes)
217
- return nil unless attributes.is_a?(Hash)
218
- self.class.swagger_types.each_pair do |key, type|
219
- if type =~ /\AArray<(.*)>/i
220
- # check to ensure the input is an array given that the attribute
221
- # is documented as an array but the input is not
222
- if attributes[self.class.attribute_map[key]].is_a?(Array)
223
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
- end
225
- elsif !attributes[self.class.attribute_map[key]].nil?
226
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
- end # or else data not found in attributes(hash), not an issue as the data can be optional
228
- end
229
-
230
- self
231
- end
232
-
233
- # Deserializes the data based on type
234
- # @param string type Data type
235
- # @param string value Value to be deserialized
236
- # @return [Object] Deserialized data
237
- def _deserialize(type, value)
238
- case type.to_sym
239
- when :DateTime
240
- DateTime.parse(value)
241
- when :Date
242
- Date.parse(value)
243
- when :String
244
- value.to_s
245
- when :Integer
246
- value.to_i
247
- when :Float
248
- value.to_f
249
- when :BOOLEAN
250
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
- true
252
- else
253
- false
254
- end
255
- when :Object
256
- # generic object (usually a Hash), return directly
257
- value
258
- when /\AArray<(?<inner_type>.+)>\z/
259
- inner_type = Regexp.last_match[:inner_type]
260
- value.map { |v| _deserialize(inner_type, v) }
261
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
- k_type = Regexp.last_match[:k_type]
263
- v_type = Regexp.last_match[:v_type]
264
- {}.tap do |hash|
265
- value.each do |k, v|
266
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
- end
268
- end
269
- else # model
270
- temp_model = UltracartClient.const_get(type).new
271
- temp_model.build_from_hash(value)
272
- end
273
- end
274
-
275
- # Returns the string representation of the object
276
- # @return [String] String presentation of the object
277
- def to_s
278
- to_hash.to_s
279
- end
280
-
281
- # to_body is an alias to to_hash (backward compatibility)
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_body
284
- to_hash
285
- end
286
-
287
- # Returns the object in the form of hash
288
- # @return [Hash] Returns the object in the form of hash
289
- def to_hash
290
- hash = {}
291
- self.class.attribute_map.each_pair do |attr, param|
292
- value = self.send(attr)
293
- next if value.nil?
294
- hash[param] = _to_hash(value)
295
- end
296
- hash
297
- end
298
-
299
- # Outputs non-array value in the form of hash
300
- # For object, use to_hash. Otherwise, just return the value
301
- # @param [Object] value Any valid value
302
- # @return [Hash] Returns the value in the form of hash
303
- def _to_hash(value)
304
- if value.is_a?(Array)
305
- value.compact.map { |v| _to_hash(v) }
306
- elsif value.is_a?(Hash)
307
- {}.tap do |hash|
308
- value.each { |k, v| hash[k] = _to_hash(v) }
309
- end
310
- elsif value.respond_to? :to_hash
311
- value.to_hash
312
- else
313
- value
314
- end
315
- end
316
-
317
- end
318
- end
@@ -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