@lcdp/api-react-rest-client 2.13.8-develop.16881196139 → 2.13.9-LDS-4699-etape-1-no-more-archive-of-frid.17041330416

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.
@@ -12,15 +12,26 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @interface ProductStorageType
15
16
  */
16
- export declare const ProductStorageType: {
17
- readonly FREE: "FREE";
18
- readonly FRIDGE: "FRIDGE";
19
- readonly FREEZER: "FREEZER";
20
- readonly FRESH: "FRESH";
21
- };
22
- export declare type ProductStorageType = typeof ProductStorageType[keyof typeof ProductStorageType];
23
- export declare function instanceOfProductStorageType(value: any): boolean;
17
+ export interface ProductStorageType {
18
+ /**
19
+ * Id of the storage type (machine name)
20
+ * @type {string}
21
+ * @memberof ProductStorageType
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Readable name for display
26
+ * @type {string}
27
+ * @memberof ProductStorageType
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProductStorageType interface.
33
+ */
34
+ export declare function instanceOfProductStorageType(value: object): value is ProductStorageType;
24
35
  export declare function ProductStorageTypeFromJSON(json: any): ProductStorageType;
25
36
  export declare function ProductStorageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductStorageType;
26
37
  export declare function ProductStorageTypeToJSON(value?: ProductStorageType | null): any;
@@ -13,26 +13,12 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = exports.ProductStorageType = void 0;
16
+ exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = void 0;
17
17
  /**
18
- *
19
- * @export
18
+ * Check if a given object implements the ProductStorageType interface.
20
19
  */
21
- exports.ProductStorageType = {
22
- FREE: 'FREE',
23
- FRIDGE: 'FRIDGE',
24
- FREEZER: 'FREEZER',
25
- FRESH: 'FRESH'
26
- };
27
20
  function instanceOfProductStorageType(value) {
28
- for (var key in exports.ProductStorageType) {
29
- if (Object.prototype.hasOwnProperty.call(exports.ProductStorageType, key)) {
30
- if (exports.ProductStorageType[key] === value) {
31
- return true;
32
- }
33
- }
34
- }
35
- return false;
21
+ return true;
36
22
  }
37
23
  exports.instanceOfProductStorageType = instanceOfProductStorageType;
38
24
  function ProductStorageTypeFromJSON(json) {
@@ -40,10 +26,22 @@ function ProductStorageTypeFromJSON(json) {
40
26
  }
41
27
  exports.ProductStorageTypeFromJSON = ProductStorageTypeFromJSON;
42
28
  function ProductStorageTypeFromJSONTyped(json, ignoreDiscriminator) {
43
- return json;
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'id': json['id'],
34
+ 'name': json['name'],
35
+ };
44
36
  }
45
37
  exports.ProductStorageTypeFromJSONTyped = ProductStorageTypeFromJSONTyped;
46
38
  function ProductStorageTypeToJSON(value) {
47
- return value;
39
+ if (value == null) {
40
+ return value;
41
+ }
42
+ return {
43
+ 'id': value['id'],
44
+ 'name': value['name'],
45
+ };
48
46
  }
49
47
  exports.ProductStorageTypeToJSON = ProductStorageTypeToJSON;
@@ -12,15 +12,26 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @interface ProductStorageType
15
16
  */
16
- export declare const ProductStorageType: {
17
- readonly FREE: "FREE";
18
- readonly FRIDGE: "FRIDGE";
19
- readonly FREEZER: "FREEZER";
20
- readonly FRESH: "FRESH";
21
- };
22
- export declare type ProductStorageType = typeof ProductStorageType[keyof typeof ProductStorageType];
23
- export declare function instanceOfProductStorageType(value: any): boolean;
17
+ export interface ProductStorageType {
18
+ /**
19
+ * Id of the storage type (machine name)
20
+ * @type {string}
21
+ * @memberof ProductStorageType
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Readable name for display
26
+ * @type {string}
27
+ * @memberof ProductStorageType
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProductStorageType interface.
33
+ */
34
+ export declare function instanceOfProductStorageType(value: object): value is ProductStorageType;
24
35
  export declare function ProductStorageTypeFromJSON(json: any): ProductStorageType;
25
36
  export declare function ProductStorageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductStorageType;
26
37
  export declare function ProductStorageTypeToJSON(value?: ProductStorageType | null): any;
@@ -13,26 +13,12 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = exports.ProductStorageType = void 0;
16
+ exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = void 0;
17
17
  /**
18
- *
19
- * @export
18
+ * Check if a given object implements the ProductStorageType interface.
20
19
  */
21
- exports.ProductStorageType = {
22
- FREE: 'FREE',
23
- FRIDGE: 'FRIDGE',
24
- FREEZER: 'FREEZER',
25
- FRESH: 'FRESH'
26
- };
27
20
  function instanceOfProductStorageType(value) {
28
- for (var key in exports.ProductStorageType) {
29
- if (Object.prototype.hasOwnProperty.call(exports.ProductStorageType, key)) {
30
- if (exports.ProductStorageType[key] === value) {
31
- return true;
32
- }
33
- }
34
- }
35
- return false;
21
+ return true;
36
22
  }
37
23
  exports.instanceOfProductStorageType = instanceOfProductStorageType;
38
24
  function ProductStorageTypeFromJSON(json) {
@@ -40,10 +26,22 @@ function ProductStorageTypeFromJSON(json) {
40
26
  }
41
27
  exports.ProductStorageTypeFromJSON = ProductStorageTypeFromJSON;
42
28
  function ProductStorageTypeFromJSONTyped(json, ignoreDiscriminator) {
43
- return json;
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'id': json['id'],
34
+ 'name': json['name'],
35
+ };
44
36
  }
45
37
  exports.ProductStorageTypeFromJSONTyped = ProductStorageTypeFromJSONTyped;
46
38
  function ProductStorageTypeToJSON(value) {
47
- return value;
39
+ if (value == null) {
40
+ return value;
41
+ }
42
+ return {
43
+ 'id': value['id'],
44
+ 'name': value['name'],
45
+ };
48
46
  }
49
47
  exports.ProductStorageTypeToJSON = ProductStorageTypeToJSON;
@@ -12,15 +12,26 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @interface ProductStorageType
15
16
  */
16
- export declare const ProductStorageType: {
17
- readonly FREE: "FREE";
18
- readonly FRIDGE: "FRIDGE";
19
- readonly FREEZER: "FREEZER";
20
- readonly FRESH: "FRESH";
21
- };
22
- export declare type ProductStorageType = typeof ProductStorageType[keyof typeof ProductStorageType];
23
- export declare function instanceOfProductStorageType(value: any): boolean;
17
+ export interface ProductStorageType {
18
+ /**
19
+ * Id of the storage type (machine name)
20
+ * @type {string}
21
+ * @memberof ProductStorageType
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Readable name for display
26
+ * @type {string}
27
+ * @memberof ProductStorageType
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProductStorageType interface.
33
+ */
34
+ export declare function instanceOfProductStorageType(value: object): value is ProductStorageType;
24
35
  export declare function ProductStorageTypeFromJSON(json: any): ProductStorageType;
25
36
  export declare function ProductStorageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductStorageType;
26
37
  export declare function ProductStorageTypeToJSON(value?: ProductStorageType | null): any;
@@ -13,26 +13,12 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = exports.ProductStorageType = void 0;
16
+ exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = void 0;
17
17
  /**
18
- *
19
- * @export
18
+ * Check if a given object implements the ProductStorageType interface.
20
19
  */
21
- exports.ProductStorageType = {
22
- FREE: 'FREE',
23
- FRIDGE: 'FRIDGE',
24
- FREEZER: 'FREEZER',
25
- FRESH: 'FRESH'
26
- };
27
20
  function instanceOfProductStorageType(value) {
28
- for (var key in exports.ProductStorageType) {
29
- if (Object.prototype.hasOwnProperty.call(exports.ProductStorageType, key)) {
30
- if (exports.ProductStorageType[key] === value) {
31
- return true;
32
- }
33
- }
34
- }
35
- return false;
21
+ return true;
36
22
  }
37
23
  exports.instanceOfProductStorageType = instanceOfProductStorageType;
38
24
  function ProductStorageTypeFromJSON(json) {
@@ -40,10 +26,22 @@ function ProductStorageTypeFromJSON(json) {
40
26
  }
41
27
  exports.ProductStorageTypeFromJSON = ProductStorageTypeFromJSON;
42
28
  function ProductStorageTypeFromJSONTyped(json, ignoreDiscriminator) {
43
- return json;
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'id': json['id'],
34
+ 'name': json['name'],
35
+ };
44
36
  }
45
37
  exports.ProductStorageTypeFromJSONTyped = ProductStorageTypeFromJSONTyped;
46
38
  function ProductStorageTypeToJSON(value) {
47
- return value;
39
+ if (value == null) {
40
+ return value;
41
+ }
42
+ return {
43
+ 'id': value['id'],
44
+ 'name': value['name'],
45
+ };
48
46
  }
49
47
  exports.ProductStorageTypeToJSON = ProductStorageTypeToJSON;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lcdp/api-react-rest-client",
3
- "version": "2.13.8-develop.16881196139",
3
+ "version": "2.13.9-LDS-4699-etape-1-no-more-archive-of-frid.17041330416",
4
4
  "scripts": {
5
5
  "build": "tsc"
6
6
  },
@@ -10,10 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ProductSecondaryType, ProductType } from '../models/index';
13
+ import type { ProductSecondaryType, ProductStorageType, ProductType } from '../models/index';
14
14
  export interface GetProductSecondaryTypeRequest {
15
15
  secondaryTypeId: string;
16
16
  }
17
+ export interface GetProductStorageTypeRequest {
18
+ productStorageTypeId: string;
19
+ }
17
20
  export interface GetProductTypeRequest {
18
21
  typeId: string;
19
22
  }
@@ -37,6 +40,22 @@ export declare class SearchProductMetadataApi extends runtime.BaseAPI {
37
40
  * Get product secondary types
38
41
  */
39
42
  getProductSecondaryTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProductSecondaryType> | runtime.BlobWithMeta>;
43
+ /**
44
+ * Get product storage type
45
+ */
46
+ getProductStorageTypeRaw(requestParameters: GetProductStorageTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductStorageType | runtime.BlobWithMeta>>;
47
+ /**
48
+ * Get product storage type
49
+ */
50
+ getProductStorageType(requestParameters: GetProductStorageTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductStorageType | runtime.BlobWithMeta>;
51
+ /**
52
+ * Get storage types relatives to a product
53
+ */
54
+ getProductStorageTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProductStorageType> | runtime.BlobWithMeta>>;
55
+ /**
56
+ * Get storage types relatives to a product
57
+ */
58
+ getProductStorageTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProductStorageType> | runtime.BlobWithMeta>;
40
59
  /**
41
60
  * Get product type
42
61
  */
@@ -230,12 +230,167 @@ var SearchProductMetadataApi = /** @class */ (function (_super) {
230
230
  });
231
231
  });
232
232
  };
233
+ /**
234
+ * Get product storage type
235
+ */
236
+ SearchProductMetadataApi.prototype.getProductStorageTypeRaw = function (requestParameters, initOverrides) {
237
+ return __awaiter(this, void 0, void 0, function () {
238
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
239
+ return __generator(this, function (_c) {
240
+ switch (_c.label) {
241
+ case 0:
242
+ if (requestParameters['productStorageTypeId'] == null) {
243
+ throw new runtime.RequiredError('productStorageTypeId', 'Required parameter "productStorageTypeId" was null or undefined when calling getProductStorageType().');
244
+ }
245
+ queryParameters = {};
246
+ headerParameters = {};
247
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
248
+ _a = headerParameters;
249
+ _b = "x-api-key";
250
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
251
+ case 1:
252
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
253
+ _c.label = 2;
254
+ case 2:
255
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
256
+ token = this.configuration.accessToken;
257
+ return [4 /*yield*/, token("bearerAuth", [])];
258
+ case 3:
259
+ tokenString = _c.sent();
260
+ if (tokenString) {
261
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
262
+ }
263
+ _c.label = 4;
264
+ case 4:
265
+ _c.trys.push([4, 6, , 7]);
266
+ return [4 /*yield*/, this.request({
267
+ path: "/products/storage-types/{productStorageTypeId}".replace("{".concat("productStorageTypeId", "}"), encodeURIComponent(String(requestParameters['productStorageTypeId']))),
268
+ method: 'GET',
269
+ headers: headerParameters,
270
+ query: queryParameters,
271
+ }, initOverrides)];
272
+ case 5:
273
+ response = _c.sent();
274
+ contentType = response.headers.get("content-type");
275
+ if (contentType && contentType.indexOf("application/json") !== -1) {
276
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductStorageTypeFromJSON)(jsonValue); })];
277
+ }
278
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
279
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
280
+ }
281
+ else {
282
+ // TODO : Better handling of others application types
283
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
284
+ }
285
+ return [3 /*break*/, 7];
286
+ case 6:
287
+ response_3 = _c.sent();
288
+ console.debug(response_3);
289
+ throw response_3;
290
+ case 7: return [2 /*return*/];
291
+ }
292
+ });
293
+ });
294
+ };
295
+ /**
296
+ * Get product storage type
297
+ */
298
+ SearchProductMetadataApi.prototype.getProductStorageType = function (requestParameters, initOverrides) {
299
+ return __awaiter(this, void 0, void 0, function () {
300
+ var response;
301
+ return __generator(this, function (_a) {
302
+ switch (_a.label) {
303
+ case 0: return [4 /*yield*/, this.getProductStorageTypeRaw(requestParameters, initOverrides)];
304
+ case 1:
305
+ response = _a.sent();
306
+ return [4 /*yield*/, response.value()];
307
+ case 2: return [2 /*return*/, _a.sent()];
308
+ }
309
+ });
310
+ });
311
+ };
312
+ /**
313
+ * Get storage types relatives to a product
314
+ */
315
+ SearchProductMetadataApi.prototype.getProductStorageTypesRaw = function (initOverrides) {
316
+ return __awaiter(this, void 0, void 0, function () {
317
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
318
+ return __generator(this, function (_c) {
319
+ switch (_c.label) {
320
+ case 0:
321
+ queryParameters = {};
322
+ headerParameters = {};
323
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
324
+ _a = headerParameters;
325
+ _b = "x-api-key";
326
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
327
+ case 1:
328
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
329
+ _c.label = 2;
330
+ case 2:
331
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
332
+ token = this.configuration.accessToken;
333
+ return [4 /*yield*/, token("bearerAuth", [])];
334
+ case 3:
335
+ tokenString = _c.sent();
336
+ if (tokenString) {
337
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
338
+ }
339
+ _c.label = 4;
340
+ case 4:
341
+ _c.trys.push([4, 6, , 7]);
342
+ return [4 /*yield*/, this.request({
343
+ path: "/products/storage-types",
344
+ method: 'GET',
345
+ headers: headerParameters,
346
+ query: queryParameters,
347
+ }, initOverrides)];
348
+ case 5:
349
+ response = _c.sent();
350
+ contentType = response.headers.get("content-type");
351
+ if (contentType && contentType.indexOf("application/json") !== -1) {
352
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.ProductStorageTypeFromJSON); })];
353
+ }
354
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
355
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
356
+ }
357
+ else {
358
+ // TODO : Better handling of others application types
359
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
360
+ }
361
+ return [3 /*break*/, 7];
362
+ case 6:
363
+ response_4 = _c.sent();
364
+ console.debug(response_4);
365
+ throw response_4;
366
+ case 7: return [2 /*return*/];
367
+ }
368
+ });
369
+ });
370
+ };
371
+ /**
372
+ * Get storage types relatives to a product
373
+ */
374
+ SearchProductMetadataApi.prototype.getProductStorageTypes = function (initOverrides) {
375
+ return __awaiter(this, void 0, void 0, function () {
376
+ var response;
377
+ return __generator(this, function (_a) {
378
+ switch (_a.label) {
379
+ case 0: return [4 /*yield*/, this.getProductStorageTypesRaw(initOverrides)];
380
+ case 1:
381
+ response = _a.sent();
382
+ return [4 /*yield*/, response.value()];
383
+ case 2: return [2 /*return*/, _a.sent()];
384
+ }
385
+ });
386
+ });
387
+ };
233
388
  /**
234
389
  * Get product type
235
390
  */
