mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
173 lines
4.1 KiB
TypeScript
173 lines
4.1 KiB
TypeScript
/* 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 { Food } from './Food';
|
|
import {
|
|
FoodFromJSON,
|
|
FoodFromJSONTyped,
|
|
FoodToJSON,
|
|
} from './Food';
|
|
import type { Unit } from './Unit';
|
|
import {
|
|
UnitFromJSON,
|
|
UnitFromJSONTyped,
|
|
UnitToJSON,
|
|
} from './Unit';
|
|
|
|
/**
|
|
* Adds nested create feature
|
|
* @export
|
|
* @interface Ingredient
|
|
*/
|
|
export interface Ingredient {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof Ingredient
|
|
*/
|
|
readonly id: number;
|
|
/**
|
|
*
|
|
* @type {Food}
|
|
* @memberof Ingredient
|
|
*/
|
|
food: Food | null;
|
|
/**
|
|
*
|
|
* @type {Unit}
|
|
* @memberof Ingredient
|
|
*/
|
|
unit: Unit | null;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof Ingredient
|
|
*/
|
|
amount: number;
|
|
/**
|
|
*
|
|
* @type {Array<any>}
|
|
* @memberof Ingredient
|
|
*/
|
|
readonly conversions: Array<any>;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof Ingredient
|
|
*/
|
|
note?: string;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof Ingredient
|
|
*/
|
|
order?: number;
|
|
/**
|
|
*
|
|
* @type {boolean}
|
|
* @memberof Ingredient
|
|
*/
|
|
isHeader?: boolean;
|
|
/**
|
|
*
|
|
* @type {boolean}
|
|
* @memberof Ingredient
|
|
*/
|
|
noAmount?: boolean;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof Ingredient
|
|
*/
|
|
originalText?: string;
|
|
/**
|
|
*
|
|
* @type {Array<any>}
|
|
* @memberof Ingredient
|
|
*/
|
|
readonly usedInRecipes: Array<any>;
|
|
/**
|
|
*
|
|
* @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): boolean {
|
|
if (!('id' in value)) return false;
|
|
if (!('food' in value)) return false;
|
|
if (!('unit' in value)) return false;
|
|
if (!('amount' in value)) return false;
|
|
if (!('conversions' in value)) return false;
|
|
if (!('usedInRecipes' in value)) 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'],
|
|
'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(value?: Omit<Ingredient, 'id'|'conversions'|'used_in_recipes'> | null): any {
|
|
if (value == null) {
|
|
return value;
|
|
}
|
|
return {
|
|
|
|
'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'],
|
|
};
|
|
}
|
|
|