zippendo 1.2.6 → 1.3.0

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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/docs/CreateOrder201ResponseOrderLinesInner.md +3 -1
  3. data/docs/CreateOrderRequestOrderLinesInner.md +3 -1
  4. data/docs/CreateShipment201ResponseParcelsInnerOrderLinesInner.md +5 -1
  5. data/docs/CreateShipmentRequestParcelsInnerOrderLinesInner.md +5 -1
  6. data/docs/GetOrder200Response.md +1 -1
  7. data/docs/GetOrder200ResponseOrderLinesInner.md +58 -0
  8. data/docs/GetOrder200ResponseShipmentsInner.md +3 -1
  9. data/docs/GetOrder200ResponseShipmentsInnerParcelsInner.md +26 -0
  10. data/docs/GetOrder200ResponseShipmentsInnerParcelsInnerOrderLinesInner.md +24 -0
  11. data/docs/UpdateOrderRequest.md +3 -1
  12. data/lib/zippendo/models/batch_send_shipments200_response_results_inner.rb +2 -2
  13. data/lib/zippendo/models/create_order201_response_order_lines_inner.rb +20 -19
  14. data/lib/zippendo/models/create_order201_response_shipping_address.rb +0 -54
  15. data/lib/zippendo/models/create_order_request_order_lines_inner.rb +15 -5
  16. data/lib/zippendo/models/create_shipment201_response_parcels_inner_order_lines_inner.rb +24 -2
  17. data/lib/zippendo/models/create_shipment_request_parcels_inner_order_lines_inner.rb +24 -2
  18. data/lib/zippendo/models/get_order200_response.rb +2 -2
  19. data/lib/zippendo/models/get_order200_response_order_lines_inner.rb +579 -0
  20. data/lib/zippendo/models/get_order200_response_shipments_inner.rb +33 -4
  21. data/lib/zippendo/models/get_order200_response_shipments_inner_parcels_inner.rb +307 -0
  22. data/lib/zippendo/models/get_order200_response_shipments_inner_parcels_inner_order_lines_inner.rb +232 -0
  23. data/lib/zippendo/models/list_api_tokens401_response.rb +2 -2
  24. data/lib/zippendo/models/send_shipment422_response.rb +2 -2
  25. data/lib/zippendo/models/update_order_request.rb +16 -5
  26. data/lib/zippendo/version.rb +1 -1
  27. data/lib/zippendo.rb +3 -0
  28. metadata +7 -1
