@teemill/product-catalog 1.4.0 → 1.6.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 (72) hide show
  1. package/.openapi-generator/FILES +7 -0
  2. package/README.md +2 -2
  3. package/dist/apis/ProductsApi.d.ts +30 -2
  4. package/dist/apis/ProductsApi.js +131 -1
  5. package/dist/apis/VariantsApi.d.ts +1 -1
  6. package/dist/apis/VariantsApi.js +1 -1
  7. package/dist/models/ApiError.d.ts +1 -1
  8. package/dist/models/ApiError.js +1 -1
  9. package/dist/models/Attribute.d.ts +1 -1
  10. package/dist/models/Attribute.js +1 -1
  11. package/dist/models/AttributeThumbnail.d.ts +1 -1
  12. package/dist/models/AttributeThumbnail.js +1 -1
  13. package/dist/models/CreateProductRequest.d.ts +75 -0
  14. package/dist/models/CreateProductRequest.js +68 -0
  15. package/dist/models/CreateProductRequestAdditionalFilesInner.d.ts +31 -0
  16. package/dist/models/CreateProductRequestAdditionalFilesInner.js +50 -0
  17. package/dist/models/CreateProductRequestVariantsInner.d.ts +59 -0
  18. package/dist/models/CreateProductRequestVariantsInner.js +62 -0
  19. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +59 -0
  20. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +68 -0
  21. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +37 -0
  22. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +52 -0
  23. package/dist/models/CreateProductRequestVariantsInnerImagesInner.d.ts +31 -0
  24. package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +50 -0
  25. package/dist/models/Image.d.ts +1 -1
  26. package/dist/models/Image.js +1 -1
  27. package/dist/models/ImportProducts200Response.d.ts +31 -0
  28. package/dist/models/ImportProducts200Response.js +50 -0
  29. package/dist/models/Price.d.ts +1 -1
  30. package/dist/models/Price.js +1 -1
  31. package/dist/models/Product.d.ts +8 -1
  32. package/dist/models/Product.js +4 -1
  33. package/dist/models/ProductAdditionalFilesInner.d.ts +37 -0
  34. package/dist/models/ProductAdditionalFilesInner.js +52 -0
  35. package/dist/models/ProductsResponse.d.ts +1 -1
  36. package/dist/models/ProductsResponse.js +1 -1
  37. package/dist/models/Stock.d.ts +1 -1
  38. package/dist/models/Stock.js +1 -1
  39. package/dist/models/Variant.d.ts +1 -1
  40. package/dist/models/Variant.js +1 -1
  41. package/dist/models/VariantProduct.d.ts +1 -1
  42. package/dist/models/VariantProduct.js +1 -1
  43. package/dist/models/VariantsResponse.d.ts +1 -1
  44. package/dist/models/VariantsResponse.js +1 -1
  45. package/dist/models/index.d.ts +7 -0
  46. package/dist/models/index.js +7 -0
  47. package/dist/runtime.d.ts +1 -1
  48. package/dist/runtime.js +1 -1
  49. package/package.json +1 -1
  50. package/src/apis/ProductsApi.ts +135 -1
  51. package/src/apis/VariantsApi.ts +1 -1
  52. package/src/models/ApiError.ts +1 -1
  53. package/src/models/Attribute.ts +1 -1
  54. package/src/models/AttributeThumbnail.ts +1 -1
  55. package/src/models/CreateProductRequest.ts +136 -0
  56. package/src/models/CreateProductRequestAdditionalFilesInner.ts +65 -0
  57. package/src/models/CreateProductRequestVariantsInner.ts +122 -0
  58. package/src/models/CreateProductRequestVariantsInnerApplicationsInner.ts +101 -0
  59. package/src/models/CreateProductRequestVariantsInnerAttributesInner.ts +73 -0
  60. package/src/models/CreateProductRequestVariantsInnerImagesInner.ts +65 -0
  61. package/src/models/Image.ts +1 -1
  62. package/src/models/ImportProducts200Response.ts +65 -0
  63. package/src/models/Price.ts +1 -1
  64. package/src/models/Product.ts +15 -1
  65. package/src/models/ProductAdditionalFilesInner.ts +73 -0
  66. package/src/models/ProductsResponse.ts +1 -1
  67. package/src/models/Stock.ts +1 -1
  68. package/src/models/Variant.ts +1 -1
  69. package/src/models/VariantProduct.ts +1 -1
  70. package/src/models/VariantsResponse.ts +1 -1
  71. package/src/models/index.ts +7 -0
  72. package/src/runtime.ts +1 -1
