Files
recipes/vue3/models/PatchedRecipe.ts
2024-04-18 10:56:15 -05:00

268 lines
7.5 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 { 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 PatchedRecipe
*/
export interface PatchedRecipe {
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
description?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
readonly image?: string;
/**
*
* @type {Array<Keyword>}
* @memberof PatchedRecipe
*/
keywords?: Array<Keyword>;
/**
*
* @type {Array<Step>}
* @memberof PatchedRecipe
*/
steps?: Array<Step>;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
workingTime?: number;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
waitingTime?: number;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly updatedAt?: Date;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
sourceUrl?: string;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
internal?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
showIngredientOverview?: boolean;
/**
*
* @type {NutritionInformation}
* @memberof PatchedRecipe
*/
nutrition?: NutritionInformation;
/**
*
* @type {Array<Property>}
* @memberof PatchedRecipe
*/
properties?: Array<Property>;
/**
*
* @type {any}
* @memberof PatchedRecipe
*/
readonly foodProperties?: any;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
servings?: number;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
filePath?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
servingsText?: string;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
readonly rating?: number;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly lastCooked?: Date;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
_private?: boolean;
/**
*
* @type {Array<User>}
* @memberof PatchedRecipe
*/
shared?: Array<User>;
}
/**
* Check if a given object implements the PatchedRecipe interface.
*/
export function instanceOfPatchedRecipe(value: object): boolean {
return true;
}
export function PatchedRecipeFromJSON(json: any): PatchedRecipe {
return PatchedRecipeFromJSONTyped(json, false);
}
export function PatchedRecipeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedRecipe {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'] == null ? undefined : json['name'],
'description': json['description'] == null ? undefined : json['description'],
'image': json['image'] == null ? undefined : json['image'],
'keywords': json['keywords'] == null ? undefined : ((json['keywords'] as Array<any>).map(KeywordFromJSON)),
'steps': json['steps'] == null ? undefined : ((json['steps'] as Array<any>).map(StepFromJSON)),
'workingTime': json['working_time'] == null ? undefined : json['working_time'],
'waitingTime': json['waiting_time'] == null ? undefined : json['waiting_time'],
'createdBy': json['created_by'] == null ? undefined : json['created_by'],
'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
'sourceUrl': json['source_url'] == null ? undefined : json['source_url'],
'internal': json['internal'] == null ? undefined : json['internal'],
'showIngredientOverview': json['show_ingredient_overview'] == null ? undefined : json['show_ingredient_overview'],
'nutrition': json['nutrition'] == null ? undefined : NutritionInformationFromJSON(json['nutrition']),
'properties': json['properties'] == null ? undefined : ((json['properties'] as Array<any>).map(PropertyFromJSON)),
'foodProperties': json['food_properties'] == null ? undefined : json['food_properties'],
'servings': json['servings'] == null ? undefined : json['servings'],
'filePath': json['file_path'] == null ? undefined : json['file_path'],
'servingsText': json['servings_text'] == null ? undefined : json['servings_text'],
'rating': json['rating'] == null ? undefined : json['rating'],
'lastCooked': json['last_cooked'] == null ? undefined : (new Date(json['last_cooked'])),
'_private': json['private'] == null ? undefined : json['private'],
'shared': json['shared'] == null ? undefined : ((json['shared'] as Array<any>).map(UserFromJSON)),
};
}
export function PatchedRecipeToJSON(value?: Omit<PatchedRecipe, 'id'|'image'|'created_by'|'created_at'|'updated_at'|'food_properties'|'rating'|'last_cooked'> | null): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'description': value['description'],
'keywords': value['keywords'] == null ? undefined : ((value['keywords'] as Array<any>).map(KeywordToJSON)),
'steps': value['steps'] == null ? undefined : ((value['steps'] as Array<any>).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'] == null ? undefined : ((value['properties'] as Array<any>).map(PropertyToJSON)),
'servings': value['servings'],
'file_path': value['filePath'],
'servings_text': value['servingsText'],
'private': value['_private'],
'shared': value['shared'] == null ? undefined : ((value['shared'] as Array<any>).map(UserToJSON)),
};
}