ultracart_api 4.1.20 → 4.1.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.
@@ -0,0 +1,265 @@
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 CustomReportChartPngUploadResponse
18
+ attr_accessor :error
19
+
20
+ attr_accessor :metadata
21
+
22
+ attr_accessor :signed_download_url
23
+
24
+ attr_accessor :signed_upload_url
25
+
26
+ # Indicates if API call was successful
27
+ attr_accessor :success
28
+
29
+ attr_accessor :warning
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'error' => :'error',
35
+ :'metadata' => :'metadata',
36
+ :'signed_download_url' => :'signed_download_url',
37
+ :'signed_upload_url' => :'signed_upload_url',
38
+ :'success' => :'success',
39
+ :'warning' => :'warning'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'error' => :'Error',
52
+ :'metadata' => :'ResponseMetadata',
53
+ :'signed_download_url' => :'String',
54
+ :'signed_upload_url' => :'String',
55
+ :'success' => :'Boolean',
56
+ :'warning' => :'Warning'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomReportChartPngUploadResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomReportChartPngUploadResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'error')
82
+ self.error = attributes[:'error']
83
+ end
84
+
85
+ if attributes.key?(:'metadata')
86
+ self.metadata = attributes[:'metadata']
87
+ end
88
+
89
+ if attributes.key?(:'signed_download_url')
90
+ self.signed_download_url = attributes[:'signed_download_url']
91
+ end
92
+
93
+ if attributes.key?(:'signed_upload_url')
94
+ self.signed_upload_url = attributes[:'signed_upload_url']
95
+ end
96
+
97
+ if attributes.key?(:'success')
98
+ self.success = attributes[:'success']
99
+ end
100
+
101
+ if attributes.key?(:'warning')
102
+ self.warning = attributes[:'warning']
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
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ error == o.error &&
125
+ metadata == o.metadata &&
126
+ signed_download_url == o.signed_download_url &&
127
+ signed_upload_url == o.signed_upload_url &&
128
+ success == o.success &&
129
+ warning == o.warning
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [error, metadata, signed_download_url, signed_upload_url, success, warning].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
+ self.send("#{key}=", nil)
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = UltracartClient.const_get(type)
213
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -82,6 +82,9 @@ module UltracartClient
82
82
  # Exempt shipping handling charge
83
83
  attr_accessor :exempt_shipping_handling_charge
84
84
 
85
+ # Fax Number
86
+ attr_accessor :fax
87
+
85
88
  # FedEx account number
86
89
  attr_accessor :fedex_account_number
87
90
 
@@ -225,6 +228,7 @@ module UltracartClient
225
228
  :'edi' => :'edi',
226
229
  :'email' => :'email',
227
230
  :'exempt_shipping_handling_charge' => :'exempt_shipping_handling_charge',
231
+ :'fax' => :'fax',
228
232
  :'fedex_account_number' => :'fedex_account_number',
229
233
  :'free_shipping' => :'free_shipping',
230
234
  :'free_shipping_minimum' => :'free_shipping_minimum',
@@ -300,6 +304,7 @@ module UltracartClient
300
304
  :'edi' => :'CustomerEDI',
301
305
  :'email' => :'String',
302
306
  :'exempt_shipping_handling_charge' => :'Boolean',
307
+ :'fax' => :'String',
303
308
  :'fedex_account_number' => :'String',
304
309
  :'free_shipping' => :'Boolean',
305
310
  :'free_shipping_minimum' => :'Float',
@@ -465,6 +470,10 @@ module UltracartClient
465
470
  self.exempt_shipping_handling_charge = attributes[:'exempt_shipping_handling_charge']
466
471
  end
467
472
 
473
+ if attributes.key?(:'fax')
474
+ self.fax = attributes[:'fax']
475
+ end
476
+
468
477
  if attributes.key?(:'fedex_account_number')
469
478
  self.fedex_account_number = attributes[:'fedex_account_number']
470
479
  end
@@ -660,6 +669,10 @@ module UltracartClient
660
669
  invalid_properties.push('invalid value for "dhl_duty_account_number", the character length must be smaller than or equal to 20.')
661
670
  end
662
671
 
672
+ if !@fax.nil? && @fax.to_s.length > 32
673
+ invalid_properties.push('invalid value for "fax", the character length must be smaller than or equal to 32.')
674
+ end
675
+
663
676
  if !@fedex_account_number.nil? && @fedex_account_number.to_s.length > 20
