ultracart_api 3.6.18 → 3.6.22

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/AddLibraryItemRequest.md +2 -2
  4. data/docs/AffiliateLedger.md +3 -2
  5. data/docs/ApplyLibraryItemRequest.md +1 -0
  6. data/docs/ApplyLibraryItemResponse.md +1 -1
  7. data/docs/ExperimentVariation.md +2 -0
  8. data/docs/ExperimentVariationStat.md +18 -0
  9. data/docs/Item.md +1 -0
  10. data/docs/ItemAutoOrderStep.md +1 -1
  11. data/docs/ItemFulfillmentAddon.md +11 -0
  12. data/docs/ItemShippingDistributionCenter.md +1 -0
  13. data/docs/OrderItem.md +0 -1
  14. data/docs/StorefrontApi.md +243 -0
  15. data/docs/Twilio.md +11 -0
  16. data/docs/TwilioResponse.md +13 -0
  17. data/docs/TwiliosResponse.md +12 -0
  18. data/lib/ultracart_api/api/storefront_api.rb +265 -0
  19. data/lib/ultracart_api/models/add_library_item_request.rb +2 -2
  20. data/lib/ultracart_api/models/affiliate_ledger.rb +13 -3
  21. data/lib/ultracart_api/models/apply_library_item_request.rb +11 -1
  22. data/lib/ultracart_api/models/apply_library_item_response.rb +1 -1
  23. data/lib/ultracart_api/models/experiment_variation.rb +23 -1
  24. data/lib/ultracart_api/models/experiment_variation_stat.rb +285 -0
  25. data/lib/ultracart_api/models/item.rb +13 -1
  26. data/lib/ultracart_api/models/item_auto_order_step.rb +3 -3
  27. data/lib/ultracart_api/models/item_fulfillment_addon.rb +215 -0
  28. data/lib/ultracart_api/models/item_shipping_distribution_center.rb +11 -1
  29. data/lib/ultracart_api/models/order_item.rb +1 -11
  30. data/lib/ultracart_api/models/order_query.rb +2 -2
  31. data/lib/ultracart_api/models/twilio.rb +213 -0
  32. data/lib/ultracart_api/models/twilio_response.rb +230 -0
  33. data/lib/ultracart_api/models/twilios_response.rb +223 -0
  34. data/lib/ultracart_api/version.rb +1 -1
  35. data/lib/ultracart_api.rb +5 -0
  36. metadata +12 -2
