UNPKG

channel3-sdk

Version:

The official TypeScript/JavaScript SDK for Channel3 AI Shopping API

86 lines 3.19 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * FastAPI * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfProduct = instanceOfProduct; exports.ProductFromJSON = ProductFromJSON; exports.ProductFromJSONTyped = ProductFromJSONTyped; exports.ProductToJSON = ProductToJSON; exports.ProductToJSONTyped = ProductToJSONTyped; const Variant_1 = require("./Variant"); const AvailabilityStatus_1 = require("./AvailabilityStatus"); const Price_1 = require("./Price"); /** * Check if a given object implements the Product interface. */ function instanceOfProduct(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('score' in value) || value['score'] === undefined) return false; if (!('url' in value) || value['url'] === undefined) return false; if (!('title' in value) || value['title'] === undefined) return false; if (!('brand_name' in value) || value['brand_name'] === undefined) return false; if (!('image_url' in value) || value['image_url'] === undefined) return false; if (!('price' in value) || value['price'] === undefined) return false; if (!('availability' in value) || value['availability'] === undefined) return false; return true; } function ProductFromJSON(json) { return ProductFromJSONTyped(json, false); } function ProductFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['id'], 'score': json['score'], 'url': json['url'], 'title': json['title'], 'description': json['description'] == null ? undefined : json['description'], 'brand_name': json['brand_name'], 'image_url': json['image_url'], 'price': (0, Price_1.PriceFromJSON)(json['price']), 'availability': (0, AvailabilityStatus_1.AvailabilityStatusFromJSON)(json['availability']), 'variants': json['variants'] == null ? undefined : (json['variants'].map(Variant_1.VariantFromJSON)), }; } function ProductToJSON(json) { return ProductToJSONTyped(json, false); } function ProductToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'id': value['id'], 'score': value['score'], 'url': value['url'], 'title': value['title'], 'description': value['description'], 'brand_name': value['brand_name'], 'image_url': value['image_url'], 'price': (0, Price_1.PriceToJSON)(value['price']), 'availability': (0, AvailabilityStatus_1.AvailabilityStatusToJSON)(value['availability']), 'variants': value['variants'] == null ? undefined : (value['variants'].map(Variant_1.VariantToJSON)), }; } //# sourceMappingURL=Product.js.map