ultracart_api 4.0.238 → 4.0.241

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.
@@ -0,0 +1,286 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class OrderCurrentStageHistory
18
+ # New stage that the order is in.
19
+ attr_accessor :after_stage
20
+
21
+ # Previous stage that the order was in.
22
+ attr_accessor :before_stage
23
+
24
+ # Date/time that the stage transitioned
25
+ attr_accessor :transition_dts
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'after_stage' => :'after_stage',
53
+ :'before_stage' => :'before_stage',
54
+ :'transition_dts' => :'transition_dts'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'after_stage' => :'String',
67
+ :'before_stage' => :'String',
68
+ :'transition_dts' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderCurrentStageHistory` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderCurrentStageHistory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'after_stage')
94
+ self.after_stage = attributes[:'after_stage']
95
+ end
96
+
97
+ if attributes.key?(:'before_stage')
98
+ self.before_stage = attributes[:'before_stage']
99
+ end
100
+
101
+ if attributes.key?(:'transition_dts')
102
+ self.transition_dts = attributes[:'transition_dts']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ after_stage_validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Pre-ordered", "Advanced Order Routing", "Hold"])
117
+ return false unless after_stage_validator.valid?(@after_stage)
118
+ before_stage_validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Pre-ordered", "Advanced Order Routing", "Hold"])
119
+ return false unless before_stage_validator.valid?(@before_stage)
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method checking allowed values (enum).
124
+ # @param [Object] after_stage Object to be assigned
125
+ def after_stage=(after_stage)
126
+ validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Pre-ordered", "Advanced Order Routing", "Hold"])
127
+ unless validator.valid?(after_stage)
128
+ fail ArgumentError, "invalid value for \"after_stage\", must be one of #{validator.allowable_values}."
129
+ end
130
+ @after_stage = after_stage
131
+ end
132
+
133
+ # Custom attribute writer method checking allowed values (enum).
134
+ # @param [Object] before_stage Object to be assigned
135
+ def before_stage=(before_stage)
136
+ validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Pre-ordered", "Advanced Order Routing", "Hold"])
137
+ unless validator.valid?(before_stage)
138
+ fail ArgumentError, "invalid value for \"before_stage\", must be one of #{validator.allowable_values}."
139
+ end
140
+ @before_stage = before_stage
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ after_stage == o.after_stage &&
149
+ before_stage == o.before_stage &&
150
+ transition_dts == o.transition_dts
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [after_stage, before_stage, transition_dts].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ self.class.openapi_types.each_pair do |key, type|
179
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
180
+ self.send("#{key}=", nil)
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
185
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
186
+ end
187
+ elsif !attributes[self.class.attribute_map[key]].nil?
188
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
189
+ end
190
+ end
191
+
192
+ self
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def _deserialize(type, value)
200
+ case type.to_sym
201
+ when :Time
202
+ Time.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ # models (e.g. Pet) or oneOf
233
+ klass = UltracartClient.const_get(type)
234
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
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
+
286
+ end
@@ -21,6 +21,8 @@ module UltracartClient
21
21
  # Activation codes assigned to this item
22
22
  attr_accessor :activation_codes
23
23
 
24
+ attr_accessor :actual_cogs
25
+
24
26
  attr_accessor :arbitrary_unit_cost
25
27
 
26
28
  # Date/time of the last rebill, used only during order insert to help project future rebills
@@ -224,6 +226,7 @@ module UltracartClient
224
226
  {
225
227
  :'accounting_code' => :'accounting_code',
226
228
  :'activation_codes' => :'activation_codes',
229
+ :'actual_cogs' => :'actual_cogs',
227
230
  :'arbitrary_unit_cost' => :'arbitrary_unit_cost',
228
231
  :'auto_order_last_rebill_dts' => :'auto_order_last_rebill_dts',
229
232
  :'auto_order_schedule' => :'auto_order_schedule',
@@ -300,6 +303,7 @@ module UltracartClient
300
303
  {
301
304
  :'accounting_code' => :'String',
302
305
  :'activation_codes' => :'Array<String>',
306
+ :'actual_cogs' => :'Currency',
303
307
  :'arbitrary_unit_cost' => :'Currency',
304
308
  :'auto_order_last_rebill_dts' => :'String',
305
309
  :'auto_order_schedule' => :'String',
@@ -397,6 +401,10 @@ module UltracartClient
397
401
  end
398
402
  end
399
403
 
404
+ if attributes.key?(:'actual_cogs')
405
+ self.actual_cogs = attributes[:'actual_cogs']
406
+ end
407
+
400
408
  if attributes.key?(:'arbitrary_unit_cost')
401
409
  self.arbitrary_unit_cost = attributes[:'arbitrary_unit_cost']
402
410
  end
@@ -853,6 +861,7 @@ module UltracartClient
853
861
  self.class == o.class &&
854
862
  accounting_code == o.accounting_code &&
855
863
  activation_codes == o.activation_codes &&
864
+ actual_cogs == o.actual_cogs &&
856
865
  arbitrary_unit_cost == o.arbitrary_unit_cost &&
857
866
  auto_order_last_rebill_dts == o.auto_order_last_rebill_dts &&
858
867
  auto_order_schedule == o.auto_order_schedule &&
@@ -927,7 +936,7 @@ module UltracartClient
927
936
  # Calculates hash code according to all attributes.
928
937
  # @return [Integer] Hash code
929
938
  def hash
930
- [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, barcode_gtin12, barcode_gtin14, barcode_upc11, barcode_upc12, 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_index, 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, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, refund_reason, return_reason, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
939
+ [accounting_code, activation_codes, actual_cogs, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, barcode_gtin12, barcode_gtin14, barcode_upc11, barcode_upc12, 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_index, 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, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, refund_reason, return_reason, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
931
940
  end
932
941
 
933
942
  # Builds the object from hash
@@ -17,8 +17,18 @@ module UltracartClient
17
17
  class OrderSummary
18
18
  attr_accessor :actual_fulfillment
19
19
 
20
+ attr_accessor :actual_other_cost
21
+
20
22
  attr_accessor :actual_payment_processing
21
23
 
24
+ attr_accessor :actual_profit
25
+
26
+ # Actual profit has been analyzed
27
+ attr_accessor :actual_profit_analyzed
28
+
29
+ # Actual profit needs review
30
+ attr_accessor :actual_profit_review
31
+
22
32
  attr_accessor :actual_shipping
23
33
 
24
34
  attr_accessor :arbitrary_shipping_handling_total
@@ -63,7 +73,11 @@ module UltracartClient
63
73
  def self.attribute_map
64
74
  {
65
75
  :'actual_fulfillment' => :'actual_fulfillment',
76
+ :'actual_other_cost' => :'actual_other_cost',
66
77
  :'actual_payment_processing' => :'actual_payment_processing',
78
+ :'actual_profit' => :'actual_profit',
79
+ :'actual_profit_analyzed' => :'actual_profit_analyzed',
80
+ :'actual_profit_review' => :'actual_profit_review',
67
81
  :'actual_shipping' => :'actual_shipping',
68
82
  :'arbitrary_shipping_handling_total' => :'arbitrary_shipping_handling_total',
69
83
  :'health_benefit_card_amount' => :'health_benefit_card_amount',
@@ -96,7 +110,11 @@ module UltracartClient
96
110
  def self.openapi_types
97
111
  {
98
112
  :'actual_fulfillment' => :'Currency',
113
+ :'actual_other_cost' => :'Currency',
99
114
  :'actual_payment_processing' => :'Currency',
115
+ :'actual_profit' => :'Currency',
116
+ :'actual_profit_analyzed' => :'Boolean',
117
+ :'actual_profit_review' => :'Boolean',
100
118
  :'actual_shipping' => :'Currency',
101
119
  :'arbitrary_shipping_handling_total' => :'Currency',
102
120
  :'health_benefit_card_amount' => :'Currency',
@@ -145,10 +163,26 @@ module UltracartClient
145
163
  self.actual_fulfillment = attributes[:'actual_fulfillment']
146
164
  end
147
165
 
166
+ if attributes.key?(:'actual_other_cost')
167
+ self.actual_other_cost = attributes[:'actual_other_cost']
168
+ end
169
+
148
170
  if attributes.key?(:'actual_payment_processing')
149
171
  self.actual_payment_processing = attributes[:'actual_payment_processing']
150
172
  end
151
173
 
174
+ if attributes.key?(:'actual_profit')
175
+ self.actual_profit = attributes[:'actual_profit']
176
+ end
177
+
178
+ if attributes.key?(:'actual_profit_analyzed')
179
+ self.actual_profit_analyzed = attributes[:'actual_profit_analyzed']
180
+ end
181
+
182
+ if attributes.key?(:'actual_profit_review')
183
+ self.actual_profit_review = attributes[:'actual_profit_review']
184
+ end
185
+
152
186
  if attributes.key?(:'actual_shipping')
153
187
  self.actual_shipping = attributes[:'actual_shipping']
154
188
  end
@@ -249,7 +283,11 @@ module UltracartClient
249
283
  return true if self.equal?(o)
250
284
  self.class == o.class &&
251
285
  actual_fulfillment == o.actual_fulfillment &&
286
+ actual_other_cost == o.actual_other_cost &&
252
287
  actual_payment_processing == o.actual_payment_processing &&
288
+ actual_profit == o.actual_profit &&
289
+ actual_profit_analyzed == o.actual_profit_analyzed &&
290
+ actual_profit_review == o.actual_profit_review &&
253
291
  actual_shipping == o.actual_shipping &&
254
292
  arbitrary_shipping_handling_total == o.arbitrary_shipping_handling_total &&
255
293
  health_benefit_card_amount == o.health_benefit_card_amount &&
@@ -281,7 +319,7 @@ module UltracartClient
281
319
  # Calculates hash code according to all attributes.
282
320
  # @return [Integer] Hash code
283
321
  def hash
284
- [actual_fulfillment, actual_payment_processing, actual_shipping, arbitrary_shipping_handling_total, health_benefit_card_amount, health_benefit_card_refunded, internal_gift_certificate_amount, internal_gift_certificate_refunded, other_refunded, shipping_handling_refunded, shipping_handling_total, shipping_handling_total_discount, subtotal, subtotal_discount, subtotal_discount_refunded, subtotal_refunded, tax, tax_refunded, taxable_subtotal, taxable_subtotal_discount, total, total_refunded].hash
322
+ [actual_fulfillment, actual_other_cost, actual_payment_processing, actual_profit, actual_profit_analyzed, actual_profit_review, actual_shipping, arbitrary_shipping_handling_total, health_benefit_card_amount, health_benefit_card_refunded, internal_gift_certificate_amount, internal_gift_certificate_refunded, other_refunded, shipping_handling_refunded, shipping_handling_total, shipping_handling_total_discount, subtotal, subtotal_discount, subtotal_discount_refunded, subtotal_refunded, tax, tax_refunded, taxable_subtotal, taxable_subtotal_discount, total, total_refunded].hash
285
323
  end
286
324
 
287
325
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.238'
14
+ VERSION = '4.0.241'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -634,6 +634,7 @@ require 'ultracart_api/models/order_by_token_query'
634
634
  require 'ultracart_api/models/order_channel_partner'
635
635
  require 'ultracart_api/models/order_checkout'
636
636
  require 'ultracart_api/models/order_coupon'
637
+ require 'ultracart_api/models/order_current_stage_history'
637
638
  require 'ultracart_api/models/order_digital_item'
638
639
  require 'ultracart_api/models/order_digital_order'
639
640
  require 'ultracart_api/models/order_edi'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.238
4
+ version: 4.0.241
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -693,6 +693,7 @@ files:
693
693
  - docs/OrderChannelPartner.md
694
694
  - docs/OrderCheckout.md
695
695
  - docs/OrderCoupon.md
696
+ - docs/OrderCurrentStageHistory.md
696
697
  - docs/OrderDigitalItem.md
697
698
  - docs/OrderDigitalOrder.md
698
699
  - docs/OrderEdi.md
@@ -1579,6 +1580,7 @@ files:
1579
1580
  - lib/ultracart_api/models/order_channel_partner.rb
1580
1581
  - lib/ultracart_api/models/order_checkout.rb
1581
1582
  - lib/ultracart_api/models/order_coupon.rb
1583
+ - lib/ultracart_api/models/order_current_stage_history.rb
1582
1584
  - lib/ultracart_api/models/order_digital_item.rb
1583
1585
  - lib/ultracart_api/models/order_digital_order.rb
1584
1586
  - lib/ultracart_api/models/order_edi.rb