/* 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 { Unit } from './Unit'; import { UnitFromJSON, UnitFromJSONTyped, UnitToJSON, UnitToJSONTyped, } from './Unit'; import type { Food } from './Food'; import { FoodFromJSON, FoodFromJSONTyped, FoodToJSON, FoodToJSONTyped, } from './Food'; /** * Adds nested create feature * @export * @interface Ingredient */ export interface Ingredient { /** * * @type {number} * @memberof Ingredient */ id?: number; /** * * @type {Food} * @memberof Ingredient */ food: Food | null; /** * * @type {Unit} * @memberof Ingredient */ unit: Unit | null; /** * * @type {number} * @memberof Ingredient */ amount: number; /** * * @type {Array} * @memberof Ingredient */ readonly conversions: Array; /** * * @type {string} * @memberof Ingredient */ note?: string | null; /** * * @type {number} * @memberof Ingredient */ order?: number; /** * * @type {boolean} * @memberof Ingredient */ isHeader?: boolean; /** * * @type {boolean} * @memberof Ingredient */ noAmount?: boolean; /** * * @type {string} * @memberof Ingredient */ originalText?: string | null; /** * * @type {Array} * @memberof Ingredient */ readonly usedInRecipes: Array; /** * * @type {boolean} * @memberof Ingredient */ alwaysUsePluralUnit?: boolean; /** * * @type {boolean} * @memberof Ingredient */ alwaysUsePluralFood?: boolean; } /** * Check if a given object implements the Ingredient interface. */ export function instanceOfIngredient(value: object): value is Ingredient { if (!('food' in value) || value['food'] === undefined) return false; if (!('unit' in value) || value['unit'] === undefined) return false; if (!('amount' in value) || value['amount'] === undefined) return false; if (!('conversions' in value) || value['conversions'] === undefined) return false; if (!('usedInRecipes' in value) || value['usedInRecipes'] === undefined) return false; return true; } export function IngredientFromJSON(json: any): Ingredient { return IngredientFromJSONTyped(json, false); } export function IngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ingredient { if (json == null) { return json; } return { 'id': json['id'] == null ? undefined : json['id'], 'food': FoodFromJSON(json['food']), 'unit': UnitFromJSON(json['unit']), 'amount': json['amount'], 'conversions': json['conversions'], 'note': json['note'] == null ? undefined : json['note'], 'order': json['order'] == null ? undefined : json['order'], 'isHeader': json['is_header'] == null ? undefined : json['is_header'], 'noAmount': json['no_amount'] == null ? undefined : json['no_amount'], 'originalText': json['original_text'] == null ? undefined : json['original_text'], 'usedInRecipes': json['used_in_recipes'], 'alwaysUsePluralUnit': json['always_use_plural_unit'] == null ? undefined : json['always_use_plural_unit'], 'alwaysUsePluralFood': json['always_use_plural_food'] == null ? undefined : json['always_use_plural_food'], }; } export function IngredientToJSON(json: any): Ingredient { return IngredientToJSONTyped(json, false); } export function IngredientToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'food': FoodToJSON(value['food']), 'unit': UnitToJSON(value['unit']), 'amount': value['amount'], 'note': value['note'], 'order': value['order'], 'is_header': value['isHeader'], 'no_amount': value['noAmount'], 'original_text': value['originalText'], 'always_use_plural_unit': value['alwaysUsePluralUnit'], 'always_use_plural_food': value['alwaysUsePluralFood'], }; }