@teemill/orders 1.0.0 → 1.0.3

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 (90) hide show
  1. package/.openapi-generator/FILES +24 -6
  2. package/README.md +3 -3
  3. package/dist/apis/OrdersApi.d.ts +79 -0
  4. package/dist/apis/OrdersApi.js +319 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +19 -0
  7. package/dist/index.d.ts +3 -13
  8. package/dist/index.js +5 -15
  9. package/dist/models/Address.d.ts +73 -0
  10. package/dist/models/Address.js +68 -0
  11. package/dist/models/ApiError.d.ts +37 -0
  12. package/dist/models/ApiError.js +53 -0
  13. package/dist/models/ConfirmOrderFulfillment.d.ts +37 -0
  14. package/dist/models/ConfirmOrderFulfillment.js +53 -0
  15. package/dist/models/ConfirmOrderRequest.d.ts +32 -0
  16. package/dist/models/ConfirmOrderRequest.js +51 -0
  17. package/dist/models/ConfirmOrderValidationError.d.ts +47 -0
  18. package/dist/models/ConfirmOrderValidationError.js +62 -0
  19. package/dist/models/ContactInformation.d.ts +37 -0
  20. package/dist/models/ContactInformation.js +53 -0
  21. package/dist/models/DeliveryEstimates.d.ts +37 -0
  22. package/dist/models/DeliveryEstimates.js +52 -0
  23. package/dist/models/Fulfillment.d.ts +71 -0
  24. package/dist/models/Fulfillment.js +66 -0
  25. package/dist/models/FulfillmentItem.d.ts +43 -0
  26. package/dist/models/FulfillmentItem.js +54 -0
  27. package/dist/models/Order.d.ts +135 -0
  28. package/dist/models/Order.js +92 -0
  29. package/dist/models/OrderItem.d.ts +75 -0
  30. package/dist/models/OrderItem.js +64 -0
  31. package/dist/models/OrderItemTaxPrice.d.ts +37 -0
  32. package/dist/models/OrderItemTaxPrice.js +52 -0
  33. package/dist/models/OrderTracking.d.ts +43 -0
  34. package/dist/models/OrderTracking.js +54 -0
  35. package/dist/models/OrdersResponse.d.ts +38 -0
  36. package/dist/models/OrdersResponse.js +53 -0
  37. package/dist/models/Origin.d.ts +37 -0
  38. package/dist/models/Origin.js +52 -0
  39. package/dist/models/Price.d.ts +37 -0
  40. package/dist/models/Price.js +52 -0
  41. package/dist/models/ShippingMethod.d.ts +75 -0
  42. package/dist/models/ShippingMethod.js +66 -0
  43. package/dist/models/Status.d.ts +26 -0
  44. package/dist/models/Status.js +39 -0
  45. package/dist/models/StatusHistoryItem.d.ts +38 -0
  46. package/dist/models/StatusHistoryItem.js +53 -0
  47. package/dist/models/index.d.ts +19 -0
  48. package/dist/models/index.js +37 -0
  49. package/dist/runtime.d.ts +182 -0
  50. package/dist/runtime.js +562 -0
  51. package/package.json +3 -15
  52. package/src/apis/OrdersApi.ts +269 -0
  53. package/src/apis/index.ts +3 -0
  54. package/src/index.ts +5 -0
  55. package/src/models/Address.ts +125 -0
  56. package/src/models/ApiError.ts +74 -0
  57. package/src/models/ConfirmOrderFulfillment.ts +75 -0
  58. package/src/models/ConfirmOrderRequest.ts +73 -0
  59. package/src/models/ConfirmOrderValidationError.ts +88 -0
  60. package/src/models/ContactInformation.ts +74 -0
  61. package/src/models/DeliveryEstimates.ts +73 -0
  62. package/src/models/Fulfillment.ts +138 -0
  63. package/src/models/FulfillmentItem.ts +81 -0
  64. package/src/models/Order.ts +244 -0
  65. package/src/models/OrderItem.ts +132 -0
  66. package/src/models/OrderItemTaxPrice.ts +73 -0
  67. package/src/models/OrderTracking.ts +81 -0
  68. package/src/models/OrdersResponse.ts +80 -0
  69. package/src/models/Origin.ts +73 -0
  70. package/src/models/Price.ts +73 -0
  71. package/src/models/ShippingMethod.ts +134 -0
  72. package/src/models/Status.ts +41 -0
  73. package/src/models/StatusHistoryItem.ts +80 -0
  74. package/src/models/index.ts +21 -0
  75. package/src/runtime.ts +431 -0
  76. package/tsconfig.json +2 -3
  77. package/api.ts +0 -988
  78. package/base.ts +0 -72
  79. package/common.ts +0 -150
  80. package/configuration.ts +0 -101
  81. package/dist/api.d.ts +0 -750
  82. package/dist/api.js +0 -560
  83. package/dist/base.d.ts +0 -54
  84. package/dist/base.js +0 -80
  85. package/dist/common.d.ts +0 -65
  86. package/dist/common.js +0 -252
  87. package/dist/configuration.d.ts +0 -83
  88. package/dist/configuration.js +0 -44
  89. package/git_push.sh +0 -57
  90. package/index.ts +0 -18