664
677
  invalid_properties.push('invalid value for "fedex_account_number", the character length must be smaller than or equal to 20.')
665
678
  end
@@ -701,6 +714,7 @@ module UltracartClient
701
714
  return false if !@business_notes.nil? && @business_notes.to_s.length > 2000
702
715
  return false if !@dhl_account_number.nil? && @dhl_account_number.to_s.length > 20
703
716
  return false if !@dhl_duty_account_number.nil? && @dhl_duty_account_number.to_s.length > 20
717
+ return false if !@fax.nil? && @fax.to_s.length > 32
704
718
  return false if !@fedex_account_number.nil? && @fedex_account_number.to_s.length > 20
705
719
  return false if !@last_modified_by.nil? && @last_modified_by.to_s.length > 100
706
720
  return false if !@password.nil? && @password.to_s.length > 30
@@ -742,6 +756,16 @@ module UltracartClient
742
756
  @dhl_duty_account_number = dhl_duty_account_number
743
757
  end
744
758
 
759
+ # Custom attribute writer method with validation
760
+ # @param [Object] fax Value to be assigned
761
+ def fax=(fax)
762
+ if !fax.nil? && fax.to_s.length > 32
763
+ fail ArgumentError, 'invalid value for "fax", the character length must be smaller than or equal to 32.'
764
+ end
765
+
766
+ @fax = fax
767
+ end
768
+
745
769
  # Custom attribute writer method with validation
746
770
  # @param [Object] fedex_account_number Value to be assigned
747
771
  def fedex_account_number=(fedex_account_number)
@@ -850,6 +874,7 @@ module UltracartClient
850
874
  edi == o.edi &&
851
875
  email == o.email &&
852
876
  exempt_shipping_handling_charge == o.exempt_shipping_handling_charge &&
877
+ fax == o.fax &&
853
878
  fedex_account_number == o.fedex_account_number &&
854
879
  free_shipping == o.free_shipping &&
855
880
  free_shipping_minimum == o.free_shipping_minimum &&
@@ -902,7 +927,7 @@ module UltracartClient
902
927
  # Calculates hash code according to all attributes.
903
928
  # @return [Integer] Hash code
904
929
  def hash
905
- [activity, affiliate_oid, allow_3rd_party_billing, allow_cod, allow_drop_shipping, allow_purchase_order, allow_quote_request, allow_selection_of_address_type, attachments, auto_approve_cod, auto_approve_purchase_order, automatic_merchant_notes, billing, business_notes, cards, cc_emails, customer_profile_oid, dhl_account_number, dhl_duty_account_number, do_not_send_mail, edi, email, exempt_shipping_handling_charge, fedex_account_number, free_shipping, free_shipping_minimum, last_modified_by, last_modified_dts, loyalty, maximum_item_count, merchant_id, minimum_item_count, minimum_subtotal, no_coupons, no_free_shipping, no_realtime_charge, orders, orders_summary, password, pricing_tiers, privacy, properties, qb_class, qb_code, qb_tax_exemption_reason_code, quotes, quotes_summary, referral_source, reviewer, sales_rep_code, send_signup_notification, shipping, signup_dts, software_entitlements, suppress_buysafe, tags, tax_codes, tax_exempt, tax_id, terms, track_separately, unapproved, ups_account_number, website_url].hash
930
+ [activity, affiliate_oid, allow_3rd_party_billing, allow_cod, allow_drop_shipping, allow_purchase_order, allow_quote_request, allow_selection_of_address_type, attachments, auto_approve_cod, auto_approve_purchase_order, automatic_merchant_notes, billing, business_notes, cards, cc_emails, customer_profile_oid, dhl_account_number, dhl_duty_account_number, do_not_send_mail, edi, email, exempt_shipping_handling_charge, fax, fedex_account_number, free_shipping, free_shipping_minimum, last_modified_by, last_modified_dts, loyalty, maximum_item_count, merchant_id, minimum_item_count, minimum_subtotal, no_coupons, no_free_shipping, no_realtime_charge, orders, orders_summary, password, pricing_tiers, privacy, properties, qb_class, qb_code, qb_tax_exemption_reason_code, quotes, quotes_summary, referral_source, reviewer, sales_rep_code, send_signup_notification, shipping, signup_dts, software_entitlements, suppress_buysafe, tags, tax_codes, tax_exempt, tax_id, terms, track_separately, unapproved, ups_account_number, website_url].hash
906
931
  end
