/* tslint:disable */ /* eslint-disable */ /** * Tandoor * Tandoor API Docs * * The version of the OpenAPI document: 0.0.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 { mapValues } from '../runtime'; import type { SourceImportUnit } from './SourceImportUnit'; import { SourceImportUnitFromJSON, SourceImportUnitFromJSONTyped, SourceImportUnitToJSON, SourceImportUnitToJSONTyped, } from './SourceImportUnit'; import type { SourceImportFood } from './SourceImportFood'; import { SourceImportFoodFromJSON, SourceImportFoodFromJSONTyped, SourceImportFoodToJSON, SourceImportFoodToJSONTyped, } from './SourceImportFood'; /** * * @export * @interface SourceImportIngredient */ export interface SourceImportIngredient { /** * * @type {number} * @memberof SourceImportIngredient */ amount: number; /** * * @type {SourceImportFood} * @memberof SourceImportIngredient */ food: SourceImportFood; /** * * @type {SourceImportUnit} * @memberof SourceImportIngredient */ unit: SourceImportUnit; /** * * @type {string} * @memberof SourceImportIngredient */ note?: string; /** * * @type {string} * @memberof SourceImportIngredient */ originalText: string; } /** * Check if a given object implements the SourceImportIngredient interface. */ export function instanceOfSourceImportIngredient(value: object): value is SourceImportIngredient { if (!('amount' in value) || value['amount'] === undefined) return false; if (!('food' in value) || value['food'] === undefined) return false; if (!('unit' in value) || value['unit'] === undefined) return false; if (!('originalText' in value) || value['originalText'] === undefined) return false; return true; } export function SourceImportIngredientFromJSON(json: any): SourceImportIngredient { return SourceImportIngredientFromJSONTyped(json, false); } export function SourceImportIngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceImportIngredient { if (json == null) { return json; } return { 'amount': json['amount'], 'food': SourceImportFoodFromJSON(json['food']), 'unit': SourceImportUnitFromJSON(json['unit']), 'note': json['note'] == null ? undefined : json['note'], 'originalText': json['original_text'], }; } export function SourceImportIngredientToJSON(json: any): SourceImportIngredient { return SourceImportIngredientToJSONTyped(json, false); } export function SourceImportIngredientToJSONTyped(value?: SourceImportIngredient | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'amount': value['amount'], 'food': SourceImportFoodToJSON(value['food']), 'unit': SourceImportUnitToJSON(value['unit']), 'note': value['note'], 'original_text': value['originalText'], }; }