zippendo 1.2.5 → 1.2.7
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.
- checksums.yaml +4 -4
- data/docs/GetOrder200Response.md +1 -1
- data/docs/GetOrder200ResponseOrderLinesInner.md +56 -0
- data/docs/GetOrder200ResponseShipmentsInner.md +3 -1
- data/docs/GetOrder200ResponseShipmentsInnerParcelsInner.md +26 -0
- data/docs/GetOrder200ResponseShipmentsInnerParcelsInnerOrderLinesInner.md +24 -0
- data/docs/UpdateOrderRequest.md +3 -1
- data/docs/UpdateOrgRequest.md +0 -2
- data/lib/zippendo/models/batch_send_shipments200_response_results_inner.rb +2 -2
- data/lib/zippendo/models/create_order201_response_order_lines_inner.rb +5 -14
- data/lib/zippendo/models/create_order201_response_shipping_address.rb +0 -54
- data/lib/zippendo/models/get_order200_response.rb +2 -2
- data/lib/zippendo/models/get_order200_response_order_lines_inner.rb +569 -0
- data/lib/zippendo/models/get_order200_response_shipments_inner.rb +33 -4
- data/lib/zippendo/models/get_order200_response_shipments_inner_parcels_inner.rb +307 -0
- data/lib/zippendo/models/get_order200_response_shipments_inner_parcels_inner_order_lines_inner.rb +232 -0
- data/lib/zippendo/models/list_api_tokens401_response.rb +2 -2
- data/lib/zippendo/models/send_shipment422_response.rb +2 -2
- data/lib/zippendo/models/update_order_request.rb +16 -5
- data/lib/zippendo/models/update_org_request.rb +1 -11
- data/lib/zippendo/version.rb +1 -1
- data/lib/zippendo.rb +3 -0
- metadata +7 -1
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zippendo Public API
|
|
3
|
+
|
|
4
|
+
#Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand's team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand's id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan's limit returns `403`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@zippendo.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zippendo
|
|
17
|
+
class GetOrder200ResponseOrderLinesInner < ApiModelBase
|
|
18
|
+
# Stock keeping unit identifier.
|
|
19
|
+
attr_accessor :sku
|
|
20
|
+
|
|
21
|
+
# Product name.
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# Quantity ordered.
|
|
25
|
+
attr_accessor :quantity
|
|
26
|
+
|
|
27
|
+
# Price per unit.
|
|
28
|
+
attr_accessor :unit_price
|
|
29
|
+
|
|
30
|
+
# Total price for the line.
|
|
31
|
+
attr_accessor :total_price
|
|
32
|
+
|
|
33
|
+
# ISO 4217 currency code.
|
|
34
|
+
attr_accessor :currency
|
|
35
|
+
|
|
36
|
+
# Item weight in the given unit.
|
|
37
|
+
attr_accessor :weight
|
|
38
|
+
|
|
39
|
+
# Unit of the weight value.
|
|
40
|
+
attr_accessor :weight_unit
|
|
41
|
+
|
|
42
|
+
# Platform variant identifier.
|
|
43
|
+
attr_accessor :variant_id
|
|
44
|
+
|
|
45
|
+
# Platform product identifier.
|
|
46
|
+
attr_accessor :product_id
|
|
47
|
+
|
|
48
|
+
# Product image URL.
|
|
49
|
+
attr_accessor :image_url
|
|
50
|
+
|
|
51
|
+
# Harmonized System customs code (6-13 digits).
|
|
52
|
+
attr_accessor :hs_code
|
|
53
|
+
|
|
54
|
+
# ISO 3166-1 alpha-2 country of origin.
|
|
55
|
+
attr_accessor :country_of_origin
|
|
56
|
+
|
|
57
|
+
# ISO 3166-2 province of origin.
|
|
58
|
+
attr_accessor :province_of_origin
|
|
59
|
+
|
|
60
|
+
# Item barcode (EAN/UPC).
|
|
61
|
+
attr_accessor :barcode
|
|
62
|
+
|
|
63
|
+
# Whether the item requires shipping.
|
|
64
|
+
attr_accessor :requires_shipping
|
|
65
|
+
|
|
66
|
+
# Whether the item is taxable.
|
|
67
|
+
attr_accessor :taxable
|
|
68
|
+
|
|
69
|
+
# Whether the item is a gift card.
|
|
70
|
+
attr_accessor :gift_card
|
|
71
|
+
|
|
72
|
+
# Vendor or brand name.
|
|
73
|
+
attr_accessor :vendor
|
|
74
|
+
|
|
75
|
+
# Quantity already allocated to outbound shipments.
|
|
76
|
+
attr_accessor :packed_quantity
|
|
77
|
+
|
|
78
|
+
class EnumAttributeValidator
|
|
79
|
+
attr_reader :datatype
|
|
80
|
+
attr_reader :allowable_values
|
|
81
|
+
|
|
82
|
+
def initialize(datatype, allowable_values)
|
|
83
|
+
@allowable_values = allowable_values.map do |value|
|
|
84
|
+
case datatype.to_s
|
|
85
|
+
when /Integer/i
|
|
86
|
+
value.to_i
|
|
87
|
+
when /Float/i
|
|
88
|
+
value.to_f
|
|
89
|
+
else
|
|
90
|
+
value
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def valid?(value)
|
|
96
|
+
!value || allowable_values.include?(value)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
101
|
+
def self.attribute_map
|
|
102
|
+
{
|
|
103
|
+
:'sku' => :'sku',
|
|
104
|
+
:'name' => :'name',
|
|
105
|
+
:'quantity' => :'quantity',
|
|
106
|
+
:'unit_price' => :'unitPrice',
|
|
107
|
+
:'total_price' => :'totalPrice',
|
|
108
|
+
:'currency' => :'currency',
|
|
109
|
+
:'weight' => :'weight',
|
|
110
|
+
:'weight_unit' => :'weightUnit',
|
|
111
|
+
:'variant_id' => :'variantId',
|
|
112
|
+
:'product_id' => :'productId',
|
|
113
|
+
:'image_url' => :'imageUrl',
|
|
114
|
+
:'hs_code' => :'hsCode',
|
|
115
|
+
:'country_of_origin' => :'countryOfOrigin',
|
|
116
|
+
:'province_of_origin' => :'provinceOfOrigin',
|
|
117
|
+
:'barcode' => :'barcode',
|
|
118
|
+
:'requires_shipping' => :'requiresShipping',
|
|
119
|
+
:'taxable' => :'taxable',
|
|
120
|
+
:'gift_card' => :'giftCard',
|
|
121
|
+
:'vendor' => :'vendor',
|
|
122
|
+
:'packed_quantity' => :'packedQuantity'
|
|
123
|
+
}
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Returns attribute mapping this model knows about
|
|
127
|
+
def self.acceptable_attribute_map
|
|
128
|
+
attribute_map
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Returns all the JSON keys this model knows about
|
|
132
|
+
def self.acceptable_attributes
|
|
133
|
+
acceptable_attribute_map.values
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Attribute type mapping.
|
|
137
|
+
def self.openapi_types
|
|
138
|
+
{
|
|
139
|
+
:'sku' => :'String',
|
|
140
|
+
:'name' => :'String',
|
|
141
|
+
:'quantity' => :'Integer',
|
|
142
|
+
:'unit_price' => :'Float',
|
|
143
|
+
:'total_price' => :'Float',
|
|
144
|
+
:'currency' => :'String',
|
|
145
|
+
:'weight' => :'Float',
|
|
146
|
+
:'weight_unit' => :'String',
|
|
147
|
+
:'variant_id' => :'String',
|
|
148
|
+
:'product_id' => :'String',
|
|
149
|
+
:'image_url' => :'String',
|
|
150
|
+
:'hs_code' => :'String',
|
|
151
|
+
:'country_of_origin' => :'String',
|
|
152
|
+
:'province_of_origin' => :'String',
|
|
153
|
+
:'barcode' => :'String',
|
|
154
|
+
:'requires_shipping' => :'Boolean',
|
|
155
|
+
:'taxable' => :'Boolean',
|
|
156
|
+
:'gift_card' => :'Boolean',
|
|
157
|
+
:'vendor' => :'String',
|
|
158
|
+
:'packed_quantity' => :'Integer'
|
|
159
|
+
}
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# List of attributes with nullable: true
|
|
163
|
+
def self.openapi_nullable
|
|
164
|
+
Set.new([
|
|
165
|
+
:'sku',
|
|
166
|
+
:'unit_price',
|
|
167
|
+
:'total_price',
|
|
168
|
+
:'currency',
|
|
169
|
+
:'weight',
|
|
170
|
+
:'weight_unit',
|
|
171
|
+
:'variant_id',
|
|
172
|
+
:'product_id',
|
|
173
|
+
:'image_url',
|
|
174
|
+
:'hs_code',
|
|
175
|
+
:'country_of_origin',
|
|
176
|
+
:'province_of_origin',
|
|
177
|
+
:'barcode',
|
|
178
|
+
:'requires_shipping',
|
|
179
|
+
:'taxable',
|
|
180
|
+
:'gift_card',
|
|
181
|
+
:'vendor',
|
|
182
|
+
])
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Initializes the object
|
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
187
|
+
def initialize(attributes = {})
|
|
188
|
+
if (!attributes.is_a?(Hash))
|
|
189
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::GetOrder200ResponseOrderLinesInner` initialize method"
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
193
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
194
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
195
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
196
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zippendo::GetOrder200ResponseOrderLinesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
197
|
+
end
|
|
198
|
+
h[k.to_sym] = v
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'sku')
|
|
202
|
+
self.sku = attributes[:'sku']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'name')
|
|
206
|
+
self.name = attributes[:'name']
|
|
207
|
+
else
|
|
208
|
+
self.name = nil
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'quantity')
|
|
212
|
+
self.quantity = attributes[:'quantity']
|
|
213
|
+
else
|
|
214
|
+
self.quantity = nil
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'unit_price')
|
|
218
|
+
self.unit_price = attributes[:'unit_price']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'total_price')
|
|
222
|
+
self.total_price = attributes[:'total_price']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'currency')
|
|
226
|
+
self.currency = attributes[:'currency']
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'weight')
|
|
230
|
+
self.weight = attributes[:'weight']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'weight_unit')
|
|
234
|
+
self.weight_unit = attributes[:'weight_unit']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'variant_id')
|
|
238
|
+
self.variant_id = attributes[:'variant_id']
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if attributes.key?(:'product_id')
|
|
242
|
+
self.product_id = attributes[:'product_id']
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'image_url')
|
|
246
|
+
self.image_url = attributes[:'image_url']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'hs_code')
|
|
250
|
+
self.hs_code = attributes[:'hs_code']
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if attributes.key?(:'country_of_origin')
|
|
254
|
+
self.country_of_origin = attributes[:'country_of_origin']
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if attributes.key?(:'province_of_origin')
|
|
258
|
+
self.province_of_origin = attributes[:'province_of_origin']
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if attributes.key?(:'barcode')
|
|
262
|
+
self.barcode = attributes[:'barcode']
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'requires_shipping')
|
|
266
|
+
self.requires_shipping = attributes[:'requires_shipping']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'taxable')
|
|
270
|
+
self.taxable = attributes[:'taxable']
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'gift_card')
|
|
274
|
+
self.gift_card = attributes[:'gift_card']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'vendor')
|
|
278
|
+
self.vendor = attributes[:'vendor']
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'packed_quantity')
|
|
282
|
+
self.packed_quantity = attributes[:'packed_quantity']
|
|
283
|
+
else
|
|
284
|
+
self.packed_quantity = nil
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
289
|
+
# @return Array for valid properties with the reasons
|
|
290
|
+
def list_invalid_properties
|
|
291
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
292
|
+
invalid_properties = Array.new
|
|
293
|
+
if @name.nil?
|
|
294
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
if @quantity.nil?
|
|
298
|
+
invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
if @quantity > 9007199254740991
|
|
302
|
+
invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 9007199254740991.')
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
if @quantity < 0
|
|
306
|
+
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 0.')
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
if !@unit_price.nil? && @unit_price < 0
|
|
310
|
+
invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
if !@total_price.nil? && @total_price < 0
|
|
314
|
+
invalid_properties.push('invalid value for "total_price", must be greater than or equal to 0.')
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
if !@currency.nil? && @currency.to_s.length > 3
|
|
318
|
+
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if !@currency.nil? && @currency.to_s.length < 3
|
|
322
|
+
invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.')
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if !@weight.nil? && @weight < 0
|
|
326
|
+
invalid_properties.push('invalid value for "weight", must be greater than or equal to 0.')
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
if !@country_of_origin.nil? && @country_of_origin.to_s.length > 2
|
|
330
|
+
invalid_properties.push('invalid value for "country_of_origin", the character length must be smaller than or equal to 2.')
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
if !@country_of_origin.nil? && @country_of_origin.to_s.length < 2
|
|
334
|
+
invalid_properties.push('invalid value for "country_of_origin", the character length must be greater than or equal to 2.')
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
if @packed_quantity.nil?
|
|
338
|
+
invalid_properties.push('invalid value for "packed_quantity", packed_quantity cannot be nil.')
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
if @packed_quantity > 9007199254740991
|
|
342
|
+
invalid_properties.push('invalid value for "packed_quantity", must be smaller than or equal to 9007199254740991.')
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
if @packed_quantity < 0
|
|
346
|
+
invalid_properties.push('invalid value for "packed_quantity", must be greater than or equal to 0.')
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
invalid_properties
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Check to see if the all the properties in the model are valid
|
|
353
|
+
# @return true if the model is valid
|
|
354
|
+
def valid?
|
|
355
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
356
|
+
return false if @name.nil?
|
|
357
|
+
return false if @quantity.nil?
|
|
358
|
+
return false if @quantity > 9007199254740991
|
|
359
|
+
return false if @quantity < 0
|
|
360
|
+
return false if !@unit_price.nil? && @unit_price < 0
|
|
361
|
+
return false if !@total_price.nil? && @total_price < 0
|
|
362
|
+
return false if !@currency.nil? && @currency.to_s.length > 3
|
|
363
|
+
return false if !@currency.nil? && @currency.to_s.length < 3
|
|
364
|
+
return false if !@weight.nil? && @weight < 0
|
|
365
|
+
weight_unit_validator = EnumAttributeValidator.new('String', ["kg", "g", "lb", "oz"])
|
|
366
|
+
return false unless weight_unit_validator.valid?(@weight_unit)
|
|
367
|
+
return false if !@country_of_origin.nil? && @country_of_origin.to_s.length > 2
|
|
368
|
+
return false if !@country_of_origin.nil? && @country_of_origin.to_s.length < 2
|
|
369
|
+
return false if @packed_quantity.nil?
|
|
370
|
+
return false if @packed_quantity > 9007199254740991
|
|
371
|
+
return false if @packed_quantity < 0
|
|
372
|
+
true
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
# Custom attribute writer method with validation
|
|
376
|
+
# @param [Object] name Value to be assigned
|
|
377
|
+
def name=(name)
|
|
378
|
+
if name.nil?
|
|
379
|
+
fail ArgumentError, 'name cannot be nil'
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
@name = name
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Custom attribute writer method with validation
|
|
386
|
+
# @param [Object] quantity Value to be assigned
|
|
387
|
+
def quantity=(quantity)
|
|
388
|
+
if quantity.nil?
|
|
389
|
+
fail ArgumentError, 'quantity cannot be nil'
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
if quantity > 9007199254740991
|
|
393
|
+
fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 9007199254740991.'
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
if quantity < 0
|
|
397
|
+
fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 0.'
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
@quantity = quantity
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Custom attribute writer method with validation
|
|
404
|
+
# @param [Object] unit_price Value to be assigned
|
|
405
|
+
def unit_price=(unit_price)
|
|
406
|
+
if !unit_price.nil? && unit_price < 0
|
|
407
|
+
fail ArgumentError, 'invalid value for "unit_price", must be greater than or equal to 0.'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@unit_price = unit_price
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# Custom attribute writer method with validation
|
|
414
|
+
# @param [Object] total_price Value to be assigned
|
|
415
|
+
def total_price=(total_price)
|
|
416
|
+
if !total_price.nil? && total_price < 0
|
|
417
|
+
fail ArgumentError, 'invalid value for "total_price", must be greater than or equal to 0.'
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
@total_price = total_price
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Custom attribute writer method with validation
|
|
424
|
+
# @param [Object] currency Value to be assigned
|
|
425
|
+
def currency=(currency)
|
|
426
|
+
if !currency.nil? && currency.to_s.length > 3
|
|
427
|
+
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
if !currency.nil? && currency.to_s.length < 3
|
|
431
|
+
fail ArgumentError, 'invalid value for "currency", the character length must be greater than or equal to 3.'
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
@currency = currency
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
# Custom attribute writer method with validation
|
|
438
|
+
# @param [Object] weight Value to be assigned
|
|
439
|
+
def weight=(weight)
|
|
440
|
+
if !weight.nil? && weight < 0
|
|
441
|
+
fail ArgumentError, 'invalid value for "weight", must be greater than or equal to 0.'
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
@weight = weight
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
448
|
+
# @param [Object] weight_unit Object to be assigned
|
|
449
|
+
def weight_unit=(weight_unit)
|
|
450
|
+
validator = EnumAttributeValidator.new('String', ["kg", "g", "lb", "oz"])
|
|
451
|
+
unless validator.valid?(weight_unit)
|
|
452
|
+
fail ArgumentError, "invalid value for \"weight_unit\", must be one of #{validator.allowable_values}."
|
|
453
|
+
end
|
|
454
|
+
@weight_unit = weight_unit
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# Custom attribute writer method with validation
|
|
458
|
+
# @param [Object] country_of_origin Value to be assigned
|
|
459
|
+
def country_of_origin=(country_of_origin)
|
|
460
|
+
if !country_of_origin.nil? && country_of_origin.to_s.length > 2
|
|
461
|
+
fail ArgumentError, 'invalid value for "country_of_origin", the character length must be smaller than or equal to 2.'
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
if !country_of_origin.nil? && country_of_origin.to_s.length < 2
|
|
465
|
+
fail ArgumentError, 'invalid value for "country_of_origin", the character length must be greater than or equal to 2.'
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
@country_of_origin = country_of_origin
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
# Custom attribute writer method with validation
|
|
472
|
+
# @param [Object] packed_quantity Value to be assigned
|
|
473
|
+
def packed_quantity=(packed_quantity)
|
|
474
|
+
if packed_quantity.nil?
|
|
475
|
+
fail ArgumentError, 'packed_quantity cannot be nil'
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
if packed_quantity > 9007199254740991
|
|
479
|
+
fail ArgumentError, 'invalid value for "packed_quantity", must be smaller than or equal to 9007199254740991.'
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
if packed_quantity < 0
|
|
483
|
+
fail ArgumentError, 'invalid value for "packed_quantity", must be greater than or equal to 0.'
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
@packed_quantity = packed_quantity
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
# Checks equality by comparing each attribute.
|
|
490
|
+
# @param [Object] Object to be compared
|
|
491
|
+
def ==(o)
|
|
492
|
+
return true if self.equal?(o)
|
|
493
|
+
self.class == o.class &&
|
|
494
|
+
sku == o.sku &&
|
|
495
|
+
name == o.name &&
|
|
496
|
+
quantity == o.quantity &&
|
|
497
|
+
unit_price == o.unit_price &&
|
|
498
|
+
total_price == o.total_price &&
|
|
499
|
+
currency == o.currency &&
|
|
500
|
+
weight == o.weight &&
|
|
501
|
+
weight_unit == o.weight_unit &&
|
|
502
|
+
variant_id == o.variant_id &&
|
|
503
|
+
product_id == o.product_id &&
|
|
504
|
+
image_url == o.image_url &&
|
|
505
|
+
hs_code == o.hs_code &&
|
|
506
|
+
country_of_origin == o.country_of_origin &&
|
|
507
|
+
province_of_origin == o.province_of_origin &&
|
|
508
|
+
barcode == o.barcode &&
|
|
509
|
+
requires_shipping == o.requires_shipping &&
|
|
510
|
+
taxable == o.taxable &&
|
|
511
|
+
gift_card == o.gift_card &&
|
|
512
|
+
vendor == o.vendor &&
|
|
513
|
+
packed_quantity == o.packed_quantity
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
# @see the `==` method
|
|
517
|
+
# @param [Object] Object to be compared
|
|
518
|
+
def eql?(o)
|
|
519
|
+
self == o
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
# Calculates hash code according to all attributes.
|
|
523
|
+
# @return [Integer] Hash code
|
|
524
|
+
def hash
|
|
525
|
+
[sku, name, quantity, unit_price, total_price, currency, weight, weight_unit, variant_id, product_id, image_url, hs_code, country_of_origin, province_of_origin, barcode, requires_shipping, taxable, gift_card, vendor, packed_quantity].hash
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
# Builds the object from hash
|
|
529
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
530
|
+
# @return [Object] Returns the model itself
|
|
531
|
+
def self.build_from_hash(attributes)
|
|
532
|
+
return nil unless attributes.is_a?(Hash)
|
|
533
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
534
|
+
transformed_hash = {}
|
|
535
|
+
openapi_types.each_pair do |key, type|
|
|
536
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
537
|
+
transformed_hash["#{key}"] = nil
|
|
538
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
539
|
+
# check to ensure the input is an array given that the attribute
|
|
540
|
+
# is documented as an array but the input is not
|
|
541
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
542
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
543
|
+
end
|
|
544
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
545
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
new(transformed_hash)
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# Returns the object in the form of hash
|
|
552
|
+
# @return [Hash] Returns the object in the form of hash
|
|
553
|
+
def to_hash
|
|
554
|
+
hash = {}
|
|
555
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
556
|
+
value = self.send(attr)
|
|
557
|
+
if value.nil?
|
|
558
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
559
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
hash[param] = _to_hash(value)
|
|
563
|
+
end
|
|
564
|
+
hash
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
end
|
|
@@ -46,6 +46,9 @@ module Zippendo
|
|
|
46
46
|
# Documents (labels, customs forms) for this shipment.
|
|
47
47
|
attr_accessor :documents
|
|
48
48
|
|
|
49
|
+
# Compact parcels for the order fulfillment workspace (no QR/label payloads).
|
|
50
|
+
attr_accessor :parcels
|
|
51
|
+
|
|
49
52
|
class EnumAttributeValidator
|
|
50
53
|
attr_reader :datatype
|
|
51
54
|
attr_reader :allowable_values
|
|
@@ -81,7 +84,8 @@ module Zippendo
|
|
|
81
84
|
:'created_at' => :'createdAt',
|
|
82
85
|
:'updated_at' => :'updatedAt',
|
|
83
86
|
:'shipping_rule_id' => :'shippingRuleId',
|
|
84
|
-
:'documents' => :'documents'
|
|
87
|
+
:'documents' => :'documents',
|
|
88
|
+
:'parcels' => :'parcels'
|
|
85
89
|
}
|
|
86
90
|
end
|
|
87
91
|
|
|
@@ -108,7 +112,8 @@ module Zippendo
|
|
|
108
112
|
:'created_at' => :'String',
|
|
109
113
|
:'updated_at' => :'String',
|
|
110
114
|
:'shipping_rule_id' => :'String',
|
|
111
|
-
:'documents' => :'Array<CreateShipment201ResponseDocumentsInner>'
|
|
115
|
+
:'documents' => :'Array<CreateShipment201ResponseDocumentsInner>',
|
|
116
|
+
:'parcels' => :'Array<GetOrder200ResponseShipmentsInnerParcelsInner>'
|
|
112
117
|
}
|
|
113
118
|
end
|
|
114
119
|
|
|
@@ -196,6 +201,14 @@ module Zippendo
|
|
|
196
201
|
self.documents = value
|
|
197
202
|
end
|
|
198
203
|
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'parcels')
|
|
206
|
+
if (value = attributes[:'parcels']).is_a?(Array)
|
|
207
|
+
self.parcels = value
|
|
208
|
+
end
|
|
209
|
+
else
|
|
210
|
+
self.parcels = nil
|
|
211
|
+
end
|
|
199
212
|
end
|
|
200
213
|
|
|
201
214
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -231,6 +244,10 @@ module Zippendo
|
|
|
231
244
|
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
232
245
|
end
|
|
233
246
|
|
|
247
|
+
if @parcels.nil?
|
|
248
|
+
invalid_properties.push('invalid value for "parcels", parcels cannot be nil.')
|
|
249
|
+
end
|
|
250
|
+
|
|
234
251
|
invalid_properties
|
|
235
252
|
end
|
|
236
253
|
|
|
@@ -249,6 +266,7 @@ module Zippendo
|
|
|
249
266
|
return false if @carrier_settings.nil?
|
|
250
267
|
return false if @created_at.nil?
|
|
251
268
|
return false if @updated_at.nil?
|
|
269
|
+
return false if @parcels.nil?
|
|
252
270
|
true
|
|
253
271
|
end
|
|
254
272
|
|
|
@@ -322,6 +340,16 @@ module Zippendo
|
|
|
322
340
|
@updated_at = updated_at
|
|
323
341
|
end
|
|
324
342
|
|
|
343
|
+
# Custom attribute writer method with validation
|
|
344
|
+
# @param [Object] parcels Value to be assigned
|
|
345
|
+
def parcels=(parcels)
|
|
346
|
+
if parcels.nil?
|
|
347
|
+
fail ArgumentError, 'parcels cannot be nil'
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
@parcels = parcels
|
|
351
|
+
end
|
|
352
|
+
|
|
325
353
|
# Checks equality by comparing each attribute.
|
|
326
354
|
# @param [Object] Object to be compared
|
|
327
355
|
def ==(o)
|
|
@@ -337,7 +365,8 @@ module Zippendo
|
|
|
337
365
|
created_at == o.created_at &&
|
|
338
366
|
updated_at == o.updated_at &&
|
|
339
367
|
shipping_rule_id == o.shipping_rule_id &&
|
|
340
|
-
documents == o.documents
|
|
368
|
+
documents == o.documents &&
|
|
369
|
+
parcels == o.parcels
|
|
341
370
|
end
|
|
342
371
|
|
|
343
372
|
# @see the `==` method
|
|
@@ -349,7 +378,7 @@ module Zippendo
|
|
|
349
378
|
# Calculates hash code according to all attributes.
|
|
350
379
|
# @return [Integer] Hash code
|
|
351
380
|
def hash
|
|
352
|
-
[id, reference, status, type, tracking, carrier_settings, service_point_id, created_at, updated_at, shipping_rule_id, documents].hash
|
|
381
|
+
[id, reference, status, type, tracking, carrier_settings, service_point_id, created_at, updated_at, shipping_rule_id, documents, parcels].hash
|
|
353
382
|
end
|
|
354
383
|
|
|
355
384
|
# Builds the object from hash
|