907
932
 
908
933
  # Builds the object from hash
@@ -57,6 +57,9 @@ module UltracartClient
57
57
  # Shipping method validity
58
58
  attr_accessor :shipping_method_validity
59
59
 
60
+ # Ships separately
61
+ attr_accessor :ships_separately
62
+
60
63
  # Signature required
61
64
  attr_accessor :signature_required
62
65
 
@@ -99,6 +102,7 @@ module UltracartClient
99
102
  :'shipping_method' => :'shipping_method',
100
103
  :'shipping_method_oid' => :'shipping_method_oid',
101
104
  :'shipping_method_validity' => :'shipping_method_validity',
105
+ :'ships_separately' => :'ships_separately',
102
106
  :'signature_required' => :'signature_required'
103
107
  }
104
108
  end
@@ -125,6 +129,7 @@ module UltracartClient
125
129
  :'shipping_method' => :'String',
126
130
  :'shipping_method_oid' => :'Integer',
127
131
  :'shipping_method_validity' => :'String',
132
+ :'ships_separately' => :'Boolean',
128
133
  :'signature_required' => :'Boolean'
129
134
  }
130
135
  end
@@ -206,6 +211,10 @@ module UltracartClient
206
211
  self.shipping_method_validity = attributes[:'shipping_method_validity']
207
212
  end
208
213
 
214
+ if attributes.key?(:'ships_separately')
215
+ self.ships_separately = attributes[:'ships_separately']
216
+ end
217
+
209
218
  if attributes.key?(:'signature_required')
210
219
  self.signature_required = attributes[:'signature_required']
211
220
  end
@@ -255,6 +264,7 @@ module UltracartClient
255
264
  shipping_method == o.shipping_method &&
256
265
  shipping_method_oid == o.shipping_method_oid &&
257
266
  shipping_method_validity == o.shipping_method_validity &&
267
+ ships_separately == o.ships_separately &&
258
268
  signature_required == o.signature_required
259
269
  end
260
270
 
@@ -267,7 +277,7 @@ module UltracartClient
267
277
  # Calculates hash code according to all attributes.
268
278
  # @return [Integer] Hash code
269
279
  def hash
270
- [cost, each_additional_item_markup, filter_to_if_available, first_item_markup, fixed_shipping_cost, flat_fee_markup, free_shipping, per_item_fee_markup, percentage_markup, percentage_of_item_markup, relax_restrictions_on_upsell, shipping_method, shipping_method_oid, shipping_method_validity, signature_required].hash
280
+ [cost, each_additional_item_markup, filter_to_if_available, first_item_markup, fixed_shipping_cost, flat_fee_markup, free_shipping, per_item_fee_markup, percentage_markup, percentage_of_item_markup, relax_restrictions_on_upsell, shipping_method, shipping_method_oid, shipping_method_validity, ships_separately, signature_required].hash
271
281
  end
272
282
 
273
283
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class ItemTag
18
- # tag_tpe
18
+ # tag_type
19
19
  attr_accessor :tag_type
20
20
 
21
21
  # tag_value
@@ -260,7 +260,7 @@ module UltracartClient
260
260
  # Check to see if the all the properties in the model are valid
261
261
  # @return true if the model is valid
262
262
  def valid?
263
- payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Goldbelly", "GoHighLevel", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
263
+ payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "Crypto", "eBay", "eCheck", "Google Shopping", "Goldbelly", "GoHighLevel", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
264
264
  return false unless payment_method_validator.valid?(@payment_method)
265
265
  payment_status_validator = EnumAttributeValidator.new('String', ["Unprocessed", "Authorized", "Capture Failed", "Processed", "Declined", "Voided", "Refunded", "Skipped"])
266
266
  return false unless payment_status_validator.valid?(@payment_status)
@@ -270,7 +270,7 @@ module UltracartClient
270
270
  # Custom attribute writer method checking allowed values (enum).
271
271
  # @param [Object] payment_method Object to be assigned
272
272
  def payment_method=(payment_method)
273
- validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Goldbelly", "GoHighLevel", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
273
+ validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "Crypto", "eBay", "eCheck", "Google Shopping", "Goldbelly", "GoHighLevel", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
274
274
  unless validator.valid?(payment_method)
275
275
  fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
276
276
  end