This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShippingUnit.ts
60 lines (60 loc) · 1.81 KB
/
ShippingUnit.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Auto-generated file. Do not change.
*/
import { Length } from './Length'
import { Type } from './Type'
import { Volume } from './Volume'
import { Weight } from './Weight'
import { TypedApiObject } from '../types/TypedApiObject'
/**
* For detailed cargo, `shipping_units` is required. For simple cargo, `shipping_units` is required, but only one should be specified.
*/
export type ShippingUnit = {
/**
* String representing the object’s type. Always `/shipping_unit` for this object.
*/
readonly _object: Type.ShippingUnit
/**
* Optional. Name of the unit of cargo.
*
* JSON-schema: string
* @example "Cellular phones"
*/
readonly name?: string
readonly volume?: Volume
readonly weight?: Weight
readonly height?: Length
readonly length?: Length
readonly width?: Length
/**
* Required. Total number of this shipping unit.
*
* JSON-schema: integer
* @example 9
*/
readonly count?: number
/**
* Required if `unit_type` = `pallet`. The number of atomic units, i.e. units that will not be unpacked and broken up during shipping, contained in each shipping unit.
*
* JSON-schema: integer
* @example 9
*/
readonly atomic_count?: number
/**
* Required. Packing method of the shipping. This can be `bag`, `bale`, `barrel`, `carton`, `crate`, `package`, `pallet`, or `roll`.
*
* JSON-schema: string
* @example "pallet"
*/
readonly unit_type?: string
}
export type LiftedShippingUnit = TypedApiObject & ShippingUnit
/**
* Lifts an object return from a Flexport API responses into the SDK domain by augmenting them with higher level properties.
* For detailed cargo, `shipping_units` is required. For simple cargo, `shipping_units` is required, but only one should be specified.
*/
export const liftShippingUnit = (
original: ShippingUnit,
): LiftedShippingUnit => {
return original
}