@@ -0,0 +1,285 @@
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 ExperimentVariationStat
17
+ # Total add to cart count for this variation
18
+ attr_accessor :add_to_cart_count
19
+
20
+ # Total bounce count for this variation
21
+ attr_accessor :bounce_count
22
+
23
+ # Total number of seconds spent on the site for this variation
24
+ attr_accessor :duration_seconds_sum
25
+
26
+ # Total event count for this variation
27
+ attr_accessor :event_count
28
+
29
+ # Total initiate checkout count for this variation
30
+ attr_accessor :initiate_checkout_count
31
+
32
+ # Total order count for this variation
33
+ attr_accessor :order_count
34
+
35
+ # Total order item count for this variation
36
+ attr_accessor :order_item_count
37
+
38
+ # Total page view count for this variation
39
+ attr_accessor :page_view_count
40
+
41
+ # Total revenue for this variation
42
+ attr_accessor :revenue
43
+
44
+ # Total sessions for this variation
45
+ attr_accessor :session_count
46
+
47
+ # Date/time that the statistic was created
48
+ attr_accessor :stat_dts
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'add_to_cart_count' => :'add_to_cart_count',
54
+ :'bounce_count' => :'bounce_count',
55
+ :'duration_seconds_sum' => :'duration_seconds_sum',
56
+ :'event_count' => :'event_count',
57
+ :'initiate_checkout_count' => :'initiate_checkout_count',
58
+ :'order_count' => :'order_count',
59
+ :'order_item_count' => :'order_item_count',
60
+ :'page_view_count' => :'page_view_count',
61
+ :'revenue' => :'revenue',
62
+ :'session_count' => :'session_count',
63
+ :'stat_dts' => :'stat_dts'
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ :'add_to_cart_count' => :'Integer',
71
+ :'bounce_count' => :'Integer',
72
+ :'duration_seconds_sum' => :'Integer',
73
+ :'event_count' => :'Integer',
74
+ :'initiate_checkout_count' => :'Integer',
75
+ :'order_count' => :'Integer',
76
+ :'order_item_count' => :'Integer',
77
+ :'page_view_count' => :'Integer',
78
+ :'revenue' => :'Float',
79
+ :'session_count' => :'Integer',
80
+ :'stat_dts' => :'String'
81
+ }
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
91
+
92
+ if attributes.has_key?(:'add_to_cart_count')
93
+ self.add_to_cart_count = attributes[:'add_to_cart_count']
94
+ end
95
+
96
+ if attributes.has_key?(:'bounce_count')
97
+ self.bounce_count = attributes[:'bounce_count']
98
+ end
99
+
100
+ if attributes.has_key?(:'duration_seconds_sum')
101
+ self.duration_seconds_sum = attributes[:'duration_seconds_sum']
102
+ end
103
+
104
+ if attributes.has_key?(:'event_count')
105
+ self.event_count = attributes[:'event_count']
106
+ end
107
+
108
+ if attributes.has_key?(:'initiate_checkout_count')
109
+ self.initiate_checkout_count = attributes[:'initiate_checkout_count']
110
+ end
111
+
112
+ if attributes.has_key?(:'order_count')
113
+ self.order_count = attributes[:'order_count']
114
+ end
115
+
116
+ if attributes.has_key?(:'order_item_count')
117
+ self.order_item_count = attributes[:'order_item_count']
118
+ end
119
+
120
+ if attributes.has_key?(:'page_view_count')
121
+ self.page_view_count = attributes[:'page_view_count']
122
+ end
123
+
124
+ if attributes.has_key?(:'revenue')
125
+ self.revenue = attributes[:'revenue']
126
+ end
127
+
128
+ if attributes.has_key?(:'session_count')
129
+ self.session_count = attributes[:'session_count']
130
+ end
131
+
132
+ if attributes.has_key?(:'stat_dts')
133
+ self.stat_dts = attributes[:'stat_dts']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ add_to_cart_count == o.add_to_cart_count &&
156
+ bounce_count == o.bounce_count &&
157
+ duration_seconds_sum == o.duration_seconds_sum &&
158
+ event_count == o.event_count &&
159
+ initiate_checkout_count == o.initiate_checkout_count &&
160
+ order_count == o.order_count &&
161
+ order_item_count == o.order_item_count &&
162
+ page_view_count == o.page_view_count &&
163
+ revenue == o.revenue &&
164
+ session_count == o.session_count &&
165
+ stat_dts == o.stat_dts
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Fixnum] Hash code
176
+ def hash
177
+ [add_to_cart_count, bounce_count, duration_seconds_sum, event_count, initiate_checkout_count, order_count, order_item_count, page_view_count, revenue, session_count, stat_dts].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.swagger_types.each_pair do |key, type|
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :DateTime
207
+ DateTime.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :BOOLEAN
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ temp_model = UltracartClient.const_get(type).new
238
+ temp_model.build_from_hash(value)
239
+ end
240
+ end
241
+
242
+ # Returns the string representation of the object
243
+ # @return [String] String presentation of the object
244
+ def to_s
245
+ to_hash.to_s
246
+ end
247
+
248
+ # to_body is an alias to to_hash (backward compatibility)
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_body
251
+ to_hash
252
+ end
253
+
254
+ # Returns the object in the form of hash
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_hash
257
+ hash = {}
258
+ self.class.attribute_map.each_pair do |attr, param|
259
+ value = self.send(attr)
260
+ next if value.nil?
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ end
285
+ end
@@ -48,6 +48,9 @@ module UltracartClient
48
48
 
49
49
  attr_accessor :enrollment123
50
50
 
51
+ # Fulfillment Add-ons
52
+ attr_accessor :fulfillment_addons
53
+
51
54
  attr_accessor :gift_certificate
52
55
 
53
56
  attr_accessor :google_product_search
@@ -151,6 +154,7 @@ module UltracartClient
151
154
  :'ebay' => :'ebay',
152
155
  :'email_notifications' => :'email_notifications',
153
156
  :'enrollment123' => :'enrollment123',
