@digital8/lighting-illusions-ts-sdk 0.0.1775 → 0.0.1776

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 (137) hide show
  1. package/.openapi-generator/FILES +50 -0
  2. package/README.md +32 -2
  3. package/dist/apis/CartsApi.d.ts +94 -0
  4. package/dist/apis/CartsApi.js +375 -0
  5. package/dist/apis/CustomersApi.d.ts +48 -0
  6. package/dist/apis/CustomersApi.js +196 -0
  7. package/dist/apis/index.d.ts +2 -0
  8. package/dist/apis/index.js +2 -0
  9. package/dist/models/AddressFrontendResource.d.ts +2 -2
  10. package/dist/models/AddressFrontendResource.js +4 -4
  11. package/dist/models/AddressResource.d.ts +1 -1
  12. package/dist/models/AddressResource.js +3 -1
  13. package/dist/models/CartAddressType.d.ts +25 -0
  14. package/dist/models/CartAddressType.js +51 -0
  15. package/dist/models/CartItemListResource.d.ts +51 -0
  16. package/dist/models/CartItemListResource.js +62 -0
  17. package/dist/models/CartItemListResourceArrayResponse.d.ts +33 -0
  18. package/dist/models/CartItemListResourceArrayResponse.js +50 -0
  19. package/dist/models/CartListResource.d.ts +101 -0
  20. package/dist/models/CartListResource.js +90 -0
  21. package/dist/models/CartListResourceArrayResponse.d.ts +33 -0
  22. package/dist/models/CartListResourceArrayResponse.js +50 -0
  23. package/dist/models/CartOrderSource.d.ts +29 -0
  24. package/dist/models/CartOrderSource.js +55 -0
  25. package/dist/models/CartResource.d.ts +155 -0
  26. package/dist/models/CartResource.js +116 -0
  27. package/dist/models/CartResourceArrayResponse.d.ts +33 -0
  28. package/dist/models/CartResourceArrayResponse.js +50 -0
  29. package/dist/models/CartStatus.d.ts +26 -0
  30. package/dist/models/CartStatus.js +52 -0
  31. package/dist/models/CustomerListResource.d.ts +69 -0
  32. package/dist/models/CustomerListResource.js +72 -0
  33. package/dist/models/CustomerListResourceArrayResponse.d.ts +33 -0
  34. package/dist/models/CustomerListResourceArrayResponse.js +50 -0
  35. package/dist/models/CustomerResource.d.ts +69 -0
  36. package/dist/models/CustomerResource.js +72 -0
  37. package/dist/models/CustomerResourceArrayResponse.d.ts +33 -0
  38. package/dist/models/CustomerResourceArrayResponse.js +50 -0
  39. package/dist/models/IndexCartRequest.d.ts +154 -0
  40. package/dist/models/IndexCartRequest.js +105 -0
  41. package/dist/models/IndexCustomerRequest.d.ts +99 -0
  42. package/dist/models/IndexCustomerRequest.js +83 -0
  43. package/dist/models/PaginatedCartListResourceResponse.d.ts +40 -0
  44. package/dist/models/PaginatedCartListResourceResponse.js +57 -0
  45. package/dist/models/PaginatedCustomerListResourceResponse.d.ts +40 -0
  46. package/dist/models/PaginatedCustomerListResourceResponse.js +57 -0
  47. package/dist/models/SitePaymentConfigResource.d.ts +6 -0
  48. package/dist/models/SitePaymentConfigResource.js +4 -0
  49. package/dist/models/StoreCartRequest.d.ts +95 -0
  50. package/dist/models/StoreCartRequest.js +90 -0
  51. package/dist/models/StoreCartRequestCustomer.d.ts +50 -0
  52. package/dist/models/StoreCartRequestCustomer.js +55 -0
  53. package/dist/models/StoreCartRequestItemsInner.d.ts +44 -0
  54. package/dist/models/StoreCartRequestItemsInner.js +57 -0
  55. package/dist/models/StoreCartRequestShippingAddress.d.ts +74 -0
  56. package/dist/models/StoreCartRequestShippingAddress.js +63 -0
  57. package/dist/models/StoreCustomerRequest.d.ts +56 -0
  58. package/dist/models/StoreCustomerRequest.js +65 -0
  59. package/dist/models/StoreListResource.d.ts +1 -1
  60. package/dist/models/StoreListResource.js +1 -3
  61. package/dist/models/StoreResource.d.ts +1 -1
  62. package/dist/models/StoreResource.js +3 -1
  63. package/dist/models/StoreSpecialDateFrontendResource.d.ts +2 -2
  64. package/dist/models/StoreSpecialDateFrontendResource.js +3 -1
  65. package/dist/models/StoreSpecialDateResource.d.ts +2 -2
  66. package/dist/models/StoreSpecialDateResource.js +3 -1
  67. package/dist/models/UpdateCartRequest.d.ts +70 -0
  68. package/dist/models/UpdateCartRequest.js +75 -0
  69. package/dist/models/UpdateSiteRequest.d.ts +6 -0
  70. package/dist/models/UpdateSiteRequest.js +4 -0
  71. package/dist/models/index.d.ts +23 -0
  72. package/dist/models/index.js +23 -0
  73. package/docs/CartAddressType.md +32 -0
  74. package/docs/CartItemListResource.md +40 -0
  75. package/docs/CartItemListResourceArrayResponse.md +34 -0
  76. package/docs/CartListResource.md +56 -0
  77. package/docs/CartListResourceArrayResponse.md +34 -0
  78. package/docs/CartOrderSource.md +32 -0
  79. package/docs/CartResource.md +74 -0
  80. package/docs/CartResourceArrayResponse.md +34 -0
  81. package/docs/CartStatus.md +32 -0
  82. package/docs/CartsApi.md +341 -0
  83. package/docs/CustomerListResource.md +46 -0
  84. package/docs/CustomerListResourceArrayResponse.md +34 -0
  85. package/docs/CustomerResource.md +46 -0
  86. package/docs/CustomerResourceArrayResponse.md +34 -0
  87. package/docs/CustomersApi.md +140 -0
  88. package/docs/IndexCartRequest.md +66 -0
  89. package/docs/IndexCustomerRequest.md +50 -0
  90. package/docs/PaginatedCartListResourceResponse.md +36 -0
  91. package/docs/PaginatedCustomerListResourceResponse.md +36 -0
  92. package/docs/SitePaymentConfigResource.md +2 -0
  93. package/docs/StoreCartRequest.md +50 -0
  94. package/docs/StoreCartRequestCustomer.md +40 -0
  95. package/docs/StoreCartRequestItemsInner.md +38 -0
  96. package/docs/StoreCartRequestShippingAddress.md +48 -0
  97. package/docs/StoreCustomerRequest.md +42 -0
  98. package/docs/StoreSpecialDateFrontendResource.md +1 -1
  99. package/docs/StoreSpecialDateResource.md +1 -1
  100. package/docs/UpdateCartRequest.md +42 -0
  101. package/docs/UpdateSiteRequest.md +2 -0
  102. package/package.json +1 -1
  103. package/src/apis/CartsApi.ts +284 -0
  104. package/src/apis/CustomersApi.ts +127 -0
  105. package/src/apis/index.ts +2 -0
  106. package/src/models/AddressFrontendResource.ts +5 -5
  107. package/src/models/AddressResource.ts +3 -2
  108. package/src/models/CartAddressType.ts +53 -0
  109. package/src/models/CartItemListResource.ts +100 -0
  110. package/src/models/CartItemListResourceArrayResponse.ts +73 -0
  111. package/src/models/CartListResource.ts +183 -0
  112. package/src/models/CartListResourceArrayResponse.ts +73 -0
  113. package/src/models/CartOrderSource.ts +57 -0
  114. package/src/models/CartResource.ts +259 -0
  115. package/src/models/CartResourceArrayResponse.ts +73 -0
  116. package/src/models/CartStatus.ts +54 -0
  117. package/src/models/CustomerListResource.ts +126 -0
  118. package/src/models/CustomerListResourceArrayResponse.ts +73 -0
  119. package/src/models/CustomerResource.ts +126 -0
  120. package/src/models/CustomerResourceArrayResponse.ts +73 -0
  121. package/src/models/IndexCartRequest.ts +224 -0
  122. package/src/models/IndexCustomerRequest.ts +152 -0
  123. package/src/models/PaginatedCartListResourceResponse.ts +90 -0
  124. package/src/models/PaginatedCustomerListResourceResponse.ts +90 -0
  125. package/src/models/SitePaymentConfigResource.ts +9 -0
  126. package/src/models/StoreCartRequest.ts +171 -0
  127. package/src/models/StoreCartRequestCustomer.ts +89 -0
  128. package/src/models/StoreCartRequestItemsInner.ts +83 -0
  129. package/src/models/StoreCartRequestShippingAddress.ts +121 -0
  130. package/src/models/StoreCustomerRequest.ts +101 -0
  131. package/src/models/StoreListResource.ts +2 -3
  132. package/src/models/StoreResource.ts +3 -2
  133. package/src/models/StoreSpecialDateFrontendResource.ts +4 -3
  134. package/src/models/StoreSpecialDateResource.ts +4 -3
  135. package/src/models/UpdateCartRequest.ts +129 -0
  136. package/src/models/UpdateSiteRequest.ts +9 -0
  137. package/src/models/index.ts +23 -0
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
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 { mapValues } from '../runtime';
16
+ import type { CartItemListResource } from './CartItemListResource';
17
+ import {
18
+ CartItemListResourceFromJSON,
19
+ CartItemListResourceFromJSONTyped,
20
+ CartItemListResourceToJSON,
21
+ CartItemListResourceToJSONTyped,
22
+ } from './CartItemListResource';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface CartItemListResourceArrayResponse
28
+ */
29
+ export interface CartItemListResourceArrayResponse {
30
+ /**
31
+ *
32
+ * @type {Array<CartItemListResource>}
33
+ * @memberof CartItemListResourceArrayResponse
34
+ */
35
+ data?: Array<CartItemListResource>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the CartItemListResourceArrayResponse interface.
40
+ */
41
+ export function instanceOfCartItemListResourceArrayResponse(value: object): value is CartItemListResourceArrayResponse {
42
+ return true;
43
+ }
44
+
45
+ export function CartItemListResourceArrayResponseFromJSON(json: any): CartItemListResourceArrayResponse {
46
+ return CartItemListResourceArrayResponseFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function CartItemListResourceArrayResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartItemListResourceArrayResponse {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(CartItemListResourceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function CartItemListResourceArrayResponseToJSON(json: any): CartItemListResourceArrayResponse {
60
+ return CartItemListResourceArrayResponseToJSONTyped(json, false);
61
+ }
62
+
63
+ export function CartItemListResourceArrayResponseToJSONTyped(value?: CartItemListResourceArrayResponse | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(CartItemListResourceToJSON)),
71
+ };
72
+ }
73
+
@@ -0,0 +1,183 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
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 { mapValues } from '../runtime';
16
+ import type { SiteLiteResource } from './SiteLiteResource';
17
+ import {
18
+ SiteLiteResourceFromJSON,
19
+ SiteLiteResourceFromJSONTyped,
20
+ SiteLiteResourceToJSON,
21
+ SiteLiteResourceToJSONTyped,
22
+ } from './SiteLiteResource';
23
+ import type { CartItemListResource } from './CartItemListResource';
24
+ import {
25
+ CartItemListResourceFromJSON,
26
+ CartItemListResourceFromJSONTyped,
27
+ CartItemListResourceToJSON,
28
+ CartItemListResourceToJSONTyped,
29
+ } from './CartItemListResource';
30
+ import type { CustomerListResource } from './CustomerListResource';
31
+ import {
32
+ CustomerListResourceFromJSON,
33
+ CustomerListResourceFromJSONTyped,
34
+ CustomerListResourceToJSON,
35
+ CustomerListResourceToJSONTyped,
36
+ } from './CustomerListResource';
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ * @interface CartListResource
42
+ */
43
+ export interface CartListResource {
44
+ /**
45
+ *
46
+ * @type {number}
47
+ * @memberof CartListResource
48
+ */
49
+ id?: number | null;
50
+ /**
51
+ *
52
+ * @type {number}
53
+ * @memberof CartListResource
54
+ */
55
+ siteId: number;
56
+ /**
57
+ *
58
+ * @type {number}
59
+ * @memberof CartListResource
60
+ */
61
+ customerId?: number | null;
62
+ /**
63
+ *
64
+ * @type {string}
65
+ * @memberof CartListResource
66
+ */
67
+ source: string;
68
+ /**
69
+ *
70
+ * @type {Date}
71
+ * @memberof CartListResource
72
+ */
73
+ expiryDate: Date;
74
+ /**
75
+ *
76
+ * @type {Date}
77
+ * @memberof CartListResource
78
+ */
79
+ checkoutCompletedAt?: Date | null;
80
+ /**
81
+ *
82
+ * @type {Date}
83
+ * @memberof CartListResource
84
+ */
85
+ createdAt?: Date | null;
86
+ /**
87
+ *
88
+ * @type {SiteLiteResource}
89
+ * @memberof CartListResource
90
+ */
91
+ site: SiteLiteResource | null;
92
+ /**
93
+ *
94
+ * @type {CustomerListResource}
95
+ * @memberof CartListResource
96
+ */
97
+ customer: CustomerListResource | null;
98
+ /**
99
+ *
100
+ * @type {Array<CartItemListResource>}
101
+ * @memberof CartListResource
102
+ */
103
+ cartItems: Array<CartItemListResource> | null;
104
+ /**
105
+ *
106
+ * @type {number}
107
+ * @memberof CartListResource
108
+ */
109
+ subtotal: number;
110
+ /**
111
+ *
112
+ * @type {string}
113
+ * @memberof CartListResource
114
+ */
115
+ status: string;
116
+ }
117
+
118
+ /**
119
+ * Check if a given object implements the CartListResource interface.
120
+ */
121
+ export function instanceOfCartListResource(value: object): value is CartListResource {
122
+ if (!('siteId' in value) || value['siteId'] === undefined) return false;
123
+ if (!('source' in value) || value['source'] === undefined) return false;
124
+ if (!('expiryDate' in value) || value['expiryDate'] === undefined) return false;
125
+ if (!('site' in value) || value['site'] === undefined) return false;
126
+ if (!('customer' in value) || value['customer'] === undefined) return false;
127
+ if (!('cartItems' in value) || value['cartItems'] === undefined) return false;
128
+ if (!('subtotal' in value) || value['subtotal'] === undefined) return false;
129
+ if (!('status' in value) || value['status'] === undefined) return false;
130
+ return true;
131
+ }
132
+
133
+ export function CartListResourceFromJSON(json: any): CartListResource {
134
+ return CartListResourceFromJSONTyped(json, false);
135
+ }
136
+
137
+ export function CartListResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartListResource {
138
+ if (json == null) {
139
+ return json;
140
+ }
141
+ return {
142
+
143
+ 'id': json['id'] == null ? undefined : json['id'],
144
+ 'siteId': json['site_id'],
145
+ 'customerId': json['customer_id'] == null ? undefined : json['customer_id'],
146
+ 'source': json['source'],
147
+ 'expiryDate': (new Date(json['expiry_date'])),
148
+ 'checkoutCompletedAt': json['checkout_completed_at'] == null ? undefined : (new Date(json['checkout_completed_at'])),
149
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
150
+ 'site': SiteLiteResourceFromJSON(json['site']),
151
+ 'customer': CustomerListResourceFromJSON(json['customer']),
152
+ 'cartItems': (json['cart_items'] == null ? null : (json['cart_items'] as Array<any>).map(CartItemListResourceFromJSON)),
153
+ 'subtotal': json['subtotal'],
154
+ 'status': json['status'],
155
+ };
156
+ }
157
+
158
+ export function CartListResourceToJSON(json: any): CartListResource {
159
+ return CartListResourceToJSONTyped(json, false);
160
+ }
161
+
162
+ export function CartListResourceToJSONTyped(value?: CartListResource | null, ignoreDiscriminator: boolean = false): any {
163
+ if (value == null) {
164
+ return value;
165
+ }
166
+
167
+ return {
168
+
169
+ 'id': value['id'],
170
+ 'site_id': value['siteId'],
171
+ 'customer_id': value['customerId'],
172
+ 'source': value['source'],
173
+ 'expiry_date': value['expiryDate'].toISOString(),
174
+ 'checkout_completed_at': value['checkoutCompletedAt'] == null ? value['checkoutCompletedAt'] : value['checkoutCompletedAt'].toISOString(),
175
+ 'created_at': value['createdAt'] == null ? value['createdAt'] : value['createdAt'].toISOString(),
176
+ 'site': SiteLiteResourceToJSON(value['site']),
177
+ 'customer': CustomerListResourceToJSON(value['customer']),
178
+ 'cart_items': (value['cartItems'] == null ? null : (value['cartItems'] as Array<any>).map(CartItemListResourceToJSON)),
179
+ 'subtotal': value['subtotal'],
180
+ 'status': value['status'],
181
+ };
182
+ }
183
+
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
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 { mapValues } from '../runtime';
16
+ import type { CartListResource } from './CartListResource';
17
+ import {
18
+ CartListResourceFromJSON,
19
+ CartListResourceFromJSONTyped,
20
+ CartListResourceToJSON,
21
+ CartListResourceToJSONTyped,
22
+ } from './CartListResource';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface CartListResourceArrayResponse
28
+ */
29
+ export interface CartListResourceArrayResponse {
30
+ /**
31
+ *
32
+ * @type {Array<CartListResource>}
33
+ * @memberof CartListResourceArrayResponse
34
+ */
35
+ data?: Array<CartListResource>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the CartListResourceArrayResponse interface.
40
+ */
41
+ export function instanceOfCartListResourceArrayResponse(value: object): value is CartListResourceArrayResponse {
42
+ return true;
43
+ }
44
+
45
+ export function CartListResourceArrayResponseFromJSON(json: any): CartListResourceArrayResponse {
46
+ return CartListResourceArrayResponseFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function CartListResourceArrayResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartListResourceArrayResponse {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(CartListResourceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function CartListResourceArrayResponseToJSON(json: any): CartListResourceArrayResponse {
60
+ return CartListResourceArrayResponseToJSONTyped(json, false);
61
+ }
62
+
63
+ export function CartListResourceArrayResponseToJSONTyped(value?: CartListResourceArrayResponse | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(CartListResourceToJSON)),
71
+ };
72
+ }
73
+
@@ -0,0 +1,57 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
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
+
16
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const CartOrderSource = {
21
+ Checkout: 'checkout',
22
+ Admin: 'admin',
23
+ Phone: 'phone',
24
+ Email: 'email',
25
+ Ebay: 'ebay',
26
+ InStore: 'in_store'
27
+ } as const;
28
+ export type CartOrderSource = typeof CartOrderSource[keyof typeof CartOrderSource];
29
+
30
+
31
+ export function instanceOfCartOrderSource(value: any): boolean {
32
+ for (const key in CartOrderSource) {
33
+ if (Object.prototype.hasOwnProperty.call(CartOrderSource, key)) {
34
+ if (CartOrderSource[key as keyof typeof CartOrderSource] === value) {
35
+ return true;
36
+ }
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+
42
+ export function CartOrderSourceFromJSON(json: any): CartOrderSource {
43
+ return CartOrderSourceFromJSONTyped(json, false);
44
+ }
45
+
46
+ export function CartOrderSourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartOrderSource {
47
+ return json as CartOrderSource;
48
+ }
49
+
50
+ export function CartOrderSourceToJSON(value?: CartOrderSource | null): any {
51
+ return value as any;
52
+ }
53
+
54
+ export function CartOrderSourceToJSONTyped(value: any, ignoreDiscriminator: boolean): CartOrderSource {
55
+ return value as CartOrderSource;
56
+ }
57
+
@@ -0,0 +1,259 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
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 { mapValues } from '../runtime';
16
+ import type { SiteLiteResource } from './SiteLiteResource';
17
+ import {
18
+ SiteLiteResourceFromJSON,
19
+ SiteLiteResourceFromJSONTyped,
20
+ SiteLiteResourceToJSON,
21
+ SiteLiteResourceToJSONTyped,
22
+ } from './SiteLiteResource';
23
+ import type { CartItemListResource } from './CartItemListResource';
24
+ import {
25
+ CartItemListResourceFromJSON,
26
+ CartItemListResourceFromJSONTyped,
27
+ CartItemListResourceToJSON,
28
+ CartItemListResourceToJSONTyped,
29
+ } from './CartItemListResource';
30
+ import type { CustomerListResource } from './CustomerListResource';
31
+ import {
32
+ CustomerListResourceFromJSON,
33
+ CustomerListResourceFromJSONTyped,
34
+ CustomerListResourceToJSON,
35
+ CustomerListResourceToJSONTyped,
36
+ } from './CustomerListResource';
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ * @interface CartResource
42
+ */
43
+ export interface CartResource {
44
+ /**
45
+ *
46
+ * @type {number}
47
+ * @memberof CartResource
48
+ */
49
+ id?: number | null;
50
+ /**
51
+ *
52
+ * @type {number}
53
+ * @memberof CartResource
54
+ */
55
+ siteId: number;
56
+ /**
57
+ *
58
+ * @type {number}
59
+ * @memberof CartResource
60
+ */
61
+ customerId?: number | null;
62
+ /**
63
+ *
64
+ * @type {string}
65
+ * @memberof CartResource
66
+ */
67
+ source: string;
68
+ /**
69
+ *
70
+ * @type {string}
71
+ * @memberof CartResource
72
+ */
73
+ sessionToken?: string | null;
74
+ /**
75
+ *
76
+ * @type {string}
77
+ * @memberof CartResource
78
+ */
79
+ paymentToken?: string | null;
80
+ /**
81
+ *
82
+ * @type {Date}
83
+ * @memberof CartResource
84
+ */
85
+ expiryDate: Date;
86
+ /**
87
+ *
88
+ * @type {Date}
89
+ * @memberof CartResource
90
+ */
91
+ checkoutCompletedAt?: Date | null;
92
+ /**
93
+ *
94
+ * @type {Date}
95
+ * @memberof CartResource
96
+ */
97
+ createdAt?: Date | null;
98
+ /**
99
+ *
100
+ * @type {Date}
101
+ * @memberof CartResource
102
+ */
103
+ updatedAt?: Date | null;
104
+ /**
105
+ *
106
+ * @type {SiteLiteResource}
107
+ * @memberof CartResource
108
+ */
109
+ site: SiteLiteResource | null;
110
+ /**
111
+ *
112
+ * @type {CustomerListResource}
113
+ * @memberof CartResource
114
+ */
115
+ customer: CustomerListResource | null;
116
+ /**
117
+ *
118
+ * @type {Array<CartItemListResource>}
119
+ * @memberof CartResource
120
+ */
121
+ cartItems: Array<CartItemListResource> | null;
122
+ /**
123
+ *
124
+ * @type {object}
125
+ * @memberof CartResource
126
+ */
127
+ coupons: object;
128
+ /**
129
+ *
130
+ * @type {Array<string | null>}
131
+ * @memberof CartResource
132
+ */
133
+ shippingAddress: Array<string | null>;
134
+ /**
135
+ *
136
+ * @type {string}
137
+ * @memberof CartResource
138
+ */
139
+ billingAddress?: string | null;
140
+ /**
141
+ *
142
+ * @type {number}
143
+ * @memberof CartResource
144
+ */
145
+ subtotal: number;
146
+ /**
147
+ *
148
+ * @type {string}
149
+ * @memberof CartResource
150
+ */
151
+ discountPreview?: string | null;
152
+ /**
153
+ *
154
+ * @type {number}
155
+ * @memberof CartResource
156
+ */
157
+ shippingEstimate: number;
158
+ /**
159
+ *
160
+ * @type {number}
161
+ * @memberof CartResource
162
+ */
163
+ insuranceEstimate: number;
164
+ /**
165
+ *
166
+ * @type {string}
167
+ * @memberof CartResource
168
+ */
169
+ status: string;
170
+ }
171
+
172
+ /**
173
+ * Check if a given object implements the CartResource interface.
174
+ */
175
+ export function instanceOfCartResource(value: object): value is CartResource {
176
+ if (!('siteId' in value) || value['siteId'] === undefined) return false;
177
+ if (!('source' in value) || value['source'] === undefined) return false;
178
+ if (!('expiryDate' in value) || value['expiryDate'] === undefined) return false;
179
+ if (!('site' in value) || value['site'] === undefined) return false;
180
+ if (!('customer' in value) || value['customer'] === undefined) return false;
181
+ if (!('cartItems' in value) || value['cartItems'] === undefined) return false;
182
+ if (!('coupons' in value) || value['coupons'] === undefined) return false;
183
+ if (!('shippingAddress' in value) || value['shippingAddress'] === undefined) return false;
184
+ if (!('subtotal' in value) || value['subtotal'] === undefined) return false;
185
+ if (!('shippingEstimate' in value) || value['shippingEstimate'] === undefined) return false;
186
+ if (!('insuranceEstimate' in value) || value['insuranceEstimate'] === undefined) return false;
187
+ if (!('status' in value) || value['status'] === undefined) return false;
188
+ return true;
189
+ }
190
+
191
+ export function CartResourceFromJSON(json: any): CartResource {
192
+ return CartResourceFromJSONTyped(json, false);
193
+ }
194
+
195
+ export function CartResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CartResource {
196
+ if (json == null) {
197
+ return json;
198
+ }
199
+ return {
200
+
201
+ 'id': json['id'] == null ? undefined : json['id'],
202
+ 'siteId': json['site_id'],
203
+ 'customerId': json['customer_id'] == null ? undefined : json['customer_id'],
204
+ 'source': json['source'],
205
+ 'sessionToken': json['session_token'] == null ? undefined : json['session_token'],
206
+ 'paymentToken': json['payment_token'] == null ? undefined : json['payment_token'],
207
+ 'expiryDate': (new Date(json['expiry_date'])),
208
+ 'checkoutCompletedAt': json['checkout_completed_at'] == null ? undefined : (new Date(json['checkout_completed_at'])),
209
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
210
+ 'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
211
+ 'site': SiteLiteResourceFromJSON(json['site']),
212
+ 'customer': CustomerListResourceFromJSON(json['customer']),
213
+ 'cartItems': (json['cart_items'] == null ? null : (json['cart_items'] as Array<any>).map(CartItemListResourceFromJSON)),
214
+ 'coupons': json['coupons'],
215
+ 'shippingAddress': json['shipping_address'],
216
+ 'billingAddress': json['billing_address'] == null ? undefined : json['billing_address'],
217
+ 'subtotal': json['subtotal'],
218
+ 'discountPreview': json['discount_preview'] == null ? undefined : json['discount_preview'],
219
+ 'shippingEstimate': json['shipping_estimate'],
220
+ 'insuranceEstimate': json['insurance_estimate'],
221
+ 'status': json['status'],
222
+ };
223
+ }
224
+
225
+ export function CartResourceToJSON(json: any): CartResource {
226
+ return CartResourceToJSONTyped(json, false);
227
+ }
228
+
229
+ export function CartResourceToJSONTyped(value?: CartResource | null, ignoreDiscriminator: boolean = false): any {
230
+ if (value == null) {
231
+ return value;
232
+ }
233
+
234
+ return {
235
+
236
+ 'id': value['id'],
237
+ 'site_id': value['siteId'],
238
+ 'customer_id': value['customerId'],
239
+ 'source': value['source'],
240
+ 'session_token': value['sessionToken'],
241
+ 'payment_token': value['paymentToken'],
242
+ 'expiry_date': value['expiryDate'].toISOString(),
243
+ 'checkout_completed_at': value['checkoutCompletedAt'] == null ? value['checkoutCompletedAt'] : value['checkoutCompletedAt'].toISOString(),
244
+ 'created_at': value['createdAt'] == null ? value['createdAt'] : value['createdAt'].toISOString(),
245
+ 'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
246
+ 'site': SiteLiteResourceToJSON(value['site']),
247
+ 'customer': CustomerListResourceToJSON(value['customer']),
248
+ 'cart_items': (value['cartItems'] == null ? null : (value['cartItems'] as Array<any>).map(CartItemListResourceToJSON)),
249
+ 'coupons': value['coupons'],
250
+ 'shipping_address': value['shippingAddress'],
251
+ 'billing_address': value['billingAddress'],
252
+ 'subtotal': value['subtotal'],
253
+ 'discount_preview': value['discountPreview'],
254
+ 'shipping_estimate': value['shippingEstimate'],
255
+ 'insurance_estimate': value['insuranceEstimate'],
256
+ 'status': value['status'],
257
+ };
258
+ }
259
+