/* 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 { MealTypeRequest } from './MealTypeRequest'; import { MealTypeRequestFromJSON, MealTypeRequestFromJSONTyped, MealTypeRequestToJSON, } from './MealTypeRequest'; import type { RecipeOverviewRequest } from './RecipeOverviewRequest'; import { RecipeOverviewRequestFromJSON, RecipeOverviewRequestFromJSONTyped, RecipeOverviewRequestToJSON, } from './RecipeOverviewRequest'; import type { UserRequest } from './UserRequest'; import { UserRequestFromJSON, UserRequestFromJSONTyped, UserRequestToJSON, } from './UserRequest'; /** * Adds nested create feature * @export * @interface PatchedMealPlanRequest */ export interface PatchedMealPlanRequest { /** * * @type {string} * @memberof PatchedMealPlanRequest */ title?: string; /** * * @type {RecipeOverviewRequest} * @memberof PatchedMealPlanRequest */ recipe?: RecipeOverviewRequest; /** * * @type {string} * @memberof PatchedMealPlanRequest */ servings?: string; /** * * @type {string} * @memberof PatchedMealPlanRequest */ note?: string; /** * * @type {Date} * @memberof PatchedMealPlanRequest */ fromDate?: Date; /** * * @type {Date} * @memberof PatchedMealPlanRequest */ toDate?: Date; /** * * @type {MealTypeRequest} * @memberof PatchedMealPlanRequest */ mealType?: MealTypeRequest; /** * * @type {Array} * @memberof PatchedMealPlanRequest */ shared?: Array; /** * * @type {number} * @memberof PatchedMealPlanRequest */ id?: number; } /** * Check if a given object implements the PatchedMealPlanRequest interface. */ export function instanceOfPatchedMealPlanRequest(value: object): boolean { return true; } export function PatchedMealPlanRequestFromJSON(json: any): PatchedMealPlanRequest { return PatchedMealPlanRequestFromJSONTyped(json, false); } export function PatchedMealPlanRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedMealPlanRequest { if (json == null) { return json; } return { 'title': json['title'] == null ? undefined : json['title'], 'recipe': json['recipe'] == null ? undefined : RecipeOverviewRequestFromJSON(json['recipe']), 'servings': json['servings'] == null ? undefined : json['servings'], 'note': json['note'] == null ? undefined : json['note'], 'fromDate': json['from_date'] == null ? undefined : (new Date(json['from_date'])), 'toDate': json['to_date'] == null ? undefined : (new Date(json['to_date'])), 'mealType': json['meal_type'] == null ? undefined : MealTypeRequestFromJSON(json['meal_type']), 'shared': json['shared'] == null ? undefined : ((json['shared'] as Array).map(UserRequestFromJSON)), 'id': json['id'] == null ? undefined : json['id'], }; } export function PatchedMealPlanRequestToJSON(value?: PatchedMealPlanRequest | null): any { if (value == null) { return value; } return { 'title': value['title'], 'recipe': RecipeOverviewRequestToJSON(value['recipe']), 'servings': value['servings'], 'note': value['note'], 'from_date': value['fromDate'] == null ? undefined : ((value['fromDate']).toISOString().substring(0,10)), 'to_date': value['toDate'] == null ? undefined : ((value['toDate']).toISOString().substring(0,10)), 'meal_type': MealTypeRequestToJSON(value['mealType']), 'shared': value['shared'] == null ? undefined : ((value['shared'] as Array).map(UserRequestToJSON)), 'id': value['id'], }; }