@teemill/orders 1.0.0 → 1.0.2
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.
- package/.openapi-generator/FILES +24 -6
- package/README.md +3 -3
- package/dist/apis/OrdersApi.d.ts +79 -0
- package/dist/apis/OrdersApi.js +319 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +19 -0
- package/dist/index.d.ts +3 -13
- package/dist/index.js +5 -15
- package/dist/models/Address.d.ts +73 -0
- package/dist/models/Address.js +68 -0
- package/dist/models/ApiError.d.ts +37 -0
- package/dist/models/ApiError.js +53 -0
- package/dist/models/ConfirmOrderFulfillment.d.ts +37 -0
- package/dist/models/ConfirmOrderFulfillment.js +53 -0
- package/dist/models/ConfirmOrderRequest.d.ts +32 -0
- package/dist/models/ConfirmOrderRequest.js +51 -0
- package/dist/models/ConfirmOrderValidationError.d.ts +47 -0
- package/dist/models/ConfirmOrderValidationError.js +62 -0
- package/dist/models/ContactInformation.d.ts +37 -0
- package/dist/models/ContactInformation.js +53 -0
- package/dist/models/DeliveryEstimates.d.ts +37 -0
- package/dist/models/DeliveryEstimates.js +52 -0
- package/dist/models/Fulfillment.d.ts +71 -0
- package/dist/models/Fulfillment.js +66 -0
- package/dist/models/FulfillmentItem.d.ts +43 -0
- package/dist/models/FulfillmentItem.js +54 -0
- package/dist/models/Order.d.ts +128 -0
- package/dist/models/Order.js +89 -0
- package/dist/models/OrderItem.d.ts +75 -0
- package/dist/models/OrderItem.js +64 -0
- package/dist/models/OrderItemTaxPrice.d.ts +37 -0
- package/dist/models/OrderItemTaxPrice.js +52 -0
- package/dist/models/OrderTracking.d.ts +43 -0
- package/dist/models/OrderTracking.js +54 -0
- package/dist/models/OrdersResponse.d.ts +38 -0
- package/dist/models/OrdersResponse.js +53 -0
- package/dist/models/Origin.d.ts +37 -0
- package/dist/models/Origin.js +52 -0
- package/dist/models/Price.d.ts +37 -0
- package/dist/models/Price.js +52 -0
- package/dist/models/ShippingMethod.d.ts +75 -0
- package/dist/models/ShippingMethod.js +66 -0
- package/dist/models/Status.d.ts +26 -0
- package/dist/models/Status.js +39 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +182 -0
- package/dist/runtime.js +562 -0
- package/package.json +3 -15
- package/src/apis/OrdersApi.ts +269 -0
- package/src/apis/index.ts +3 -0
- package/src/index.ts +5 -0
- package/src/models/Address.ts +125 -0
- package/src/models/ApiError.ts +74 -0
- package/src/models/ConfirmOrderFulfillment.ts +75 -0
- package/src/models/ConfirmOrderRequest.ts +73 -0
- package/src/models/ConfirmOrderValidationError.ts +88 -0
- package/src/models/ContactInformation.ts +74 -0
- package/src/models/DeliveryEstimates.ts +73 -0
- package/src/models/Fulfillment.ts +138 -0
- package/src/models/FulfillmentItem.ts +81 -0
- package/src/models/Order.ts +230 -0
- package/src/models/OrderItem.ts +132 -0
- package/src/models/OrderItemTaxPrice.ts +73 -0
- package/src/models/OrderTracking.ts +81 -0
- package/src/models/OrdersResponse.ts +80 -0
- package/src/models/Origin.ts +73 -0
- package/src/models/Price.ts +73 -0
- package/src/models/ShippingMethod.ts +134 -0
- package/src/models/Status.ts +41 -0
- package/src/models/index.ts +20 -0
- package/src/runtime.ts +431 -0
- package/tsconfig.json +2 -3
- package/api.ts +0 -988
- package/base.ts +0 -72
- package/common.ts +0 -150
- package/configuration.ts +0 -101
- package/dist/api.d.ts +0 -750
- package/dist/api.js +0 -560
- package/dist/base.d.ts +0 -54
- package/dist/base.js +0 -80
- package/dist/common.d.ts +0 -65
- package/dist/common.js +0 -252
- package/dist/configuration.d.ts +0 -83
- package/dist/configuration.js +0 -44
- package/git_push.sh +0 -57
- 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.2
|
|
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.2
|
|
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.2
|
|
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.2
|
|
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.2
|
|
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,230 @@
|
|
|
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.2
|
|
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
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @export
|
|
62
|
+
* @interface Order
|
|
63
|
+
*/
|
|
64
|
+
export interface Order {
|
|
65
|
+
/**
|
|
66
|
+
* Unique object identifier
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @memberof Order
|
|
69
|
+
*/
|
|
70
|
+
id?: string;
|
|
71
|
+
/**
|
|
72
|
+
* A reference to the resource location
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @memberof Order
|
|
75
|
+
*/
|
|
76
|
+
ref?: string;
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @type {Status}
|
|
80
|
+
* @memberof Order
|
|
81
|
+
*/
|
|
82
|
+
status?: Status;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @type {ContactInformation}
|
|
86
|
+
* @memberof Order
|
|
87
|
+
*/
|
|
88
|
+
contactInformation: ContactInformation;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @type {Address}
|
|
92
|
+
* @memberof Order
|
|
93
|
+
*/
|
|
94
|
+
shippingAddress: Address;
|
|
95
|
+
/**
|
|
96
|
+
* ISO 8601 Timestamp
|
|
97
|
+
* @type {Date}
|
|
98
|
+
* @memberof Order
|
|
99
|
+
*/
|
|
100
|
+
createdAt?: Date;
|
|
101
|
+
/**
|
|
102
|
+
* ISO 8601 Timestamp
|
|
103
|
+
* @type {Date}
|
|
104
|
+
* @memberof Order
|
|
105
|
+
*/
|
|
106
|
+
updatedAt?: Date;
|
|
107
|
+
/**
|
|
108
|
+
* A custom reference to the merchant's order that will be displayed on the shipping label.
|
|
109
|
+
* @type {string}
|
|
110
|
+
* @memberof Order
|
|
111
|
+
*/
|
|
112
|
+
merchantReference?: string | null;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @type {Array<Fulfillment>}
|
|
116
|
+
* @memberof Order
|
|
117
|
+
*/
|
|
118
|
+
readonly fulfillments?: Array<Fulfillment>;
|
|
119
|
+
/**
|
|
120
|
+
*
|
|
121
|
+
* @type {Array<OrderItem>}
|
|
122
|
+
* @memberof Order
|
|
123
|
+
*/
|
|
124
|
+
items: Array<OrderItem>;
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @type {Price}
|
|
128
|
+
* @memberof Order
|
|
129
|
+
*/
|
|
130
|
+
totalPrice?: Price;
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @type {Price}
|
|
134
|
+
* @memberof Order
|
|
135
|
+
*/
|
|
136
|
+
taxPrice?: Price;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @type {Price}
|
|
140
|
+
* @memberof Order
|
|
141
|
+
*/
|
|
142
|
+
subtotalPrice?: Price;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @type {Price}
|
|
146
|
+
* @memberof Order
|
|
147
|
+
*/
|
|
148
|
+
discountPrice?: Price;
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @type {Price}
|
|
152
|
+
* @memberof Order
|
|
153
|
+
*/
|
|
154
|
+
shippingPrice?: Price;
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* @type {Origin}
|
|
158
|
+
* @memberof Order
|
|
159
|
+
*/
|
|
160
|
+
origin?: Origin;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Check if a given object implements the Order interface.
|
|
165
|
+
*/
|
|
166
|
+
export function instanceOfOrder(value: object): boolean {
|
|
167
|
+
let isInstance = true;
|
|
168
|
+
isInstance = isInstance && "contactInformation" in value;
|
|
169
|
+
isInstance = isInstance && "shippingAddress" in value;
|
|
170
|
+
isInstance = isInstance && "items" in value;
|
|
171
|
+
|
|
172
|
+
return isInstance;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function OrderFromJSON(json: any): Order {
|
|
176
|
+
return OrderFromJSONTyped(json, false);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
|
180
|
+
if ((json === undefined) || (json === null)) {
|
|
181
|
+
return json;
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
|
|
185
|
+
'id': !exists(json, 'id') ? undefined : json['id'],
|
|
186
|
+
'ref': !exists(json, 'ref') ? undefined : json['ref'],
|
|
187
|
+
'status': !exists(json, 'status') ? undefined : StatusFromJSON(json['status']),
|
|
188
|
+
'contactInformation': ContactInformationFromJSON(json['contactInformation']),
|
|
189
|
+
'shippingAddress': AddressFromJSON(json['shippingAddress']),
|
|
190
|
+
'createdAt': !exists(json, 'createdAt') ? undefined : (new Date(json['createdAt'])),
|
|
191
|
+
'updatedAt': !exists(json, 'updatedAt') ? undefined : (new Date(json['updatedAt'])),
|
|
192
|
+
'merchantReference': !exists(json, 'merchantReference') ? undefined : json['merchantReference'],
|
|
193
|
+
'fulfillments': !exists(json, 'fulfillments') ? undefined : ((json['fulfillments'] as Array<any>).map(FulfillmentFromJSON)),
|
|
194
|
+
'items': ((json['items'] as Array<any>).map(OrderItemFromJSON)),
|
|
195
|
+
'totalPrice': !exists(json, 'totalPrice') ? undefined : PriceFromJSON(json['totalPrice']),
|
|
196
|
+
'taxPrice': !exists(json, 'taxPrice') ? undefined : PriceFromJSON(json['taxPrice']),
|
|
197
|
+
'subtotalPrice': !exists(json, 'subtotalPrice') ? undefined : PriceFromJSON(json['subtotalPrice']),
|
|
198
|
+
'discountPrice': !exists(json, 'discountPrice') ? undefined : PriceFromJSON(json['discountPrice']),
|
|
199
|
+
'shippingPrice': !exists(json, 'shippingPrice') ? undefined : PriceFromJSON(json['shippingPrice']),
|
|
200
|
+
'origin': !exists(json, 'origin') ? undefined : OriginFromJSON(json['origin']),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function OrderToJSON(value?: Order | null): any {
|
|
205
|
+
if (value === undefined) {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
if (value === null) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
|
|
213
|
+
'id': value.id,
|
|
214
|
+
'ref': value.ref,
|
|
215
|
+
'status': StatusToJSON(value.status),
|
|
216
|
+
'contactInformation': ContactInformationToJSON(value.contactInformation),
|
|
217
|
+
'shippingAddress': AddressToJSON(value.shippingAddress),
|
|
218
|
+
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
|
|
219
|
+
'updatedAt': value.updatedAt === undefined ? undefined : (value.updatedAt.toISOString()),
|
|
220
|
+
'merchantReference': value.merchantReference,
|
|
221
|
+
'items': ((value.items as Array<any>).map(OrderItemToJSON)),
|
|
222
|
+
'totalPrice': PriceToJSON(value.totalPrice),
|
|
223
|
+
'taxPrice': PriceToJSON(value.taxPrice),
|
|
224
|
+
'subtotalPrice': PriceToJSON(value.subtotalPrice),
|
|
225
|
+
'discountPrice': PriceToJSON(value.discountPrice),
|
|
226
|
+
'shippingPrice': PriceToJSON(value.shippingPrice),
|
|
227
|
+
'origin': OriginToJSON(value.origin),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|