/* tslint:disable */ /* eslint-disable */ /** * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * 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'; import type { Keyword } from './Keyword'; import { KeywordFromJSON, KeywordFromJSONTyped, KeywordToJSON, } from './Keyword'; import type { NutritionInformation } from './NutritionInformation'; import { NutritionInformationFromJSON, NutritionInformationFromJSONTyped, NutritionInformationToJSON, } from './NutritionInformation'; import type { Property } from './Property'; import { PropertyFromJSON, PropertyFromJSONTyped, PropertyToJSON, } from './Property'; import type { Step } from './Step'; import { StepFromJSON, StepFromJSONTyped, StepToJSON, } from './Step'; import type { User } from './User'; import { UserFromJSON, UserFromJSONTyped, UserToJSON, } from './User'; /** * Adds nested create feature * @export * @interface Recipe */ export interface Recipe { /** * * @type {number} * @memberof Recipe */ readonly id: number; /** * * @type {string} * @memberof Recipe */ name: string; /** * * @type {string} * @memberof Recipe */ description?: string | null; /** * * @type {string} * @memberof Recipe */ readonly image: string | null; /** * * @type {Array} * @memberof Recipe */ keywords?: Array; /** * * @type {Array} * @memberof Recipe */ steps: Array; /** * * @type {number} * @memberof Recipe */ workingTime?: number; /** * * @type {number} * @memberof Recipe */ waitingTime?: number; /** * * @type {number} * @memberof Recipe */ readonly createdBy: number; /** * * @type {Date} * @memberof Recipe */ readonly createdAt: Date; /** * * @type {Date} * @memberof Recipe */ readonly updatedAt: Date; /** * * @type {string} * @memberof Recipe */ sourceUrl?: string | null; /** * * @type {boolean} * @memberof Recipe */ internal?: boolean; /** * * @type {boolean} * @memberof Recipe */ showIngredientOverview?: boolean; /** * * @type {NutritionInformation} * @memberof Recipe */ nutrition?: NutritionInformation | null; /** * * @type {Array} * @memberof Recipe */ properties?: Array; /** * * @type {string} * @memberof Recipe */ readonly foodProperties: string; /** * * @type {number} * @memberof Recipe */ servings?: number; /** * * @type {string} * @memberof Recipe */ filePath?: string; /** * * @type {string} * @memberof Recipe */ servingsText?: string; /** * * @type {string} * @memberof Recipe */ readonly rating: string | null; /** * * @type {Date} * @memberof Recipe */ readonly lastCooked: Date | null; /** * * @type {boolean} * @memberof Recipe */ _private?: boolean; /** * * @type {Array} * @memberof Recipe */ shared?: Array; } /** * Check if a given object implements the Recipe interface. */ export function instanceOfRecipe(value: object): boolean { let isInstance = true; isInstance = isInstance && "id" in value; isInstance = isInstance && "name" in value; isInstance = isInstance && "image" in value; isInstance = isInstance && "steps" in value; isInstance = isInstance && "createdBy" in value; isInstance = isInstance && "createdAt" in value; isInstance = isInstance && "updatedAt" in value; isInstance = isInstance && "foodProperties" in value; isInstance = isInstance && "rating" in value; isInstance = isInstance && "lastCooked" in value; return isInstance; } export function RecipeFromJSON(json: any): Recipe { return RecipeFromJSONTyped(json, false); } export function RecipeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Recipe { if ((json === undefined) || (json === null)) { return json; } return { 'id': json['id'], 'name': json['name'], 'description': !exists(json, 'description') ? undefined : json['description'], 'image': json['image'], 'keywords': !exists(json, 'keywords') ? undefined : ((json['keywords'] as Array).map(KeywordFromJSON)), 'steps': ((json['steps'] as Array).map(StepFromJSON)), 'workingTime': !exists(json, 'working_time') ? undefined : json['working_time'], 'waitingTime': !exists(json, 'waiting_time') ? undefined : json['waiting_time'], 'createdBy': json['created_by'], 'createdAt': (new Date(json['created_at'])), 'updatedAt': (new Date(json['updated_at'])), 'sourceUrl': !exists(json, 'source_url') ? undefined : json['source_url'], 'internal': !exists(json, 'internal') ? undefined : json['internal'], 'showIngredientOverview': !exists(json, 'show_ingredient_overview') ? undefined : json['show_ingredient_overview'], 'nutrition': !exists(json, 'nutrition') ? undefined : NutritionInformationFromJSON(json['nutrition']), 'properties': !exists(json, 'properties') ? undefined : ((json['properties'] as Array).map(PropertyFromJSON)), 'foodProperties': json['food_properties'], 'servings': !exists(json, 'servings') ? undefined : json['servings'], 'filePath': !exists(json, 'file_path') ? undefined : json['file_path'], 'servingsText': !exists(json, 'servings_text') ? undefined : json['servings_text'], 'rating': json['rating'], 'lastCooked': (json['last_cooked'] === null ? null : new Date(json['last_cooked'])), '_private': !exists(json, 'private') ? undefined : json['private'], 'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array).map(UserFromJSON)), }; } export function RecipeToJSON(value?: Recipe | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'name': value.name, 'description': value.description, 'keywords': value.keywords === undefined ? undefined : ((value.keywords as Array).map(KeywordToJSON)), 'steps': ((value.steps as Array).map(StepToJSON)), 'working_time': value.workingTime, 'waiting_time': value.waitingTime, 'source_url': value.sourceUrl, 'internal': value.internal, 'show_ingredient_overview': value.showIngredientOverview, 'nutrition': NutritionInformationToJSON(value.nutrition), 'properties': value.properties === undefined ? undefined : ((value.properties as Array).map(PropertyToJSON)), 'servings': value.servings, 'file_path': value.filePath, 'servings_text': value.servingsText, 'private': value._private, 'shared': value.shared === undefined ? undefined : ((value.shared as Array).map(UserToJSON)), }; }