236
391
  SearchProductMetadataApi.prototype.getProductTypeRaw = function (requestParameters, initOverrides) {
237
392
  return __awaiter(this, void 0, void 0, function () {
238
- var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
393
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_5;
239
394
  return __generator(this, function (_c) {
240
395
  switch (_c.label) {
241
396
  case 0:
@@ -284,9 +439,9 @@ var SearchProductMetadataApi = /** @class */ (function (_super) {
284
439
  }
285
440
  return [3 /*break*/, 7];
286
441
  case 6:
287
- response_3 = _c.sent();
288
- console.debug(response_3);
289
- throw response_3;
442
+ response_5 = _c.sent();
443
+ console.debug(response_5);
444
+ throw response_5;
290
445
  case 7: return [2 /*return*/];
291
446
  }
292
447
  });
@@ -314,7 +469,7 @@ var SearchProductMetadataApi = /** @class */ (function (_super) {
314
469
  */
315
470
  SearchProductMetadataApi.prototype.getProductTypesRaw = function (initOverrides) {
316
471
  return __awaiter(this, void 0, void 0, function () {
317
- var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_4;
472
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_6;
318
473
  return __generator(this, function (_c) {
319
474
  switch (_c.label) {
320
475
  case 0:
@@ -360,9 +515,9 @@ var SearchProductMetadataApi = /** @class */ (function (_super) {
360
515
  }
361
516
  return [3 /*break*/, 7];
362
517
  case 6:
363
- response_4 = _c.sent();
364
- console.debug(response_4);
365
- throw response_4;
518
+ response_6 = _c.sent();
519
+ console.debug(response_6);
520
+ throw response_6;
366
521
  case 7: return [2 /*return*/];
367
522
  }
368
523
  });
@@ -12,15 +12,26 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @interface ProductStorageType
15
16
  */
16
- export declare const ProductStorageType: {
17
- readonly FREE: "FREE";
18
- readonly FRIDGE: "FRIDGE";
19
- readonly FREEZER: "FREEZER";
20
- readonly FRESH: "FRESH";
21
- };
22
- export declare type ProductStorageType = typeof ProductStorageType[keyof typeof ProductStorageType];
23
- export declare function instanceOfProductStorageType(value: any): boolean;
17
+ export interface ProductStorageType {
18
+ /**
19
+ * Id of the storage type (machine name)
20
+ * @type {string}
21
+ * @memberof ProductStorageType
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Readable name for display
26
+ * @type {string}
27
+ * @memberof ProductStorageType
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProductStorageType interface.
33
+ */
34
+ export declare function instanceOfProductStorageType(value: object): value is ProductStorageType;
24
35
  export declare function ProductStorageTypeFromJSON(json: any): ProductStorageType;
25
36
  export declare function ProductStorageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductStorageType;
26
37
  export declare function ProductStorageTypeToJSON(value?: ProductStorageType | null): any;
@@ -13,26 +13,12 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = exports.ProductStorageType = void 0;
16
+ exports.ProductStorageTypeToJSON = exports.ProductStorageTypeFromJSONTyped = exports.ProductStorageTypeFromJSON = exports.instanceOfProductStorageType = void 0;
17
17
  /**
18
- *
19
- * @export
18
+ * Check if a given object implements the ProductStorageType interface.
20
19
  */
21
- exports.ProductStorageType = {
22
- FREE: 'FREE',
23
- FRIDGE: 'FRIDGE',
24
- FREEZER: 'FREEZER',
25
- FRESH: 'FRESH'
26
- };
27
20
  function instanceOfProductStorageType(value) {
28
- for (var key in exports.ProductStorageType) {
29
- if (Object.prototype.hasOwnProperty.call(exports.ProductStorageType, key)) {
30
- if (exports.ProductStorageType[key] === value) {
31
- return true;
32
- }
33
- }
34
- }
35
- return false;
21
+ return true;
36
22
  }
37
23
  exports.instanceOfProductStorageType = instanceOfProductStorageType;
38
24
  function ProductStorageTypeFromJSON(json) {
@@ -40,10 +26,22 @@ function ProductStorageTypeFromJSON(json) {
40
26
  }
41
27
  exports.ProductStorageTypeFromJSON = ProductStorageTypeFromJSON;
42
28
  function ProductStorageTypeFromJSONTyped(json, ignoreDiscriminator) {
43
- return json;
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'id': json['id'],
34
+ 'name': json['name'],
35
+ };
44
36
  }
45
37
  exports.ProductStorageTypeFromJSONTyped = ProductStorageTypeFromJSONTyped;
46
38
  function ProductStorageTypeToJSON(value) {
47
- return value;
39
+ if (value == null) {
40
+ return value;
41
+ }
42
+ return {
43
+ 'id': value['id'],
44
+ 'name': value['name'],
45
+ };
48
46
  }
49
47
  exports.ProductStorageTypeToJSON = ProductStorageTypeToJSON;
@@ -12,15 +12,26 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @interface ProductStorageType
15
16
  */
16
- export declare const ProductStorageType: {
17
- readonly FREE: "FREE";
18
- readonly FRIDGE: "FRIDGE";
19
- readonly FREEZER: "FREEZER";
20
- readonly FRESH: "FRESH";
21
- };
22
- export declare type ProductStorageType = typeof ProductStorageType[keyof typeof ProductStorageType];
23
- export declare function instanceOfProductStorageType(value: any): boolean;
17
+ export interface ProductStorageType {
18
+ /**
19
+ * Id of the storage type (machine name)
20
+ * @type {string}
21
+ * @memberof ProductStorageType
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Readable name for display
26
+ * @type {string}
27
+ * @memberof ProductStorageType
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the ProductStorageType interface.
33
+ */
34
+ export declare function instanceOfProductStorageType(value: object): value is ProductStorageType;
24
35
  export declare function ProductStorageTypeFromJSON(json: any): ProductStorageType;
25
36
  export declare function ProductStorageTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductStorageType;
26
37
  export declare function ProductStorageTypeToJSON(value?: ProductStorageType | null): any;