Files
recipes/vue3/models/PatchedIngredient.ts
2024-04-18 10:56:15 -05:00

167 lines
4.2 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 PatchedIngredient
*/
export interface PatchedIngredient {
/**
*
* @type {number}
* @memberof PatchedIngredient
*/
readonly id?: number;
/**
*
* @type {Food}
* @memberof PatchedIngredient
*/
food?: Food;
/**
*
* @type {Unit}
* @memberof PatchedIngredient
*/
unit?: Unit;
/**
*
* @type {number}
* @memberof PatchedIngredient
*/
amount?: number;
/**
*
* @type {Array<any>}
* @memberof PatchedIngredient
*/
readonly conversions?: Array<any>;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
note?: string;
/**
*
* @type {number}
* @memberof PatchedIngredient
*/
order?: number;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
isHeader?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
noAmount?: boolean;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
originalText?: string;
/**
*
* @type {Array<any>}
* @memberof PatchedIngredient
*/
readonly usedInRecipes?: Array<any>;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
alwaysUsePluralUnit?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
alwaysUsePluralFood?: boolean;
}
/**
* Check if a given object implements the PatchedIngredient interface.
*/
export function instanceOfPatchedIngredient(value: object): boolean {
return true;
}
export function PatchedIngredientFromJSON(json: any): PatchedIngredient {
return PatchedIngredientFromJSONTyped(json, false);
}
export function PatchedIngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedIngredient {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'food': json['food'] == null ? undefined : FoodFromJSON(json['food']),
'unit': json['unit'] == null ? undefined : UnitFromJSON(json['unit']),
'amount': json['amount'] == null ? undefined : json['amount'],
'conversions': json['conversions'] == null ? undefined : 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'] == null ? undefined : 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 PatchedIngredientToJSON(value?: Omit<PatchedIngredient, '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'],
};
}