@@ -2,7 +2,7 @@
2
2
  * Product Catalog API
3
3
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 1.4.0
5
+ * The version of the OpenAPI document: 1.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Product Catalog API
6
6
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 1.4.0
8
+ * The version of the OpenAPI document: 1.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Product Catalog API
3
3
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 1.4.0
5
+ * The version of the OpenAPI document: 1.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Product Catalog API
6
6
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 1.4.0
8
+ * The version of the OpenAPI document: 1.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Product Catalog API
3
3
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 1.4.0
5
+ * The version of the OpenAPI document: 1.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Product Catalog API
6
6
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 1.4.0
8
+ * The version of the OpenAPI document: 1.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Product Catalog API
3
3
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 1.4.0
5
+ * The version of the OpenAPI document: 1.6.0
6
6
  * Contact: hello@teemill.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Product Catalog API
6
6
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 1.4.0
8
+ * The version of the OpenAPI document: 1.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,9 +1,16 @@
1
1
  export * from './ApiError';
2
2
  export * from './Attribute';
3
3
  export * from './AttributeThumbnail';
4
+ export * from './CreateProductRequest';
5
+ export * from './CreateProductRequestVariantsInner';
6
+ export * from './CreateProductRequestVariantsInnerApplicationsInner';
7
+ export * from './CreateProductRequestVariantsInnerAttributesInner';
8
+ export * from './CreateProductRequestVariantsInnerImagesInner';
4
9
  export * from './Image';
10
+ export * from './ImportProducts200Response';
5
11
  export * from './Price';
6
12
  export * from './Product';
13
+ export * from './ProductAdditionalFilesInner';
7
14
  export * from './ProductsResponse';
8
15
  export * from './Stock';
9
16
  export * from './Variant';
@@ -19,9 +19,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./ApiError"), exports);
20
20
  __exportStar(require("./Attribute"), exports);
21
21
  __exportStar(require("./AttributeThumbnail"), exports);
22
+ __exportStar(require("./CreateProductRequest"), exports);
23
+ __exportStar(require("./CreateProductRequestVariantsInner"), exports);
24
+ __exportStar(require("./CreateProductRequestVariantsInnerApplicationsInner"), exports);
25
+ __exportStar(require("./CreateProductRequestVariantsInnerAttributesInner"), exports);
26
+ __exportStar(require("./CreateProductRequestVariantsInnerImagesInner"), exports);
22
27
  __exportStar(require("./Image"), exports);
28
+ __exportStar(require("./ImportProducts200Response"), exports);
23
29
  __exportStar(require("./Price"), exports);
24
30
  __exportStar(require("./Product"), exports);
31
+ __exportStar(require("./ProductAdditionalFilesInner"), exports);
25
32
  __exportStar(require("./ProductsResponse"), exports);
26
33
  __exportStar(require("./Stock"), exports);
27
34
  __exportStar(require("./Variant"), exports);
package/dist/runtime.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Product Catalog API
3
3
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
4
  *
5
- * The version of the OpenAPI document: 1.4.0
5
+ * The version of the OpenAPI document: 1.6.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
  * Product Catalog API
6
6
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
7
  *
8
- * The version of the OpenAPI document: 1.4.0
8
+ * The version of the OpenAPI document: 1.6.0
9
9
  * Contact: hello@teemill.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teemill/product-catalog",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "OpenAPI client for @teemill/product-catalog",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -4,7 +4,7 @@
4
4
  * Product Catalog API
5
5
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 1.4.0
7
+ * The version of the OpenAPI document: 1.6.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,18 +16,29 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
+ CreateProductRequest,
20
+ ImportProducts200Response,
19
21
  Product,
20
22
  ProductsResponse,
21
23
  } from '../models/index';