@@ -0,0 +1,579 @@
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
+ # Order line ID. Present once the line is a row. Absent for jsonb-only lines during the dual-write window — do not synthesise one, or an edit would re-point packed lines.
76
+ attr_accessor :id
77
+
78
+ # Quantity already allocated to outbound shipments.
79
+ attr_accessor :packed_quantity
80
+
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
102
+
103
+ # Attribute mapping from ruby-style variable name to JSON key.
104
+ def self.attribute_map
105
+ {
106
+ :'sku' => :'sku',
107
+ :'name' => :'name',
108
+ :'quantity' => :'quantity',
109
+ :'unit_price' => :'unitPrice',
110
+ :'total_price' => :'totalPrice',
111
+ :'currency' => :'currency',
112
+ :'weight' => :'weight',
113
+ :'weight_unit' => :'weightUnit',
114
+ :'variant_id' => :'variantId',
115
+ :'product_id' => :'productId',
116
+ :'image_url' => :'imageUrl',
117
+ :'hs_code' => :'hsCode',
118
+ :'country_of_origin' => :'countryOfOrigin',
119
+ :'province_of_origin' => :'provinceOfOrigin',
120
+ :'barcode' => :'barcode',
121
+ :'requires_shipping' => :'requiresShipping',
122
+ :'taxable' => :'taxable',
123
+ :'gift_card' => :'giftCard',
124
+ :'vendor' => :'vendor',
125
+ :'id' => :'id',
126
+ :'packed_quantity' => :'packedQuantity'
127
+ }
128
+ end
129
+
130
+ # Returns attribute mapping this model knows about
131
+ def self.acceptable_attribute_map
132
+ attribute_map
133
+ end
134
+
135
+ # Returns all the JSON keys this model knows about
136
+ def self.acceptable_attributes
137
+ acceptable_attribute_map.values
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.openapi_types
142
+ {
143
+ :'sku' => :'String',
144
+ :'name' => :'String',
145
+ :'quantity' => :'Integer',
146
+ :'unit_price' => :'Float',
147
+ :'total_price' => :'Float',
148
+ :'currency' => :'String',
149
+ :'weight' => :'Float',
150
+ :'weight_unit' => :'String',
151
+ :'variant_id' => :'String',
152
+ :'product_id' => :'String',
153
+ :'image_url' => :'String',
154
+ :'hs_code' => :'String',
155
+ :'country_of_origin' => :'String',
156
+ :'province_of_origin' => :'String',
157
+ :'barcode' => :'String',
158
+ :'requires_shipping' => :'Boolean',
159
+ :'taxable' => :'Boolean',
160
+ :'gift_card' => :'Boolean',
161
+ :'vendor' => :'String',
162
+ :'id' => :'String',
163
+ :'packed_quantity' => :'Integer'
164
+ }
165
+ end
166
+
167
+ # List of attributes with nullable: true
168
+ def self.openapi_nullable
169
+ Set.new([
170
+ :'sku',
171
+ :'unit_price',
172
+ :'total_price',
173
+ :'currency',
174
+ :'weight',
175
+ :'weight_unit',
176
+ :'variant_id',
177
+ :'product_id',
178
+ :'image_url',
179
+ :'hs_code',
180
+ :'country_of_origin',
181
+ :'province_of_origin',
182
+ :'barcode',
183
+ :'requires_shipping',
184
+ :'taxable',
185
+ :'gift_card',
186
+ :'vendor',
187
+ ])
188
+ end
189
+
190
+ # Initializes the object
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ def initialize(attributes = {})
193
+ if (!attributes.is_a?(Hash))
194
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::GetOrder200ResponseOrderLinesInner` initialize method"
195
+ end
196
+
197
+ # check to see if the attribute exists and convert string to symbol for hash key
198
+ acceptable_attribute_map = self.class.acceptable_attribute_map
199
+ attributes = attributes.each_with_object({}) { |(k, v), h|
200
+ if (!acceptable_attribute_map.key?(k.to_sym))
201
+ 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
202
+ end
203
+ h[k.to_sym] = v
204
+ }
205
+
206
+ if attributes.key?(:'sku')
207
+ self.sku = attributes[:'sku']
208
+ end
209
+
210
+ if attributes.key?(:'name')
211
+ self.name = attributes[:'name']
212
+ else
213
+ self.name = nil
214
+ end
215
+
216
+ if attributes.key?(:'quantity')
217
+ self.quantity = attributes[:'quantity']
218
+ else
219
+ self.quantity = nil
220
+ end
221
+
222
+ if attributes.key?(:'unit_price')
223
+ self.unit_price = attributes[:'unit_price']
224
+ end
225
+
226
+ if attributes.key?(:'total_price')
227
+ self.total_price = attributes[:'total_price']
228
+ end
229
+
230
+ if attributes.key?(:'currency')
231
+ self.currency = attributes[:'currency']
232
+ end
233
+
234
+ if attributes.key?(:'weight')
235
+ self.weight = attributes[:'weight']
236
+ end
237
+
238
+ if attributes.key?(:'weight_unit')
239
+ self.weight_unit = attributes[:'weight_unit']
240
+ end
241
+
242
+ if attributes.key?(:'variant_id')
243
+ self.variant_id = attributes[:'variant_id']
244
+ end
245
+
246
+ if attributes.key?(:'product_id')
247
+ self.product_id = attributes[:'product_id']
248
+ end
249
+
250
+ if attributes.key?(:'image_url')
251
+ self.image_url = attributes[:'image_url']
252
+ end
253
+
254
+ if attributes.key?(:'hs_code')
255
+ self.hs_code = attributes[:'hs_code']
256
+ end
257
+
258
+ if attributes.key?(:'country_of_origin')
259
+ self.country_of_origin = attributes[:'country_of_origin']
260
+ end
261
+
262
+ if attributes.key?(:'province_of_origin')
263
+ self.province_of_origin = attributes[:'province_of_origin']
264
+ end
265
+
266
+ if attributes.key?(:'barcode')
267
+ self.barcode = attributes[:'barcode']
268
+ end
269
+
270
+ if attributes.key?(:'requires_shipping')
271
+ self.requires_shipping = attributes[:'requires_shipping']
272
+ end
273
+
274
+ if attributes.key?(:'taxable')
275
+ self.taxable = attributes[:'taxable']
276
+ end
277
+
278
+ if attributes.key?(:'gift_card')
279
+ self.gift_card = attributes[:'gift_card']
280
+ end
281
+
282
+ if attributes.key?(:'vendor')
283
+ self.vendor = attributes[:'vendor']
284
+ end
285
+
286
+ if attributes.key?(:'id')
287
+ self.id = attributes[:'id']
288
+ end
289
+
290
+ if attributes.key?(:'packed_quantity')
291
+ self.packed_quantity = attributes[:'packed_quantity']
292
+ else
293
+ self.packed_quantity = nil
294
+ end
295
+ end
296
+
297
+ # Show invalid properties with the reasons. Usually used together with valid?
298
+ # @return Array for valid properties with the reasons
299
+ def list_invalid_properties
300
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
301
+ invalid_properties = Array.new
302
+ if @name.nil?
303
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
304
+ end
305
+
306
+ if @quantity.nil?
307
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
308
+ end
309
+
310
+ if @quantity > 9007199254740991
311
+ invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 9007199254740991.')
312
+ end
313
+
314
+ if @quantity < 0
315
+ invalid_properties.push('invalid value for "quantity", must be greater than or equal to 0.')
316
+ end
317
+
318
+ if !@unit_price.nil? && @unit_price < 0
319
+ invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
320
+ end
321
+
322
+ if !@total_price.nil? && @total_price < 0
323
+ invalid_properties.push('invalid value for "total_price", must be greater than or equal to 0.')
324
+ end
325
+
326
+ if !@currency.nil? && @currency.to_s.length > 3
327
+ invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
328
+ end
329
+
330
+ if !@currency.nil? && @currency.to_s.length < 3
331
+ invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.')
332
+ end
333
+
334
+ if !@weight.nil? && @weight < 0
335
+ invalid_properties.push('invalid value for "weight", must be greater than or equal to 0.')
336
+ end
337
+
338
+ if !@country_of_origin.nil? && @country_of_origin.to_s.length > 2
339
+ invalid_properties.push('invalid value for "country_of_origin", the character length must be smaller than or equal to 2.')
340
+ end
341
+
342
+ if !@country_of_origin.nil? && @country_of_origin.to_s.length < 2
343
+ invalid_properties.push('invalid value for "country_of_origin", the character length must be greater than or equal to 2.')
344
+ end
345
+
346
+ if @packed_quantity.nil?
347
+ invalid_properties.push('invalid value for "packed_quantity", packed_quantity cannot be nil.')
348
+ end
349
+
350
+ if @packed_quantity > 9007199254740991
351
+ invalid_properties.push('invalid value for "packed_quantity", must be smaller than or equal to 9007199254740991.')
352
+ end
353
+
354
+ if @packed_quantity < 0
355
+ invalid_properties.push('invalid value for "packed_quantity", must be greater than or equal to 0.')
356
+ end
357
+
358
+ invalid_properties
359
+ end
360
+
361
+ # Check to see if the all the properties in the model are valid
362
+ # @return true if the model is valid
363
+ def valid?
364
+ warn '[DEPRECATED] the `valid?` method is obsolete'
365
+ return false if @name.nil?
366
+ return false if @quantity.nil?
367
+ return false if @quantity > 9007199254740991
368
+ return false if @quantity < 0
369
+ return false if !@unit_price.nil? && @unit_price < 0
370
+ return false if !@total_price.nil? && @total_price < 0
371
+ return false if !@currency.nil? && @currency.to_s.length > 3
372
+ return false if !@currency.nil? && @currency.to_s.length < 3
373
+ return false if !@weight.nil? && @weight < 0
374
+ weight_unit_validator = EnumAttributeValidator.new('String', ["kg", "g", "lb", "oz"])
375
+ return false unless weight_unit_validator.valid?(@weight_unit)
376
+ return false if !@country_of_origin.nil? && @country_of_origin.to_s.length > 2
377
+ return false if !@country_of_origin.nil? && @country_of_origin.to_s.length < 2
378
+ return false if @packed_quantity.nil?
379
+ return false if @packed_quantity > 9007199254740991
380
+ return false if @packed_quantity < 0
381
+ true
382
+ end
383
+
384
+ # Custom attribute writer method with validation
385
+ # @param [Object] name Value to be assigned
386
+ def name=(name)
387
+ if name.nil?
388
+ fail ArgumentError, 'name cannot be nil'
389
+ end
390
+
391
+ @name = name
392
+ end
393
+
394
+ # Custom attribute writer method with validation
395
+ # @param [Object] quantity Value to be assigned
396
+ def quantity=(quantity)
397
+ if quantity.nil?
398
+ fail ArgumentError, 'quantity cannot be nil'
399
+ end
400
+
401
+ if quantity > 9007199254740991
402
+ fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 9007199254740991.'
403
+ end
404
+
405
+ if quantity < 0
406
+ fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 0.'
407
+ end
408
+
409
+ @quantity = quantity
410
+ end
411
+
412
+ # Custom attribute writer method with validation
413
+ # @param [Object] unit_price Value to be assigned
414
+ def unit_price=(unit_price)
415
+ if !unit_price.nil? && unit_price < 0
416
+ fail ArgumentError, 'invalid value for "unit_price", must be greater than or equal to 0.'
417
+ end
418
+
419
+ @unit_price = unit_price
420
+ end
421
+
422
+ # Custom attribute writer method with validation
423
+ # @param [Object] total_price Value to be assigned
424
+ def total_price=(total_price)
425
+ if !total_price.nil? && total_price < 0
426
+ fail ArgumentError, 'invalid value for "total_price", must be greater than or equal to 0.'
427
+ end
428
+
429
+ @total_price = total_price
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] currency Value to be assigned
434
+ def currency=(currency)
435
+ if !currency.nil? && currency.to_s.length > 3
436
+ fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
437
+ end
438
+
439
+ if !currency.nil? && currency.to_s.length < 3
440
+ fail ArgumentError, 'invalid value for "currency", the character length must be greater than or equal to 3.'
441
+ end
442
+
443
+ @currency = currency
444
+ end
445
+
446
+ # Custom attribute writer method with validation
447
+ # @param [Object] weight Value to be assigned
448
+ def weight=(weight)
449
+ if !weight.nil? && weight < 0
450
+ fail ArgumentError, 'invalid value for "weight", must be greater than or equal to 0.'
451
+ end
452
+
453
+ @weight = weight
454
+ end
455
+
456
+ # Custom attribute writer method checking allowed values (enum).
457
+ # @param [Object] weight_unit Object to be assigned
458
+ def weight_unit=(weight_unit)
459
+ validator = EnumAttributeValidator.new('String', ["kg", "g", "lb", "oz"])
460
+ unless validator.valid?(weight_unit)
461
+ fail ArgumentError, "invalid value for \"weight_unit\", must be one of #{validator.allowable_values}."
462
+ end
463
+ @weight_unit = weight_unit
464
+ end
465
+
466
+ # Custom attribute writer method with validation
467
+ # @param [Object] country_of_origin Value to be assigned
468
+ def country_of_origin=(country_of_origin)
469
+ if !country_of_origin.nil? && country_of_origin.to_s.length > 2
470
+ fail ArgumentError, 'invalid value for "country_of_origin", the character length must be smaller than or equal to 2.'
471
+ end
472
+
473
+ if !country_of_origin.nil? && country_of_origin.to_s.length < 2
474
+ fail ArgumentError, 'invalid value for "country_of_origin", the character length must be greater than or equal to 2.'
475
+ end
476
+
477
+ @country_of_origin = country_of_origin
478
+ end
479
+
480
+ # Custom attribute writer method with validation
481
+ # @param [Object] packed_quantity Value to be assigned
482
+ def packed_quantity=(packed_quantity)
483
+ if packed_quantity.nil?
484
+ fail ArgumentError, 'packed_quantity cannot be nil'
485
+ end
486
+
487
+ if packed_quantity > 9007199254740991
488
+ fail ArgumentError, 'invalid value for "packed_quantity", must be smaller than or equal to 9007199254740991.'
489
+ end
490
+
491
+ if packed_quantity < 0
492
+ fail ArgumentError, 'invalid value for "packed_quantity", must be greater than or equal to 0.'
493
+ end
494
+
495
+ @packed_quantity = packed_quantity
496
+ end
497
+
498
+ # Checks equality by comparing each attribute.
499
+ # @param [Object] Object to be compared
500
+ def ==(o)
501
+ return true if self.equal?(o)
502
+ self.class == o.class &&
503
+ sku == o.sku &&
504
+ name == o.name &&
505
+ quantity == o.quantity &&
506
+ unit_price == o.unit_price &&
507
+ total_price == o.total_price &&
508
+ currency == o.currency &&
509
+ weight == o.weight &&
510
+ weight_unit == o.weight_unit &&
511
+ variant_id == o.variant_id &&
512
+ product_id == o.product_id &&
513
+ image_url == o.image_url &&
514
+ hs_code == o.hs_code &&
515
+ country_of_origin == o.country_of_origin &&
516
+ province_of_origin == o.province_of_origin &&
517
+ barcode == o.barcode &&
518
+ requires_shipping == o.requires_shipping &&
519
+ taxable == o.taxable &&
520
+ gift_card == o.gift_card &&
521
+ vendor == o.vendor &&
522
+ id == o.id &&
523
+ packed_quantity == o.packed_quantity
524
+ end
525
+
526
+ # @see the `==` method
527
+ # @param [Object] Object to be compared
528
+ def eql?(o)
529
+ self == o
530
+ end
531
+
532
+ # Calculates hash code according to all attributes.
533
+ # @return [Integer] Hash code
534
+ def hash
535
+ [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, id, packed_quantity].hash
536
+ end
537
+
538
+ # Builds the object from hash
539
+ # @param [Hash] attributes Model attributes in the form of hash
540
+ # @return [Object] Returns the model itself
541
+ def self.build_from_hash(attributes)
542
+ return nil unless attributes.is_a?(Hash)
543
+ attributes = attributes.transform_keys(&:to_sym)
544
+ transformed_hash = {}
545
+ openapi_types.each_pair do |key, type|
546
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
547
+ transformed_hash["#{key}"] = nil
548
+ elsif type =~ /\AArray<(.*)>/i
549
+ # check to ensure the input is an array given that the attribute
550
+ # is documented as an array but the input is not
551
+ if attributes[attribute_map[key]].is_a?(Array)
552
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
553
+ end
554
+ elsif !attributes[attribute_map[key]].nil?
555
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
556
+ end
557
+ end
558
+ new(transformed_hash)
559
+ end
560
+
561
+ # Returns the object in the form of hash
562
+ # @return [Hash] Returns the object in the form of hash
563
+ def to_hash
564
+ hash = {}
565
+ self.class.attribute_map.each_pair do |attr, param|
566
+ value = self.send(attr)
567
+ if value.nil?
568
+ is_nullable = self.class.openapi_nullable.include?(attr)
569
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
570
+ end
571
+
572
+ hash[param] = _to_hash(value)
573
+ end
574
+ hash
575
+ end
576
+
577
+ end
578
+
579
+ 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