Files
recipes/vue3/src/openapi/models/RecipeShoppingUpdate.ts
2024-03-11 19:46:37 +01:00

85 lines
2.2 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';
/**
*
* @export
* @interface RecipeShoppingUpdate
*/
export interface RecipeShoppingUpdate {
/**
*
* @type {number}
* @memberof RecipeShoppingUpdate
*/
readonly id: number;
/**
* Existing shopping list to update
* @type {number}
* @memberof RecipeShoppingUpdate
*/
listRecipe?: number;
/**
* List of ingredient IDs from the recipe to add, if not provided all ingredients will be added.
* @type {number}
* @memberof RecipeShoppingUpdate
*/
ingredients?: number;
/**
* Providing a list_recipe ID and servings of 0 will delete that shopping list.
* @type {number}
* @memberof RecipeShoppingUpdate
*/
servings?: number;
}
/**
* Check if a given object implements the RecipeShoppingUpdate interface.
*/
export function instanceOfRecipeShoppingUpdate(value: object): boolean {
if (!('id' in value)) return false;
return true;
}
export function RecipeShoppingUpdateFromJSON(json: any): RecipeShoppingUpdate {
return RecipeShoppingUpdateFromJSONTyped(json, false);
}
export function RecipeShoppingUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecipeShoppingUpdate {
if (json == null) {
return json;
}
return {
'id': json['id'],
'listRecipe': json['list_recipe'] == null ? undefined : json['list_recipe'],
'ingredients': json['ingredients'] == null ? undefined : json['ingredients'],
'servings': json['servings'] == null ? undefined : json['servings'],
};
}
export function RecipeShoppingUpdateToJSON(value?: RecipeShoppingUpdate | null): any {
if (value == null) {
return value;
}
return {
'list_recipe': value['listRecipe'],
'ingredients': value['ingredients'],
'servings': value['servings'],
};
}