@teemill/gfn-catalog 1.0.1 → 1.2.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 (55) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +2 -2
  4. package/dist/apis/ProductsApi.d.ts +1 -1
  5. package/dist/apis/ProductsApi.js +1 -1
  6. package/dist/apis/VariantsApi.d.ts +17 -2
  7. package/dist/apis/VariantsApi.js +70 -1
  8. package/dist/models/ApiError.d.ts +1 -1
  9. package/dist/models/ApiError.js +10 -14
  10. package/dist/models/Attribute.d.ts +1 -1
  11. package/dist/models/Attribute.js +15 -18
  12. package/dist/models/AttributeThumbnail.d.ts +1 -1
  13. package/dist/models/AttributeThumbnail.js +9 -14
  14. package/dist/models/Image.d.ts +1 -1
  15. package/dist/models/Image.js +19 -24
  16. package/dist/models/Product.d.ts +19 -1
  17. package/dist/models/Product.js +20 -18
  18. package/dist/models/ProductsResponse.d.ts +1 -1
  19. package/dist/models/ProductsResponse.js +9 -14
  20. package/dist/models/Stock.d.ts +31 -0
  21. package/dist/models/Stock.js +45 -0
  22. package/dist/models/StockResponse.d.ts +38 -0
  23. package/dist/models/StockResponse.js +48 -0
  24. package/dist/models/Variant.d.ts +15 -1
  25. package/dist/models/Variant.js +25 -22
  26. package/dist/models/VariantManufacturerOrigin.d.ts +37 -0
  27. package/dist/models/VariantManufacturerOrigin.js +47 -0
  28. package/dist/models/VariantProduct.d.ts +1 -1
  29. package/dist/models/VariantProduct.js +9 -14
  30. package/dist/models/VariantStock.d.ts +50 -0
  31. package/dist/models/VariantStock.js +52 -0
  32. package/dist/models/VariantsResponse.d.ts +1 -1
  33. package/dist/models/VariantsResponse.js +9 -14
  34. package/dist/models/index.d.ts +4 -0
  35. package/dist/models/index.js +4 -0
  36. package/dist/runtime.d.ts +1 -1
  37. package/dist/runtime.js +2 -2
  38. package/package.json +1 -1
  39. package/src/apis/ProductsApi.ts +1 -1
  40. package/src/apis/VariantsApi.ts +74 -1
  41. package/src/models/ApiError.ts +10 -15
  42. package/src/models/Attribute.ts +14 -19
  43. package/src/models/AttributeThumbnail.ts +10 -15
  44. package/src/models/Image.ts +20 -25
  45. package/src/models/Product.ts +38 -19
  46. package/src/models/ProductsResponse.ts +10 -15
  47. package/src/models/Stock.ts +60 -0
  48. package/src/models/StockResponse.ts +75 -0
  49. package/src/models/Variant.ts +46 -23
  50. package/src/models/VariantManufacturerOrigin.ts +68 -0
  51. package/src/models/VariantProduct.ts +10 -15
  52. package/src/models/VariantStock.ts +91 -0
  53. package/src/models/VariantsResponse.ts +10 -15
  54. package/src/models/index.ts +4 -0
  55. package/src/runtime.ts +2 -2
@@ -5,7 +5,7 @@
5
5
  * GFN Catalog API
6
6
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
7
7
  *
8
- * The version of the OpenAPI document: 1.0.1
8
+ * The version of the OpenAPI document: 1.2.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -14,14 +14,12 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.VariantsResponseToJSON = exports.VariantsResponseFromJSONTyped = exports.VariantsResponseFromJSON = exports.instanceOfVariantsResponse = void 0;
17
- var runtime_1 = require("../runtime");
18
17
  var Variant_1 = require("./Variant");
19
18
  /**
20
19
  * Check if a given object implements the VariantsResponse interface.
21
20
  */
22
21
  function instanceOfVariantsResponse(value) {
23
- var isInstance = true;
24
- return isInstance;
22
+ return true;
25
23
  }
