ultracart_api 3.10.13 → 3.10.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) 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/ChargebackApi.md +1 -1
  6. data/docs/CustomerApi.md +1 -1
  7. data/docs/EmailDomain.md +1 -0
  8. data/docs/Mailgun.md +8 -0
  9. data/docs/OrderApi.md +1 -1
  10. data/docs/SsoApi.md +2 -2
  11. data/docs/StorefrontApi.md +101 -0
  12. data/docs/UserApi.md +2 -2
  13. data/docs/WebhookApi.md +1 -1
  14. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  15. data/lib/ultracart_api/api/chargeback_api.rb +1 -1
  16. data/lib/ultracart_api/api/customer_api.rb +1 -1
  17. data/lib/ultracart_api/api/order_api.rb +1 -1
  18. data/lib/ultracart_api/api/sso_api.rb +2 -2
  19. data/lib/ultracart_api/api/storefront_api.rb +112 -0
  20. data/lib/ultracart_api/api/user_api.rb +2 -2
  21. data/lib/ultracart_api/api/webhook_api.rb +1 -1
  22. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  23. data/lib/ultracart_api/models/email_domain.rb +10 -1
  24. data/lib/ultracart_api/models/{payments_configuration_cash.rb → mailgun.rb} +8 -18
  25. data/lib/ultracart_api/version.rb +1 -1
  26. data/lib/ultracart_api.rb +2 -39
  27. metadata +6 -80
  28. data/docs/ConfigurationApi.md +0 -756
  29. data/docs/PaymentsConfiguration.md +0 -24
  30. data/docs/PaymentsConfigurationAffirm.md +0 -15
  31. data/docs/PaymentsConfigurationAmazon.md +0 -15
  32. data/docs/PaymentsConfigurationCOD.md +0 -13
  33. data/docs/PaymentsConfigurationCash.md +0 -9
  34. data/docs/PaymentsConfigurationCheck.md +0 -19
  35. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  36. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  37. data/docs/PaymentsConfigurationEcheck.md +0 -12
  38. data/docs/PaymentsConfigurationInsurance.md +0 -9
  39. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  40. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  41. data/docs/PaymentsConfigurationPayPal.md +0 -36
  42. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  43. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  44. data/docs/PaymentsConfigurationResponse.md +0 -12
  45. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  46. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  47. data/docs/PaymentsConfigurationSezzle.md +0 -15
  48. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  49. data/docs/PaymentsConfigurationWePay.md +0 -35
  50. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  51. data/docs/PaymentsThemeTransactionType.md +0 -10
  52. data/docs/PaymentsWepayEnroll.md +0 -22
  53. data/docs/RotatingTransactionGateway.md +0 -51
  54. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  55. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  56. data/docs/RtgCurrency.md +0 -10
  57. data/docs/RtgDayOfMonthRestriction.md +0 -9
  58. data/docs/RtgDayOfWeekRestriction.md +0 -10
  59. data/docs/RtgSummaryGateway.md +0 -24
  60. data/docs/RtgSummaryResponse.md +0 -14
  61. data/docs/RtgThemeRestriction.md +0 -10
  62. data/docs/StripeConnectResponse.md +0 -12
  63. data/docs/TransactionGateway.md +0 -71
  64. data/docs/TransactionGatewaysRequest.md +0 -10
  65. data/docs/TransactionGatewaysResponse.md +0 -12
  66. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  67. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  68. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  69. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  70. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  71. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  72. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  73. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  74. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  75. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  76. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  77. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  78. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  79. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  80. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  81. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  82. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  83. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  84. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  85. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  86. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  87. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  88. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  89. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  90. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  91. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  92. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  93. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  94. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  95. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  96. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  97. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  98. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  99. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  100. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  101. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  102. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,294 +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 PaymentsConfigurationCheck
