aboutsummaryrefslogtreecommitdiffstats
path: root/crates/rocie-client/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-client/src')
-rw-r--r--crates/rocie-client/src/apis/api_set_no_auth_user_api.rs6
-rw-r--r--crates/rocie-client/src/models/content.rs14
-rw-r--r--crates/rocie-client/src/models/content_one_of.rs23
-rw-r--r--crates/rocie-client/src/models/content_one_of_1.rs23
-rw-r--r--crates/rocie-client/src/models/item.rs20
-rw-r--r--crates/rocie-client/src/models/item_one_of.rs23
-rw-r--r--crates/rocie-client/src/models/item_one_of_1.rs23
-rw-r--r--crates/rocie-client/src/models/item_one_of_1_ingredient.rs27
-rw-r--r--crates/rocie-client/src/models/item_one_of_2.rs23
-rw-r--r--crates/rocie-client/src/models/item_one_of_3.rs23
-rw-r--r--crates/rocie-client/src/models/item_one_of_4.rs23
-rw-r--r--crates/rocie-client/src/models/item_one_of_text.rs29
-rw-r--r--crates/rocie-client/src/models/mod.rs6
-rw-r--r--crates/rocie-client/src/models/provision_info.rs31
-rw-r--r--crates/rocie-client/src/models/timer.rs8
15 files changed, 128 insertions, 174 deletions
diff --git a/crates/rocie-client/src/apis/api_set_no_auth_user_api.rs b/crates/rocie-client/src/apis/api_set_no_auth_user_api.rs
index 1db2d9c..d1ff45a 100644
--- a/crates/rocie-client/src/apis/api_set_no_auth_user_api.rs
+++ b/crates/rocie-client/src/apis/api_set_no_auth_user_api.rs
@@ -93,9 +93,9 @@ pub async fn logout(configuration: &configuration::Configuration, ) -> Result<()
}
/// This only works, if no users exist yet.
-pub async fn provision(configuration: &configuration::Configuration, user_stub: models::UserStub) -> Result<models::UserId, Error<ProvisionError>> {
+pub async fn provision(configuration: &configuration::Configuration, provision_info: models::ProvisionInfo) -> Result<models::UserId, Error<ProvisionError>> {
// add a prefix to parameters to efficiently prevent name collisions
- let p_body_user_stub = user_stub;
+ let p_body_provision_info = provision_info;
let uri_str = format!("{}/provision", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
@@ -103,7 +103,7 @@ pub async fn provision(configuration: &configuration::Configuration, user_stub:
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
- req_builder = req_builder.json(&p_body_user_stub);
+ req_builder = req_builder.json(&p_body_provision_info);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
diff --git a/crates/rocie-client/src/models/content.rs b/crates/rocie-client/src/models/content.rs
index 8823605..357f675 100644
--- a/crates/rocie-client/src/models/content.rs
+++ b/crates/rocie-client/src/models/content.rs
@@ -25,18 +25,4 @@ impl Default for Content {
Self::ContentOneOf(Default::default())
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "step")]
- Step,
- #[serde(rename = "text")]
- Text,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Step
- }
-}
diff --git a/crates/rocie-client/src/models/content_one_of.rs b/crates/rocie-client/src/models/content_one_of.rs
index 1c82c61..02d5beb 100644
--- a/crates/rocie-client/src/models/content_one_of.rs
+++ b/crates/rocie-client/src/models/content_one_of.rs
@@ -14,32 +14,17 @@ use serde::{Deserialize, Serialize};
/// ContentOneOf : A step
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ContentOneOf {
- #[serde(rename = "type")]
- pub r#type: Type,
/// A step
- #[serde(rename = "value")]
- pub value: models::Step,
+ #[serde(rename = "Step")]
+ pub step: models::Step,
}
impl ContentOneOf {
/// A step
- pub fn new(r#type: Type, value: models::Step) -> ContentOneOf {
+ pub fn new(step: models::Step) -> ContentOneOf {
ContentOneOf {
- r#type,
- value,
+ step,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "step")]
- Step,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Step
- }
-}
diff --git a/crates/rocie-client/src/models/content_one_of_1.rs b/crates/rocie-client/src/models/content_one_of_1.rs
index 148999d..760a08f 100644
--- a/crates/rocie-client/src/models/content_one_of_1.rs
+++ b/crates/rocie-client/src/models/content_one_of_1.rs
@@ -14,32 +14,17 @@ use serde::{Deserialize, Serialize};
/// ContentOneOf1 : A paragraph of just text, no instructions
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ContentOneOf1 {
- #[serde(rename = "type")]
- pub r#type: Type,
/// A paragraph of just text, no instructions
- #[serde(rename = "value")]
- pub value: String,
+ #[serde(rename = "Text")]
+ pub text: String,
}
impl ContentOneOf1 {
/// A paragraph of just text, no instructions
- pub fn new(r#type: Type, value: String) -> ContentOneOf1 {
+ pub fn new(text: String) -> ContentOneOf1 {
ContentOneOf1 {
- r#type,
- value,
+ text,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "text")]
- Text,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Text
- }
-}
diff --git a/crates/rocie-client/src/models/item.rs b/crates/rocie-client/src/models/item.rs
index d3460bc..ef6891f 100644
--- a/crates/rocie-client/src/models/item.rs
+++ b/crates/rocie-client/src/models/item.rs
@@ -28,24 +28,4 @@ impl Default for Item {
Self::ItemOneOf(Default::default())
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "text")]
- Text,
- #[serde(rename = "ingredient")]
- Ingredient,
- #[serde(rename = "cookware")]
- Cookware,
- #[serde(rename = "timer")]
- Timer,
- #[serde(rename = "inlineQuantity")]
- InlineQuantity,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Text
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of.rs b/crates/rocie-client/src/models/item_one_of.rs
index af9bbcc..684d9b7 100644
--- a/crates/rocie-client/src/models/item_one_of.rs
+++ b/crates/rocie-client/src/models/item_one_of.rs
@@ -14,31 +14,16 @@ use serde::{Deserialize, Serialize};
/// ItemOneOf : Just plain text
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemOneOf {
- #[serde(rename = "type")]
- pub r#type: Type,
- #[serde(rename = "value")]
- pub value: String,
+ #[serde(rename = "Text")]
+ pub text: models::ItemOneOfText,
}
impl ItemOneOf {
/// Just plain text
- pub fn new(r#type: Type, value: String) -> ItemOneOf {
+ pub fn new(text: models::ItemOneOfText) -> ItemOneOf {
ItemOneOf {
- r#type,
- value,
+ text,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "text")]
- Text,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Text
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of_1.rs b/crates/rocie-client/src/models/item_one_of_1.rs
index 82888e7..618c56d 100644
--- a/crates/rocie-client/src/models/item_one_of_1.rs
+++ b/crates/rocie-client/src/models/item_one_of_1.rs
@@ -13,30 +13,15 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemOneOf1 {
- #[serde(rename = "index")]
- pub index: u32,
- #[serde(rename = "type")]
- pub r#type: Type,
+ #[serde(rename = "Ingredient")]
+ pub ingredient: models::ItemOneOf1Ingredient,
}
impl ItemOneOf1 {
- pub fn new(index: u32, r#type: Type) -> ItemOneOf1 {
+ pub fn new(ingredient: models::ItemOneOf1Ingredient) -> ItemOneOf1 {
ItemOneOf1 {
- index,
- r#type,
+ ingredient,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "ingredient")]
- Ingredient,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Ingredient
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of_1_ingredient.rs b/crates/rocie-client/src/models/item_one_of_1_ingredient.rs
new file mode 100644
index 0000000..59b21d3
--- /dev/null
+++ b/crates/rocie-client/src/models/item_one_of_1_ingredient.rs
@@ -0,0 +1,27 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct ItemOneOf1Ingredient {
+ #[serde(rename = "index")]
+ pub index: u32,
+}
+
+impl ItemOneOf1Ingredient {
+ pub fn new(index: u32) -> ItemOneOf1Ingredient {
+ ItemOneOf1Ingredient {
+ index,
+ }
+ }
+}
+
diff --git a/crates/rocie-client/src/models/item_one_of_2.rs b/crates/rocie-client/src/models/item_one_of_2.rs
index 93fb342..11732d2 100644
--- a/crates/rocie-client/src/models/item_one_of_2.rs
+++ b/crates/rocie-client/src/models/item_one_of_2.rs
@@ -13,30 +13,15 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemOneOf2 {
- #[serde(rename = "index")]
- pub index: u32,
- #[serde(rename = "type")]
- pub r#type: Type,
+ #[serde(rename = "Cookware")]
+ pub cookware: models::ItemOneOf1Ingredient,
}
impl ItemOneOf2 {
- pub fn new(index: u32, r#type: Type) -> ItemOneOf2 {
+ pub fn new(cookware: models::ItemOneOf1Ingredient) -> ItemOneOf2 {
ItemOneOf2 {
- index,
- r#type,
+ cookware,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "cookware")]
- Cookware,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Cookware
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of_3.rs b/crates/rocie-client/src/models/item_one_of_3.rs
index eaae1ad..2b29f6a 100644
--- a/crates/rocie-client/src/models/item_one_of_3.rs
+++ b/crates/rocie-client/src/models/item_one_of_3.rs
@@ -13,30 +13,15 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemOneOf3 {
- #[serde(rename = "index")]
- pub index: u32,
- #[serde(rename = "type")]
- pub r#type: Type,
+ #[serde(rename = "Timer")]
+ pub timer: models::ItemOneOf1Ingredient,
}
impl ItemOneOf3 {
- pub fn new(index: u32, r#type: Type) -> ItemOneOf3 {
+ pub fn new(timer: models::ItemOneOf1Ingredient) -> ItemOneOf3 {
ItemOneOf3 {
- index,
- r#type,
+ timer,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "timer")]
- Timer,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::Timer
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of_4.rs b/crates/rocie-client/src/models/item_one_of_4.rs
index 2abaf27..a3c29aa 100644
--- a/crates/rocie-client/src/models/item_one_of_4.rs
+++ b/crates/rocie-client/src/models/item_one_of_4.rs
@@ -13,30 +13,15 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemOneOf4 {
- #[serde(rename = "index")]
- pub index: u32,
- #[serde(rename = "type")]
- pub r#type: Type,
+ #[serde(rename = "InlineQuantity")]
+ pub inline_quantity: models::ItemOneOf1Ingredient,
}
impl ItemOneOf4 {
- pub fn new(index: u32, r#type: Type) -> ItemOneOf4 {
+ pub fn new(inline_quantity: models::ItemOneOf1Ingredient) -> ItemOneOf4 {
ItemOneOf4 {
- index,
- r#type,
+ inline_quantity,
}
}
}
-///
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
-pub enum Type {
- #[serde(rename = "inlineQuantity")]
- InlineQuantity,
-}
-
-impl Default for Type {
- fn default() -> Type {
- Self::InlineQuantity
- }
-}
diff --git a/crates/rocie-client/src/models/item_one_of_text.rs b/crates/rocie-client/src/models/item_one_of_text.rs
new file mode 100644
index 0000000..b47f792
--- /dev/null
+++ b/crates/rocie-client/src/models/item_one_of_text.rs
@@ -0,0 +1,29 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+/// ItemOneOfText : Just plain text
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct ItemOneOfText {
+ #[serde(rename = "value")]
+ pub value: String,
+}
+
+impl ItemOneOfText {
+ /// Just plain text
+ pub fn new(value: String) -> ItemOneOfText {
+ ItemOneOfText {
+ value,
+ }
+ }
+}
+
diff --git a/crates/rocie-client/src/models/mod.rs b/crates/rocie-client/src/models/mod.rs
index 53b0c13..2b426a1 100644
--- a/crates/rocie-client/src/models/mod.rs
+++ b/crates/rocie-client/src/models/mod.rs
@@ -32,12 +32,16 @@ pub mod item_one_of;
pub use self::item_one_of::ItemOneOf;
pub mod item_one_of_1;
pub use self::item_one_of_1::ItemOneOf1;
+pub mod item_one_of_1_ingredient;
+pub use self::item_one_of_1_ingredient::ItemOneOf1Ingredient;
pub mod item_one_of_2;
pub use self::item_one_of_2::ItemOneOf2;
pub mod item_one_of_3;
pub use self::item_one_of_3::ItemOneOf3;
pub mod item_one_of_4;
pub use self::item_one_of_4::ItemOneOf4;
+pub mod item_one_of_text;
+pub use self::item_one_of_text::ItemOneOfText;
pub mod login_info;
pub use self::login_info::LoginInfo;
pub mod metadata;
@@ -60,6 +64,8 @@ pub mod product_parent_stub;
pub use self::product_parent_stub::ProductParentStub;
pub mod product_stub;
pub use self::product_stub::ProductStub;
+pub mod provision_info;
+pub use self::provision_info::ProvisionInfo;
pub mod recipe;
pub use self::recipe::Recipe;
pub mod recipe_id;
diff --git a/crates/rocie-client/src/models/provision_info.rs b/crates/rocie-client/src/models/provision_info.rs
new file mode 100644
index 0000000..fc91f70
--- /dev/null
+++ b/crates/rocie-client/src/models/provision_info.rs
@@ -0,0 +1,31 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct ProvisionInfo {
+ /// Whether we should apply the default configuration.
+ #[serde(rename = "use_defaults")]
+ pub use_defaults: bool,
+ #[serde(rename = "user")]
+ pub user: models::UserStub,
+}
+
+impl ProvisionInfo {
+ pub fn new(use_defaults: bool, user: models::UserStub) -> ProvisionInfo {
+ ProvisionInfo {
+ use_defaults,
+ user,
+ }
+ }
+}
+
diff --git a/crates/rocie-client/src/models/timer.rs b/crates/rocie-client/src/models/timer.rs
index 6c06d61..290520f 100644
--- a/crates/rocie-client/src/models/timer.rs
+++ b/crates/rocie-client/src/models/timer.rs
@@ -18,16 +18,16 @@ pub struct Timer {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Time quantity
- #[serde(rename = "quantity")]
- pub quantity: models::UnitAmount,
+ #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
+ pub quantity: Option<models::UnitAmount>,
}
impl Timer {
/// A recipe timer If created from parsing, at least one of the fields is guaranteed to be [`Some`].
- pub fn new(quantity: models::UnitAmount) -> Timer {
+ pub fn new() -> Timer {
Timer {
name: None,
- quantity,
+ quantity: None,
}
}
}