Parse ingredient amounts from V1 response

This commit is contained in:
Kirill Kamakin
2022-12-04 18:47:27 +01:00
parent 8e7ccbeca1
commit a628912557
17 changed files with 472 additions and 31 deletions

View File

@@ -8,13 +8,32 @@ data class GetRecipeResponseV1(
@SerialName("id") val remoteId: String,
@SerialName("name") val name: String,
@SerialName("recipeYield") val recipeYield: String = "",
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV1>,
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV1>,
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV1> = emptyList(),
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV1> = emptyList(),
@SerialName("settings") val settings: GetRecipeSettingsResponseV1,
)
@Serializable
data class GetRecipeSettingsResponseV1(
@SerialName("disableAmount") val disableAmount: Boolean,
)
@Serializable
data class GetRecipeIngredientResponseV1(
@SerialName("note") val note: String = "",
@SerialName("unit") val unit: GetRecipeIngredientUnitResponseV1?,
@SerialName("food") val food: GetRecipeIngredientFoodResponseV1?,
@SerialName("quantity") val quantity: Double?,
)
@Serializable
data class GetRecipeIngredientFoodResponseV1(
@SerialName("name") val name: String = "",
)
@Serializable
data class GetRecipeIngredientUnitResponseV1(
@SerialName("name") val name: String = "",
)
@Serializable