17
- # Master flag indicating this merchant accepts paper checks
18
- attr_accessor :accept_check_orders
19
-
20
- # Optional Quickbooks accounting code
21
- attr_accessor :accounting_code
22
-
23
- # This is who the customer makes the check out to
24
- attr_accessor :checks_payable_to
25
-
26
- # Optional Quickbooks deposit to account
27
- attr_accessor :deposit_to_account
28
-
29
- # MailTo address line 1
30
- attr_accessor :mail_to_address1
31
-
32
- # MailTo address line 2
33
- attr_accessor :mail_to_address2
34
-
35
- # MailTo city
36
- attr_accessor :mail_to_city
37
-
38
- # MailTo country
39
- attr_accessor :mail_to_country
40
-
41
- # MailTo name
42
- attr_accessor :mail_to_name
43
-
44
- # MailTo postal code
45
- attr_accessor :mail_to_postal_code
46
-
47
- # MailTo store
48
- attr_accessor :mail_to_store
49
-
50
- attr_accessor :restrictions
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'accept_check_orders' => :'accept_check_orders',
56
- :'accounting_code' => :'accounting_code',
57
- :'checks_payable_to' => :'checks_payable_to',
58
- :'deposit_to_account' => :'deposit_to_account',
59
- :'mail_to_address1' => :'mail_to_address1',
60
- :'mail_to_address2' => :'mail_to_address2',
61
- :'mail_to_city' => :'mail_to_city',
62
- :'mail_to_country' => :'mail_to_country',
63
- :'mail_to_name' => :'mail_to_name',
64
- :'mail_to_postal_code' => :'mail_to_postal_code',
65
- :'mail_to_store' => :'mail_to_store',
66
- :'restrictions' => :'restrictions'
67
- }
68
- end
69
-
70
- # Attribute type mapping.
71
- def self.swagger_types
72
- {
73
- :'accept_check_orders' => :'BOOLEAN',
74
- :'accounting_code' => :'String',
75
- :'checks_payable_to' => :'String',
76
- :'deposit_to_account' => :'String',
77
- :'mail_to_address1' => :'String',
78
- :'mail_to_address2' => :'String',
79
- :'mail_to_city' => :'String',
80
- :'mail_to_country' => :'String',
81
- :'mail_to_name' => :'String',
82
- :'mail_to_postal_code' => :'String',
83
- :'mail_to_store' => :'String',
84
- :'restrictions' => :'PaymentsConfigurationRestrictions'
85
- }
86
- end
87
-
88
- # Initializes the object
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- def initialize(attributes = {})
91
- return unless attributes.is_a?(Hash)
92
-
93
- # convert string to symbol for hash key
94
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
-
96
- if attributes.has_key?(:'accept_check_orders')
97
- self.accept_check_orders = attributes[:'accept_check_orders']
98
- end
99
-
100
- if attributes.has_key?(:'accounting_code')
101
- self.accounting_code = attributes[:'accounting_code']
102
- end
103
-
104
- if attributes.has_key?(:'checks_payable_to')
105
- self.checks_payable_to = attributes[:'checks_payable_to']
106
- end
107
-
108
- if attributes.has_key?(:'deposit_to_account')
109
- self.deposit_to_account = attributes[:'deposit_to_account']
110
- end
111
-
112
- if attributes.has_key?(:'mail_to_address1')
113
- self.mail_to_address1 = attributes[:'mail_to_address1']
114
- end
115
-
116
- if attributes.has_key?(:'mail_to_address2')
117
- self.mail_to_address2 = attributes[:'mail_to_address2']
118
- end
119
-
120
- if attributes.has_key?(:'mail_to_city')
121
- self.mail_to_city = attributes[:'mail_to_city']
122
- end
123
-
124
- if attributes.has_key?(:'mail_to_country')
125
- self.mail_to_country = attributes[:'mail_to_country']
126
- end
127
-
128
- if attributes.has_key?(:'mail_to_name')
129
- self.mail_to_name = attributes[:'mail_to_name']
130
- end
131
-
132
- if attributes.has_key?(:'mail_to_postal_code')
133
- self.mail_to_postal_code = attributes[:'mail_to_postal_code']
134
- end
135
-
136
- if attributes.has_key?(:'mail_to_store')
137
- self.mail_to_store = attributes[:'mail_to_store']
138
- end
139
-
140
- if attributes.has_key?(:'restrictions')
141
- self.restrictions = attributes[:'restrictions']
142
- end
143
- end
144
-
145
- # Show invalid properties with the reasons. Usually used together with valid?
146
- # @return Array for valid properties with the reasons
147
- def list_invalid_properties
148
- invalid_properties = Array.new
149
- invalid_properties
150
- end
151
-
152
- # Check to see if the all the properties in the model are valid
153
- # @return true if the model is valid
154
- def valid?
155
- true
156
- end
157
-
158
- # Checks equality by comparing each attribute.
159
- # @param [Object] Object to be compared
160
- def ==(o)
161
- return true if self.equal?(o)
162
- self.class == o.class &&
163
- accept_check_orders == o.accept_check_orders &&
164
- accounting_code == o.accounting_code &&
165
- checks_payable_to == o.checks_payable_to &&
166
- deposit_to_account == o.deposit_to_account &&
167
- mail_to_address1 == o.mail_to_address1 &&
168
- mail_to_address2 == o.mail_to_address2 &&
169
- mail_to_city == o.mail_to_city &&
170
- mail_to_country == o.mail_to_country &&
171
- mail_to_name == o.mail_to_name &&
172
- mail_to_postal_code == o.mail_to_postal_code &&
173
- mail_to_store == o.mail_to_store &&
174
- restrictions == o.restrictions
175
- end
176
-
177
- # @see the `==` method
178
- # @param [Object] Object to be compared
179
- def eql?(o)
180
- self == o
181
- end
182
-
183
- # Calculates hash code according to all attributes.
184
- # @return [Fixnum] Hash code
185
- def hash
186
- [accept_check_orders, accounting_code, checks_payable_to, deposit_to_account, mail_to_address1, mail_to_address2, mail_to_city, mail_to_country, mail_to_name, mail_to_postal_code, mail_to_store, restrictions].hash
187
- end
188
-
189
- # Builds the object from hash
190
- # @param [Hash] attributes Model attributes in the form of hash
191
- # @return [Object] Returns the model itself
192
- def build_from_hash(attributes)
193
- return nil unless attributes.is_a?(Hash)
194
- self.class.swagger_types.each_pair do |key, type|
195
- if type =~ /\AArray<(.*)>/i
196
- # check to ensure the input is an array given that the attribute
197
- # is documented as an array but the input is not
198
- if attributes[self.class.attribute_map[key]].is_a?(Array)
199
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
- end
201
- elsif !attributes[self.class.attribute_map[key]].nil?
202
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
- end # or else data not found in attributes(hash), not an issue as the data can be optional
204
- end
205
-
206
- self
207
- end
208
-
209
- # Deserializes the data based on type
210
- # @param string type Data type
211
- # @param string value Value to be deserialized
212
- # @return [Object] Deserialized data
213
- def _deserialize(type, value)
214
- case type.to_sym
215
- when :DateTime
216
- DateTime.parse(value)
217
- when :Date
218
- Date.parse(value)
219
- when :String
220
- value.to_s
221
- when :Integer
222
- value.to_i
223
- when :Float
224
- value.to_f
225
- when :BOOLEAN
226
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
- true
228
- else
229
- false
230
- end
231
- when :Object
232
- # generic object (usually a Hash), return directly
233
- value
234
- when /\AArray<(?<inner_type>.+)>\z/
235
- inner_type = Regexp.last_match[:inner_type]
236
- value.map { |v| _deserialize(inner_type, v) }
237
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
- k_type = Regexp.last_match[:k_type]
239
- v_type = Regexp.last_match[:v_type]
240
- {}.tap do |hash|
241
- value.each do |k, v|
242
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
- end
244
- end
245
- else # model
246
- temp_model = UltracartClient.const_get(type).new
247
- temp_model.build_from_hash(value)
248
- end
249
- end
250
-
251
- # Returns the string representation of the object
252
- # @return [String] String presentation of the object
253
- def to_s
254
- to_hash.to_s
255
- end
256
-
257
- # to_body is an alias to to_hash (backward compatibility)
258
- # @return [Hash] Returns the object in the form of hash
259
- def to_body
260
- to_hash
261
- end
262
-
263
- # Returns the object in the form of hash
264
- # @return [Hash] Returns the object in the form of hash
265
- def to_hash
266
- hash = {}
267
- self.class.attribute_map.each_pair do |attr, param|
268
- value = self.send(attr)
269
- next if value.nil?
270
- hash[param] = _to_hash(value)
271
- end
272
- hash
273
- end
274
-
275
- # Outputs non-array value in the form of hash
276
- # For object, use to_hash. Otherwise, just return the value
277
- # @param [Object] value Any valid value
278
- # @return [Hash] Returns the value in the form of hash
279
- def _to_hash(value)
280
- if value.is_a?(Array)
281
- value.compact.map { |v| _to_hash(v) }
282
- elsif value.is_a?(Hash)
283
- {}.tap do |hash|
284
- value.each { |k, v| hash[k] = _to_hash(v) }
285
- end
286
- elsif value.respond_to? :to_hash
287
- value.to_hash
288
- else
289
- value
290
- end
291
- end
292
-
293
- end
294
- end
@@ -1,234 +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 PaymentsConfigurationCOD
17
- # Master flag indicating this merchant accepts COD
18
- attr_accessor :accept_cod
19
-
20
- # If true, only approved customers may pay with COD
21
- attr_accessor :approved_customers_only
22
-
23
- attr_accessor :restrictions
24
-
25
- # Optional field, if surcharge is set, this is the accounting code the surcharge is tagged with when sent to Quickbooks
26
- attr_accessor :surcharge_accounting_code
27
-
28
- # Additional cost for using COD
29
- attr_accessor :surcharge_fee
30
-
31
- # Additional percentage cost for using COD
32
- attr_accessor :surcharge_percentage
33
-
34
- # Attribute mapping from ruby-style variable name to JSON key.
35
- def self.attribute_map
36
- {
37
- :'accept_cod' => :'accept_cod',
38
- :'approved_customers_only' => :'approved_customers_only',
39
- :'restrictions' => :'restrictions',
40
- :'surcharge_accounting_code' => :'surcharge_accounting_code',
41
- :'surcharge_fee' => :'surcharge_fee',
42
- :'surcharge_percentage' => :'surcharge_percentage'
43
- }
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.swagger_types
48
- {
49
- :'accept_cod' => :'BOOLEAN',
50
- :'approved_customers_only' => :'BOOLEAN',
51
- :'restrictions' => :'PaymentsConfigurationRestrictions',
52
- :'surcharge_accounting_code' => :'String',
53
- :'surcharge_fee' => :'Float',
54
- :'surcharge_percentage' => :'Float'
55
- }
56
- end
57
-
58
- # Initializes the object
59
- # @param [Hash] attributes Model attributes in the form of hash
60
- def initialize(attributes = {})
61
- return unless attributes.is_a?(Hash)
62
-
63
- # convert string to symbol for hash key
64
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
-
66
- if attributes.has_key?(:'accept_cod')
67
- self.accept_cod = attributes[:'accept_cod']
68
- end
69
-
70
- if attributes.has_key?(:'approved_customers_only')
71
- self.approved_customers_only = attributes[:'approved_customers_only']
72
- end
73
-
74
- if attributes.has_key?(:'restrictions')
75
- self.restrictions = attributes[:'restrictions']
76
- end
77
-
78
- if attributes.has_key?(:'surcharge_accounting_code')
79
- self.surcharge_accounting_code = attributes[:'surcharge_accounting_code']
80
- end
81
-
82
- if attributes.has_key?(:'surcharge_fee')
83
- self.surcharge_fee = attributes[:'surcharge_fee']
84
- end
85
-
86
- if attributes.has_key?(:'surcharge_percentage')
87
- self.surcharge_percentage = attributes[:'surcharge_percentage']
88
- end
89
- end
90
-
91
- # Show invalid properties with the reasons. Usually used together with valid?
92
- # @return Array for valid properties with the reasons
93
- def list_invalid_properties
94
- invalid_properties = Array.new
95
- invalid_properties
96
- end
97
-
98
- # Check to see if the all the properties in the model are valid
99
- # @return true if the model is valid
100
- def valid?
101
- true
102
- end
103
-
104
- # Checks equality by comparing each attribute.
105
- # @param [Object] Object to be compared
106
- def ==(o)
107
- return true if self.equal?(o)
108
- self.class == o.class &&
109
- accept_cod == o.accept_cod &&
110
- approved_customers_only == o.approved_customers_only &&
111
- restrictions == o.restrictions &&
112
- surcharge_accounting_code == o.surcharge_accounting_code &&
113
- surcharge_fee == o.surcharge_fee &&
114
- surcharge_percentage == o.surcharge_percentage
115
- end
116
-
117
- # @see the `==` method
118
- # @param [Object] Object to be compared
119
- def eql?(o)
120
- self == o
121
- end
122
-
123
- # Calculates hash code according to all attributes.
124
- # @return [Fixnum] Hash code
125
- def hash
126
- [accept_cod, approved_customers_only, restrictions, surcharge_accounting_code, surcharge_fee, surcharge_percentage].hash
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def build_from_hash(attributes)
133
- return nil unless attributes.is_a?(Hash)
134
- self.class.swagger_types.each_pair do |key, type|
135
- if type =~ /\AArray<(.*)>/i
136
- # check to ensure the input is an array given that the attribute
137
- # is documented as an array but the input is not
138
- if attributes[self.class.attribute_map[key]].is_a?(Array)
139
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
- end
141
- elsif !attributes[self.class.attribute_map[key]].nil?
142
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
- end # or else data not found in attributes(hash), not an issue as the data can be optional
144
- end
145
-
146
- self
147
- end
148
-
149
- # Deserializes the data based on type
150
- # @param string type Data type
151
- # @param string value Value to be deserialized
152
- # @return [Object] Deserialized data
153
- def _deserialize(type, value)
154
- case type.to_sym
155
- when :DateTime
156
- DateTime.parse(value)
157
- when :Date
158
- Date.parse(value)
159
- when :String
160
- value.to_s
161
- when :Integer
162
- value.to_i
163
- when :Float
164
- value.to_f
165
- when :BOOLEAN
166
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
- true
168
- else
169
- false
170
- end
171
- when :Object
172
- # generic object (usually a Hash), return directly
173
- value
174
- when /\AArray<(?<inner_type>.+)>\z/
175
- inner_type = Regexp.last_match[:inner_type]
176
- value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
- k_type = Regexp.last_match[:k_type]
179
- v_type = Regexp.last_match[:v_type]
180
- {}.tap do |hash|
181
- value.each do |k, v|
182
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
- end
184
- end
185
- else # model
186
- temp_model = UltracartClient.const_get(type).new
187
- temp_model.build_from_hash(value)
188
- end
189
- end
190
-
191
- # Returns the string representation of the object
192
- # @return [String] String presentation of the object
193
- def to_s
194
- to_hash.to_s
195
- end
196
-
197
- # to_body is an alias to to_hash (backward compatibility)
198
- # @return [Hash] Returns the object in the form of hash
199
- def to_body
200
- to_hash
201
- end
202
-
203
- # Returns the object in the form of hash
204
- # @return [Hash] Returns the object in the form of hash
205
- def to_hash
206
- hash = {}
207
- self.class.attribute_map.each_pair do |attr, param|
208
- value = self.send(attr)
209
- next if value.nil?
210
- hash[param] = _to_hash(value)
211
- end
212
- hash
213
- end
214
-
215
- # Outputs non-array value in the form of hash
216
- # For object, use to_hash. Otherwise, just return the value
217
- # @param [Object] value Any valid value
218
- # @return [Hash] Returns the value in the form of hash
219
- def _to_hash(value)
220
- if value.is_a?(Array)
221
- value.compact.map { |v| _to_hash(v) }
222
- elsif value.is_a?(Hash)
223
- {}.tap do |hash|
224
- value.each { |k, v| hash[k] = _to_hash(v) }
225
- end
226
- elsif value.respond_to? :to_hash
227
- value.to_hash
228
- else
229
- value
230
- end
231
- end
232
-
233
- end
234
- end