26
24
  exports.instanceOfVariantsResponse = instanceOfVariantsResponse;
27
25
  function VariantsResponseFromJSON(json) {
@@ -29,25 +27,22 @@ function VariantsResponseFromJSON(json) {
29
27
  }
30
28
  exports.VariantsResponseFromJSON = VariantsResponseFromJSON;
31
29
  function VariantsResponseFromJSONTyped(json, ignoreDiscriminator) {
32
- if ((json === undefined) || (json === null)) {
30
+ if (json == null) {
33
31
  return json;
34
32
  }
35
33
  return {
36
- 'variants': !(0, runtime_1.exists)(json, 'variants') ? undefined : (json['variants'].map(Variant_1.VariantFromJSON)),
37
- 'nextPageToken': !(0, runtime_1.exists)(json, 'nextPageToken') ? undefined : json['nextPageToken'],
34
+ 'variants': json['variants'] == null ? undefined : (json['variants'].map(Variant_1.VariantFromJSON)),
35
+ 'nextPageToken': json['nextPageToken'] == null ? undefined : json['nextPageToken'],
38
36
  };
39
37
  }
40
38
  exports.VariantsResponseFromJSONTyped = VariantsResponseFromJSONTyped;
41
39
  function VariantsResponseToJSON(value) {
42
- if (value === undefined) {
43
- return undefined;
44
- }
45
- if (value === null) {
46
- return null;
40
+ if (value == null) {
41
+ return value;
47
42
  }
48
43
  return {
49
- 'variants': value.variants === undefined ? undefined : (value.variants.map(Variant_1.VariantToJSON)),
50
- 'nextPageToken': value.nextPageToken,
44
+ 'variants': value['variants'] == null ? undefined : (value['variants'].map(Variant_1.VariantToJSON)),
45
+ 'nextPageToken': value['nextPageToken'],
51
46
  };
52
47
  }
53
48
  exports.VariantsResponseToJSON = VariantsResponseToJSON;
@@ -4,6 +4,10 @@ export * from './AttributeThumbnail';
4
4
  export * from './Image';
5
5
  export * from './Product';
6
6
  export * from './ProductsResponse';
7
+ export * from './Stock';
8
+ export * from './StockResponse';
7
9
  export * from './Variant';
10
+ export * from './VariantManufacturerOrigin';
8
11
  export * from './VariantProduct';
12
+ export * from './VariantStock';
9
13
  export * from './VariantsResponse';
@@ -22,6 +22,10 @@ __exportStar(require("./AttributeThumbnail"), exports);
22
22
  __exportStar(require("./Image"), exports);
23
23
  __exportStar(require("./Product"), exports);
24
24
  __exportStar(require("./ProductsResponse"), exports);
25
+ __exportStar(require("./Stock"), exports);
26
+ __exportStar(require("./StockResponse"), exports);
25
27
  __exportStar(require("./Variant"), exports);
28
+ __exportStar(require("./VariantManufacturerOrigin"), exports);
26
29
  __exportStar(require("./VariantProduct"), exports);
30
+ __exportStar(require("./VariantStock"), exports);
27
31
  __exportStar(require("./VariantsResponse"), exports);
package/dist/runtime.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * GFN Catalog API
3
3
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
4
4
  *
5
- * The version of the OpenAPI document: 1.0.1
5
+ * The version of the OpenAPI document: 1.2.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/runtime.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * GFN Catalog API
6
6
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
7
7
  *
8
- * The version of the OpenAPI document: 1.0.1
8
+ * The version of the OpenAPI document: 1.2.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -76,7 +76,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
76
76
  };
77
77
  Object.defineProperty(exports, "__esModule", { value: true });
78
78
  exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
79
- exports.BASE_PATH = "http://api.localhost".replace(/\/+$/, "");
79
+ exports.BASE_PATH = "https://api.teemill.com".replace(/\/+$/, "");
80
80
  var Configuration = /** @class */ (function () {
81
81
  function Configuration(configuration) {
82
82
  if (configuration === void 0) { configuration = {}; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teemill/gfn-catalog",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "OpenAPI client for @teemill/gfn-catalog",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,12 +16,15 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
+ StockResponse,
19
20
  Variant,
20
21
  VariantsResponse,
21
22
  } from '../models/index';
22
23
  import {
23
24
  ApiErrorFromJSON,
24
25
  ApiErrorToJSON,
26
+ StockResponseFromJSON,
27
+ StockResponseToJSON,
25
28
  VariantFromJSON,
26
29
  VariantToJSON,
27
30
  VariantsResponseFromJSON,
@@ -34,6 +37,12 @@ export interface GetVariantRequest {
34
37
  fields?: string;
35
38
  }
36
39
 
40
+ export interface ListStockRequest {
41
+ project: string;
42
+ pageToken?: number;
43
+ pageSize?: number;
44
+ }
45
+
37
46
  export interface ListVariantsRequest {
38
47
  project: string;
39
48
  pageToken?: number;
@@ -111,6 +120,70 @@ export class VariantsApi extends runtime.BaseAPI {
111
120
  return await response.value();
112
121
  }
113
122
 
123
+ /**
124
+ * Lists the stock levels for all GFN variants available to the project.
125
+ * List GFN variant stock
126
+ */
127
+ async listStockRaw(requestParameters: ListStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StockResponse>> {
128
+ if (requestParameters.project === null || requestParameters.project === undefined) {
129
+ throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listStock.');
130
+ }
131
+
132
+ const queryParameters: any = {};
133
+
134
+ if (requestParameters.project !== undefined) {
135
+ queryParameters['project'] = requestParameters.project;
136
+ }
137
+
138
+ if (requestParameters.pageToken !== undefined) {
139
+ queryParameters['pageToken'] = requestParameters.pageToken;
140
+ }
141
+
142
+ if (requestParameters.pageSize !== undefined) {
143
+ queryParameters['pageSize'] = requestParameters.pageSize;
144
+ }
145
+
146
+ const headerParameters: runtime.HTTPHeaders = {};
147
+
148
+ if (this.configuration && this.configuration.accessToken) {
149
+ // oauth required
150
+ headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
151
+ }
152
+
153
+ if (this.configuration && this.configuration.apiKey) {
154
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
155
+ }
156
+
157
+ const response = await this.request({
158
+ path: `/v1/gfn/catalog/stock`,
159
+ method: 'GET',
160
+ headers: headerParameters,
161
+ query: queryParameters,
162
+ }, initOverrides);
163
+
164
+ return new runtime.JSONApiResponse(response, (jsonValue) => StockResponseFromJSON(jsonValue));
165
+ }
166
+
167
+ /**
168
+ * Lists the stock levels for all GFN variants available to the project.
169
+ * List GFN variant stock
170
+ */
171
+ async listStock(
172
+ project: string,
173
+ optionalParameters: runtime.OptionalOnly<ListStockRequest> = {},
174
+ initOverrides?: RequestInit | runtime.InitOverrideFunction
175
+ ): Promise<StockResponse> {
176
+ const response = await this.listStockRaw(
177
+ {
178
+ project: project,
179
+ ...optionalParameters,
180
+ },
181
+ initOverrides
182
+ );
183
+
184
+ return await response.value();
185
+ }
186
+
114
187
  /**
115
188
  * Lists all GFN variants available to the project. Can be filtered by product ID, SKU, and attribute values using the search parameter.
116
189
  * List GFN variants
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { exists, mapValues } from '../runtime';
15
+ import { mapValues } from '../runtime';
16
16
  /**
17
17
  *
18
18
  * @export
@@ -37,10 +37,8 @@ export interface ApiError {
37
37
  * Check if a given object implements the ApiError interface.
38
38
  */
39
39
  export function instanceOfApiError(value: object): boolean {
40
- let isInstance = true;
41
- isInstance = isInstance && "message" in value;
42
-
43
- return isInstance;
40
+ if (!('message' in value)) return false;
41
+ return true;
44
42
  }
45
43
 
46
44
  export function ApiErrorFromJSON(json: any): ApiError {
@@ -48,27 +46,24 @@ export function ApiErrorFromJSON(json: any): ApiError {
48
46
  }
49
47
 
50
48
  export function ApiErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiError {
51
- if ((json === undefined) || (json === null)) {
49
+ if (json == null) {
52
50
  return json;
53
51
  }
54
52
  return {
55
53
 
56
- 'code': !exists(json, 'code') ? undefined : json['code'],
54
+ 'code': json['code'] == null ? undefined : json['code'],
57
55
  'message': json['message'],
58
56
  };
59
57
  }
60
58
 
61
59
  export function ApiErrorToJSON(value?: ApiError | null): any {
62
- if (value === undefined) {
63
- return undefined;
64
- }
65
- if (value === null) {
66
- return null;
60
+ if (value == null) {
61
+ return value;
67
62
  }
68
63
  return {
69
64
 
70
- 'code': value.code,
71
- 'message': value.message,
65
+ 'code': value['code'],
66
+ 'message': value['message'],
72
67
  };
73
68
  }
74
69
 
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { exists, mapValues } from '../runtime';
15
+ import { mapValues } from '../runtime';
16
16
  import type { AttributeThumbnail } from './AttributeThumbnail';
17
17
  import {
18
18
  AttributeThumbnailFromJSON,
@@ -56,11 +56,9 @@ export interface Attribute {
56
56
  * Check if a given object implements the Attribute interface.
57
57
  */
58
58
  export function instanceOfAttribute(value: object): boolean {
59
- let isInstance = true;
60
- isInstance = isInstance && "name" in value;
61
- isInstance = isInstance && "value" in value;
62
-
63
- return isInstance;
59
+ if (!('name' in value)) return false;
60
+ if (!('value' in value)) return false;
61
+ return true;
64
62
  }
65
63
 
66
64
  export function AttributeFromJSON(json: any): Attribute {
@@ -68,31 +66,28 @@ export function AttributeFromJSON(json: any): Attribute {
68
66
  }
69
67
 
70
68
  export function AttributeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attribute {
71
- if ((json === undefined) || (json === null)) {
69
+ if (json == null) {
72
70
  return json;
73
71
  }
74
72
  return {
75
73
 
76
74
  'name': json['name'],
77
75
  'value': json['value'],
78
- 'thumbnail': !exists(json, 'thumbnail') ? undefined : AttributeThumbnailFromJSON(json['thumbnail']),
79
- 'tags': !exists(json, 'tags') ? undefined : json['tags'],
76
+ 'thumbnail': json['thumbnail'] == null ? undefined : AttributeThumbnailFromJSON(json['thumbnail']),
77
+ 'tags': json['tags'] == null ? undefined : json['tags'],
80
78
  };
81
79
  }
82
80
 
83
81
  export function AttributeToJSON(value?: Attribute | null): any {
84
- if (value === undefined) {
85
- return undefined;
86
- }
87
- if (value === null) {
88
- return null;
82
+ if (value == null) {
83
+ return value;
89
84
  }
90
85
  return {
91
86
 
92
- 'name': value.name,
93
- 'value': value.value,
94
- 'thumbnail': AttributeThumbnailToJSON(value.thumbnail),
95
- 'tags': value.tags,
87
+ 'name': value['name'],
88
+ 'value': value['value'],
89
+ 'thumbnail': AttributeThumbnailToJSON(value['thumbnail']),
90
+ 'tags': value['tags'],
96
91
  };
97
92
  }
98
93
 
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { exists, mapValues } from '../runtime';
15
+ import { mapValues } from '../runtime';
16
16
  /**
17
17
  * Attribute thumbnail
18
18
  * @export
@@ -49,9 +49,7 @@ export type AttributeThumbnailTypeEnum = typeof AttributeThumbnailTypeEnum[keyof
49
49
  * Check if a given object implements the AttributeThumbnail interface.
50
50
  */
51
51
  export function instanceOfAttributeThumbnail(value: object): boolean {
52
- let isInstance = true;
53
-
54
- return isInstance;
52
+ return true;
55
53
  }
56
54
 
57
55
  export function AttributeThumbnailFromJSON(json: any): AttributeThumbnail {
@@ -59,27 +57,24 @@ export function AttributeThumbnailFromJSON(json: any): AttributeThumbnail {
59
57
  }
60
58
 
61
59
  export function AttributeThumbnailFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttributeThumbnail {
62
- if ((json === undefined) || (json === null)) {
60
+ if (json == null) {
63
61
  return json;
64
62
  }
65
63
  return {
66
64
 
67
- 'type': !exists(json, 'type') ? undefined : json['type'],
68
- 'value': !exists(json, 'value') ? undefined : json['value'],
65
+ 'type': json['type'] == null ? undefined : json['type'],
66
+ 'value': json['value'] == null ? undefined : json['value'],
69
67
  };
70
68
  }
71
69
 
72
70
  export function AttributeThumbnailToJSON(value?: AttributeThumbnail | null): any {
73
- if (value === undefined) {
74
- return undefined;
75
- }
76
- if (value === null) {
77
- return null;
71
+ if (value == null) {
72
+ return value;
78
73
  }
79
74
  return {
80
75
 
81
- 'type': value.type,
82
- 'value': value.value,
76
+ 'type': value['type'],
77
+ 'value': value['value'],
83
78
  };
84
79
  }
85
80
 
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { exists, mapValues } from '../runtime';
15
+ import { mapValues } from '../runtime';
16
16
  /**
17
17
  * Image description
18
18
  * @export
@@ -67,9 +67,7 @@ export interface Image {
67
67
  * Check if a given object implements the Image interface.
68
68
  */
69
69
  export function instanceOfImage(value: object): boolean {
70
- let isInstance = true;
71
-
72
- return isInstance;
70
+ return true;
73
71
  }
74
72
 
75
73
  export function ImageFromJSON(json: any): Image {
@@ -77,37 +75,34 @@ export function ImageFromJSON(json: any): Image {
77
75
  }
78
76
 
79
77
  export function ImageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Image {
80
- if ((json === undefined) || (json === null)) {
78
+ if (json == null) {
81
79
  return json;
82
80
  }
83
81
  return {
84
82
 
85
- 'id': !exists(json, 'id') ? undefined : json['id'],
86
- 'src': !exists(json, 'src') ? undefined : json['src'],
87
- 'alt': !exists(json, 'alt') ? undefined : json['alt'],
88
- 'variantIds': !exists(json, 'variantIds') ? undefined : json['variantIds'],
89
- 'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
90
- 'createdAt': !exists(json, 'createdAt') ? undefined : json['createdAt'],
91
- 'updatedAt': !exists(json, 'updatedAt') ? undefined : json['updatedAt'],
83
+ 'id': json['id'] == null ? undefined : json['id'],
84
+ 'src': json['src'] == null ? undefined : json['src'],
85
+ 'alt': json['alt'] == null ? undefined : json['alt'],
86
+ 'variantIds': json['variantIds'] == null ? undefined : json['variantIds'],
87
+ 'sortOrder': json['sortOrder'] == null ? undefined : json['sortOrder'],
88
+ 'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
89
+ 'updatedAt': json['updatedAt'] == null ? undefined : json['updatedAt'],
92
90
  };
93
91
  }
94
92
 
95
93
  export function ImageToJSON(value?: Image | null): any {
96
- if (value === undefined) {
97
- return undefined;
98
- }
99
- if (value === null) {
100
- return null;
94
+ if (value == null) {
95
+ return value;
101
96
  }
102
97
  return {
103
98
 
104
- 'id': value.id,
105
- 'src': value.src,
106
- 'alt': value.alt,
107
- 'variantIds': value.variantIds,
108
- 'sortOrder': value.sortOrder,
109
- 'createdAt': value.createdAt,
110
- 'updatedAt': value.updatedAt,
99
+ 'id': value['id'],
100
+ 'src': value['src'],
101
+ 'alt': value['alt'],
102
+ 'variantIds': value['variantIds'],
103
+ 'sortOrder': value['sortOrder'],
104
+ 'createdAt': value['createdAt'],
105
+ 'updatedAt': value['updatedAt'],
111
106
  };
112
107
  }
113
108
 
@@ -4,7 +4,7 @@
4
4
  * GFN Catalog API
5
5
  * Use this API to access the Global Fulfilment Network, which contains all the warehouse products and variants available to a given project. Warehouse products represent the base products that can be printed on. Products are the top level items, and variants are the different options available for each product. For example, a product might be a T-shirt, and each variant represents a different size and colour combination of that T-shirt. Use references to these warehouse products to create new product listings on your project via the Product Catalog API. Use the variant information to decide which options you would like to offer on each product listing.
6
6
  *
7
- * The version of the OpenAPI document: 1.0.1
7
+ * The version of the OpenAPI document: 1.2.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- import { exists, mapValues } from '../runtime';
15
+ import { mapValues } from '../runtime';
16
16
  /**
17
17
  *
18
18
  * @export
@@ -43,16 +43,32 @@ export interface Product {
43
43
  * @memberof Product
44
44
  */
45
45
  styleCode?: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof Product
50
+ */
51
+ material?: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof Product
56
+ */
57
+ description?: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof Product
62
+ */
63
+ specifications?: string;
46
64
  }
47
65
 
48
66
  /**
49
67
  * Check if a given object implements the Product interface.
50
68
  */
51
69
  export function instanceOfProduct(value: object): boolean {
52
- let isInstance = true;
53
- isInstance = isInstance && "title" in value;
54
-
55
- return isInstance;
70
+ if (!('title' in value)) return false;
71
+ return true;
56
72
  }
57
73
 
58
74
  export function ProductFromJSON(json: any): Product {
@@ -60,31 +76,34 @@ export function ProductFromJSON(json: any): Product {
60
76
  }
61
77
 
62
78
  export function ProductFromJSONTyped(json: any, ignoreDiscriminator: boolean): Product {
63
- if ((json === undefined) || (json === null)) {
79
+ if (json == null) {
64
80
  return json;
65
81
  }
66
82
  return {
67
83
 
68
- 'id': !exists(json, 'id') ? undefined : json['id'],
69
- 'ref': !exists(json, 'ref') ? undefined : json['ref'],
84
+ 'id': json['id'] == null ? undefined : json['id'],
85
+ 'ref': json['ref'] == null ? undefined : json['ref'],
70
86
  'title': json['title'],
71
- 'styleCode': !exists(json, 'styleCode') ? undefined : json['styleCode'],
87
+ 'styleCode': json['styleCode'] == null ? undefined : json['styleCode'],
88
+ 'material': json['material'] == null ? undefined : json['material'],
89
+ 'description': json['description'] == null ? undefined : json['description'],
90
+ 'specifications': json['specifications'] == null ? undefined : json['specifications'],
72
91
  };
73
92
  }
74
93
 
75
94
  export function ProductToJSON(value?: Product | null): any {
76
- if (value === undefined) {
77
- return undefined;
78
- }
79
- if (value === null) {
80
- return null;
95
+ if (value == null) {
96
+ return value;
81
97
  }
82
98
  return {
83
99
 
84
- 'id': value.id,
85
- 'ref': value.ref,
86
- 'title': value.title,
87
- 'styleCode': value.styleCode,
100
+ 'id': value['id'],
101
+ 'ref': value['ref'],
102
+ 'title': value['title'],
103
+ 'styleCode': value['styleCode'],
104
+ 'material': value['material'],
105
+ 'description': value['description'],
106
+ 'specifications': value['specifications'],
88
107
  };
89
108
  }
90
109