mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
171 lines
3.9 KiB
TypeScript
171 lines
3.9 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';
|
|
import {
|
|
MealType,
|
|
MealTypeFromJSON,
|
|
MealTypeFromJSONTyped,
|
|
MealTypeToJSON,
|
|
RecipeOverview,
|
|
RecipeOverviewFromJSON,
|
|
RecipeOverviewFromJSONTyped,
|
|
RecipeOverviewToJSON,
|
|
User,
|
|
UserFromJSON,
|
|
UserFromJSONTyped,
|
|
UserToJSON,
|
|
} from './';
|
|
|
|
/**
|
|
* Adds nested create feature
|
|
* @export
|
|
* @interface MealPlan
|
|
*/
|
|
export interface MealPlan {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly id: number;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
title?: string;
|
|
/**
|
|
*
|
|
* @type {RecipeOverview}
|
|
* @memberof MealPlan
|
|
*/
|
|
recipe?: RecipeOverview | null;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
servings: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
note?: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly noteMarkdown: string;
|
|
/**
|
|
*
|
|
* @type {Date}
|
|
* @memberof MealPlan
|
|
*/
|
|
fromDate: Date;
|
|
/**
|
|
*
|
|
* @type {Date}
|
|
* @memberof MealPlan
|
|
*/
|
|
toDate?: Date;
|
|
/**
|
|
*
|
|
* @type {MealType}
|
|
* @memberof MealPlan
|
|
*/
|
|
mealType: MealType;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly createdBy: number;
|
|
/**
|
|
*
|
|
* @type {Array<User>}
|
|
* @memberof MealPlan
|
|
*/
|
|
shared?: Array<User> | null;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly recipeName: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly mealTypeName: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof MealPlan
|
|
*/
|
|
readonly shopping: string;
|
|
}
|
|
|
|
export function MealPlanFromJSON(json: any): MealPlan {
|
|
return MealPlanFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function MealPlanFromJSONTyped(json: any, ignoreDiscriminator: boolean): MealPlan {
|
|
if ((json === undefined) || (json === null)) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'id': json['id'],
|
|
'title': !exists(json, 'title') ? undefined : json['title'],
|
|
'recipe': !exists(json, 'recipe') ? undefined : RecipeOverviewFromJSON(json['recipe']),
|
|
'servings': json['servings'],
|
|
'note': !exists(json, 'note') ? undefined : json['note'],
|
|
'noteMarkdown': json['note_markdown'],
|
|
'fromDate': (new Date(json['from_date'])),
|
|
'toDate': !exists(json, 'to_date') ? undefined : (new Date(json['to_date'])),
|
|
'mealType': MealTypeFromJSON(json['meal_type']),
|
|
'createdBy': json['created_by'],
|
|
'shared': !exists(json, 'shared') ? undefined : (json['shared'] === null ? null : (json['shared'] as Array<any>).map(UserFromJSON)),
|
|
'recipeName': json['recipe_name'],
|
|
'mealTypeName': json['meal_type_name'],
|
|
'shopping': json['shopping'],
|
|
};
|
|
}
|
|
|
|
export function MealPlanToJSON(value?: MealPlan | null): any {
|
|
if (value === undefined) {
|
|
return undefined;
|
|
}
|
|
if (value === null) {
|
|
return null;
|
|
}
|
|
return {
|
|
|
|
'title': value.title,
|
|
'recipe': RecipeOverviewToJSON(value.recipe),
|
|
'servings': value.servings,
|
|
'note': value.note,
|
|
'from_date': (value.fromDate.toISOString().substr(0,10)),
|
|
'to_date': value.toDate === undefined ? undefined : (value.toDate.toISOString().substr(0,10)),
|
|
'meal_type': MealTypeToJSON(value.mealType),
|
|
'shared': value.shared === undefined ? undefined : (value.shared === null ? null : (value.shared as Array<any>).map(UserToJSON)),
|
|
};
|
|
}
|
|
|
|
|