UNPKG

channel3-sdk

Version:

The official TypeScript/JavaScript SDK for Channel3 AI Shopping API

79 lines 2.89 kB
/* 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. */ import { VariantFromJSON, VariantToJSON, } from './Variant'; import { AvailabilityStatusFromJSON, AvailabilityStatusToJSON, } from './AvailabilityStatus'; import { PriceFromJSON, PriceToJSON, } from './Price'; /** * Check if a given object implements the Product interface. */ export 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; } export function ProductFromJSON(json) { return ProductFromJSONTyped(json, false); } export 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': PriceFromJSON(json['price']), 'availability': AvailabilityStatusFromJSON(json['availability']), 'variants': json['variants'] == null ? undefined : (json['variants'].map(VariantFromJSON)), }; } export function ProductToJSON(json) { return ProductToJSONTyped(json, false); } export 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': PriceToJSON(value['price']), 'availability': AvailabilityStatusToJSON(value['availability']), 'variants': value['variants'] == null ? undefined : (value['variants'].map(VariantToJSON)), }; } //# sourceMappingURL=Product.js.map