22
24
  import {
23
25
  ApiErrorFromJSON,
24
26
  ApiErrorToJSON,
27
+ CreateProductRequestFromJSON,
28
+ CreateProductRequestToJSON,
29
+ ImportProducts200ResponseFromJSON,
30
+ ImportProducts200ResponseToJSON,
25
31
  ProductFromJSON,
26
32
  ProductToJSON,
27
33
  ProductsResponseFromJSON,
28
34
  ProductsResponseToJSON,
29
35
  } from '../models/index';
30
36
 
37
+ export interface CreateProductOperationRequest {
38
+ project: string;
39
+ createProductRequest?: CreateProductRequest;
40
+ }
41
+
31
42
  export interface GetProductRequest {
32
43
  project: string;
33
44
  productId: string;
@@ -41,11 +52,75 @@ export interface GetProductsRequest {
41
52
  fields?: string;
42
53
  }
43
54
 
55
+ export interface ImportProductsRequest {
56
+ project: string;
57
+ body?: string;
58
+ }
59
+
44
60
  /**
45
61
  *
46
62
  */
47
63
  export class ProductsApi extends runtime.BaseAPI {
48
64
 
65
+ /**
66
+ * Creates a catalog product
67
+ * Create catalog product
68
+ */
69
+ async createProductRaw(requestParameters: CreateProductOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>> {
70
+ if (requestParameters.project === null || requestParameters.project === undefined) {
71
+ throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling createProduct.');
72
+ }
73
+
74
+ const queryParameters: any = {};
75
+
76
+ if (requestParameters.project !== undefined) {
77
+ queryParameters['project'] = requestParameters.project;
78
+ }
79
+
80
+ const headerParameters: runtime.HTTPHeaders = {};
81
+
82
+ headerParameters['Content-Type'] = 'application/json';
83
+
84
+ if (this.configuration && this.configuration.accessToken) {
85
+ // oauth required
86
+ headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
87
+ }
88
+
89
+ if (this.configuration && this.configuration.apiKey) {
90
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
91
+ }
92
+
93
+ const response = await this.request({
94
+ path: `/v1/catalog/products`,
95
+ method: 'POST',
96
+ headers: headerParameters,
97
+ query: queryParameters,
98
+ body: CreateProductRequestToJSON(requestParameters.createProductRequest),
99
+ }, initOverrides);
100
+
101
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProductFromJSON(jsonValue));
102
+ }
103
+
104
+ /**
105
+ * Creates a catalog product
106
+ * Create catalog product
107
+ */
108
+ async createProduct(
109
+ project: string,
110
+ optionalParameters: runtime.OptionalOnly<CreateProductOperationRequest> = {},
111
+ initOverrides?: RequestInit | runtime.InitOverrideFunction
112
+ ): Promise<Product> {
113
+ const response = await this.createProductRaw(
114
+ {
115
+ project: project,
116
+ ...optionalParameters,
117
+ },
118
+ initOverrides
119
+ );
120
+
121
+ return await response.value();
122
+ }
123
+
49
124
  /**
50
125
  * Gets a product by the given id
51
126
  * Get product
@@ -178,4 +253,63 @@ export class ProductsApi extends runtime.BaseAPI {
178
253
  return await response.value();
179
254
  }
180
255
 
256
+ /**
257
+ * Import products
258
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
259
+ */
260
+ async importProductsRaw(requestParameters: ImportProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ImportProducts200Response>> {
261
+ if (requestParameters.project === null || requestParameters.project === undefined) {
262
+ throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling importProducts.');
263
+ }
264
+
265
+ const queryParameters: any = {};
266
+
267
+ if (requestParameters.project !== undefined) {
268
+ queryParameters['project'] = requestParameters.project;
269
+ }
270
+
271
+ const headerParameters: runtime.HTTPHeaders = {};
272
+
273
+ headerParameters['Content-Type'] = 'text/csv';
274
+
275
+ if (this.configuration && this.configuration.accessToken) {
276
+ // oauth required
277
+ headerParameters["Authorization"] = await this.configuration.accessToken("session-oauth", []);
278
+ }
279
+
280
+ if (this.configuration && this.configuration.apiKey) {
281
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
282
+ }
283
+
284
+ const response = await this.request({
285
+ path: `/v1/catalog/products/import`,
286
+ method: 'POST',
287
+ headers: headerParameters,
288
+ query: queryParameters,
289
+ body: requestParameters.body as any,
290
+ }, initOverrides);
291
+
292
+ return new runtime.JSONApiResponse(response, (jsonValue) => ImportProducts200ResponseFromJSON(jsonValue));
293
+ }
294
+
295
+ /**
296
+ * Import products
297
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
298
+ */
299
+ async importProducts(
300
+ project: string,
301
+ optionalParameters: runtime.OptionalOnly<ImportProductsRequest> = {},
302
+ initOverrides?: RequestInit | runtime.InitOverrideFunction
303
+ ): Promise<ImportProducts200Response> {
304
+ const response = await this.importProductsRaw(
305
+ {
306
+ project: project,
307
+ ...optionalParameters,
308
+ },
309
+ initOverrides
310
+ );
311
+
312
+ return await response.value();
313
+ }
314
+
181
315
  }
@@ -4,7 +4,7 @@
4
4
  * Product Catalog API
5
5
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 1.4.0
7
+ * The version of the OpenAPI document: 1.6.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
  * Product Catalog API
5
5
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 1.4.0
7
+ * The version of the OpenAPI document: 1.6.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
  * Product Catalog API
5
5
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 1.4.0
7
+ * The version of the OpenAPI document: 1.6.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
  * Product Catalog API
5
5
  * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
6
  *
7
- * The version of the OpenAPI document: 1.4.0
7
+ * The version of the OpenAPI document: 1.6.0
8
8
  * Contact: hello@teemill.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -0,0 +1,136 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Product Catalog API
5
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.6.0
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 { CreateProductRequestVariantsInner } from './CreateProductRequestVariantsInner';
17
+ import {
18
+ CreateProductRequestVariantsInnerFromJSON,
19
+ CreateProductRequestVariantsInnerFromJSONTyped,
20
+ CreateProductRequestVariantsInnerToJSON,
21
+ } from './CreateProductRequestVariantsInner';
22
+ import type { CreateProductRequestVariantsInnerImagesInner } from './CreateProductRequestVariantsInnerImagesInner';
23
+ import {
24
+ CreateProductRequestVariantsInnerImagesInnerFromJSON,
25
+ CreateProductRequestVariantsInnerImagesInnerFromJSONTyped,
26
+ CreateProductRequestVariantsInnerImagesInnerToJSON,
27
+ } from './CreateProductRequestVariantsInnerImagesInner';
28
+
29
+ /**
30
+ *
31
+ * @export
32
+ * @interface CreateProductRequest
33
+ */
34
+ export interface CreateProductRequest {
35
+ /**
36
+ * GFN product ref
37
+ * @type {string}
38
+ * @memberof CreateProductRequest
39
+ */
40
+ gfnProductRef: string;
41
+ /**
42
+ * Product title
43
+ * @type {string}
44
+ * @memberof CreateProductRequest
45
+ */
46
+ title?: string;
47
+ /**
48
+ * Product description
49
+ * @type {string}
50
+ * @memberof CreateProductRequest
51
+ */
52
+ description?: string;
53
+ /**
54
+ * Whether the product is enabled
55
+ * @type {boolean}
56
+ * @memberof CreateProductRequest
57
+ */
58
+ enabled?: boolean;
59
+ /**
60
+ * A custom url slug for the product
61
+ * @type {string}
62
+ * @memberof CreateProductRequest
63
+ */
64
+ slug?: string;
65
+ /**
66
+ * Product tags
67
+ * @type {Array<string>}
68
+ * @memberof CreateProductRequest
69
+ */
70
+ tags?: Array<string>;
71
+ /**
72
+ * Variants
73
+ * @type {Array<CreateProductRequestVariantsInner>}
74
+ * @memberof CreateProductRequest
75
+ */
76
+ variants: Array<CreateProductRequestVariantsInner>;
77
+ /**
78
+ * Additional files
79
+ * @type {Array<CreateProductRequestVariantsInnerImagesInner>}
80
+ * @memberof CreateProductRequest
81
+ */
82
+ additionalFiles?: Array<CreateProductRequestVariantsInnerImagesInner>;
83
+ }
84
+
85
+ /**
86
+ * Check if a given object implements the CreateProductRequest interface.
87
+ */
88
+ export function instanceOfCreateProductRequest(value: object): boolean {
89
+ let isInstance = true;
90
+ isInstance = isInstance && "gfnProductRef" in value;
91
+ isInstance = isInstance && "variants" in value;
92
+
93
+ return isInstance;
94
+ }
95
+
96
+ export function CreateProductRequestFromJSON(json: any): CreateProductRequest {
97
+ return CreateProductRequestFromJSONTyped(json, false);
98
+ }
99
+
100
+ export function CreateProductRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProductRequest {
101
+ if ((json === undefined) || (json === null)) {
102
+ return json;
103
+ }
104
+ return {
105
+
106
+ 'gfnProductRef': json['gfnProductRef'],
107
+ 'title': !exists(json, 'title') ? undefined : json['title'],
108
+ 'description': !exists(json, 'description') ? undefined : json['description'],
109
+ 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'],
110
+ 'slug': !exists(json, 'slug') ? undefined : json['slug'],
111
+ 'tags': !exists(json, 'tags') ? undefined : json['tags'],
112
+ 'variants': ((json['variants'] as Array<any>).map(CreateProductRequestVariantsInnerFromJSON)),
113
+ 'additionalFiles': !exists(json, 'additionalFiles') ? undefined : ((json['additionalFiles'] as Array<any>).map(CreateProductRequestVariantsInnerImagesInnerFromJSON)),
114
+ };
115
+ }
116
+
117
+ export function CreateProductRequestToJSON(value?: CreateProductRequest | null): any {
118
+ if (value === undefined) {
119
+ return undefined;
120
+ }
121
+ if (value === null) {
122
+ return null;
123
+ }
124
+ return {
125
+
126
+ 'gfnProductRef': value.gfnProductRef,
127
+ 'title': value.title,
128
+ 'description': value.description,
129
+ 'enabled': value.enabled,
130
+ 'slug': value.slug,
131
+ 'tags': value.tags,
132
+ 'variants': ((value.variants as Array<any>).map(CreateProductRequestVariantsInnerToJSON)),
133
+ 'additionalFiles': value.additionalFiles === undefined ? undefined : ((value.additionalFiles as Array<any>).map(CreateProductRequestVariantsInnerImagesInnerToJSON)),
134
+ };
135
+ }
136
+
@@ -0,0 +1,65 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Product Catalog API
5
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
+ *
7
+ * The version of the OpenAPI document: 1.5.0
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 CreateProductRequestAdditionalFilesInner
20
+ */
21
+ export interface CreateProductRequestAdditionalFilesInner {
22
+ /**
23
+ * File url
24
+ * @type {string}
25
+ * @memberof CreateProductRequestAdditionalFilesInner
26
+ */
27
+ src?: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the CreateProductRequestAdditionalFilesInner interface.
32
+ */
33
+ export function instanceOfCreateProductRequestAdditionalFilesInner(value: object): boolean {
34
+ let isInstance = true;
35
+
36
+ return isInstance;
37
+ }
38
+
39
+ export function CreateProductRequestAdditionalFilesInnerFromJSON(json: any): CreateProductRequestAdditionalFilesInner {
40
+ return CreateProductRequestAdditionalFilesInnerFromJSONTyped(json, false);
41
+ }
42
+
43
+ export function CreateProductRequestAdditionalFilesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProductRequestAdditionalFilesInner {
44
+ if ((json === undefined) || (json === null)) {
45
+ return json;
46
+ }
47
+ return {
48
+
49
+ 'src': !exists(json, 'src') ? undefined : json['src'],
50
+ };
51
+ }
52
+
53
+ export function CreateProductRequestAdditionalFilesInnerToJSON(value?: CreateProductRequestAdditionalFilesInner | null): any {
54
+ if (value === undefined) {
55
+ return undefined;
56
+ }
57
+ if (value === null) {
58
+ return null;
59
+ }
60
+ return {
61
+
62
+ 'src': value.src,
63
+ };
64
+ }
65
+