cart_sync/src/models/recipe_shopping_update.rs
2023-02-14 15:44:56 +01:00

41 lines
1.4 KiB
Rust

/*
* Django Recipes
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.5
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct RecipeShoppingUpdate {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
/// Existing shopping list to update
#[serde(rename = "list_recipe", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub list_recipe: Option<Option<i32>>,
/// List of ingredient IDs from the recipe to add, if not provided all ingredients will be added.
#[serde(rename = "ingredients", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub ingredients: Option<Option<i32>>,
/// Providing a list_recipe ID and servings of 0 will delete that shopping list.
#[serde(rename = "servings", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub servings: Option<Option<i32>>,
}
impl RecipeShoppingUpdate {
pub fn new() -> RecipeShoppingUpdate {
RecipeShoppingUpdate {
id: None,
list_recipe: None,
ingredients: None,
servings: None,
}
}
}