@@ -0,0 +1,88 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ConfirmOrderValidationError
20
+ */
21
+ export interface ConfirmOrderValidationError {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ConfirmOrderValidationError
26
+ */
27
+ code: ConfirmOrderValidationErrorCodeEnum;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ConfirmOrderValidationError
32
+ */
33
+ message: string;
34
+ }
35
+
36
+
37
+ /**
38
+ * @export
39
+ */
40
+ export const ConfirmOrderValidationErrorCodeEnum = {
41
+ BadRequest: 'BAD_REQUEST',
42
+ PaymentFailed: 'PAYMENT_FAILED',
43
+ Conflict: 'CONFLICT',
44
+ ActionRequired: 'ACTION_REQUIRED'
45
+ } as const;
46
+ export type ConfirmOrderValidationErrorCodeEnum = typeof ConfirmOrderValidationErrorCodeEnum[keyof typeof ConfirmOrderValidationErrorCodeEnum];
47
+
48
+
49
+ /**
50
+ * Check if a given object implements the ConfirmOrderValidationError interface.
51
+ */
52
+ export function instanceOfConfirmOrderValidationError(value: object): boolean {
53
+ let isInstance = true;
54
+ isInstance = isInstance && "code" in value;
55
+ isInstance = isInstance && "message" in value;
56
+
57
+ return isInstance;
58
+ }
59
+
60
+ export function ConfirmOrderValidationErrorFromJSON(json: any): ConfirmOrderValidationError {
61
+ return ConfirmOrderValidationErrorFromJSONTyped(json, false);
62
+ }
63
+
64
+ export function ConfirmOrderValidationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfirmOrderValidationError {
65
+ if ((json === undefined) || (json === null)) {
66
+ return json;
67
+ }
68
+ return {
69
+
70
+ 'code': json['code'],
71
+ 'message': json['message'],
72
+ };
73
+ }
74
+
75
+ export function ConfirmOrderValidationErrorToJSON(value?: ConfirmOrderValidationError | null): any {
76
+ if (value === undefined) {
77
+ return undefined;
78
+ }
79
+ if (value === null) {
80
+ return null;
81
+ }
82
+ return {
83
+
84
+ 'code': value.code,
85
+ 'message': value.message,
86
+ };
87
+ }
88
+
@@ -0,0 +1,74 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ * Order recipient contact information, used only for courier tracking/updates.
18
+ * @export
19
+ * @interface ContactInformation
20
+ */
21
+ export interface ContactInformation {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ContactInformation
26
+ */
27
+ email: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ContactInformation
32
+ */
33
+ phone?: string | null;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ContactInformation interface.
38
+ */
39
+ export function instanceOfContactInformation(value: object): boolean {
40
+ let isInstance = true;
41
+ isInstance = isInstance && "email" in value;
42
+
43
+ return isInstance;
44
+ }
45
+
46
+ export function ContactInformationFromJSON(json: any): ContactInformation {
47
+ return ContactInformationFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function ContactInformationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContactInformation {
51
+ if ((json === undefined) || (json === null)) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'email': json['email'],
57
+ 'phone': !exists(json, 'phone') ? undefined : json['phone'],
58
+ };
59
+ }
60
+
61
+ export function ContactInformationToJSON(value?: ContactInformation | null): any {
62
+ if (value === undefined) {
63
+ return undefined;
64
+ }
65
+ if (value === null) {
66
+ return null;
67
+ }
68
+ return {
69
+
70
+ 'email': value.email,
71
+ 'phone': value.phone,
72
+ };
73
+ }
74
+
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface DeliveryEstimates
20
+ */
21
+ export interface DeliveryEstimates {
22
+ /**
23
+ * ISO 8601 Timestamp
24
+ * @type {Date}
25
+ * @memberof DeliveryEstimates
26
+ */
27
+ min?: Date;
28
+ /**
29
+ * ISO 8601 Timestamp
30
+ * @type {Date}
31
+ * @memberof DeliveryEstimates
32
+ */
33
+ max?: Date;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the DeliveryEstimates interface.
38
+ */
39
+ export function instanceOfDeliveryEstimates(value: object): boolean {
40
+ let isInstance = true;
41
+
42
+ return isInstance;
43
+ }
44
+
45
+ export function DeliveryEstimatesFromJSON(json: any): DeliveryEstimates {
46
+ return DeliveryEstimatesFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function DeliveryEstimatesFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeliveryEstimates {
50
+ if ((json === undefined) || (json === null)) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'min': !exists(json, 'min') ? undefined : (new Date(json['min'])),
56
+ 'max': !exists(json, 'max') ? undefined : (new Date(json['max'])),
57
+ };
58
+ }
59
+
60
+ export function DeliveryEstimatesToJSON(value?: DeliveryEstimates | null): any {
61
+ if (value === undefined) {
62
+ return undefined;
63
+ }
64
+ if (value === null) {
65
+ return null;
66
+ }
67
+ return {
68
+
69
+ 'min': value.min === undefined ? undefined : (value.min.toISOString()),
70
+ 'max': value.max === undefined ? undefined : (value.max.toISOString()),
71
+ };
72
+ }
73
+
@@ -0,0 +1,138 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ import type { FulfillmentItem } from './FulfillmentItem';
17
+ import {
18
+ FulfillmentItemFromJSON,
19
+ FulfillmentItemFromJSONTyped,
20
+ FulfillmentItemToJSON,
21
+ } from './FulfillmentItem';
22
+ import type { OrderTracking } from './OrderTracking';
23
+ import {
24
+ OrderTrackingFromJSON,
25
+ OrderTrackingFromJSONTyped,
26
+ OrderTrackingToJSON,
27
+ } from './OrderTracking';
28
+ import type { ShippingMethod } from './ShippingMethod';
29
+ import {
30
+ ShippingMethodFromJSON,
31
+ ShippingMethodFromJSONTyped,
32
+ ShippingMethodToJSON,
33
+ } from './ShippingMethod';
34
+ import type { Status } from './Status';
35
+ import {
36
+ StatusFromJSON,
37
+ StatusFromJSONTyped,
38
+ StatusToJSON,
39
+ } from './Status';
40
+
41
+ /**
42
+ *
43
+ * @export
44
+ * @interface Fulfillment
45
+ */
46
+ export interface Fulfillment {
47
+ /**
48
+ * Unique object identifier
49
+ * @type {string}
50
+ * @memberof Fulfillment
51
+ */
52
+ id?: string;
53
+ /**
54
+ *
55
+ * @type {Status}
56
+ * @memberof Fulfillment
57
+ */
58
+ status?: Status;
59
+ /**
60
+ *
61
+ * @type {Array<FulfillmentItem>}
62
+ * @memberof Fulfillment
63
+ */
64
+ items?: Array<FulfillmentItem>;
65
+ /**
66
+ *
67
+ * @type {OrderTracking}
68
+ * @memberof Fulfillment
69
+ */
70
+ tracking?: OrderTracking | null;
71
+ /**
72
+ *
73
+ * @type {ShippingMethod}
74
+ * @memberof Fulfillment
75
+ */
76
+ shippingMethod?: ShippingMethod;
77
+ /**
78
+ * Shipping methods available for this fulfillment. One of these should be used to confirm the fulfillment.
79
+ * @type {Array<ShippingMethod>}
80
+ * @memberof Fulfillment
81
+ */
82
+ availableShippingMethods?: Array<ShippingMethod>;
83
+ /**
84
+ * Weight of the package being shipped in grams
85
+ * @type {number}
86
+ * @memberof Fulfillment
87
+ */
88
+ packageWeight?: number;
89
+ }
90
+
91
+ /**
92
+ * Check if a given object implements the Fulfillment interface.
93
+ */
94
+ export function instanceOfFulfillment(value: object): boolean {
95
+ let isInstance = true;
96
+
97
+ return isInstance;
98
+ }
99
+
100
+ export function FulfillmentFromJSON(json: any): Fulfillment {
101
+ return FulfillmentFromJSONTyped(json, false);
102
+ }
103
+
104
+ export function FulfillmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Fulfillment {
105
+ if ((json === undefined) || (json === null)) {
106
+ return json;
107
+ }
108
+ return {
109
+
110
+ 'id': !exists(json, 'id') ? undefined : json['id'],
111
+ 'status': !exists(json, 'status') ? undefined : StatusFromJSON(json['status']),
112
+ 'items': !exists(json, 'items') ? undefined : ((json['items'] as Array<any>).map(FulfillmentItemFromJSON)),
113
+ 'tracking': !exists(json, 'tracking') ? undefined : OrderTrackingFromJSON(json['tracking']),
114
+ 'shippingMethod': !exists(json, 'shippingMethod') ? undefined : ShippingMethodFromJSON(json['shippingMethod']),
115
+ 'availableShippingMethods': !exists(json, 'availableShippingMethods') ? undefined : ((json['availableShippingMethods'] as Array<any>).map(ShippingMethodFromJSON)),
116
+ 'packageWeight': !exists(json, 'packageWeight') ? undefined : json['packageWeight'],
117
+ };
118
+ }
119
+
120
+ export function FulfillmentToJSON(value?: Fulfillment | null): any {
121
+ if (value === undefined) {
122
+ return undefined;
123
+ }
124
+ if (value === null) {
125
+ return null;
126
+ }
127
+ return {
128
+
129
+ 'id': value.id,
130
+ 'status': StatusToJSON(value.status),
131
+ 'items': value.items === undefined ? undefined : ((value.items as Array<any>).map(FulfillmentItemToJSON)),
132
+ 'tracking': OrderTrackingToJSON(value.tracking),
133
+ 'shippingMethod': ShippingMethodToJSON(value.shippingMethod),
134
+ 'availableShippingMethods': value.availableShippingMethods === undefined ? undefined : ((value.availableShippingMethods as Array<any>).map(ShippingMethodToJSON)),
135
+ 'packageWeight': value.packageWeight,
136
+ };
137
+ }
138
+
@@ -0,0 +1,81 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface FulfillmentItem
20
+ */
21
+ export interface FulfillmentItem {
22
+ /**
23
+ * Unique object identifier
24
+ * @type {string}
25
+ * @memberof FulfillmentItem
26
+ */
27
+ id?: string;
28
+ /**
29
+ * Unique object identifier
30
+ * @type {string}
31
+ * @memberof FulfillmentItem
32
+ */
33
+ itemId?: string;
34
+ /**
35
+ * Number of this item being fulfilled
36
+ * @type {number}
37
+ * @memberof FulfillmentItem
38
+ */
39
+ quantity?: number;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the FulfillmentItem interface.
44
+ */
45
+ export function instanceOfFulfillmentItem(value: object): boolean {
46
+ let isInstance = true;
47
+
48
+ return isInstance;
49
+ }
50
+
51
+ export function FulfillmentItemFromJSON(json: any): FulfillmentItem {
52
+ return FulfillmentItemFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function FulfillmentItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): FulfillmentItem {
56
+ if ((json === undefined) || (json === null)) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'id': !exists(json, 'id') ? undefined : json['id'],
62
+ 'itemId': !exists(json, 'itemId') ? undefined : json['itemId'],
63
+ 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
64
+ };
65
+ }
66
+
67
+ export function FulfillmentItemToJSON(value?: FulfillmentItem | null): any {
68
+ if (value === undefined) {
69
+ return undefined;
70
+ }
71
+ if (value === null) {
72
+ return null;
73
+ }
74
+ return {
75
+
76
+ 'id': value.id,
77
+ 'itemId': value.itemId,
78
+ 'quantity': value.quantity,
79
+ };
80
+ }
81
+
@@ -0,0 +1,244 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.3
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ import type { Address } from './Address';
17
+ import {
18
+ AddressFromJSON,
19
+ AddressFromJSONTyped,
20
+ AddressToJSON,
21
+ } from './Address';
22
+ import type { ContactInformation } from './ContactInformation';
23
+ import {
24
+ ContactInformationFromJSON,
25
+ ContactInformationFromJSONTyped,
26
+ ContactInformationToJSON,
27
+ } from './ContactInformation';
28
+ import type { Fulfillment } from './Fulfillment';
29
+ import {
30
+ FulfillmentFromJSON,
31
+ FulfillmentFromJSONTyped,
32
+ FulfillmentToJSON,
33
+ } from './Fulfillment';
34
+ import type { OrderItem } from './OrderItem';
35
+ import {
36
+ OrderItemFromJSON,
37
+ OrderItemFromJSONTyped,
38
+ OrderItemToJSON,
39
+ } from './OrderItem';
40
+ import type { Origin } from './Origin';
41
+ import {
42
+ OriginFromJSON,
43
+ OriginFromJSONTyped,
44
+ OriginToJSON,
45
+ } from './Origin';
46
+ import type { Price } from './Price';
47
+ import {
48
+ PriceFromJSON,
49
+ PriceFromJSONTyped,
50
+ PriceToJSON,
51
+ } from './Price';
52
+ import type { Status } from './Status';
53
+ import {
54
+ StatusFromJSON,
55
+ StatusFromJSONTyped,
56
+ StatusToJSON,
57
+ } from './Status';
58
+ import type { StatusHistoryItem } from './StatusHistoryItem';
59
+ import {
60
+ StatusHistoryItemFromJSON,
61
+ StatusHistoryItemFromJSONTyped,
62
+ StatusHistoryItemToJSON,
63
+ } from './StatusHistoryItem';
64
+
65
+ /**
66
+ *
67
+ * @export
68
+ * @interface Order
69
+ */
70
+ export interface Order {
71
+ /**
72
+ * Unique object identifier
73
+ * @type {string}
74
+ * @memberof Order
75
+ */
76
+ id?: string;
77
+ /**
78
+ * A reference to the resource location
79
+ * @type {string}
80
+ * @memberof Order
81
+ */
82
+ ref?: string;
83
+ /**
84
+ *
85
+ * @type {Status}
86
+ * @memberof Order
87
+ */
88
+ status?: Status;
89
+ /**
90
+ *
91
+ * @type {ContactInformation}
92
+ * @memberof Order
93
+ */
94
+ contactInformation: ContactInformation;
95
+ /**
96
+ *
97
+ * @type {Address}
98
+ * @memberof Order
99
+ */
100
+ shippingAddress: Address;
101
+ /**
102
+ * ISO 8601 Timestamp
103
+ * @type {Date}
104
+ * @memberof Order
105
+ */
106
+ createdAt?: Date;
107
+ /**
108
+ * ISO 8601 Timestamp
109
+ * @type {Date}
110
+ * @memberof Order
111
+ */
112
+ updatedAt?: Date;
113
+ /**
114
+ * A custom reference to the merchant's order that will be displayed on the shipping label.
115
+ * @type {string}
116
+ * @memberof Order
117
+ */
118
+ merchantReference?: string | null;
119
+ /**
120
+ *
121
+ * @type {Array<Fulfillment>}
122
+ * @memberof Order
123
+ */
124
+ readonly fulfillments?: Array<Fulfillment>;
125
+ /**
126
+ *
127
+ * @type {Array<OrderItem>}
128
+ * @memberof Order
129
+ */
130
+ items: Array<OrderItem>;
131
+ /**
132
+ *
133
+ * @type {Price}
134
+ * @memberof Order
135
+ */
136
+ totalPrice?: Price;
137
+ /**
138
+ *
139
+ * @type {Price}
140
+ * @memberof Order
141
+ */
142
+ taxPrice?: Price;
143
+ /**
144
+ *
145
+ * @type {Price}
146
+ * @memberof Order
147
+ */
148
+ subtotalPrice?: Price;
149
+ /**
150
+ *
151
+ * @type {Price}
152
+ * @memberof Order
153
+ */
154
+ discountPrice?: Price;
155
+ /**
156
+ *
157
+ * @type {Price}
158
+ * @memberof Order
159
+ */
160
+ shippingPrice?: Price;
161
+ /**
162
+ *
163
+ * @type {Origin}
164
+ * @memberof Order
165
+ */
166
+ origin?: Origin;
167
+ /**
168
+ *
169
+ * @type {Array<StatusHistoryItem>}
170
+ * @memberof Order
171
+ */
172
+ statusHistory?: Array<StatusHistoryItem>;
173
+ }
174
+
175
+ /**
176
+ * Check if a given object implements the Order interface.
177
+ */
178
+ export function instanceOfOrder(value: object): boolean {
179
+ let isInstance = true;
180
+ isInstance = isInstance && "contactInformation" in value;
181
+ isInstance = isInstance && "shippingAddress" in value;
182
+ isInstance = isInstance && "items" in value;
183
+
184
+ return isInstance;
185
+ }
186
+
187
+ export function OrderFromJSON(json: any): Order {
188
+ return OrderFromJSONTyped(json, false);
189
+ }
190
+
191
+ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
192
+ if ((json === undefined) || (json === null)) {
193
+ return json;
194
+ }
195
+ return {
196
+
197
+ 'id': !exists(json, 'id') ? undefined : json['id'],
198
+ 'ref': !exists(json, 'ref') ? undefined : json['ref'],
199
+ 'status': !exists(json, 'status') ? undefined : StatusFromJSON(json['status']),
200
+ 'contactInformation': ContactInformationFromJSON(json['contactInformation']),
201
+ 'shippingAddress': AddressFromJSON(json['shippingAddress']),
202
+ 'createdAt': !exists(json, 'createdAt') ? undefined : (new Date(json['createdAt'])),
203
+ 'updatedAt': !exists(json, 'updatedAt') ? undefined : (new Date(json['updatedAt'])),
204
+ 'merchantReference': !exists(json, 'merchantReference') ? undefined : json['merchantReference'],
205
+ 'fulfillments': !exists(json, 'fulfillments') ? undefined : ((json['fulfillments'] as Array<any>).map(FulfillmentFromJSON)),
206
+ 'items': ((json['items'] as Array<any>).map(OrderItemFromJSON)),
207
+ 'totalPrice': !exists(json, 'totalPrice') ? undefined : PriceFromJSON(json['totalPrice']),
208
+ 'taxPrice': !exists(json, 'taxPrice') ? undefined : PriceFromJSON(json['taxPrice']),
209
+ 'subtotalPrice': !exists(json, 'subtotalPrice') ? undefined : PriceFromJSON(json['subtotalPrice']),
210
+ 'discountPrice': !exists(json, 'discountPrice') ? undefined : PriceFromJSON(json['discountPrice']),
211
+ 'shippingPrice': !exists(json, 'shippingPrice') ? undefined : PriceFromJSON(json['shippingPrice']),
212
+ 'origin': !exists(json, 'origin') ? undefined : OriginFromJSON(json['origin']),
213
+ 'statusHistory': !exists(json, 'statusHistory') ? undefined : ((json['statusHistory'] as Array<any>).map(StatusHistoryItemFromJSON)),
214
+ };
215
+ }
216
+
217
+ export function OrderToJSON(value?: Order | null): any {
218
+ if (value === undefined) {
219
+ return undefined;
220
+ }
221
+ if (value === null) {
222
+ return null;
223
+ }
224
+ return {
225
+
226
+ 'id': value.id,
227
+ 'ref': value.ref,
228
+ 'status': StatusToJSON(value.status),
229
+ 'contactInformation': ContactInformationToJSON(value.contactInformation),
230
+ 'shippingAddress': AddressToJSON(value.shippingAddress),
231
+ 'createdAt': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
232
+ 'updatedAt': value.updatedAt === undefined ? undefined : (value.updatedAt.toISOString()),
233
+ 'merchantReference': value.merchantReference,
234
+ 'items': ((value.items as Array<any>).map(OrderItemToJSON)),
235
+ 'totalPrice': PriceToJSON(value.totalPrice),
236
+ 'taxPrice': PriceToJSON(value.taxPrice),
237
+ 'subtotalPrice': PriceToJSON(value.subtotalPrice),
238
+ 'discountPrice': PriceToJSON(value.discountPrice),
239
+ 'shippingPrice': PriceToJSON(value.shippingPrice),
240
+ 'origin': OriginToJSON(value.origin),
241
+ 'statusHistory': value.statusHistory === undefined ? undefined : ((value.statusHistory as Array<any>).map(StatusHistoryItemToJSON)),
242
+ };
243
+ }
244
+