157
+ :'fulfillment_addons' => :'fulfillment_addons',
154
158
  :'gift_certificate' => :'gift_certificate',
155
159
  :'google_product_search' => :'google_product_search',
156
160
  :'identifiers' => :'identifiers',
@@ -207,6 +211,7 @@ module UltracartClient
207
211
  :'ebay' => :'ItemEbay',
208
212
  :'email_notifications' => :'ItemEmailNotifications',
209
213
  :'enrollment123' => :'ItemEnrollment123',
214
+ :'fulfillment_addons' => :'Array<ItemFulfillmentAddon>',
210
215
  :'gift_certificate' => :'ItemGiftCertificate',
211
216
  :'google_product_search' => :'ItemGoogleProductSearch',
212
217
  :'identifiers' => :'ItemIdentifiers',
@@ -315,6 +320,12 @@ module UltracartClient
315
320
  self.enrollment123 = attributes[:'enrollment123']
316
321
  end
317
322
 
323
+ if attributes.has_key?(:'fulfillment_addons')
324
+ if (value = attributes[:'fulfillment_addons']).is_a?(Array)
325
+ self.fulfillment_addons = value
326
+ end
327
+ end
328
+
318
329
  if attributes.has_key?(:'gift_certificate')
319
330
  self.gift_certificate = attributes[:'gift_certificate']
320
331
  end
@@ -544,6 +555,7 @@ module UltracartClient
544
555
  ebay == o.ebay &&
545
556
  email_notifications == o.email_notifications &&
546
557
  enrollment123 == o.enrollment123 &&
558
+ fulfillment_addons == o.fulfillment_addons &&
547
559
  gift_certificate == o.gift_certificate &&
548
560
  google_product_search == o.google_product_search &&
549
561
  identifiers == o.identifiers &&
@@ -590,7 +602,7 @@ module UltracartClient
590
602
  # Calculates hash code according to all attributes.
591
603
  # @return [Fixnum] Hash code
592
604
  def hash
593
- [accounting, amember, auto_order, ccbill, channel_partner_item_mappings, chargeback, checkout, content, creation_dts, description, description_translated_text_instance_oid, digital_delivery, ebay, email_notifications, enrollment123, gift_certificate, google_product_search, identifiers, inactive, instant_payment_notifications, internal, kit, kit_component_only, kit_definition, last_modified_dts, merchant_id, merchant_item_id, merchant_item_oid, options, parent_category_id, parent_category_path, payment_processing, physical, pricing, properties, realtime_pricing, recommend_replenishment_days, related, reporting, restriction, revguard, reviews, salesforce, shipping, tags, tax, third_party_email_marketing, variant_items, variations, wishlist_member].hash
605
+ [accounting, amember, auto_order, ccbill, channel_partner_item_mappings, chargeback, checkout, content, creation_dts, description, description_translated_text_instance_oid, digital_delivery, ebay, email_notifications, enrollment123, fulfillment_addons, gift_certificate, google_product_search, identifiers, inactive, instant_payment_notifications, internal, kit, kit_component_only, kit_definition, last_modified_dts, merchant_id, merchant_item_id, merchant_item_oid, options, parent_category_id, parent_category_path, payment_processing, physical, pricing, properties, realtime_pricing, recommend_replenishment_days, related, reporting, restriction, revguard, reviews, salesforce, shipping, tags, tax, third_party_email_marketing, variant_items, variations, wishlist_member].hash
594
606
  end
595
607
 
596
608
  # Builds the object from hash
@@ -56,7 +56,7 @@ module UltracartClient
56
56
  # Email list identifier to subscribe the customer to when this rebill occurs
57
57
  attr_accessor :subscribe_email_list_oid
58
58
 
59
- # Type of step (item or pause)
59
+ # Type of step (item, kit only, loop or pause)
60
60
  attr_accessor :type
61
61
 
62
62
  class EnumAttributeValidator
@@ -211,7 +211,7 @@ module UltracartClient
211
211
  # @return true if the model is valid
212
212
  def valid?
213
213
  return false if !@recurring_merchant_item_id.nil? && @recurring_merchant_item_id.to_s.length > 20
