56 lines
2.1 KiB
Rust
56 lines
2.1 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 RecipeStepsInnerIngredientsInner {
|
|
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
|
pub id: Option<i32>,
|
|
#[serde(rename = "food", deserialize_with = "Option::deserialize")]
|
|
pub food: Option<Box<crate::models::IngredientFood>>,
|
|
#[serde(rename = "unit", deserialize_with = "Option::deserialize")]
|
|
pub unit: Option<Box<crate::models::FoodSupermarketCategory>>,
|
|
#[serde(rename = "amount")]
|
|
pub amount: String,
|
|
#[serde(rename = "note", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub note: Option<Option<String>>,
|
|
#[serde(rename = "order", skip_serializing_if = "Option::is_none")]
|
|
pub order: Option<i32>,
|
|
#[serde(rename = "is_header", skip_serializing_if = "Option::is_none")]
|
|
pub is_header: Option<bool>,
|
|
#[serde(rename = "no_amount", skip_serializing_if = "Option::is_none")]
|
|
pub no_amount: Option<bool>,
|
|
#[serde(rename = "original_text", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub original_text: Option<Option<String>>,
|
|
#[serde(rename = "used_in_recipes", skip_serializing_if = "Option::is_none")]
|
|
pub used_in_recipes: Option<String>,
|
|
}
|
|
|
|
impl RecipeStepsInnerIngredientsInner {
|
|
pub fn new(food: Option<crate::models::IngredientFood>, unit: Option<crate::models::FoodSupermarketCategory>, amount: String) -> RecipeStepsInnerIngredientsInner {
|
|
RecipeStepsInnerIngredientsInner {
|
|
id: None,
|
|
food: if let Some(x) = food {Some(Box::new(x))} else {None},
|
|
unit: if let Some(x) = unit {Some(Box::new(x))} else {None},
|
|
amount,
|
|
note: None,
|
|
order: None,
|
|
is_header: None,
|
|
no_amount: None,
|
|
original_text: None,
|
|
used_in_recipes: None,
|
|
}
|
|
}
|
|
}
|
|
|
|
|