Files
recipes/models/FoodSimple.ts

83 lines
1.7 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 { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface FoodSimple
*/
export interface FoodSimple {
/**
*
* @type {number}
* @memberof FoodSimple
*/
readonly id: number;
/**
*
* @type {string}
* @memberof FoodSimple
*/
name: string;
/**
*
* @type {string}
* @memberof FoodSimple
*/
pluralName?: string | null;
}
/**
* Check if a given object implements the FoodSimple interface.
*/
export function instanceOfFoodSimple(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
return isInstance;
}
export function FoodSimpleFromJSON(json: any): FoodSimple {
return FoodSimpleFromJSONTyped(json, false);
}
export function FoodSimpleFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoodSimple {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
};
}
export function FoodSimpleToJSON(value?: FoodSimple | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'plural_name': value.pluralName,
};
}