214
- type_validator = EnumAttributeValidator.new('String', ['item', 'pause'])
214
+ type_validator = EnumAttributeValidator.new('String', ['item', 'pause', 'loop', 'kit only'])
215
215
  return false unless type_validator.valid?(@type)
216
216
  true
217
217
  end
@@ -229,7 +229,7 @@ module UltracartClient
229
229
  # Custom attribute writer method checking allowed values (enum).
230
230
  # @param [Object] type Object to be assigned
231
231
  def type=(type)
232
- validator = EnumAttributeValidator.new('String', ['item', 'pause'])
232
+ validator = EnumAttributeValidator.new('String', ['item', 'pause', 'loop', 'kit only'])
233
233
  unless validator.valid?(type)
234
234
  fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
235
235
  end
@@ -0,0 +1,215 @@
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 ItemFulfillmentAddon
17
+ # Add Item Id
18
+ attr_accessor :add_item_id
19
+
20
+ # Add Item object identifier
21
+ attr_accessor :add_item_oid
22
+
23
+ # Quantity
24
+ attr_accessor :once_per_order
25
+
26
+ # Quantity
27
+ attr_accessor :quantity
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'add_item_id' => :'add_item_id',
33
+ :'add_item_oid' => :'add_item_oid',
34
+ :'once_per_order' => :'once_per_order',
35
+ :'quantity' => :'quantity'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'add_item_id' => :'String',
43
+ :'add_item_oid' => :'Integer',
44
+ :'once_per_order' => :'BOOLEAN',
45
+ :'quantity' => :'Integer'
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?(:'add_item_id')
58
+ self.add_item_id = attributes[:'add_item_id']
59
+ end
60
+
61
+ if attributes.has_key?(:'add_item_oid')
62
+ self.add_item_oid = attributes[:'add_item_oid']
63
+ end
64
+
65
+ if attributes.has_key?(:'once_per_order')
66
+ self.once_per_order = attributes[:'once_per_order']
67
+ end
68
+
69
+ if attributes.has_key?(:'quantity')
70
+ self.quantity = attributes[:'quantity']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ add_item_id == o.add_item_id &&
93
+ add_item_oid == o.add_item_oid &&
94
+ once_per_order == o.once_per_order &&
95
+ quantity == o.quantity
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [add_item_id, add_item_oid, once_per_order, quantity].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = UltracartClient.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+ end
@@ -23,6 +23,9 @@ module UltracartClient
23
23
  # Available to allocate
24
24
  attr_accessor :available_to_allocate
25
25
 
26
+ # Cost of goods sold override at the distribution center level
27
+ attr_accessor :cogs
28
+
26
29
  # Desired inventory level
27
30
  attr_accessor :desired_inventory_level
28
31
 
@@ -59,6 +62,7 @@ module UltracartClient
59
62
  :'allocated_to_placed_orders' => :'allocated_to_placed_orders',
60
63
  :'allocated_to_shopping_carts' => :'allocated_to_shopping_carts',
61
64
  :'available_to_allocate' => :'available_to_allocate',
65
+ :'cogs' => :'cogs',
62
66
  :'desired_inventory_level' => :'desired_inventory_level',
63
67
  :'distribution_center_code' => :'distribution_center_code',
64
68
  :'distribution_center_oid' => :'distribution_center_oid',
@@ -78,6 +82,7 @@ module UltracartClient
78
82
  :'allocated_to_placed_orders' => :'Float',
79
83
  :'allocated_to_shopping_carts' => :'Float',
80
84
  :'available_to_allocate' => :'Float',
85
+ :'cogs' => :'Float',
81
86
  :'desired_inventory_level' => :'Float',
82
87
  :'distribution_center_code' => :'String',
83
88
  :'distribution_center_oid' => :'Integer',
@@ -111,6 +116,10 @@ module UltracartClient
111
116
  self.available_to_allocate = attributes[:'available_to_allocate']
112
117
  end
113
118
 
119
+ if attributes.has_key?(:'cogs')
120
+ self.cogs = attributes[:'cogs']
121
+ end
122
+
114
123
  if attributes.has_key?(:'desired_inventory_level')
115
124
  self.desired_inventory_level = attributes[:'desired_inventory_level']
116
125
  end
@@ -203,6 +212,7 @@ module UltracartClient
203
212
  allocated_to_placed_orders == o.allocated_to_placed_orders &&
