working on model select

This commit is contained in:
vabene1111
2024-03-11 19:46:37 +01:00
committed by smilerz
parent cf74187be1
commit a4225769f6
140 changed files with 7676 additions and 5949 deletions

View File

@@ -12,17 +12,19 @@
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { mapValues } from '../runtime';
import type { Food } from './Food';
import {
Food,
FoodFromJSON,
FoodFromJSONTyped,
FoodToJSON,
Unit,
} from './Food';
import type { Unit } from './Unit';
import {
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './';
} from './Unit';
/**
* Adds nested create feature
@@ -65,7 +67,7 @@ export interface Ingredient {
* @type {string}
* @memberof Ingredient
*/
note?: string | null;
note?: string;
/**
*
* @type {number}
@@ -89,7 +91,7 @@ export interface Ingredient {
* @type {string}
* @memberof Ingredient
*/
originalText?: string | null;
originalText?: string;
/**
*
* @type {string}
@@ -110,12 +112,25 @@ export interface 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 === undefined) || (json === null)) {
if (json == null) {
return json;
}
return {
@@ -125,37 +140,33 @@ export function IngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean)
'unit': UnitFromJSON(json['unit']),
'amount': json['amount'],
'conversions': json['conversions'],
'note': !exists(json, 'note') ? undefined : json['note'],
'order': !exists(json, 'order') ? undefined : json['order'],
'isHeader': !exists(json, 'is_header') ? undefined : json['is_header'],
'noAmount': !exists(json, 'no_amount') ? undefined : json['no_amount'],
'originalText': !exists(json, 'original_text') ? undefined : json['original_text'],
'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': !exists(json, 'always_use_plural_unit') ? undefined : json['always_use_plural_unit'],
'alwaysUsePluralFood': !exists(json, 'always_use_plural_food') ? undefined : json['always_use_plural_food'],
'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?: Ingredient | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
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,
'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'],
};
}