204
213
  allocated_to_shopping_carts == o.allocated_to_shopping_carts &&
205
214
  available_to_allocate == o.available_to_allocate &&
215
+ cogs == o.cogs &&
206
216
  desired_inventory_level == o.desired_inventory_level &&
207
217
  distribution_center_code == o.distribution_center_code &&
208
218
  distribution_center_oid == o.distribution_center_oid &&
@@ -224,7 +234,7 @@ module UltracartClient
224
234
  # Calculates hash code according to all attributes.
225
235
  # @return [Fixnum] Hash code
226
236
  def hash
227
- [allocated_to_placed_orders, allocated_to_shopping_carts, available_to_allocate, desired_inventory_level, distribution_center_code, distribution_center_oid, eta, handles, inventory_level, maximum_backorder, reorder_inventory_level, sku, stock_picking_location].hash
237
+ [allocated_to_placed_orders, allocated_to_shopping_carts, available_to_allocate, cogs, desired_inventory_level, distribution_center_code, distribution_center_oid, eta, handles, inventory_level, maximum_backorder, reorder_inventory_level, sku, stock_picking_location].hash
228
238
  end
229
239
 
230
240
  # Builds the object from hash
@@ -151,9 +151,6 @@ module UltracartClient
151
151
 
152
152
  attr_accessor :total_refunded
153
153
 
154
- # Tracking number, if null or missing, use order level tracking number(s). Used if there are multiple shipments for one order
155
- attr_accessor :tracking_number
156
-
157
154
  # Date/time that this item was transmitted to the distribution center
158
155
  attr_accessor :transmitted_to_distribution_center_dts
159
156
 
@@ -218,7 +215,6 @@ module UltracartClient
218
215
  :'taxable_cost' => :'taxable_cost',
219
216
  :'total_cost_with_discount' => :'total_cost_with_discount',
220
217
  :'total_refunded' => :'total_refunded',
221
- :'tracking_number' => :'tracking_number',
222
218
  :'transmitted_to_distribution_center_dts' => :'transmitted_to_distribution_center_dts',
223
219
  :'unit_cost_with_discount' => :'unit_cost_with_discount',
224
220
  :'upsell' => :'upsell',
@@ -279,7 +275,6 @@ module UltracartClient
279
275
  :'taxable_cost' => :'Currency',
280
276
  :'total_cost_with_discount' => :'Currency',
281
277
  :'total_refunded' => :'Currency',
282
- :'tracking_number' => :'String',
283
278
  :'transmitted_to_distribution_center_dts' => :'String',
284
279
  :'unit_cost_with_discount' => :'Currency',
285
280
  :'upsell' => :'BOOLEAN',
@@ -500,10 +495,6 @@ module UltracartClient
500
495
  self.total_refunded = attributes[:'total_refunded']
501
496
  end
502
497
 
503
- if attributes.has_key?(:'tracking_number')
504
- self.tracking_number = attributes[:'tracking_number']
505
- end
506
-
507
498
  if attributes.has_key?(:'transmitted_to_distribution_center_dts')
508
499
  self.transmitted_to_distribution_center_dts = attributes[:'transmitted_to_distribution_center_dts']
509
500
  end
@@ -682,7 +673,6 @@ module UltracartClient
682
673
  taxable_cost == o.taxable_cost &&
683
674
  total_cost_with_discount == o.total_cost_with_discount &&
684
675
  total_refunded == o.total_refunded &&
685
- tracking_number == o.tracking_number &&
686
676
  transmitted_to_distribution_center_dts == o.transmitted_to_distribution_center_dts &&
687
677
  unit_cost_with_discount == o.unit_cost_with_discount &&
688
678
  upsell == o.upsell &&
@@ -699,7 +689,7 @@ module UltracartClient
699
689
  # Calculates hash code according to all attributes.
700
690
  # @return [Fixnum] Hash code
701
691
  def hash
702
- [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, ship_separately, shipped_by_user, shipped_dts, special_product_type, tags, tax_free, taxable_cost, total_cost_with_discount, total_refunded, tracking_number, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
692
+ [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, ship_separately, shipped_by_user, shipped_dts, special_product_type, tags, tax_free, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
703
693
  end
704
694
 
705
695
  # Builds the object from hash