diff options
Diffstat (limited to 'crates/rocie-client')
148 files changed, 3499 insertions, 1409 deletions
diff --git a/crates/rocie-client/.openapi-generator/FILES b/crates/rocie-client/.openapi-generator/FILES index a8ce119..82fd640 100644 --- a/crates/rocie-client/.openapi-generator/FILES +++ b/crates/rocie-client/.openapi-generator/FILES @@ -5,20 +5,43 @@ docs/ApiGetAuthInventoryApi.md docs/ApiGetAuthProductApi.md docs/ApiGetAuthProductParentApi.md docs/ApiGetAuthRecipeApi.md +docs/ApiGetAuthRecipeParentApi.md docs/ApiGetAuthUnitApi.md docs/ApiGetAuthUnitPropertyApi.md docs/ApiGetAuthUserApi.md +docs/ApiGetNoAuthStateApi.md docs/ApiSetAuthBarcodeApi.md docs/ApiSetAuthProductApi.md docs/ApiSetAuthProductParentApi.md docs/ApiSetAuthRecipeApi.md +docs/ApiSetAuthRecipeParentApi.md docs/ApiSetAuthUnitApi.md docs/ApiSetAuthUnitPropertyApi.md docs/ApiSetAuthUserApi.md docs/ApiSetNoAuthUserApi.md docs/Barcode.md docs/BarcodeId.md +docs/Content.md +docs/ContentOneOf.md +docs/ContentOneOf1.md +docs/CooklangRecipe.md +docs/Cookware.md +docs/Ingredient.md +docs/IngredientOneOf.md +docs/IngredientOneOf1.md +docs/IngredientOneOf1NotRegisteredProduct.md +docs/IngredientOneOf2.md +docs/IngredientOneOf2RecipeReference.md +docs/IngredientOneOfRegisteredProduct.md +docs/Item.md +docs/ItemOneOf.md +docs/ItemOneOf1.md +docs/ItemOneOf2.md +docs/ItemOneOf3.md +docs/ItemOneOf4.md docs/LoginInfo.md +docs/Metadata.md +docs/NameAndUrl.md docs/PasswordHash.md docs/Product.md docs/ProductAmount.md @@ -29,7 +52,13 @@ docs/ProductParentStub.md docs/ProductStub.md docs/Recipe.md docs/RecipeId.md +docs/RecipeParent.md +docs/RecipeParentId.md +docs/RecipeParentStub.md docs/RecipeStub.md +docs/Section.md +docs/Step.md +docs/Timer.md docs/Unit.md docs/UnitAmount.md docs/UnitId.md @@ -40,18 +69,20 @@ docs/UnitStub.md docs/User.md docs/UserId.md docs/UserStub.md -git_push.sh src/apis/api_get_auth_inventory_api.rs src/apis/api_get_auth_product_api.rs src/apis/api_get_auth_product_parent_api.rs src/apis/api_get_auth_recipe_api.rs +src/apis/api_get_auth_recipe_parent_api.rs src/apis/api_get_auth_unit_api.rs src/apis/api_get_auth_unit_property_api.rs src/apis/api_get_auth_user_api.rs +src/apis/api_get_no_auth_state_api.rs src/apis/api_set_auth_barcode_api.rs src/apis/api_set_auth_product_api.rs src/apis/api_set_auth_product_parent_api.rs src/apis/api_set_auth_recipe_api.rs +src/apis/api_set_auth_recipe_parent_api.rs src/apis/api_set_auth_unit_api.rs src/apis/api_set_auth_unit_property_api.rs src/apis/api_set_auth_user_api.rs @@ -59,8 +90,28 @@ src/apis/api_set_no_auth_user_api.rs src/apis/mod.rs src/models/barcode.rs src/models/barcode_id.rs +src/models/content.rs +src/models/content_one_of.rs +src/models/content_one_of_1.rs +src/models/cooklang_recipe.rs +src/models/cookware.rs +src/models/ingredient.rs +src/models/ingredient_one_of.rs +src/models/ingredient_one_of_1.rs +src/models/ingredient_one_of_1_not_registered_product.rs +src/models/ingredient_one_of_2.rs +src/models/ingredient_one_of_2_recipe_reference.rs +src/models/ingredient_one_of_registered_product.rs +src/models/item.rs +src/models/item_one_of.rs +src/models/item_one_of_1.rs +src/models/item_one_of_2.rs +src/models/item_one_of_3.rs +src/models/item_one_of_4.rs src/models/login_info.rs +src/models/metadata.rs src/models/mod.rs +src/models/name_and_url.rs src/models/password_hash.rs src/models/product.rs src/models/product_amount.rs @@ -71,7 +122,13 @@ src/models/product_parent_stub.rs src/models/product_stub.rs src/models/recipe.rs src/models/recipe_id.rs +src/models/recipe_parent.rs +src/models/recipe_parent_id.rs +src/models/recipe_parent_stub.rs src/models/recipe_stub.rs +src/models/section.rs +src/models/step.rs +src/models/timer.rs src/models/unit.rs src/models/unit_amount.rs src/models/unit_id.rs diff --git a/crates/rocie-client/.openapi-generator/VERSION b/crates/rocie-client/.openapi-generator/VERSION index e465da4..6328c54 100644 --- a/crates/rocie-client/.openapi-generator/VERSION +++ b/crates/rocie-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.14.0 +7.17.0 diff --git a/crates/rocie-client/Cargo.toml b/crates/rocie-client/Cargo.toml index 768d3ee..64b57e9 100644 --- a/crates/rocie-client/Cargo.toml +++ b/crates/rocie-client/Cargo.toml @@ -6,6 +6,7 @@ description = "An enterprise grocery management system" license = "GPL-3.0-or-later" edition = "2024" + [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.16", default-features = false, features = [ diff --git a/crates/rocie-client/README.md b/crates/rocie-client/README.md index 03a4362..fd8ed2b 100644 --- a/crates/rocie-client/README.md +++ b/crates/rocie-client/README.md @@ -2,22 +2,19 @@ An enterprise grocery management system - server + ## Overview -This API client was generated by the -[OpenAPI Generator](https://openapi-generator.tech) project. By using the -[openapi-spec](https://openapis.org) from a remote server, you can easily -generate an API client. +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - API version: 0.1.0 - Package version: 0.1.0 -- Generator version: 7.14.0 +- Generator version: 7.17.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation -Put the package under your project folder in a directory named `rocie-client` -and add the following to `Cargo.toml` under `[dependencies]`: +Put the package under your project folder in a directory named `rocie-client` and add the following to `Cargo.toml` under `[dependencies]`: ``` rocie-client = { path = "./rocie-client" } @@ -25,69 +22,108 @@ rocie-client = { path = "./rocie-client" } ## Documentation for API Endpoints -All URIs are relative to _http://localhost_ - -| Class | Method | HTTP request | Description | -| ---------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------- | -| _ApiGetAuthInventoryApi_ | [**amount_by_id**](docs/ApiGetAuthInventoryApi.md#amount_by_id) | **GET** /inventory/{id} | Get the amount of an product | -| _ApiGetAuthProductApi_ | [**product_by_id**](docs/ApiGetAuthProductApi.md#product_by_id) | **GET** /product/by-id/{id} | Get Product by id | -| _ApiGetAuthProductApi_ | [**product_by_name**](docs/ApiGetAuthProductApi.md#product_by_name) | **GET** /product/by-name/{name} | Get Product by name | -| _ApiGetAuthProductApi_ | [**product_suggestion_by_name**](docs/ApiGetAuthProductApi.md#product_suggestion_by_name) | **GET** /product/by-part-name/{name} | Get Product suggestion by name | -| _ApiGetAuthProductApi_ | [**products_by_product_parent_id_direct**](docs/ApiGetAuthProductApi.md#products_by_product_parent_id_direct) | **GET** /product/by-product-parent-id-direct/{id} | Get Products by it's product parent id | -| _ApiGetAuthProductApi_ | [**products_by_product_parent_id_indirect**](docs/ApiGetAuthProductApi.md#products_by_product_parent_id_indirect) | **GET** /product/by-product-parent-id-indirect/{id} | Get Products by it's product parent id | -| _ApiGetAuthProductApi_ | [**products_in_storage**](docs/ApiGetAuthProductApi.md#products_in_storage) | **GET** /products_in_storage/ | Return all products, which non-null amount in storage | -| _ApiGetAuthProductApi_ | [**products_registered**](docs/ApiGetAuthProductApi.md#products_registered) | **GET** /products_registered/ | Return all registered products | -| _ApiGetAuthProductParentApi_ | [**product_parents**](docs/ApiGetAuthProductParentApi.md#product_parents) | **GET** /product_parents/ | Return all registered product parents | -| _ApiGetAuthProductParentApi_ | [**product_parents_toplevel**](docs/ApiGetAuthProductParentApi.md#product_parents_toplevel) | **GET** /product_parents_toplevel/ | Return all registered product parents, that have no parents themselves | -| _ApiGetAuthProductParentApi_ | [**product_parents_under**](docs/ApiGetAuthProductParentApi.md#product_parents_under) | **GET** /product_parents_under/{id} | Return all parents, that have this parent as parent | -| _ApiGetAuthRecipeApi_ | [**recipe_by_id**](docs/ApiGetAuthRecipeApi.md#recipe_by_id) | **GET** /recipe/by-id/{id} | Get an recipe by it's id. | -| _ApiGetAuthRecipeApi_ | [**recipes**](docs/ApiGetAuthRecipeApi.md#recipes) | **GET** /recipe/all | Get all added recipes | -| _ApiGetAuthUnitApi_ | [**unit_by_id**](docs/ApiGetAuthUnitApi.md#unit_by_id) | **GET** /unit/{id} | Get Unit by id | -| _ApiGetAuthUnitApi_ | [**units**](docs/ApiGetAuthUnitApi.md#units) | **GET** /units/ | Return all registered units | -| _ApiGetAuthUnitApi_ | [**units_by_property_id**](docs/ApiGetAuthUnitApi.md#units_by_property_id) | **GET** /units-by-property/{id} | Return all registered units for a specific unit property | -| _ApiGetAuthUnitPropertyApi_ | [**unit_properties**](docs/ApiGetAuthUnitPropertyApi.md#unit_properties) | **GET** /unit-properties/ | Return all registered unit properties | -| _ApiGetAuthUnitPropertyApi_ | [**unit_property_by_id**](docs/ApiGetAuthUnitPropertyApi.md#unit_property_by_id) | **GET** /unit-property/{id} | Get Unit property by id | -| _ApiGetAuthUserApi_ | [**user_by_id**](docs/ApiGetAuthUserApi.md#user_by_id) | **GET** /user/{id} | Get an specific user by id. | -| _ApiGetAuthUserApi_ | [**users**](docs/ApiGetAuthUserApi.md#users) | **GET** /users | Get all registered users. | -| _ApiSetAuthBarcodeApi_ | [**buy_barcode**](docs/ApiSetAuthBarcodeApi.md#buy_barcode) | **POST** /barcode/{barcode_id}/buy/{times} | Buy an barcode | -| _ApiSetAuthBarcodeApi_ | [**consume_barcode**](docs/ApiSetAuthBarcodeApi.md#consume_barcode) | **POST** /barcode/{id}/consume | Consume an barcode | -| _ApiSetAuthProductApi_ | [**associate_barcode**](docs/ApiSetAuthProductApi.md#associate_barcode) | **POST** /product/{id}/associate | Associate a barcode with a product | -| _ApiSetAuthProductApi_ | [**register_product**](docs/ApiSetAuthProductApi.md#register_product) | **POST** /product/new | Register a product | -| _ApiSetAuthProductParentApi_ | [**register_product_parent**](docs/ApiSetAuthProductParentApi.md#register_product_parent) | **POST** /product_parent/new | Register a product parent | -| _ApiSetAuthRecipeApi_ | [**add_recipe**](docs/ApiSetAuthRecipeApi.md#add_recipe) | **POST** /recipe/new | Register a product parent | -| _ApiSetAuthUnitApi_ | [**register_unit**](docs/ApiSetAuthUnitApi.md#register_unit) | **POST** /unit/new | Register an Unit | -| _ApiSetAuthUnitPropertyApi_ | [**register_unit_property**](docs/ApiSetAuthUnitPropertyApi.md#register_unit_property) | **POST** /unit-property/new | Register an Unit Property | -| _ApiSetAuthUserApi_ | [**register_user**](docs/ApiSetAuthUserApi.md#register_user) | **POST** /user/new | Register an new User | -| _ApiSetNoAuthUserApi_ | [**login**](docs/ApiSetNoAuthUserApi.md#login) | **POST** /login | Log in as a specific user | -| _ApiSetNoAuthUserApi_ | [**logout**](docs/ApiSetNoAuthUserApi.md#logout) | **POST** /logout | Log the current user out | -| _ApiSetNoAuthUserApi_ | [**provision**](docs/ApiSetNoAuthUserApi.md#provision) | **POST** /provision | Provision this instance. | +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ApiGetAuthInventoryApi* | [**amount_by_id**](docs/ApiGetAuthInventoryApi.md#amount_by_id) | **GET** /inventory/{id} | Get the amount of an product +*ApiGetAuthProductApi* | [**product_by_id**](docs/ApiGetAuthProductApi.md#product_by_id) | **GET** /product/by-id/{id} | Get Product by id +*ApiGetAuthProductApi* | [**product_by_name**](docs/ApiGetAuthProductApi.md#product_by_name) | **GET** /product/by-name/{name} | Get Product by name +*ApiGetAuthProductApi* | [**product_suggestion_by_name**](docs/ApiGetAuthProductApi.md#product_suggestion_by_name) | **GET** /product/by-part-name/{name} | Get Product suggestion by name +*ApiGetAuthProductApi* | [**products_by_product_parent_id_direct**](docs/ApiGetAuthProductApi.md#products_by_product_parent_id_direct) | **GET** /product/by-product-parent-id-direct/{id} | Get Products by it's product parent id +*ApiGetAuthProductApi* | [**products_by_product_parent_id_indirect**](docs/ApiGetAuthProductApi.md#products_by_product_parent_id_indirect) | **GET** /product/by-product-parent-id-indirect/{id} | Get Products by it's product parent id +*ApiGetAuthProductApi* | [**products_in_storage**](docs/ApiGetAuthProductApi.md#products_in_storage) | **GET** /products_in_storage/ | Return all products, which non-null amount in storage +*ApiGetAuthProductApi* | [**products_registered**](docs/ApiGetAuthProductApi.md#products_registered) | **GET** /products_registered/ | Return all registered products +*ApiGetAuthProductApi* | [**products_without_product_parent**](docs/ApiGetAuthProductApi.md#products_without_product_parent) | **GET** /product/without-product-parent | Get Products by it's absents of a product parent +*ApiGetAuthProductParentApi* | [**product_parents**](docs/ApiGetAuthProductParentApi.md#product_parents) | **GET** /product_parents/ | Return all registered product parents +*ApiGetAuthProductParentApi* | [**product_parents_toplevel**](docs/ApiGetAuthProductParentApi.md#product_parents_toplevel) | **GET** /product_parents_toplevel/ | Return all registered product parents, that have no parents themselves +*ApiGetAuthProductParentApi* | [**product_parents_under**](docs/ApiGetAuthProductParentApi.md#product_parents_under) | **GET** /product_parents_under/{id} | Return all parents, that have this parent as parent +*ApiGetAuthRecipeApi* | [**recipe_by_id**](docs/ApiGetAuthRecipeApi.md#recipe_by_id) | **GET** /recipe/by-id/{id} | Get an recipe by it's id. +*ApiGetAuthRecipeApi* | [**recipe_by_name**](docs/ApiGetAuthRecipeApi.md#recipe_by_name) | **GET** /recipe/by-name/{name} | Get an recipe by it's name. +*ApiGetAuthRecipeApi* | [**recipes**](docs/ApiGetAuthRecipeApi.md#recipes) | **GET** /recipe/all | Get all added recipes +*ApiGetAuthRecipeApi* | [**recipes_by_recipe_parent_id_direct**](docs/ApiGetAuthRecipeApi.md#recipes_by_recipe_parent_id_direct) | **GET** /recipe/by-recipe-parent-id-direct/{id} | Get Recipes by it's recipe parent id +*ApiGetAuthRecipeApi* | [**recipes_by_recipe_parent_id_indirect**](docs/ApiGetAuthRecipeApi.md#recipes_by_recipe_parent_id_indirect) | **GET** /recipe/by-recipe-parent-id-indirect/{id} | Get Recipes by it's recipe parent id +*ApiGetAuthRecipeApi* | [**recipes_without_recipe_parent**](docs/ApiGetAuthRecipeApi.md#recipes_without_recipe_parent) | **GET** /recipe/without-recipe-parent | Get Recipes by it's absents of a recipe parent +*ApiGetAuthRecipeParentApi* | [**recipe_parents**](docs/ApiGetAuthRecipeParentApi.md#recipe_parents) | **GET** /recipe_parents/ | Return all registered recipe parents +*ApiGetAuthRecipeParentApi* | [**recipe_parents_toplevel**](docs/ApiGetAuthRecipeParentApi.md#recipe_parents_toplevel) | **GET** /recipe_parents_toplevel/ | Return all registered recipe parents, that have no parents themselves +*ApiGetAuthRecipeParentApi* | [**recipe_parents_under**](docs/ApiGetAuthRecipeParentApi.md#recipe_parents_under) | **GET** /recipe_parents_under/{id} | Return all parents, that have this parent as parent +*ApiGetAuthUnitApi* | [**unit_by_id**](docs/ApiGetAuthUnitApi.md#unit_by_id) | **GET** /unit/{id} | Get Unit by id +*ApiGetAuthUnitApi* | [**units**](docs/ApiGetAuthUnitApi.md#units) | **GET** /units/ | Return all registered units +*ApiGetAuthUnitApi* | [**units_by_property_id**](docs/ApiGetAuthUnitApi.md#units_by_property_id) | **GET** /units-by-property/{id} | Return all registered units for a specific unit property +*ApiGetAuthUnitPropertyApi* | [**unit_properties**](docs/ApiGetAuthUnitPropertyApi.md#unit_properties) | **GET** /unit-properties/ | Return all registered unit properties +*ApiGetAuthUnitPropertyApi* | [**unit_property_by_id**](docs/ApiGetAuthUnitPropertyApi.md#unit_property_by_id) | **GET** /unit-property/{id} | Get Unit property by id +*ApiGetAuthUserApi* | [**user_by_id**](docs/ApiGetAuthUserApi.md#user_by_id) | **GET** /user/{id} | Get an specific user by id. +*ApiGetAuthUserApi* | [**users**](docs/ApiGetAuthUserApi.md#users) | **GET** /users | Get all registered users. +*ApiGetNoAuthStateApi* | [**can_be_provisioned**](docs/ApiGetNoAuthStateApi.md#can_be_provisioned) | **GET** /can-be-provisioned | Check if the server can be provisioned +*ApiGetNoAuthStateApi* | [**is_logged_in**](docs/ApiGetNoAuthStateApi.md#is_logged_in) | **GET** /is-logged-in | Check if you are logged in +*ApiSetAuthBarcodeApi* | [**buy_barcode**](docs/ApiSetAuthBarcodeApi.md#buy_barcode) | **POST** /barcode/{barcode_id}/buy/{times} | Buy an barcode +*ApiSetAuthBarcodeApi* | [**consume_barcode**](docs/ApiSetAuthBarcodeApi.md#consume_barcode) | **POST** /barcode/{id}/consume | Consume an barcode +*ApiSetAuthProductApi* | [**associate_barcode**](docs/ApiSetAuthProductApi.md#associate_barcode) | **POST** /product/{id}/associate | Associate a barcode with a product +*ApiSetAuthProductApi* | [**register_product**](docs/ApiSetAuthProductApi.md#register_product) | **POST** /product/new | Register a product +*ApiSetAuthProductParentApi* | [**register_product_parent**](docs/ApiSetAuthProductParentApi.md#register_product_parent) | **POST** /product_parent/new | Register a product parent +*ApiSetAuthRecipeApi* | [**add_recipe**](docs/ApiSetAuthRecipeApi.md#add_recipe) | **POST** /recipe/new | Register a product parent +*ApiSetAuthRecipeParentApi* | [**register_recipe_parent**](docs/ApiSetAuthRecipeParentApi.md#register_recipe_parent) | **POST** /recipe_parent/new | Register a product parent +*ApiSetAuthUnitApi* | [**register_unit**](docs/ApiSetAuthUnitApi.md#register_unit) | **POST** /unit/new | Register an Unit +*ApiSetAuthUnitPropertyApi* | [**register_unit_property**](docs/ApiSetAuthUnitPropertyApi.md#register_unit_property) | **POST** /unit-property/new | Register an Unit Property +*ApiSetAuthUserApi* | [**register_user**](docs/ApiSetAuthUserApi.md#register_user) | **POST** /user/new | Register an new User +*ApiSetNoAuthUserApi* | [**login**](docs/ApiSetNoAuthUserApi.md#login) | **POST** /login | Log in as a specific user +*ApiSetNoAuthUserApi* | [**logout**](docs/ApiSetNoAuthUserApi.md#logout) | **POST** /logout | Log the current user out +*ApiSetNoAuthUserApi* | [**provision**](docs/ApiSetNoAuthUserApi.md#provision) | **POST** /provision | Provision this instance. + ## Documentation For Models -- [Barcode](docs/Barcode.md) -- [BarcodeId](docs/BarcodeId.md) -- [LoginInfo](docs/LoginInfo.md) -- [PasswordHash](docs/PasswordHash.md) -- [Product](docs/Product.md) -- [ProductAmount](docs/ProductAmount.md) -- [ProductId](docs/ProductId.md) -- [ProductParent](docs/ProductParent.md) -- [ProductParentId](docs/ProductParentId.md) -- [ProductParentStub](docs/ProductParentStub.md) -- [ProductStub](docs/ProductStub.md) -- [Recipe](docs/Recipe.md) -- [RecipeId](docs/RecipeId.md) -- [RecipeStub](docs/RecipeStub.md) -- [Unit](docs/Unit.md) -- [UnitAmount](docs/UnitAmount.md) -- [UnitId](docs/UnitId.md) -- [UnitProperty](docs/UnitProperty.md) -- [UnitPropertyId](docs/UnitPropertyId.md) -- [UnitPropertyStub](docs/UnitPropertyStub.md) -- [UnitStub](docs/UnitStub.md) -- [User](docs/User.md) -- [UserId](docs/UserId.md) -- [UserStub](docs/UserStub.md) + - [Barcode](docs/Barcode.md) + - [BarcodeId](docs/BarcodeId.md) + - [Content](docs/Content.md) + - [ContentOneOf](docs/ContentOneOf.md) + - [ContentOneOf1](docs/ContentOneOf1.md) + - [CooklangRecipe](docs/CooklangRecipe.md) + - [Cookware](docs/Cookware.md) + - [Ingredient](docs/Ingredient.md) + - [IngredientOneOf](docs/IngredientOneOf.md) + - [IngredientOneOf1](docs/IngredientOneOf1.md) + - [IngredientOneOf1NotRegisteredProduct](docs/IngredientOneOf1NotRegisteredProduct.md) + - [IngredientOneOf2](docs/IngredientOneOf2.md) + - [IngredientOneOf2RecipeReference](docs/IngredientOneOf2RecipeReference.md) + - [IngredientOneOfRegisteredProduct](docs/IngredientOneOfRegisteredProduct.md) + - [Item](docs/Item.md) + - [ItemOneOf](docs/ItemOneOf.md) + - [ItemOneOf1](docs/ItemOneOf1.md) + - [ItemOneOf2](docs/ItemOneOf2.md) + - [ItemOneOf3](docs/ItemOneOf3.md) + - [ItemOneOf4](docs/ItemOneOf4.md) + - [LoginInfo](docs/LoginInfo.md) + - [Metadata](docs/Metadata.md) + - [NameAndUrl](docs/NameAndUrl.md) + - [PasswordHash](docs/PasswordHash.md) + - [Product](docs/Product.md) + - [ProductAmount](docs/ProductAmount.md) + - [ProductId](docs/ProductId.md) + - [ProductParent](docs/ProductParent.md) + - [ProductParentId](docs/ProductParentId.md) + - [ProductParentStub](docs/ProductParentStub.md) + - [ProductStub](docs/ProductStub.md) + - [Recipe](docs/Recipe.md) + - [RecipeId](docs/RecipeId.md) + - [RecipeParent](docs/RecipeParent.md) + - [RecipeParentId](docs/RecipeParentId.md) + - [RecipeParentStub](docs/RecipeParentStub.md) + - [RecipeStub](docs/RecipeStub.md) + - [Section](docs/Section.md) + - [Step](docs/Step.md) + - [Timer](docs/Timer.md) + - [Unit](docs/Unit.md) + - [UnitAmount](docs/UnitAmount.md) + - [UnitId](docs/UnitId.md) + - [UnitProperty](docs/UnitProperty.md) + - [UnitPropertyId](docs/UnitPropertyId.md) + - [UnitPropertyStub](docs/UnitPropertyStub.md) + - [UnitStub](docs/UnitStub.md) + - [User](docs/User.md) + - [UserId](docs/UserId.md) + - [UserStub](docs/UserStub.md) + To get access to the crate's generated documentation, use: @@ -98,3 +134,4 @@ cargo doc --open ## Author benedikt.peetz@b-peetz.de + diff --git a/crates/rocie-client/docs/ApiGetAuthInventoryApi.md b/crates/rocie-client/docs/ApiGetAuthInventoryApi.md index 1551249..ece4d4b 100644 --- a/crates/rocie-client/docs/ApiGetAuthInventoryApi.md +++ b/crates/rocie-client/docs/ApiGetAuthInventoryApi.md @@ -1,20 +1,24 @@ -# \\ApiGetAuthInventoryApi +# \ApiGetAuthInventoryApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**amount_by_id**](ApiGetAuthInventoryApi.md#amount_by_id) | **GET** /inventory/{id} | Get the amount of an product -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ---------------------------------------------------------- | ----------------------- | ---------------------------- | -| [**amount_by_id**](ApiGetAuthInventoryApi.md#amount_by_id) | **GET** /inventory/{id} | Get the amount of an product | ## amount_by_id -> models::ProductAmount amount_by_id(id) Get the amount of an product +> models::ProductAmount amount_by_id(id) +Get the amount of an product ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | -------------------- | ----------- | ---------- | ----- | -| **id** | [**ProductId**](.md) | Product id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductId**](.md) | Product id | [required] | ### Return type @@ -29,7 +33,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthProductApi.md b/crates/rocie-client/docs/ApiGetAuthProductApi.md index 44471fa..cd3c140 100644 --- a/crates/rocie-client/docs/ApiGetAuthProductApi.md +++ b/crates/rocie-client/docs/ApiGetAuthProductApi.md @@ -1,26 +1,31 @@ -# \\ApiGetAuthProductApi +# \ApiGetAuthProductApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**product_by_id**](ApiGetAuthProductApi.md#product_by_id) | **GET** /product/by-id/{id} | Get Product by id +[**product_by_name**](ApiGetAuthProductApi.md#product_by_name) | **GET** /product/by-name/{name} | Get Product by name +[**product_suggestion_by_name**](ApiGetAuthProductApi.md#product_suggestion_by_name) | **GET** /product/by-part-name/{name} | Get Product suggestion by name +[**products_by_product_parent_id_direct**](ApiGetAuthProductApi.md#products_by_product_parent_id_direct) | **GET** /product/by-product-parent-id-direct/{id} | Get Products by it's product parent id +[**products_by_product_parent_id_indirect**](ApiGetAuthProductApi.md#products_by_product_parent_id_indirect) | **GET** /product/by-product-parent-id-indirect/{id} | Get Products by it's product parent id +[**products_in_storage**](ApiGetAuthProductApi.md#products_in_storage) | **GET** /products_in_storage/ | Return all products, which non-null amount in storage +[**products_registered**](ApiGetAuthProductApi.md#products_registered) | **GET** /products_registered/ | Return all registered products +[**products_without_product_parent**](ApiGetAuthProductApi.md#products_without_product_parent) | **GET** /product/without-product-parent | Get Products by it's absents of a product parent -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- | ----------------------------------------------------- | -| [**product_by_id**](ApiGetAuthProductApi.md#product_by_id) | **GET** /product/by-id/{id} | Get Product by id | -| [**product_by_name**](ApiGetAuthProductApi.md#product_by_name) | **GET** /product/by-name/{name} | Get Product by name | -| [**product_suggestion_by_name**](ApiGetAuthProductApi.md#product_suggestion_by_name) | **GET** /product/by-part-name/{name} | Get Product suggestion by name | -| [**products_by_product_parent_id_direct**](ApiGetAuthProductApi.md#products_by_product_parent_id_direct) | **GET** /product/by-product-parent-id-direct/{id} | Get Products by it's product parent id | -| [**products_by_product_parent_id_indirect**](ApiGetAuthProductApi.md#products_by_product_parent_id_indirect) | **GET** /product/by-product-parent-id-indirect/{id} | Get Products by it's product parent id | -| [**products_in_storage**](ApiGetAuthProductApi.md#products_in_storage) | **GET** /products_in_storage/ | Return all products, which non-null amount in storage | -| [**products_registered**](ApiGetAuthProductApi.md#products_registered) | **GET** /products_registered/ | Return all registered products | ## product_by_id -> models::Product product_by_id(id) Get Product by id +> models::Product product_by_id(id) +Get Product by id ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | -------------------- | ----------- | ---------- | ----- | -| **id** | [**ProductId**](.md) | Product id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductId**](.md) | Product id | [required] | ### Return type @@ -35,20 +40,20 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## product_by_name -> models::Product product_by_name(name) Get Product by name +> models::Product product_by_name(name) +Get Product by name ### Parameters -| Name | Type | Description | Required | Notes | -| -------- | ---------- | ------------------- | ---------- | ----- | -| **name** | **String** | Name of the product | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Name of the product | [required] | ### Return type @@ -63,21 +68,20 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## product_suggestion_by_name -> Vec<models::Product> product_suggestion_by_name(name) Get Product suggestion -> by name +> Vec<models::Product> product_suggestion_by_name(name) +Get Product suggestion by name ### Parameters -| Name | Type | Description | Required | Notes | -| -------- | ---------- | ------------------------- | ---------- | ----- | -| **name** | **String** | Partial name of a product | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Partial name of a product | [required] | ### Return type @@ -92,23 +96,22 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## products_by_product_parent_id_direct -> Vec<models::Product> products_by_product_parent_id_direct(id) Get Products by -> it's product parent id +> Vec<models::Product> products_by_product_parent_id_direct(id) +Get Products by it's product parent id This will only return products directly associated with this product parent id ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | -------------------------- | ----------------- | ---------- | ----- | -| **id** | [**ProductParentId**](.md) | Product parent id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductParentId**](.md) | Product parent id | [required] | ### Return type @@ -123,23 +126,22 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## products_by_product_parent_id_indirect -> Vec<models::Product> products_by_product_parent_id_indirect(id) Get Products -> by it's product parent id +> Vec<models::Product> products_by_product_parent_id_indirect(id) +Get Products by it's product parent id This will also return all products below this product parent id ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | -------------------------- | ----------------- | ---------- | ----- | -| **id** | [**ProductParentId**](.md) | Product parent id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductParentId**](.md) | Product parent id | [required] | ### Return type @@ -154,15 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## products_in_storage -> Vec<models::Product> products_in_storage() Return all products, which non-null -> amount in storage +> Vec<models::Product> products_in_storage() +Return all products, which non-null amount in storage ### Parameters @@ -181,14 +181,40 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## products_registered -> Vec<models::Product> products_registered() Return all registered products +> Vec<models::Product> products_registered() +Return all registered products + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec<models::Product>**](Product.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## products_without_product_parent + +> Vec<models::Product> products_without_product_parent() +Get Products by it's absents of a product parent + +This will only return products without a product parent associated with it ### Parameters @@ -207,7 +233,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthProductParentApi.md b/crates/rocie-client/docs/ApiGetAuthProductParentApi.md index f51a316..fbdc3b1 100644 --- a/crates/rocie-client/docs/ApiGetAuthProductParentApi.md +++ b/crates/rocie-client/docs/ApiGetAuthProductParentApi.md @@ -1,17 +1,19 @@ -# \\ApiGetAuthProductParentApi +# \ApiGetAuthProductParentApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**product_parents**](ApiGetAuthProductParentApi.md#product_parents) | **GET** /product_parents/ | Return all registered product parents +[**product_parents_toplevel**](ApiGetAuthProductParentApi.md#product_parents_toplevel) | **GET** /product_parents_toplevel/ | Return all registered product parents, that have no parents themselves +[**product_parents_under**](ApiGetAuthProductParentApi.md#product_parents_under) | **GET** /product_parents_under/{id} | Return all parents, that have this parent as parent -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| -------------------------------------------------------------------------------------- | ----------------------------------- | ---------------------------------------------------------------------- | -| [**product_parents**](ApiGetAuthProductParentApi.md#product_parents) | **GET** /product_parents/ | Return all registered product parents | -| [**product_parents_toplevel**](ApiGetAuthProductParentApi.md#product_parents_toplevel) | **GET** /product_parents_toplevel/ | Return all registered product parents, that have no parents themselves | -| [**product_parents_under**](ApiGetAuthProductParentApi.md#product_parents_under) | **GET** /product_parents_under/{id} | Return all parents, that have this parent as parent | ## product_parents -> Vec<models::ProductParent> product_parents() Return all registered product -> parents +> Vec<models::ProductParent> product_parents() +Return all registered product parents ### Parameters @@ -30,15 +32,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## product_parents_toplevel -> Vec<models::ProductParent> product_parents_toplevel() Return all registered -> product parents, that have no parents themselves +> Vec<models::ProductParent> product_parents_toplevel() +Return all registered product parents, that have no parents themselves ### Parameters @@ -57,21 +57,20 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## product_parents_under -> Vec<models::ProductParent> product_parents_under(id) Return all parents, that -> have this parent as parent +> Vec<models::ProductParent> product_parents_under(id) +Return all parents, that have this parent as parent ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | -------------------------- | ----------------- | ---------- | ----- | -| **id** | [**ProductParentId**](.md) | Product parent id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductParentId**](.md) | Product parent id | [required] | ### Return type @@ -86,7 +85,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthRecipeApi.md b/crates/rocie-client/docs/ApiGetAuthRecipeApi.md index 29e2e36..b3fd96c 100644 --- a/crates/rocie-client/docs/ApiGetAuthRecipeApi.md +++ b/crates/rocie-client/docs/ApiGetAuthRecipeApi.md @@ -1,21 +1,29 @@ -# \\ApiGetAuthRecipeApi +# \ApiGetAuthRecipeApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**recipe_by_id**](ApiGetAuthRecipeApi.md#recipe_by_id) | **GET** /recipe/by-id/{id} | Get an recipe by it's id. +[**recipe_by_name**](ApiGetAuthRecipeApi.md#recipe_by_name) | **GET** /recipe/by-name/{name} | Get an recipe by it's name. +[**recipes**](ApiGetAuthRecipeApi.md#recipes) | **GET** /recipe/all | Get all added recipes +[**recipes_by_recipe_parent_id_direct**](ApiGetAuthRecipeApi.md#recipes_by_recipe_parent_id_direct) | **GET** /recipe/by-recipe-parent-id-direct/{id} | Get Recipes by it's recipe parent id +[**recipes_by_recipe_parent_id_indirect**](ApiGetAuthRecipeApi.md#recipes_by_recipe_parent_id_indirect) | **GET** /recipe/by-recipe-parent-id-indirect/{id} | Get Recipes by it's recipe parent id +[**recipes_without_recipe_parent**](ApiGetAuthRecipeApi.md#recipes_without_recipe_parent) | **GET** /recipe/without-recipe-parent | Get Recipes by it's absents of a recipe parent -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------- | -------------------------- | ------------------------- | -| [**recipe_by_id**](ApiGetAuthRecipeApi.md#recipe_by_id) | **GET** /recipe/by-id/{id} | Get an recipe by it's id. | -| [**recipes**](ApiGetAuthRecipeApi.md#recipes) | **GET** /recipe/all | Get all added recipes | ## recipe_by_id -> models::Recipe recipe_by_id(id) Get an recipe by it's id. +> models::Recipe recipe_by_id(id) +Get an recipe by it's id. ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | ------------------- | ----------- | ---------- | ----- | -| **id** | [**RecipeId**](.md) | Recipe id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**RecipeId**](.md) | Recipe id | [required] | ### Return type @@ -30,14 +38,41 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipe_by_name + +> models::Recipe recipe_by_name(name) +Get an recipe by it's name. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Recipe name | [required] | + +### Return type + +[**models::Recipe**](Recipe.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## recipes -> models::Recipe recipes() Get all added recipes +> Vec<models::Recipe> recipes() +Get all added recipes ### Parameters @@ -45,7 +80,67 @@ This endpoint does not need any parameter. ### Return type -[**models::Recipe**](Recipe.md) +[**Vec<models::Recipe>**](Recipe.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipes_by_recipe_parent_id_direct + +> Vec<models::Recipe> recipes_by_recipe_parent_id_direct(id) +Get Recipes by it's recipe parent id + +This will only return recipes directly associated with this recipe parent id + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**RecipeParentId**](.md) | Recipe parent id | [required] | + +### Return type + +[**Vec<models::Recipe>**](Recipe.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipes_by_recipe_parent_id_indirect + +> Vec<models::Recipe> recipes_by_recipe_parent_id_indirect(id) +Get Recipes by it's recipe parent id + +This will also return all recipes below this recipe parent id + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**RecipeParentId**](.md) | Recipe parent id | [required] | + +### Return type + +[**Vec<models::Recipe>**](Recipe.md) ### Authorization @@ -56,7 +151,32 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipes_without_recipe_parent + +> Vec<models::Recipe> recipes_without_recipe_parent() +Get Recipes by it's absents of a recipe parent + +This will only return recipes without a recipe parent associated with it + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec<models::Recipe>**](Recipe.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthRecipeParentApi.md b/crates/rocie-client/docs/ApiGetAuthRecipeParentApi.md new file mode 100644 index 0000000..0490daf --- /dev/null +++ b/crates/rocie-client/docs/ApiGetAuthRecipeParentApi.md @@ -0,0 +1,89 @@ +# \ApiGetAuthRecipeParentApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**recipe_parents**](ApiGetAuthRecipeParentApi.md#recipe_parents) | **GET** /recipe_parents/ | Return all registered recipe parents +[**recipe_parents_toplevel**](ApiGetAuthRecipeParentApi.md#recipe_parents_toplevel) | **GET** /recipe_parents_toplevel/ | Return all registered recipe parents, that have no parents themselves +[**recipe_parents_under**](ApiGetAuthRecipeParentApi.md#recipe_parents_under) | **GET** /recipe_parents_under/{id} | Return all parents, that have this parent as parent + + + +## recipe_parents + +> Vec<models::RecipeParent> recipe_parents() +Return all registered recipe parents + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec<models::RecipeParent>**](RecipeParent.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipe_parents_toplevel + +> Vec<models::RecipeParent> recipe_parents_toplevel() +Return all registered recipe parents, that have no parents themselves + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec<models::RecipeParent>**](RecipeParent.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## recipe_parents_under + +> Vec<models::RecipeParent> recipe_parents_under(id) +Return all parents, that have this parent as parent + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**RecipeParentId**](.md) | Recipe parent id | [required] | + +### Return type + +[**Vec<models::RecipeParent>**](RecipeParent.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthRefinedRecipeApi.md b/crates/rocie-client/docs/ApiGetAuthRefinedRecipeApi.md new file mode 100644 index 0000000..9f0bbf9 --- /dev/null +++ b/crates/rocie-client/docs/ApiGetAuthRefinedRecipeApi.md @@ -0,0 +1,37 @@ +# \ApiGetAuthRefinedRecipeApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**refined_recipe_by_id**](ApiGetAuthRefinedRecipeApi.md#refined_recipe_by_id) | **GET** /refined-recipe/by-id/{id} | Get an refined recipe from it's recipe's id. + + + +## refined_recipe_by_id + +> models::RefinedRecipe refined_recipe_by_id(id) +Get an refined recipe from it's recipe's id. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**RecipeId**](.md) | Recipe id | [required] | + +### Return type + +[**models::RefinedRecipe**](RefinedRecipe.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthUnitApi.md b/crates/rocie-client/docs/ApiGetAuthUnitApi.md index d8db77d..3f2b02f 100644 --- a/crates/rocie-client/docs/ApiGetAuthUnitApi.md +++ b/crates/rocie-client/docs/ApiGetAuthUnitApi.md @@ -1,22 +1,26 @@ -# \\ApiGetAuthUnitApi +# \ApiGetAuthUnitApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**unit_by_id**](ApiGetAuthUnitApi.md#unit_by_id) | **GET** /unit/{id} | Get Unit by id +[**units**](ApiGetAuthUnitApi.md#units) | **GET** /units/ | Return all registered units +[**units_by_property_id**](ApiGetAuthUnitApi.md#units_by_property_id) | **GET** /units-by-property/{id} | Return all registered units for a specific unit property -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| --------------------------------------------------------------------- | ------------------------------- | -------------------------------------------------------- | -| [**unit_by_id**](ApiGetAuthUnitApi.md#unit_by_id) | **GET** /unit/{id} | Get Unit by id | -| [**units**](ApiGetAuthUnitApi.md#units) | **GET** /units/ | Return all registered units | -| [**units_by_property_id**](ApiGetAuthUnitApi.md#units_by_property_id) | **GET** /units-by-property/{id} | Return all registered units for a specific unit property | ## unit_by_id -> models::Unit unit_by_id(id) Get Unit by id +> models::Unit unit_by_id(id) +Get Unit by id ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | ----------------- | ----------- | ---------- | ----- | -| **id** | [**UnitId**](.md) | Unit id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**UnitId**](.md) | Unit id | [required] | ### Return type @@ -31,14 +35,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## units -> Vec<models::Unit> units() Return all registered units +> Vec<models::Unit> units() +Return all registered units ### Parameters @@ -57,21 +60,20 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## units_by_property_id -> Vec<models::Unit> units_by_property_id(id) Return all registered units for a -> specific unit property +> Vec<models::Unit> units_by_property_id(id) +Return all registered units for a specific unit property ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | ------------------------- | ---------------- | ---------- | ----- | -| **id** | [**UnitPropertyId**](.md) | Unit property id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**UnitPropertyId**](.md) | Unit property id | [required] | ### Return type @@ -86,7 +88,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthUnitPropertyApi.md b/crates/rocie-client/docs/ApiGetAuthUnitPropertyApi.md index 09c261f..d88249a 100644 --- a/crates/rocie-client/docs/ApiGetAuthUnitPropertyApi.md +++ b/crates/rocie-client/docs/ApiGetAuthUnitPropertyApi.md @@ -1,16 +1,18 @@ -# \\ApiGetAuthUnitPropertyApi +# \ApiGetAuthUnitPropertyApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**unit_properties**](ApiGetAuthUnitPropertyApi.md#unit_properties) | **GET** /unit-properties/ | Return all registered unit properties +[**unit_property_by_id**](ApiGetAuthUnitPropertyApi.md#unit_property_by_id) | **GET** /unit-property/{id} | Get Unit property by id -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| --------------------------------------------------------------------------- | --------------------------- | ------------------------------------- | -| [**unit_properties**](ApiGetAuthUnitPropertyApi.md#unit_properties) | **GET** /unit-properties/ | Return all registered unit properties | -| [**unit_property_by_id**](ApiGetAuthUnitPropertyApi.md#unit_property_by_id) | **GET** /unit-property/{id} | Get Unit property by id | ## unit_properties -> Vec<models::UnitProperty> unit_properties() Return all registered unit -> properties +> Vec<models::UnitProperty> unit_properties() +Return all registered unit properties ### Parameters @@ -29,20 +31,20 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## unit_property_by_id -> models::UnitProperty unit_property_by_id(id) Get Unit property by id +> models::UnitProperty unit_property_by_id(id) +Get Unit property by id ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | ------------------------- | ---------------- | ---------- | ----- | -| **id** | [**UnitPropertyId**](.md) | Unit Property id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**UnitPropertyId**](.md) | Unit Property id | [required] | ### Return type @@ -57,7 +59,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetAuthUserApi.md b/crates/rocie-client/docs/ApiGetAuthUserApi.md index be9fe70..653e82a 100644 --- a/crates/rocie-client/docs/ApiGetAuthUserApi.md +++ b/crates/rocie-client/docs/ApiGetAuthUserApi.md @@ -1,21 +1,25 @@ -# \\ApiGetAuthUserApi +# \ApiGetAuthUserApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**user_by_id**](ApiGetAuthUserApi.md#user_by_id) | **GET** /user/{id} | Get an specific user by id. +[**users**](ApiGetAuthUserApi.md#users) | **GET** /users | Get all registered users. -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------- | ------------------ | --------------------------- | -| [**user_by_id**](ApiGetAuthUserApi.md#user_by_id) | **GET** /user/{id} | Get an specific user by id. | -| [**users**](ApiGetAuthUserApi.md#users) | **GET** /users | Get all registered users. | ## user_by_id -> models::User user_by_id(id) Get an specific user by id. +> models::User user_by_id(id) +Get an specific user by id. ### Parameters -| Name | Type | Description | Required | Notes | -| ------ | ----------------- | ----------- | ---------- | ----- | -| **id** | [**UserId**](.md) | User id | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**UserId**](.md) | User id | [required] | ### Return type @@ -30,14 +34,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## users -> Vec<models::User> users() Get all registered users. +> Vec<models::User> users() +Get all registered users. ### Parameters @@ -56,7 +59,5 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiGetNoAuthStateApi.md b/crates/rocie-client/docs/ApiGetNoAuthStateApi.md new file mode 100644 index 0000000..c72e9e2 --- /dev/null +++ b/crates/rocie-client/docs/ApiGetNoAuthStateApi.md @@ -0,0 +1,60 @@ +# \ApiGetNoAuthStateApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**can_be_provisioned**](ApiGetNoAuthStateApi.md#can_be_provisioned) | **GET** /can-be-provisioned | Check if the server can be provisioned +[**is_logged_in**](ApiGetNoAuthStateApi.md#is_logged_in) | **GET** /is-logged-in | Check if you are logged in + + + +## can_be_provisioned + +> bool can_be_provisioned() +Check if the server can be provisioned + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## is_logged_in + +> bool is_logged_in() +Check if you are logged in + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthBarcodeApi.md b/crates/rocie-client/docs/ApiSetAuthBarcodeApi.md index 357c26b..535643b 100644 --- a/crates/rocie-client/docs/ApiSetAuthBarcodeApi.md +++ b/crates/rocie-client/docs/ApiSetAuthBarcodeApi.md @@ -1,26 +1,30 @@ -# \\ApiSetAuthBarcodeApi +# \ApiSetAuthBarcodeApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**buy_barcode**](ApiSetAuthBarcodeApi.md#buy_barcode) | **POST** /barcode/{barcode_id}/buy/{times} | Buy an barcode +[**consume_barcode**](ApiSetAuthBarcodeApi.md#consume_barcode) | **POST** /barcode/{id}/consume | Consume an barcode -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| -------------------------------------------------------------- | ------------------------------------------ | ------------------ | -| [**buy_barcode**](ApiSetAuthBarcodeApi.md#buy_barcode) | **POST** /barcode/{barcode_id}/buy/{times} | Buy an barcode | -| [**consume_barcode**](ApiSetAuthBarcodeApi.md#consume_barcode) | **POST** /barcode/{id}/consume | Consume an barcode | ## buy_barcode -> buy_barcode(barcode_id, times) Buy an barcode +> buy_barcode(barcode_id, times) +Buy an barcode ### Parameters -| Name | Type | Description | Required | Notes | -| -------------- | -------------------- | -------------------------------- | ---------- | ----- | -| **barcode_id** | [**BarcodeId**](.md) | The numeric value of the barcode | [required] | -| **times** | **u32** | How often to buy the barcode | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**barcode_id** | [**BarcodeId**](.md) | The numeric value of the barcode | [required] | +**times** | **u32** | How often to buy the barcode | [required] | ### Return type -(empty response body) + (empty response body) ### Authorization @@ -31,25 +35,25 @@ No authorization required - **Content-Type**: Not defined - **Accept**: text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## consume_barcode -> consume_barcode(id, unit_amount) Consume an barcode +> consume_barcode(id, unit_amount) +Consume an barcode ### Parameters -| Name | Type | Description | Required | Notes | -| --------------- | ------------------------------- | -------------------------------- | ---------- | ----- | -| **id** | [**BarcodeId**](.md) | The numeric value of the barcode | [required] | -| **unit_amount** | [**UnitAmount**](UnitAmount.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**BarcodeId**](.md) | The numeric value of the barcode | [required] | +**unit_amount** | [**UnitAmount**](UnitAmount.md) | | [required] | ### Return type -(empty response body) + (empty response body) ### Authorization @@ -60,7 +64,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthProductApi.md b/crates/rocie-client/docs/ApiSetAuthProductApi.md index df659ef..eb52b59 100644 --- a/crates/rocie-client/docs/ApiSetAuthProductApi.md +++ b/crates/rocie-client/docs/ApiSetAuthProductApi.md @@ -1,26 +1,30 @@ -# \\ApiSetAuthProductApi +# \ApiSetAuthProductApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**associate_barcode**](ApiSetAuthProductApi.md#associate_barcode) | **POST** /product/{id}/associate | Associate a barcode with a product +[**register_product**](ApiSetAuthProductApi.md#register_product) | **POST** /product/new | Register a product -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------------------ | -------------------------------- | ---------------------------------- | -| [**associate_barcode**](ApiSetAuthProductApi.md#associate_barcode) | **POST** /product/{id}/associate | Associate a barcode with a product | -| [**register_product**](ApiSetAuthProductApi.md#register_product) | **POST** /product/new | Register a product | ## associate_barcode -> associate_barcode(id, barcode) Associate a barcode with a product +> associate_barcode(id, barcode) +Associate a barcode with a product ### Parameters -| Name | Type | Description | Required | Notes | -| ----------- | ------------------------- | ---------------------------------------------------- | ---------- | ----- | -| **id** | [**ProductId**](.md) | The id of the product to associated the barcode with | [required] | -| **barcode** | [**Barcode**](Barcode.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | [**ProductId**](.md) | The id of the product to associated the barcode with | [required] | +**barcode** | [**Barcode**](Barcode.md) | | [required] | ### Return type -(empty response body) + (empty response body) ### Authorization @@ -31,20 +35,20 @@ No authorization required - **Content-Type**: application/json - **Accept**: text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## register_product -> models::ProductId register_product(product_stub) Register a product +> models::ProductId register_product(product_stub) +Register a product ### Parameters -| Name | Type | Description | Required | Notes | -| ---------------- | --------------------------------- | ----------- | ---------- | ----- | -| **product_stub** | [**ProductStub**](ProductStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**product_stub** | [**ProductStub**](ProductStub.md) | | [required] | ### Return type @@ -59,7 +63,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthProductParentApi.md b/crates/rocie-client/docs/ApiSetAuthProductParentApi.md index 54fbef1..e48c269 100644 --- a/crates/rocie-client/docs/ApiSetAuthProductParentApi.md +++ b/crates/rocie-client/docs/ApiSetAuthProductParentApi.md @@ -1,21 +1,24 @@ -# \\ApiSetAuthProductParentApi +# \ApiSetAuthProductParentApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**register_product_parent**](ApiSetAuthProductParentApi.md#register_product_parent) | **POST** /product_parent/new | Register a product parent -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------------------------------------ | ---------------------------- | ------------------------- | -| [**register_product_parent**](ApiSetAuthProductParentApi.md#register_product_parent) | **POST** /product_parent/new | Register a product parent | ## register_product_parent -> models::ProductParentId register_product_parent(product_parent_stub) Register -> a product parent +> models::ProductParentId register_product_parent(product_parent_stub) +Register a product parent ### Parameters -| Name | Type | Description | Required | Notes | -| ----------------------- | --------------------------------------------- | ----------- | ---------- | ----- | -| **product_parent_stub** | [**ProductParentStub**](ProductParentStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**product_parent_stub** | [**ProductParentStub**](ProductParentStub.md) | | [required] | ### Return type @@ -30,7 +33,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthRecipeApi.md b/crates/rocie-client/docs/ApiSetAuthRecipeApi.md index a897210..0ec118b 100644 --- a/crates/rocie-client/docs/ApiSetAuthRecipeApi.md +++ b/crates/rocie-client/docs/ApiSetAuthRecipeApi.md @@ -1,20 +1,24 @@ -# \\ApiSetAuthRecipeApi +# \ApiSetAuthRecipeApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_recipe**](ApiSetAuthRecipeApi.md#add_recipe) | **POST** /recipe/new | Register a product parent -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| --------------------------------------------------- | -------------------- | ------------------------- | -| [**add_recipe**](ApiSetAuthRecipeApi.md#add_recipe) | **POST** /recipe/new | Register a product parent | ## add_recipe -> models::RecipeId add_recipe(recipe_stub) Register a product parent +> models::RecipeId add_recipe(recipe_stub) +Register a product parent ### Parameters -| Name | Type | Description | Required | Notes | -| --------------- | ------------------------------- | ----------- | ---------- | ----- | -| **recipe_stub** | [**RecipeStub**](RecipeStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**recipe_stub** | [**RecipeStub**](RecipeStub.md) | | [required] | ### Return type @@ -29,7 +33,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthRecipeParentApi.md b/crates/rocie-client/docs/ApiSetAuthRecipeParentApi.md new file mode 100644 index 0000000..20190e5 --- /dev/null +++ b/crates/rocie-client/docs/ApiSetAuthRecipeParentApi.md @@ -0,0 +1,37 @@ +# \ApiSetAuthRecipeParentApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**register_recipe_parent**](ApiSetAuthRecipeParentApi.md#register_recipe_parent) | **POST** /recipe_parent/new | Register a product parent + + + +## register_recipe_parent + +> models::RecipeParentId register_recipe_parent(recipe_parent_stub) +Register a product parent + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**recipe_parent_stub** | [**RecipeParentStub**](RecipeParentStub.md) | | [required] | + +### Return type + +[**models::RecipeParentId**](RecipeParentId.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthUnitApi.md b/crates/rocie-client/docs/ApiSetAuthUnitApi.md index ddb7581..d5927f8 100644 --- a/crates/rocie-client/docs/ApiSetAuthUnitApi.md +++ b/crates/rocie-client/docs/ApiSetAuthUnitApi.md @@ -1,20 +1,24 @@ -# \\ApiSetAuthUnitApi +# \ApiSetAuthUnitApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**register_unit**](ApiSetAuthUnitApi.md#register_unit) | **POST** /unit/new | Register an Unit -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------- | ------------------ | ---------------- | -| [**register_unit**](ApiSetAuthUnitApi.md#register_unit) | **POST** /unit/new | Register an Unit | ## register_unit -> models::UnitId register_unit(unit_stub) Register an Unit +> models::UnitId register_unit(unit_stub) +Register an Unit ### Parameters -| Name | Type | Description | Required | Notes | -| ------------- | --------------------------- | ----------- | ---------- | ----- | -| **unit_stub** | [**UnitStub**](UnitStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**unit_stub** | [**UnitStub**](UnitStub.md) | | [required] | ### Return type @@ -29,7 +33,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthUnitPropertyApi.md b/crates/rocie-client/docs/ApiSetAuthUnitPropertyApi.md index df662c8..855065c 100644 --- a/crates/rocie-client/docs/ApiSetAuthUnitPropertyApi.md +++ b/crates/rocie-client/docs/ApiSetAuthUnitPropertyApi.md @@ -1,21 +1,24 @@ -# \\ApiSetAuthUnitPropertyApi +# \ApiSetAuthUnitPropertyApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**register_unit_property**](ApiSetAuthUnitPropertyApi.md#register_unit_property) | **POST** /unit-property/new | Register an Unit Property -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| --------------------------------------------------------------------------------- | --------------------------- | ------------------------- | -| [**register_unit_property**](ApiSetAuthUnitPropertyApi.md#register_unit_property) | **POST** /unit-property/new | Register an Unit Property | ## register_unit_property -> models::UnitPropertyId register_unit_property(unit_property_stub) Register an -> Unit Property +> models::UnitPropertyId register_unit_property(unit_property_stub) +Register an Unit Property ### Parameters -| Name | Type | Description | Required | Notes | -| ---------------------- | ------------------------------------------- | ----------- | ---------- | ----- | -| **unit_property_stub** | [**UnitPropertyStub**](UnitPropertyStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**unit_property_stub** | [**UnitPropertyStub**](UnitPropertyStub.md) | | [required] | ### Return type @@ -30,7 +33,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetAuthUserApi.md b/crates/rocie-client/docs/ApiSetAuthUserApi.md index 77bdd60..7409a8a 100644 --- a/crates/rocie-client/docs/ApiSetAuthUserApi.md +++ b/crates/rocie-client/docs/ApiSetAuthUserApi.md @@ -1,20 +1,24 @@ -# \\ApiSetAuthUserApi +# \ApiSetAuthUserApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**register_user**](ApiSetAuthUserApi.md#register_user) | **POST** /user/new | Register an new User -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------------- | ------------------ | -------------------- | -| [**register_user**](ApiSetAuthUserApi.md#register_user) | **POST** /user/new | Register an new User | ## register_user -> models::UserId register_user(user_stub) Register an new User +> models::UserId register_user(user_stub) +Register an new User ### Parameters -| Name | Type | Description | Required | Notes | -| ------------- | --------------------------- | ----------- | ---------- | ----- | -| **user_stub** | [**UserStub**](UserStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_stub** | [**UserStub**](UserStub.md) | | [required] | ### Return type @@ -29,7 +33,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/ApiSetNoAuthUserApi.md b/crates/rocie-client/docs/ApiSetNoAuthUserApi.md index 4cfc846..f532533 100644 --- a/crates/rocie-client/docs/ApiSetNoAuthUserApi.md +++ b/crates/rocie-client/docs/ApiSetNoAuthUserApi.md @@ -1,26 +1,30 @@ -# \\ApiSetNoAuthUserApi +# \ApiSetNoAuthUserApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**login**](ApiSetNoAuthUserApi.md#login) | **POST** /login | Log in as a specific user +[**logout**](ApiSetNoAuthUserApi.md#logout) | **POST** /logout | Log the current user out +[**provision**](ApiSetNoAuthUserApi.md#provision) | **POST** /provision | Provision this instance. -All URIs are relative to _http://localhost_ -| Method | HTTP request | Description | -| ------------------------------------------------- | ------------------- | ------------------------- | -| [**login**](ApiSetNoAuthUserApi.md#login) | **POST** /login | Log in as a specific user | -| [**logout**](ApiSetNoAuthUserApi.md#logout) | **POST** /logout | Log the current user out | -| [**provision**](ApiSetNoAuthUserApi.md#provision) | **POST** /provision | Provision this instance. | ## login -> login(login_info) Log in as a specific user +> login(login_info) +Log in as a specific user ### Parameters -| Name | Type | Description | Required | Notes | -| -------------- | ----------------------------- | ----------- | ---------- | ----- | -| **login_info** | [**LoginInfo**](LoginInfo.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**login_info** | [**LoginInfo**](LoginInfo.md) | | [required] | ### Return type -(empty response body) + (empty response body) ### Authorization @@ -31,14 +35,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## logout -> logout() Log the current user out +> logout() +Log the current user out ### Parameters @@ -46,7 +49,7 @@ This endpoint does not need any parameter. ### Return type -(empty response body) + (empty response body) ### Authorization @@ -57,22 +60,22 @@ No authorization required - **Content-Type**: Not defined - **Accept**: text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + ## provision -> models::UserId provision(user_stub) Provision this instance. +> models::UserId provision(user_stub) +Provision this instance. This only works, if no users exist yet. ### Parameters -| Name | Type | Description | Required | Notes | -| ------------- | --------------------------- | ----------- | ---------- | ----- | -| **user_stub** | [**UserStub**](UserStub.md) | | [required] | + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_stub** | [**UserStub**](UserStub.md) | | [required] | ### Return type @@ -87,7 +90,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json, text/plain -[[Back to top]](#) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/rocie-client/docs/Barcode.md b/crates/rocie-client/docs/Barcode.md index 7d84458..622b82d 100644 --- a/crates/rocie-client/docs/Barcode.md +++ b/crates/rocie-client/docs/Barcode.md @@ -2,11 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| ---------- | --------------------------------------- | ----------- | ----- | -| **amount** | [**models::UnitAmount**](UnitAmount.md) | | -| **id** | [**models::BarcodeId**](BarcodeId.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | [**models::UnitAmount**](UnitAmount.md) | | +**id** | [**models::BarcodeId**](BarcodeId.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/BarcodeId.md b/crates/rocie-client/docs/BarcodeId.md index b180bd9..630e07f 100644 --- a/crates/rocie-client/docs/BarcodeId.md +++ b/crates/rocie-client/docs/BarcodeId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------- | ----------- | ----- | -| **value** | **u32** | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **u32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/Content.md b/crates/rocie-client/docs/Content.md new file mode 100644 index 0000000..e69b125 --- /dev/null +++ b/crates/rocie-client/docs/Content.md @@ -0,0 +1,12 @@ +# Content + +## Enum Variants + +| Name | Description | +|---- | -----| +| ContentOneOf | Each type of content inside a section | +| ContentOneOf1 | Each type of content inside a section | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ContentOneOf.md b/crates/rocie-client/docs/ContentOneOf.md new file mode 100644 index 0000000..61ea868 --- /dev/null +++ b/crates/rocie-client/docs/ContentOneOf.md @@ -0,0 +1,12 @@ +# ContentOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**value** | [**models::Step**](Step.md) | A step | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ContentOneOf1.md b/crates/rocie-client/docs/ContentOneOf1.md new file mode 100644 index 0000000..eef8337 --- /dev/null +++ b/crates/rocie-client/docs/ContentOneOf1.md @@ -0,0 +1,12 @@ +# ContentOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**value** | **String** | A paragraph of just text, no instructions | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/CooklangRecipe.md b/crates/rocie-client/docs/CooklangRecipe.md new file mode 100644 index 0000000..0bee54e --- /dev/null +++ b/crates/rocie-client/docs/CooklangRecipe.md @@ -0,0 +1,15 @@ +# CooklangRecipe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cookware** | [**Vec<models::Cookware>**](Cookware.md) | All the cookware | +**ingredients** | [**Vec<models::Ingredient>**](Ingredient.md) | All the ingredients | +**metadata** | [**models::Metadata**](Metadata.md) | Metadata as read from preamble | +**sections** | [**Vec<models::Section>**](Section.md) | Each of the sections If no sections declared, a section without name is the default. | +**timers** | [**Vec<models::Timer>**](Timer.md) | All the timers | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Cookware.md b/crates/rocie-client/docs/Cookware.md new file mode 100644 index 0000000..8861782 --- /dev/null +++ b/crates/rocie-client/docs/Cookware.md @@ -0,0 +1,14 @@ +# Cookware + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | Option<**String**> | Alias | [optional] +**name** | **String** | Name | +**note** | Option<**String**> | Note | [optional] +**quantity** | Option<**u32**> | Amount needed Note that this is a value, not a quantity, so it doesn't have units. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Ingredient.md b/crates/rocie-client/docs/Ingredient.md new file mode 100644 index 0000000..9dee5c9 --- /dev/null +++ b/crates/rocie-client/docs/Ingredient.md @@ -0,0 +1,13 @@ +# Ingredient + +## Enum Variants + +| Name | Description | +|---- | -----| +| IngredientOneOf | A recipe ingredient | +| IngredientOneOf1 | A recipe ingredient | +| IngredientOneOf2 | A recipe ingredient | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOf.md b/crates/rocie-client/docs/IngredientOneOf.md new file mode 100644 index 0000000..a4e4fb9 --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOf.md @@ -0,0 +1,11 @@ +# IngredientOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**registered_product** | [**models::IngredientOneOfRegisteredProduct**](Ingredient_oneOf_RegisteredProduct.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOf1.md b/crates/rocie-client/docs/IngredientOneOf1.md new file mode 100644 index 0000000..fd70578 --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOf1.md @@ -0,0 +1,11 @@ +# IngredientOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**not_registered_product** | [**models::IngredientOneOf1NotRegisteredProduct**](Ingredient_oneOf_1_NotRegisteredProduct.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOf1NotRegisteredProduct.md b/crates/rocie-client/docs/IngredientOneOf1NotRegisteredProduct.md new file mode 100644 index 0000000..b23f98b --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOf1NotRegisteredProduct.md @@ -0,0 +1,12 @@ +# IngredientOneOf1NotRegisteredProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**quantity** | Option<[**models::UnitAmount**](UnitAmount.md)> | Quantity | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOf2.md b/crates/rocie-client/docs/IngredientOneOf2.md new file mode 100644 index 0000000..33a7ffc --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOf2.md @@ -0,0 +1,11 @@ +# IngredientOneOf2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recipe_reference** | [**models::IngredientOneOf2RecipeReference**](Ingredient_oneOf_2_RecipeReference.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOf2RecipeReference.md b/crates/rocie-client/docs/IngredientOneOf2RecipeReference.md new file mode 100644 index 0000000..469603f --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOf2RecipeReference.md @@ -0,0 +1,11 @@ +# IngredientOneOf2RecipeReference + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | [**models::RecipeId**](RecipeId.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/IngredientOneOfRegisteredProduct.md b/crates/rocie-client/docs/IngredientOneOfRegisteredProduct.md new file mode 100644 index 0000000..a85bc6f --- /dev/null +++ b/crates/rocie-client/docs/IngredientOneOfRegisteredProduct.md @@ -0,0 +1,13 @@ +# IngredientOneOfRegisteredProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | Option<**String**> | Alias | [optional] +**id** | [**models::ProductId**](ProductId.md) | | +**quantity** | Option<[**models::ProductAmount**](ProductAmount.md)> | Quantity | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Item.md b/crates/rocie-client/docs/Item.md new file mode 100644 index 0000000..805f99d --- /dev/null +++ b/crates/rocie-client/docs/Item.md @@ -0,0 +1,15 @@ +# Item + +## Enum Variants + +| Name | Description | +|---- | -----| +| ItemOneOf | A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. | +| ItemOneOf1 | A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. | +| ItemOneOf2 | A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. | +| ItemOneOf3 | A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. | +| ItemOneOf4 | A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ItemOneOf.md b/crates/rocie-client/docs/ItemOneOf.md new file mode 100644 index 0000000..5009d60 --- /dev/null +++ b/crates/rocie-client/docs/ItemOneOf.md @@ -0,0 +1,12 @@ +# ItemOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**value** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ItemOneOf1.md b/crates/rocie-client/docs/ItemOneOf1.md new file mode 100644 index 0000000..8160228 --- /dev/null +++ b/crates/rocie-client/docs/ItemOneOf1.md @@ -0,0 +1,12 @@ +# ItemOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **u32** | | +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ItemOneOf2.md b/crates/rocie-client/docs/ItemOneOf2.md new file mode 100644 index 0000000..8cfe0f3 --- /dev/null +++ b/crates/rocie-client/docs/ItemOneOf2.md @@ -0,0 +1,12 @@ +# ItemOneOf2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **u32** | | +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ItemOneOf3.md b/crates/rocie-client/docs/ItemOneOf3.md new file mode 100644 index 0000000..2fd7331 --- /dev/null +++ b/crates/rocie-client/docs/ItemOneOf3.md @@ -0,0 +1,12 @@ +# ItemOneOf3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **u32** | | +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ItemOneOf4.md b/crates/rocie-client/docs/ItemOneOf4.md new file mode 100644 index 0000000..f50a058 --- /dev/null +++ b/crates/rocie-client/docs/ItemOneOf4.md @@ -0,0 +1,12 @@ +# ItemOneOf4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **u32** | | +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/LoginInfo.md b/crates/rocie-client/docs/LoginInfo.md index 97c02c4..f1a371f 100644 --- a/crates/rocie-client/docs/LoginInfo.md +++ b/crates/rocie-client/docs/LoginInfo.md @@ -2,11 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| ------------ | ------------------------------- | ------------------------- | ----- | -| **id** | [**models::UserId**](UserId.md) | The id of the user. | -| **password** | **String** | The password of the user. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | **String** | The password of the user. | +**user_name** | **String** | The user name of the user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Metadata.md b/crates/rocie-client/docs/Metadata.md new file mode 100644 index 0000000..4794f5c --- /dev/null +++ b/crates/rocie-client/docs/Metadata.md @@ -0,0 +1,15 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**models::NameAndUrl**](NameAndUrl.md)> | | [optional] +**description** | Option<**String**> | | [optional] +**source** | Option<[**models::NameAndUrl**](NameAndUrl.md)> | | [optional] +**tags** | Option<**Vec<String>**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/NameAndUrl.md b/crates/rocie-client/docs/NameAndUrl.md new file mode 100644 index 0000000..829b4db --- /dev/null +++ b/crates/rocie-client/docs/NameAndUrl.md @@ -0,0 +1,12 @@ +# NameAndUrl + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/PasswordHash.md b/crates/rocie-client/docs/PasswordHash.md index 208e234..ac022d2 100644 --- a/crates/rocie-client/docs/PasswordHash.md +++ b/crates/rocie-client/docs/PasswordHash.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ---------- | ----------- | ----- | -| **value** | **String** | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/Product.md b/crates/rocie-client/docs/Product.md index 7e4bdf6..b04a9f1 100644 --- a/crates/rocie-client/docs/Product.md +++ b/crates/rocie-client/docs/Product.md @@ -2,15 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| ------------------------ | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------- | -| **associated_bar_codes** | [**Vec<models::Barcode>**](Barcode.md) | Which barcodes are associated with this product. | -| **description** | Option\<**String**> | An optional description of this product. | [optional] | -| **id** | [**models::ProductId**](ProductId.md) | The id of the product. | -| **name** | **String** | The name of the product. This should be globally unique, to make searching easier for the user. | -| **parent** | Option\<[**models::ProductParentId**](ProductParentId.md)> | The parent this product has. This is effectively it's anchor in the product DAG. | [optional] | -| **unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | The property this product is measured in. (This is probably always either Mass, Volume or Quantity). | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**associated_bar_codes** | [**Vec<models::Barcode>**](Barcode.md) | Which barcodes are associated with this product. | +**description** | Option<**String**> | An optional description of this product. | [optional] +**id** | [**models::ProductId**](ProductId.md) | The id of the product. | +**name** | **String** | The name of the product. This should be globally unique, to make searching easier for the user. | +**parent** | Option<[**models::ProductParentId**](ProductParentId.md)> | The parent this product has. This is effectively it's anchor in the product DAG. None means, that it has no parents and as such is in the toplevel. | [optional] +**unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | The property this product is measured in. (This is probably always either Mass, Volume or Quantity). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/ProductAmount.md b/crates/rocie-client/docs/ProductAmount.md index 7a841bf..ac5d9cc 100644 --- a/crates/rocie-client/docs/ProductAmount.md +++ b/crates/rocie-client/docs/ProductAmount.md @@ -2,11 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| -------------- | --------------------------------------- | ----------- | ----- | -| **amount** | [**models::UnitAmount**](UnitAmount.md) | | -| **product_id** | [**models::ProductId**](ProductId.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | [**models::UnitAmount**](UnitAmount.md) | | +**product_id** | [**models::ProductId**](ProductId.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ProductId.md b/crates/rocie-client/docs/ProductId.md index af4e0a9..90dc866 100644 --- a/crates/rocie-client/docs/ProductId.md +++ b/crates/rocie-client/docs/ProductId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/ProductParent.md b/crates/rocie-client/docs/ProductParent.md index 8cb0028..a63384b 100644 --- a/crates/rocie-client/docs/ProductParent.md +++ b/crates/rocie-client/docs/ProductParent.md @@ -2,13 +2,13 @@ ## Properties -| Name | Type | Description | Notes | -| --------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------- | -| **description** | Option\<**String**> | An optional description of this product parent. | [optional] | -| **id** | [**models::ProductParentId**](ProductParentId.md) | The id of the product parent. | -| **name** | **String** | The name of the product parent. This should be globally unique, to make searching easier for the user. | -| **parent** | Option\<[**models::ProductParentId**](ProductParentId.md)> | The optional id of the parent of this product parent. This must not form a cycle. | [optional] | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An optional description of this product parent. | [optional] +**id** | [**models::ProductParentId**](ProductParentId.md) | The id of the product parent. | +**name** | **String** | The name of the product parent. This should be globally unique, to make searching easier for the user. | +**parent** | Option<[**models::ProductParentId**](ProductParentId.md)> | The optional id of the parent of this product parent. This must not form a cycle. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ProductParentId.md b/crates/rocie-client/docs/ProductParentId.md index 49f4e17..c9163f4 100644 --- a/crates/rocie-client/docs/ProductParentId.md +++ b/crates/rocie-client/docs/ProductParentId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/ProductParentStub.md b/crates/rocie-client/docs/ProductParentStub.md index a8a3544..c15118e 100644 --- a/crates/rocie-client/docs/ProductParentStub.md +++ b/crates/rocie-client/docs/ProductParentStub.md @@ -2,12 +2,12 @@ ## Properties -| Name | Type | Description | Notes | -| --------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------- | -| **description** | Option\<**String**> | A description. | [optional] | -| **name** | **String** | The name of the product parent | -| **parent** | Option\<[**models::ProductParentId**](ProductParentId.md)> | A parent of this product parent, otherwise the parent will be the root of the parent tree. | [optional] | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | A description. | [optional] +**name** | **String** | The name of the product parent | +**parent** | Option<[**models::ProductParentId**](ProductParentId.md)> | A parent of this product parent, otherwise the parent will be the root of the parent tree. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/ProductStub.md b/crates/rocie-client/docs/ProductStub.md index 3c25dd4..10d783b 100644 --- a/crates/rocie-client/docs/ProductStub.md +++ b/crates/rocie-client/docs/ProductStub.md @@ -2,13 +2,13 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------- | ---------- | -| **description** | Option\<**String**> | A description. | [optional] | -| **name** | **String** | The name of the product | -| **parent** | Option\<[**models::ProductParentId**](ProductParentId.md)> | A parent of this product, otherwise the parent will be the root of the parent tree. | [optional] | -| **unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | The Unit Property to use for this product. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | A description. | [optional] +**name** | **String** | The name of the product | +**parent** | Option<[**models::ProductParentId**](ProductParentId.md)> | A parent of this product, otherwise the parent will be the root of the parent tree. | [optional] +**unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | The Unit Property to use for this product. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Recipe.md b/crates/rocie-client/docs/Recipe.md index d2aa0f9..1c088a6 100644 --- a/crates/rocie-client/docs/Recipe.md +++ b/crates/rocie-client/docs/Recipe.md @@ -2,12 +2,13 @@ ## Properties -| Name | Type | Description | Notes | -| ----------- | ----------------------------------- | ----------- | ----- | -| **content** | **String** | | -| **id** | [**models::RecipeId**](RecipeId.md) | | -| **path** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [**models::CooklangRecipe**](CooklangRecipe.md) | The actual content of this recipe. | +**id** | [**models::RecipeId**](RecipeId.md) | The unique id of this recipe. | +**name** | **String** | The name of the recipe. This should be globally unique, to make searching easier for the user. | +**parent** | Option<[**models::RecipeParentId**](RecipeParentId.md)> | The parent this recipe has. This is effectively it's anchor in the recipe DAG. None means, that it has no parents and as such is in the toplevel. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/RecipeId.md b/crates/rocie-client/docs/RecipeId.md index 812de9a..5211596 100644 --- a/crates/rocie-client/docs/RecipeId.md +++ b/crates/rocie-client/docs/RecipeId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/RecipeParent.md b/crates/rocie-client/docs/RecipeParent.md new file mode 100644 index 0000000..3c0c462 --- /dev/null +++ b/crates/rocie-client/docs/RecipeParent.md @@ -0,0 +1,14 @@ +# RecipeParent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An optional description of this recipe parent. | [optional] +**id** | [**models::RecipeParentId**](RecipeParentId.md) | The id of the recipe parent. | +**name** | **String** | The name of the recipe parent. This should be globally unique, to make searching easier for the user. | +**parent** | Option<[**models::RecipeParentId**](RecipeParentId.md)> | The optional id of the parent of this recipe parent. This must not form a cycle. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/RecipeParentId.md b/crates/rocie-client/docs/RecipeParentId.md new file mode 100644 index 0000000..96737d2 --- /dev/null +++ b/crates/rocie-client/docs/RecipeParentId.md @@ -0,0 +1,11 @@ +# RecipeParentId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/RecipeParentStub.md b/crates/rocie-client/docs/RecipeParentStub.md new file mode 100644 index 0000000..92d8b6d --- /dev/null +++ b/crates/rocie-client/docs/RecipeParentStub.md @@ -0,0 +1,13 @@ +# RecipeParentStub + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | A description. | [optional] +**name** | **String** | The name of the recipe parent | +**parent** | Option<[**models::RecipeParentId**](RecipeParentId.md)> | A parent of this recipe parent, otherwise the parent will be the root of the parent tree. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/RecipeStub.md b/crates/rocie-client/docs/RecipeStub.md index b123337..d1c8a53 100644 --- a/crates/rocie-client/docs/RecipeStub.md +++ b/crates/rocie-client/docs/RecipeStub.md @@ -2,11 +2,12 @@ ## Properties -| Name | Type | Description | Notes | -| ----------- | ---------- | ---------------------------------------------- | ----- | -| **content** | **String** | The content of this recipe, in cooklang format | -| **path** | **String** | The path the recipe should have | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | The content of this recipe, in cooklang format | +**name** | **String** | The globally unique name of this recipe | +**parent** | Option<[**models::RecipeParentId**](RecipeParentId.md)> | The optional parent of this recipe. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/RefinedRecipe.md b/crates/rocie-client/docs/RefinedRecipe.md new file mode 100644 index 0000000..bc3dcd0 --- /dev/null +++ b/crates/rocie-client/docs/RefinedRecipe.md @@ -0,0 +1,12 @@ +# RefinedRecipe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | [**models::RecipeId**](RecipeId.md) | The unique id of this refined recipe's original recipe. | +**ingridients** | [**Vec<models::ProductId>**](ProductId.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Section.md b/crates/rocie-client/docs/Section.md new file mode 100644 index 0000000..2a6de45 --- /dev/null +++ b/crates/rocie-client/docs/Section.md @@ -0,0 +1,12 @@ +# Section + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [**Vec<models::Content>**](Content.md) | Content inside | +**name** | Option<**String**> | Name of the section | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Step.md b/crates/rocie-client/docs/Step.md new file mode 100644 index 0000000..162c52f --- /dev/null +++ b/crates/rocie-client/docs/Step.md @@ -0,0 +1,12 @@ +# Step + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**Vec<models::Item>**](Item.md) | [`Item`]s inside | +**number** | **u32** | Step number The step numbers start at 1 in each section and increase with non text step. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Timer.md b/crates/rocie-client/docs/Timer.md new file mode 100644 index 0000000..0e65ee7 --- /dev/null +++ b/crates/rocie-client/docs/Timer.md @@ -0,0 +1,12 @@ +# Timer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | Name | [optional] +**quantity** | [**models::UnitAmount**](UnitAmount.md) | Time quantity | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/Unit.md b/crates/rocie-client/docs/Unit.md index 2db7b1a..5349b7a 100644 --- a/crates/rocie-client/docs/Unit.md +++ b/crates/rocie-client/docs/Unit.md @@ -2,15 +2,15 @@ ## Properties -| Name | Type | Description | Notes | -| ---------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -| **description** | Option\<**String**> | Description of this unit. | [optional] | -| **full_name_plural** | **String** | The plural version of this unit's name. Is used by a value of two and more. (We do not support Slovenian dual numerus versions) E.g.: Kilogram -> Kilograms gram -> meters | -| **full_name_singular** | **String** | The singular version of this unit's name. E.g.: Kilogram Gram | -| **id** | [**models::UnitId**](UnitId.md) | Unique id for this unit. | -| **short_name** | **String** | Short name or abbreviation of this unit. E.g.: kg for Kilogram g for gram m for meter | -| **unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | Which property is described by this unit. E.g.: kg -> Mass L -> Volume m/s -> Speed and so forth | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | Description of this unit. | [optional] +**full_name_plural** | **String** | The plural version of this unit's name. Is used by a value of two and more. (We do not support Slovenian dual numerus versions) E.g.: Kilogram -> Kilograms gram -> meters | +**full_name_singular** | **String** | The singular version of this unit's name. E.g.: Kilogram Gram | +**id** | [**models::UnitId**](UnitId.md) | Unique id for this unit. | +**short_name** | **String** | Short name or abbreviation of this unit. E.g.: kg for Kilogram g for gram m for meter | +**unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | Which property is described by this unit. E.g.: kg -> Mass L -> Volume m/s -> Speed and so forth | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/UnitAmount.md b/crates/rocie-client/docs/UnitAmount.md index 1bb855d..1546f57 100644 --- a/crates/rocie-client/docs/UnitAmount.md +++ b/crates/rocie-client/docs/UnitAmount.md @@ -2,11 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **unit** | [**models::UnitId**](UnitId.md) | | -| **value** | **u32** | | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unit** | [**models::UnitId**](UnitId.md) | | +**value** | **u32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/UnitId.md b/crates/rocie-client/docs/UnitId.md index 551eda2..7d0979c 100644 --- a/crates/rocie-client/docs/UnitId.md +++ b/crates/rocie-client/docs/UnitId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/UnitProperty.md b/crates/rocie-client/docs/UnitProperty.md index fc6bfc9..b560f0c 100644 --- a/crates/rocie-client/docs/UnitProperty.md +++ b/crates/rocie-client/docs/UnitProperty.md @@ -2,13 +2,13 @@ ## Properties -| Name | Type | Description | Notes | -| --------------- | ----------------------------------------------- | ------------------------------------------- | ---------- | -| **description** | Option\<**String**> | An description of this property. | [optional] | -| **id** | [**models::UnitPropertyId**](UnitPropertyId.md) | The unique ID for this unit property. | -| **name** | **String** | The user-displayed name of this property. | -| **units** | [**Vec<models::UnitId>**](UnitId.md) | The units with are measuring this property. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An description of this property. | [optional] +**id** | [**models::UnitPropertyId**](UnitPropertyId.md) | The unique ID for this unit property. | +**name** | **String** | The user-displayed name of this property. | +**units** | [**Vec<models::UnitId>**](UnitId.md) | The units with are measuring this property. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/UnitPropertyId.md b/crates/rocie-client/docs/UnitPropertyId.md index 7a228c1..34d572f 100644 --- a/crates/rocie-client/docs/UnitPropertyId.md +++ b/crates/rocie-client/docs/UnitPropertyId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/UnitPropertyStub.md b/crates/rocie-client/docs/UnitPropertyStub.md index e537d6f..0fae3f7 100644 --- a/crates/rocie-client/docs/UnitPropertyStub.md +++ b/crates/rocie-client/docs/UnitPropertyStub.md @@ -2,11 +2,11 @@ ## Properties -| Name | Type | Description | Notes | -| --------------- | ------------------- | --------------------------------------------- | ---------- | -| **description** | Option\<**String**> | An optional description of the unit property. | [optional] | -| **name** | **String** | The name of the unit property. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An optional description of the unit property. | [optional] +**name** | **String** | The name of the unit property. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/UnitStub.md b/crates/rocie-client/docs/UnitStub.md index 5b89817..92398c5 100644 --- a/crates/rocie-client/docs/UnitStub.md +++ b/crates/rocie-client/docs/UnitStub.md @@ -2,14 +2,14 @@ ## Properties -| Name | Type | Description | Notes | -| ---------------------- | ----------------------------------------------- | ----------- | ---------- | -| **description** | Option\<**String**> | | [optional] | -| **full_name_plural** | **String** | | -| **full_name_singular** | **String** | | -| **short_name** | **String** | | -| **unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**full_name_plural** | **String** | | +**full_name_singular** | **String** | | +**short_name** | **String** | | +**unit_property** | [**models::UnitPropertyId**](UnitPropertyId.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/User.md b/crates/rocie-client/docs/User.md index 016740a..d0f2a81 100644 --- a/crates/rocie-client/docs/User.md +++ b/crates/rocie-client/docs/User.md @@ -2,13 +2,13 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ------------------------------------------- | ------------------------------------- | ---------- | -| **description** | Option\<**String**> | An description of this user. | [optional] | -| **id** | [**models::UserId**](UserId.md) | The unique ID for this user. | -| **name** | **String** | The user-displayed name of this user. | -| **password_hash** | [**models::PasswordHash**](PasswordHash.md) | The hash of the user's password. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An description of this user. | [optional] +**id** | [**models::UserId**](UserId.md) | The unique ID for this user. | +**name** | **String** | The user-displayed name of this user. | +**password_hash** | [**models::PasswordHash**](PasswordHash.md) | The hash of the user's password. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/docs/UserId.md b/crates/rocie-client/docs/UserId.md index b58b3dc..f183106 100644 --- a/crates/rocie-client/docs/UserId.md +++ b/crates/rocie-client/docs/UserId.md @@ -2,10 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| --------- | ------------------------------- | ----------- | ----- | -| **value** | [**uuid::Uuid**](uuid::Uuid.md) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**uuid::Uuid**](uuid::Uuid.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/crates/rocie-client/docs/UserStub.md b/crates/rocie-client/docs/UserStub.md index ef83846..60bd072 100644 --- a/crates/rocie-client/docs/UserStub.md +++ b/crates/rocie-client/docs/UserStub.md @@ -2,12 +2,12 @@ ## Properties -| Name | Type | Description | Notes | -| --------------- | ------------------- | ---------------------------------------- | ---------- | -| **description** | Option\<**String**> | An optional description of the new user. | [optional] | -| **name** | **String** | The name of the new user. | -| **password** | **String** | The password of the new user. | - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | An optional description of the new user. | [optional] +**name** | **String** | The name of the new user. | +**password** | **String** | The password of the new user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/rocie-client/src/apis/api_get_auth_inventory_api.rs b/crates/rocie-client/src/apis/api_get_auth_inventory_api.rs index a8b1684..ff7125f 100644 --- a/crates/rocie-client/src/apis/api_get_auth_inventory_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_inventory_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`amount_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -23,18 +25,12 @@ pub enum AmountByIdError { UnknownValue(serde_json::Value), } -pub async fn amount_by_id( - configuration: &configuration::Configuration, - id: models::ProductId, -) -> Result<models::ProductAmount, Error<AmountByIdError>> { + +pub async fn amount_by_id(configuration: &configuration::Configuration, id: models::ProductId) -> Result<models::ProductAmount, Error<AmountByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/inventory/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/inventory/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -56,24 +52,13 @@ pub async fn amount_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::ProductAmount`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::ProductAmount`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProductAmount`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProductAmount`")))), } } else { let content = resp.text().await?; let entity: Option<AmountByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_get_auth_product_api.rs b/crates/rocie-client/src/apis/api_get_auth_product_api.rs index e6a3db2..969d4e2 100644 --- a/crates/rocie-client/src/apis/api_get_auth_product_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_product_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`product_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -80,18 +82,21 @@ pub enum ProductsRegisteredError { UnknownValue(serde_json::Value), } -pub async fn product_by_id( - configuration: &configuration::Configuration, - id: models::ProductId, -) -> Result<models::Product, Error<ProductByIdError>> { +/// struct for typed errors of method [`products_without_product_parent`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProductsWithoutProductParentError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + + +pub async fn product_by_id(configuration: &configuration::Configuration, id: models::ProductId) -> Result<models::Product, Error<ProductByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/product/by-id/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/product/by-id/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -113,40 +118,21 @@ pub async fn product_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::Product`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::Product`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Product`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Product`")))), } } else { let content = resp.text().await?; let entity: Option<ProductByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn product_by_name( - configuration: &configuration::Configuration, - name: &str, -) -> Result<models::Product, Error<ProductByNameError>> { +pub async fn product_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::Product, Error<ProductByNameError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_name = name; + let p_path_name = name; - let uri_str = format!( - "{}/product/by-name/{name}", - configuration.base_path, - name = crate::apis::urlencode(p_name) - ); + let uri_str = format!("{}/product/by-name/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_name)); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -168,40 +154,21 @@ pub async fn product_by_name( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::Product`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::Product`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Product`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Product`")))), } } else { let content = resp.text().await?; let entity: Option<ProductByNameError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn product_suggestion_by_name( - configuration: &configuration::Configuration, - name: &str, -) -> Result<Vec<models::Product>, Error<ProductSuggestionByNameError>> { +pub async fn product_suggestion_by_name(configuration: &configuration::Configuration, name: &str) -> Result<Vec<models::Product>, Error<ProductSuggestionByNameError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_name = name; + let p_path_name = name; - let uri_str = format!( - "{}/product/by-part-name/{name}", - configuration.base_path, - name = crate::apis::urlencode(p_name) - ); + let uri_str = format!("{}/product/by-part-name/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_name)); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -223,41 +190,22 @@ pub async fn product_suggestion_by_name( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductSuggestionByNameError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } /// This will only return products directly associated with this product parent id -pub async fn products_by_product_parent_id_direct( - configuration: &configuration::Configuration, - id: models::ProductParentId, -) -> Result<Vec<models::Product>, Error<ProductsByProductParentIdDirectError>> { +pub async fn products_by_product_parent_id_direct(configuration: &configuration::Configuration, id: models::ProductParentId) -> Result<Vec<models::Product>, Error<ProductsByProductParentIdDirectError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/product/by-product-parent-id-direct/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/product/by-product-parent-id-direct/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -279,42 +227,22 @@ pub async fn products_by_product_parent_id_direct( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), } } else { let content = resp.text().await?; - let entity: Option<ProductsByProductParentIdDirectError> = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + let entity: Option<ProductsByProductParentIdDirectError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } /// This will also return all products below this product parent id -pub async fn products_by_product_parent_id_indirect( - configuration: &configuration::Configuration, - id: models::ProductParentId, -) -> Result<Vec<models::Product>, Error<ProductsByProductParentIdIndirectError>> { +pub async fn products_by_product_parent_id_indirect(configuration: &configuration::Configuration, id: models::ProductParentId) -> Result<Vec<models::Product>, Error<ProductsByProductParentIdIndirectError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/product/by-product-parent-id-indirect/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/product/by-product-parent-id-indirect/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -336,32 +264,18 @@ pub async fn products_by_product_parent_id_indirect( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), } } else { let content = resp.text().await?; - let entity: Option<ProductsByProductParentIdIndirectError> = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + let entity: Option<ProductsByProductParentIdIndirectError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn products_in_storage( - configuration: &configuration::Configuration, -) -> Result<Vec<models::Product>, Error<ProductsInStorageError>> { +pub async fn products_in_storage(configuration: &configuration::Configuration, ) -> Result<Vec<models::Product>, Error<ProductsInStorageError>> { + let uri_str = format!("{}/products_in_storage/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -384,31 +298,18 @@ pub async fn products_in_storage( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductsInStorageError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn products_registered( - configuration: &configuration::Configuration, -) -> Result<Vec<models::Product>, Error<ProductsRegisteredError>> { +pub async fn products_registered(configuration: &configuration::Configuration, ) -> Result<Vec<models::Product>, Error<ProductsRegisteredError>> { + let uri_str = format!("{}/products_registered/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -431,24 +332,48 @@ pub async fn products_registered( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductsRegisteredError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + +/// This will only return products without a product parent associated with it +pub async fn products_without_product_parent(configuration: &configuration::Configuration, ) -> Result<Vec<models::Product>, Error<ProductsWithoutProductParentError>> { + + let uri_str = format!("{}/product/without-product-parent", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Product>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Product>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<ProductsWithoutProductParentError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_get_auth_product_parent_api.rs b/crates/rocie-client/src/apis/api_get_auth_product_parent_api.rs index b29a155..05f277f 100644 --- a/crates/rocie-client/src/apis/api_get_auth_product_parent_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_product_parent_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`product_parents`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -40,9 +42,9 @@ pub enum ProductParentsUnderError { UnknownValue(serde_json::Value), } -pub async fn product_parents( - configuration: &configuration::Configuration, -) -> Result<Vec<models::ProductParent>, Error<ProductParentsError>> { + +pub async fn product_parents(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProductParent>, Error<ProductParentsError>> { + let uri_str = format!("{}/product_parents/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -65,31 +67,18 @@ pub async fn product_parents( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductParentsError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn product_parents_toplevel( - configuration: &configuration::Configuration, -) -> Result<Vec<models::ProductParent>, Error<ProductParentsToplevelError>> { +pub async fn product_parents_toplevel(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProductParent>, Error<ProductParentsToplevelError>> { + let uri_str = format!("{}/product_parents_toplevel/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -112,40 +101,21 @@ pub async fn product_parents_toplevel( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductParentsToplevelError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn product_parents_under( - configuration: &configuration::Configuration, - id: models::ProductParentId, -) -> Result<Vec<models::ProductParent>, Error<ProductParentsUnderError>> { +pub async fn product_parents_under(configuration: &configuration::Configuration, id: models::ProductParentId) -> Result<Vec<models::ProductParent>, Error<ProductParentsUnderError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/product_parents_under/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/product_parents_under/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -167,24 +137,13 @@ pub async fn product_parents_under( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProductParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProductParent>`")))), } } else { let content = resp.text().await?; let entity: Option<ProductParentsUnderError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_get_auth_recipe_api.rs b/crates/rocie-client/src/apis/api_get_auth_recipe_api.rs index 90420c9..10bf3e1 100644 --- a/crates/rocie-client/src/apis/api_get_auth_recipe_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_recipe_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`recipe_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -23,6 +25,16 @@ pub enum RecipeByIdError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`recipe_by_name`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipeByNameError { + Status401(), + Status404(), + Status500(String), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`recipes`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -32,18 +44,41 @@ pub enum RecipesError { UnknownValue(serde_json::Value), } -pub async fn recipe_by_id( - configuration: &configuration::Configuration, - id: models::RecipeId, -) -> Result<models::Recipe, Error<RecipeByIdError>> { +/// struct for typed errors of method [`recipes_by_recipe_parent_id_direct`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipesByRecipeParentIdDirectError { + Status401(), + Status404(), + Status500(String), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`recipes_by_recipe_parent_id_indirect`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipesByRecipeParentIdIndirectError { + Status401(), + Status404(), + Status500(String), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`recipes_without_recipe_parent`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipesWithoutRecipeParentError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + + +pub async fn recipe_by_id(configuration: &configuration::Configuration, id: models::RecipeId) -> Result<models::Recipe, Error<RecipeByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/recipe/by-id/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/recipe/by-id/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -65,31 +100,54 @@ pub async fn recipe_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::Recipe`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::Recipe`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Recipe`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Recipe`")))), } } else { let content = resp.text().await?; let entity: Option<RecipeByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn recipes( - configuration: &configuration::Configuration, -) -> Result<models::Recipe, Error<RecipesError>> { +pub async fn recipe_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::Recipe, Error<RecipeByNameError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_name = name; + + let uri_str = format!("{}/recipe/by-name/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_name)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Recipe`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Recipe`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipeByNameError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn recipes(configuration: &configuration::Configuration, ) -> Result<Vec<models::Recipe>, Error<RecipesError>> { + let uri_str = format!("{}/recipe/all", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -112,24 +170,122 @@ pub async fn recipes( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::Recipe`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::Recipe`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Recipe>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Recipe>`")))), } } else { let content = resp.text().await?; let entity: Option<RecipesError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + +/// This will only return recipes directly associated with this recipe parent id +pub async fn recipes_by_recipe_parent_id_direct(configuration: &configuration::Configuration, id: models::RecipeParentId) -> Result<Vec<models::Recipe>, Error<RecipesByRecipeParentIdDirectError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!("{}/recipe/by-recipe-parent-id-direct/{id}", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Recipe>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Recipe>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipesByRecipeParentIdDirectError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// This will also return all recipes below this recipe parent id +pub async fn recipes_by_recipe_parent_id_indirect(configuration: &configuration::Configuration, id: models::RecipeParentId) -> Result<Vec<models::Recipe>, Error<RecipesByRecipeParentIdIndirectError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!("{}/recipe/by-recipe-parent-id-indirect/{id}", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Recipe>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Recipe>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipesByRecipeParentIdIndirectError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// This will only return recipes without a recipe parent associated with it +pub async fn recipes_without_recipe_parent(configuration: &configuration::Configuration, ) -> Result<Vec<models::Recipe>, Error<RecipesWithoutRecipeParentError>> { + + let uri_str = format!("{}/recipe/without-recipe-parent", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Recipe>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Recipe>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipesWithoutRecipeParentError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_get_auth_recipe_parent_api.rs b/crates/rocie-client/src/apis/api_get_auth_recipe_parent_api.rs new file mode 100644 index 0000000..1aef8f8 --- /dev/null +++ b/crates/rocie-client/src/apis/api_get_auth_recipe_parent_api.rs @@ -0,0 +1,149 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`recipe_parents`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipeParentsError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`recipe_parents_toplevel`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipeParentsToplevelError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`recipe_parents_under`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RecipeParentsUnderError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + + +pub async fn recipe_parents(configuration: &configuration::Configuration, ) -> Result<Vec<models::RecipeParent>, Error<RecipeParentsError>> { + + let uri_str = format!("{}/recipe_parents/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::RecipeParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::RecipeParent>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipeParentsError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn recipe_parents_toplevel(configuration: &configuration::Configuration, ) -> Result<Vec<models::RecipeParent>, Error<RecipeParentsToplevelError>> { + + let uri_str = format!("{}/recipe_parents_toplevel/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::RecipeParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::RecipeParent>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipeParentsToplevelError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn recipe_parents_under(configuration: &configuration::Configuration, id: models::RecipeParentId) -> Result<Vec<models::RecipeParent>, Error<RecipeParentsUnderError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!("{}/recipe_parents_under/{id}", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::RecipeParent>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::RecipeParent>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RecipeParentsUnderError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_get_auth_refined_recipe_api.rs b/crates/rocie-client/src/apis/api_get_auth_refined_recipe_api.rs new file mode 100644 index 0000000..63a0d5d --- /dev/null +++ b/crates/rocie-client/src/apis/api_get_auth_refined_recipe_api.rs @@ -0,0 +1,64 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`refined_recipe_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RefinedRecipeByIdError { + Status401(), + Status404(), + Status500(String), + UnknownValue(serde_json::Value), +} + + +pub async fn refined_recipe_by_id(configuration: &configuration::Configuration, id: models::RecipeId) -> Result<models::RefinedRecipe, Error<RefinedRecipeByIdError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!("{}/refined-recipe/by-id/{id}", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefinedRecipe`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RefinedRecipe`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RefinedRecipeByIdError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_get_auth_unit_api.rs b/crates/rocie-client/src/apis/api_get_auth_unit_api.rs index 5d17a74..caf3ab4 100644 --- a/crates/rocie-client/src/apis/api_get_auth_unit_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_unit_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`unit_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -41,18 +43,12 @@ pub enum UnitsByPropertyIdError { UnknownValue(serde_json::Value), } -pub async fn unit_by_id( - configuration: &configuration::Configuration, - id: models::UnitId, -) -> Result<models::Unit, Error<UnitByIdError>> { + +pub async fn unit_by_id(configuration: &configuration::Configuration, id: models::UnitId) -> Result<models::Unit, Error<UnitByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/unit/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/unit/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -74,31 +70,18 @@ pub async fn unit_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::Unit`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::Unit`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Unit`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Unit`")))), } } else { let content = resp.text().await?; let entity: Option<UnitByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn units( - configuration: &configuration::Configuration, -) -> Result<Vec<models::Unit>, Error<UnitsError>> { +pub async fn units(configuration: &configuration::Configuration, ) -> Result<Vec<models::Unit>, Error<UnitsError>> { + let uri_str = format!("{}/units/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -121,40 +104,21 @@ pub async fn units( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Unit>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Unit>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Unit>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Unit>`")))), } } else { let content = resp.text().await?; let entity: Option<UnitsError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn units_by_property_id( - configuration: &configuration::Configuration, - id: models::UnitPropertyId, -) -> Result<Vec<models::Unit>, Error<UnitsByPropertyIdError>> { +pub async fn units_by_property_id(configuration: &configuration::Configuration, id: models::UnitPropertyId) -> Result<Vec<models::Unit>, Error<UnitsByPropertyIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/units-by-property/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/units-by-property/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -176,24 +140,13 @@ pub async fn units_by_property_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::Unit>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Unit>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Unit>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Unit>`")))), } } else { let content = resp.text().await?; let entity: Option<UnitsByPropertyIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_get_auth_unit_property_api.rs b/crates/rocie-client/src/apis/api_get_auth_unit_property_api.rs index a2ac138..7e1b1a9 100644 --- a/crates/rocie-client/src/apis/api_get_auth_unit_property_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_unit_property_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`unit_properties`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -32,9 +34,9 @@ pub enum UnitPropertyByIdError { UnknownValue(serde_json::Value), } -pub async fn unit_properties( - configuration: &configuration::Configuration, -) -> Result<Vec<models::UnitProperty>, Error<UnitPropertiesError>> { + +pub async fn unit_properties(configuration: &configuration::Configuration, ) -> Result<Vec<models::UnitProperty>, Error<UnitPropertiesError>> { + let uri_str = format!("{}/unit-properties/", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -57,40 +59,21 @@ pub async fn unit_properties( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::UnitProperty>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UnitProperty>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UnitProperty>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UnitProperty>`")))), } } else { let content = resp.text().await?; let entity: Option<UnitPropertiesError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn unit_property_by_id( - configuration: &configuration::Configuration, - id: models::UnitPropertyId, -) -> Result<models::UnitProperty, Error<UnitPropertyByIdError>> { +pub async fn unit_property_by_id(configuration: &configuration::Configuration, id: models::UnitPropertyId) -> Result<models::UnitProperty, Error<UnitPropertyByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/unit-property/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/unit-property/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -112,24 +95,13 @@ pub async fn unit_property_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::UnitProperty`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::UnitProperty`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UnitProperty`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UnitProperty`")))), } } else { let content = resp.text().await?; let entity: Option<UnitPropertyByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_get_auth_user_api.rs b/crates/rocie-client/src/apis/api_get_auth_user_api.rs index 64d4671..5d98f15 100644 --- a/crates/rocie-client/src/apis/api_get_auth_user_api.rs +++ b/crates/rocie-client/src/apis/api_get_auth_user_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`user_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -33,18 +35,12 @@ pub enum UsersError { UnknownValue(serde_json::Value), } -pub async fn user_by_id( - configuration: &configuration::Configuration, - id: models::UserId, -) -> Result<models::User, Error<UserByIdError>> { + +pub async fn user_by_id(configuration: &configuration::Configuration, id: models::UserId) -> Result<models::User, Error<UserByIdError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; + let p_path_id = id; - let uri_str = format!( - "{}/user/{id}", - configuration.base_path, - id = p_id.to_string() - ); + let uri_str = format!("{}/user/{id}", configuration.base_path, id=p_path_id.to_string()); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); if let Some(ref user_agent) = configuration.user_agent { @@ -66,31 +62,18 @@ pub async fn user_by_id( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::User`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::User`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), } } else { let content = resp.text().await?; let entity: Option<UserByIdError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn users( - configuration: &configuration::Configuration, -) -> Result<Vec<models::User>, Error<UsersError>> { +pub async fn users(configuration: &configuration::Configuration, ) -> Result<Vec<models::User>, Error<UsersError>> { + let uri_str = format!("{}/users", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -113,24 +96,13 @@ pub async fn users( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `Vec<models::User>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), } } else { let content = resp.text().await?; let entity: Option<UsersError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_get_no_auth_state_api.rs b/crates/rocie-client/src/apis/api_get_no_auth_state_api.rs new file mode 100644 index 0000000..c4ec2cd --- /dev/null +++ b/crates/rocie-client/src/apis/api_get_no_auth_state_api.rs @@ -0,0 +1,101 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`can_be_provisioned`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CanBeProvisionedError { + Status500(String), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`is_logged_in`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IsLoggedInError { + UnknownValue(serde_json::Value), +} + + +pub async fn can_be_provisioned(configuration: &configuration::Configuration, ) -> Result<bool, Error<CanBeProvisionedError>> { + + let uri_str = format!("{}/can-be-provisioned", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `bool`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<CanBeProvisionedError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn is_logged_in(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsLoggedInError>> { + + let uri_str = format!("{}/is-logged-in", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `bool`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<IsLoggedInError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_set_auth_barcode_api.rs b/crates/rocie-client/src/apis/api_set_auth_barcode_api.rs index 55f813e..066d8e1 100644 --- a/crates/rocie-client/src/apis/api_set_auth_barcode_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_barcode_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`buy_barcode`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -33,24 +35,14 @@ pub enum ConsumeBarcodeError { UnknownValue(serde_json::Value), } -pub async fn buy_barcode( - configuration: &configuration::Configuration, - barcode_id: models::BarcodeId, - times: u32, -) -> Result<(), Error<BuyBarcodeError>> { + +pub async fn buy_barcode(configuration: &configuration::Configuration, barcode_id: models::BarcodeId, times: u32) -> Result<(), Error<BuyBarcodeError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_barcode_id = barcode_id; - let p_times = times; - - let uri_str = format!( - "{}/barcode/{barcode_id}/buy/{times}", - configuration.base_path, - barcode_id = p_barcode_id.to_string(), - times = p_times - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let p_path_barcode_id = barcode_id; + let p_path_times = times; + + let uri_str = format!("{}/barcode/{barcode_id}/buy/{times}", configuration.base_path, barcode_id=p_path_barcode_id.to_string(), times=p_path_times); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); @@ -66,36 +58,22 @@ pub async fn buy_barcode( } else { let content = resp.text().await?; let entity: Option<BuyBarcodeError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn consume_barcode( - configuration: &configuration::Configuration, - id: models::BarcodeId, - unit_amount: models::UnitAmount, -) -> Result<(), Error<ConsumeBarcodeError>> { +pub async fn consume_barcode(configuration: &configuration::Configuration, id: models::BarcodeId, unit_amount: models::UnitAmount) -> Result<(), Error<ConsumeBarcodeError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; - let p_unit_amount = unit_amount; - - let uri_str = format!( - "{}/barcode/{id}/consume", - configuration.base_path, - id = p_id.to_string() - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let p_path_id = id; + let p_body_unit_amount = unit_amount; + + let uri_str = format!("{}/barcode/{id}/consume", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_unit_amount); + req_builder = req_builder.json(&p_body_unit_amount); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -107,10 +85,7 @@ pub async fn consume_barcode( } else { let content = resp.text().await?; let entity: Option<ConsumeBarcodeError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_product_api.rs b/crates/rocie-client/src/apis/api_set_auth_product_api.rs index e29c7f1..3b4ed2f 100644 --- a/crates/rocie-client/src/apis/api_set_auth_product_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_product_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`associate_barcode`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -33,28 +35,19 @@ pub enum RegisterProductError { UnknownValue(serde_json::Value), } -pub async fn associate_barcode( - configuration: &configuration::Configuration, - id: models::ProductId, - barcode: models::Barcode, -) -> Result<(), Error<AssociateBarcodeError>> { + +pub async fn associate_barcode(configuration: &configuration::Configuration, id: models::ProductId, barcode: models::Barcode) -> Result<(), Error<AssociateBarcodeError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; - let p_barcode = barcode; - - let uri_str = format!( - "{}/product/{id}/associate", - configuration.base_path, - id = p_id.to_string() - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let p_path_id = id; + let p_body_barcode = barcode; + + let uri_str = format!("{}/product/{id}/associate", configuration.base_path, id=p_path_id.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_barcode); + req_builder = req_builder.json(&p_body_barcode); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -66,30 +59,21 @@ pub async fn associate_barcode( } else { let content = resp.text().await?; let entity: Option<AssociateBarcodeError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn register_product( - configuration: &configuration::Configuration, - product_stub: models::ProductStub, -) -> Result<models::ProductId, Error<RegisterProductError>> { +pub async fn register_product(configuration: &configuration::Configuration, product_stub: models::ProductStub) -> Result<models::ProductId, Error<RegisterProductError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_product_stub = product_stub; + let p_body_product_stub = product_stub; let uri_str = format!("{}/product/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_product_stub); + req_builder = req_builder.json(&p_body_product_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -106,24 +90,13 @@ pub async fn register_product( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::ProductId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::ProductId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProductId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProductId`")))), } } else { let content = resp.text().await?; let entity: Option<RegisterProductError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_product_parent_api.rs b/crates/rocie-client/src/apis/api_set_auth_product_parent_api.rs index f42dd99..990554c 100644 --- a/crates/rocie-client/src/apis/api_set_auth_product_parent_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_product_parent_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`register_product_parent`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -22,22 +24,18 @@ pub enum RegisterProductParentError { UnknownValue(serde_json::Value), } -pub async fn register_product_parent( - configuration: &configuration::Configuration, - product_parent_stub: models::ProductParentStub, -) -> Result<models::ProductParentId, Error<RegisterProductParentError>> { + +pub async fn register_product_parent(configuration: &configuration::Configuration, product_parent_stub: models::ProductParentStub) -> Result<models::ProductParentId, Error<RegisterProductParentError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_product_parent_stub = product_parent_stub; + let p_body_product_parent_stub = product_parent_stub; let uri_str = format!("{}/product_parent/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_product_parent_stub); + req_builder = req_builder.json(&p_body_product_parent_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -54,24 +52,13 @@ pub async fn register_product_parent( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::ProductParentId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::ProductParentId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProductParentId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProductParentId`")))), } } else { let content = resp.text().await?; let entity: Option<RegisterProductParentError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_recipe_api.rs b/crates/rocie-client/src/apis/api_set_auth_recipe_api.rs index 8df320d..8b847f0 100644 --- a/crates/rocie-client/src/apis/api_set_auth_recipe_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_recipe_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`add_recipe`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -22,22 +24,18 @@ pub enum AddRecipeError { UnknownValue(serde_json::Value), } -pub async fn add_recipe( - configuration: &configuration::Configuration, - recipe_stub: models::RecipeStub, -) -> Result<models::RecipeId, Error<AddRecipeError>> { + +pub async fn add_recipe(configuration: &configuration::Configuration, recipe_stub: models::RecipeStub) -> Result<models::RecipeId, Error<AddRecipeError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_recipe_stub = recipe_stub; + let p_body_recipe_stub = recipe_stub; let uri_str = format!("{}/recipe/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_recipe_stub); + req_builder = req_builder.json(&p_body_recipe_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -54,24 +52,13 @@ pub async fn add_recipe( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::RecipeId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::RecipeId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RecipeId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RecipeId`")))), } } else { let content = resp.text().await?; let entity: Option<AddRecipeError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_recipe_parent_api.rs b/crates/rocie-client/src/apis/api_set_auth_recipe_parent_api.rs new file mode 100644 index 0000000..27aef14 --- /dev/null +++ b/crates/rocie-client/src/apis/api_set_auth_recipe_parent_api.rs @@ -0,0 +1,64 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`register_recipe_parent`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RegisterRecipeParentError { + Status401(), + Status500(String), + UnknownValue(serde_json::Value), +} + + +pub async fn register_recipe_parent(configuration: &configuration::Configuration, recipe_parent_stub: models::RecipeParentStub) -> Result<models::RecipeParentId, Error<RegisterRecipeParentError>> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_recipe_parent_stub = recipe_parent_stub; + + let uri_str = format!("{}/recipe_parent/new", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + 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_recipe_parent_stub); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RecipeParentId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RecipeParentId`")))), + } + } else { + let content = resp.text().await?; + let entity: Option<RegisterRecipeParentError> = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/crates/rocie-client/src/apis/api_set_auth_unit_api.rs b/crates/rocie-client/src/apis/api_set_auth_unit_api.rs index d9bf507..aa95127 100644 --- a/crates/rocie-client/src/apis/api_set_auth_unit_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_unit_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`register_unit`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -22,22 +24,18 @@ pub enum RegisterUnitError { UnknownValue(serde_json::Value), } -pub async fn register_unit( - configuration: &configuration::Configuration, - unit_stub: models::UnitStub, -) -> Result<models::UnitId, Error<RegisterUnitError>> { + +pub async fn register_unit(configuration: &configuration::Configuration, unit_stub: models::UnitStub) -> Result<models::UnitId, Error<RegisterUnitError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_unit_stub = unit_stub; + let p_body_unit_stub = unit_stub; let uri_str = format!("{}/unit/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_unit_stub); + req_builder = req_builder.json(&p_body_unit_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -54,24 +52,13 @@ pub async fn register_unit( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::UnitId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::UnitId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UnitId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UnitId`")))), } } else { let content = resp.text().await?; let entity: Option<RegisterUnitError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_unit_property_api.rs b/crates/rocie-client/src/apis/api_set_auth_unit_property_api.rs index cb59235..eb78fac 100644 --- a/crates/rocie-client/src/apis/api_set_auth_unit_property_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_unit_property_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`register_unit_property`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -22,22 +24,18 @@ pub enum RegisterUnitPropertyError { UnknownValue(serde_json::Value), } -pub async fn register_unit_property( - configuration: &configuration::Configuration, - unit_property_stub: models::UnitPropertyStub, -) -> Result<models::UnitPropertyId, Error<RegisterUnitPropertyError>> { + +pub async fn register_unit_property(configuration: &configuration::Configuration, unit_property_stub: models::UnitPropertyStub) -> Result<models::UnitPropertyId, Error<RegisterUnitPropertyError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_unit_property_stub = unit_property_stub; + let p_body_unit_property_stub = unit_property_stub; let uri_str = format!("{}/unit-property/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_unit_property_stub); + req_builder = req_builder.json(&p_body_unit_property_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -54,24 +52,13 @@ pub async fn register_unit_property( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::UnitPropertyId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::UnitPropertyId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UnitPropertyId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UnitPropertyId`")))), } } else { let content = resp.text().await?; let entity: Option<RegisterUnitPropertyError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/api_set_auth_user_api.rs b/crates/rocie-client/src/apis/api_set_auth_user_api.rs index 758b707..516ea1e 100644 --- a/crates/rocie-client/src/apis/api_set_auth_user_api.rs +++ b/crates/rocie-client/src/apis/api_set_auth_user_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`register_user`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -22,22 +24,18 @@ pub enum RegisterUserError { UnknownValue(serde_json::Value), } -pub async fn register_user( - configuration: &configuration::Configuration, - user_stub: models::UserStub, -) -> Result<models::UserId, Error<RegisterUserError>> { + +pub async fn register_user(configuration: &configuration::Configuration, user_stub: models::UserStub) -> Result<models::UserId, Error<RegisterUserError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_user_stub = user_stub; + let p_body_user_stub = user_stub; let uri_str = format!("{}/user/new", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_user_stub); + req_builder = req_builder.json(&p_body_user_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -54,24 +52,13 @@ pub async fn register_user( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::UserId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::UserId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserId`")))), } } else { let content = resp.text().await?; let entity: Option<RegisterUserError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + 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 1d203c5..1db2d9c 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 @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + /// struct for typed errors of method [`login`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -40,22 +42,18 @@ pub enum ProvisionError { UnknownValue(serde_json::Value), } -pub async fn login( - configuration: &configuration::Configuration, - login_info: models::LoginInfo, -) -> Result<(), Error<LoginError>> { + +pub async fn login(configuration: &configuration::Configuration, login_info: models::LoginInfo) -> Result<(), Error<LoginError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_login_info = login_info; + let p_body_login_info = login_info; let uri_str = format!("{}/login", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_login_info); + req_builder = req_builder.json(&p_body_login_info); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -67,21 +65,14 @@ pub async fn login( } else { let content = resp.text().await?; let entity: Option<LoginError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } -pub async fn logout( - configuration: &configuration::Configuration, -) -> Result<(), Error<LogoutError>> { +pub async fn logout(configuration: &configuration::Configuration, ) -> Result<(), Error<LogoutError>> { + let uri_str = format!("{}/logout", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); @@ -97,31 +88,22 @@ pub async fn logout( } else { let content = resp.text().await?; let entity: Option<LogoutError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } /// 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, user_stub: models::UserStub) -> Result<models::UserId, Error<ProvisionError>> { // add a prefix to parameters to efficiently prevent name collisions - let p_user_stub = user_stub; + let p_body_user_stub = user_stub; let uri_str = format!("{}/provision", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); 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_user_stub); + req_builder = req_builder.json(&p_body_user_stub); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -138,24 +120,13 @@ pub async fn provision( let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to `models::UserId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to `models::UserId`" - )))); - } + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserId`")))), } } else { let content = resp.text().await?; let entity: Option<ProvisionError> = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) + Err(Error::ResponseError(ResponseContent { status, content, entity })) } } + diff --git a/crates/rocie-client/src/apis/configuration.rs b/crates/rocie-client/src/apis/configuration.rs index d576aef..118712f 100644 --- a/crates/rocie-client/src/apis/configuration.rs +++ b/crates/rocie-client/src/apis/configuration.rs @@ -35,10 +35,15 @@ impl Configuration { impl Default for Configuration { fn default() -> Self { - let client = reqwest::Client::builder() - .cookie_store(true) - .build() - .expect("to be not missconfigured"); + let client = { + let builder = reqwest::Client::builder(); + + // The browser handles cookies for us, so we don't need to have a storage for them. + #[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))] + let builder = builder.cookie_store(true); + + builder.build().expect("to be not missconfigured") + }; Configuration { base_path: "http://localhost".to_owned(), diff --git a/crates/rocie-client/src/apis/mod.rs b/crates/rocie-client/src/apis/mod.rs index dd7464f..c8e4015 100644 --- a/crates/rocie-client/src/apis/mod.rs +++ b/crates/rocie-client/src/apis/mod.rs @@ -16,7 +16,7 @@ pub enum Error<T> { ResponseError(ResponseContent<T>), } -impl<T> fmt::Display for Error<T> { +impl <T> fmt::Display for Error<T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let (module, e) = match self { Error::Reqwest(e) => ("reqwest", e.to_string()), @@ -28,7 +28,7 @@ impl<T> fmt::Display for Error<T> { } } -impl<T: fmt::Debug> error::Error for Error<T> { +impl <T: fmt::Debug> error::Error for Error<T> { fn source(&self) -> Option<&(dyn error::Error + 'static)> { Some(match self { Error::Reqwest(e) => e, @@ -39,19 +39,19 @@ impl<T: fmt::Debug> error::Error for Error<T> { } } -impl<T> From<reqwest::Error> for Error<T> { +impl <T> From<reqwest::Error> for Error<T> { fn from(e: reqwest::Error) -> Self { Error::Reqwest(e) } } -impl<T> From<serde_json::Error> for Error<T> { +impl <T> From<serde_json::Error> for Error<T> { fn from(e: serde_json::Error) -> Self { Error::Serde(e) } } -impl<T> From<std::io::Error> for Error<T> { +impl <T> From<std::io::Error> for Error<T> { fn from(e: std::io::Error) -> Self { Error::Io(e) } @@ -78,10 +78,8 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String value, )); } - } - serde_json::Value::String(s) => { - params.push((format!("{}[{}]", prefix, key), s.clone())) - } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), } } @@ -98,7 +96,7 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String enum ContentType { Json, Text, - Unsupported(String), + Unsupported(String) } impl From<&str> for ContentType { @@ -117,13 +115,16 @@ pub mod api_get_auth_inventory_api; pub mod api_get_auth_product_api; pub mod api_get_auth_product_parent_api; pub mod api_get_auth_recipe_api; +pub mod api_get_auth_recipe_parent_api; pub mod api_get_auth_unit_api; pub mod api_get_auth_unit_property_api; pub mod api_get_auth_user_api; +pub mod api_get_no_auth_state_api; pub mod api_set_auth_barcode_api; pub mod api_set_auth_product_api; pub mod api_set_auth_product_parent_api; pub mod api_set_auth_recipe_api; +pub mod api_set_auth_recipe_parent_api; pub mod api_set_auth_unit_api; pub mod api_set_auth_unit_property_api; pub mod api_set_auth_user_api; diff --git a/crates/rocie-client/src/implies.rs b/crates/rocie-client/src/implies.rs index 5957942..4cbe6b3 100644 --- a/crates/rocie-client/src/implies.rs +++ b/crates/rocie-client/src/implies.rs @@ -1,7 +1,7 @@ use std::fmt::Display; use crate::models::{ - BarcodeId, ProductId, ProductParentId, RecipeId, UnitId, UnitPropertyId, UserId, + BarcodeId, ProductId, ProductParentId, RecipeId, RecipeParentId, UnitId, UnitPropertyId, UserId }; // TODO(@bpeetz): The client generator should just do this. <2025-09-23> @@ -54,3 +54,10 @@ impl Display for UserId { } } impl Copy for UserId {} + +impl Display for RecipeParentId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.value.fmt(f) + } +} +impl Copy for RecipeParentId {} diff --git a/crates/rocie-client/src/models/barcode.rs b/crates/rocie-client/src/models/barcode.rs index ca950cd..f44caa9 100644 --- a/crates/rocie-client/src/models/barcode.rs +++ b/crates/rocie-client/src/models/barcode.rs @@ -21,6 +21,10 @@ pub struct Barcode { impl Barcode { pub fn new(amount: models::UnitAmount, id: models::BarcodeId) -> Barcode { - Barcode { amount, id } + Barcode { + amount, + id, + } } } + diff --git a/crates/rocie-client/src/models/barcode_id.rs b/crates/rocie-client/src/models/barcode_id.rs index 581c07d..a081913 100644 --- a/crates/rocie-client/src/models/barcode_id.rs +++ b/crates/rocie-client/src/models/barcode_id.rs @@ -19,6 +19,9 @@ pub struct BarcodeId { impl BarcodeId { pub fn new(value: u32) -> BarcodeId { - BarcodeId { value } + BarcodeId { + value, + } } } + diff --git a/crates/rocie-client/src/models/content.rs b/crates/rocie-client/src/models/content.rs new file mode 100644 index 0000000..8823605 --- /dev/null +++ b/crates/rocie-client/src/models/content.rs @@ -0,0 +1,42 @@ +/* + * 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}; + +/// Content : Each type of content inside a section +/// Each type of content inside a section +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Content { + ContentOneOf(models::ContentOneOf), + ContentOneOf1(models::ContentOneOf1), +} + +impl Default for Content { + fn default() -> Self { + 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 new file mode 100644 index 0000000..1c82c61 --- /dev/null +++ b/crates/rocie-client/src/models/content_one_of.rs @@ -0,0 +1,45 @@ +/* + * 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}; + +/// 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, +} + +impl ContentOneOf { + /// A step + pub fn new(r#type: Type, value: models::Step) -> ContentOneOf { + ContentOneOf { + r#type, + value, + } + } +} +/// +#[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 new file mode 100644 index 0000000..148999d --- /dev/null +++ b/crates/rocie-client/src/models/content_one_of_1.rs @@ -0,0 +1,45 @@ +/* + * 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}; + +/// 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, +} + +impl ContentOneOf1 { + /// A paragraph of just text, no instructions + pub fn new(r#type: Type, value: String) -> ContentOneOf1 { + ContentOneOf1 { + r#type, + value, + } + } +} +/// +#[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/cooklang_recipe.rs b/crates/rocie-client/src/models/cooklang_recipe.rs new file mode 100644 index 0000000..3d4bb35 --- /dev/null +++ b/crates/rocie-client/src/models/cooklang_recipe.rs @@ -0,0 +1,46 @@ +/* + * 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}; + +/// CooklangRecipe : A complete recipe The recipes do not have a name. You give it externally or maybe use some metadata key. The recipe returned from parsing is a [`ScalableRecipe`]. The difference between [`ScalableRecipe`] and [`ScaledRecipe`] is in the values of the quantities of ingredients, cookware and timers. The parser returns [`ScalableValue`]s and after scaling, these are converted to regular [`Value`]s. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CooklangRecipe { + /// All the cookware + #[serde(rename = "cookware")] + pub cookware: Vec<models::Cookware>, + /// All the ingredients + #[serde(rename = "ingredients")] + pub ingredients: Vec<models::Ingredient>, + /// Metadata as read from preamble + #[serde(rename = "metadata")] + pub metadata: models::Metadata, + /// Each of the sections If no sections declared, a section without name is the default. + #[serde(rename = "sections")] + pub sections: Vec<models::Section>, + /// All the timers + #[serde(rename = "timers")] + pub timers: Vec<models::Timer>, +} + +impl CooklangRecipe { + /// A complete recipe The recipes do not have a name. You give it externally or maybe use some metadata key. The recipe returned from parsing is a [`ScalableRecipe`]. The difference between [`ScalableRecipe`] and [`ScaledRecipe`] is in the values of the quantities of ingredients, cookware and timers. The parser returns [`ScalableValue`]s and after scaling, these are converted to regular [`Value`]s. + pub fn new(cookware: Vec<models::Cookware>, ingredients: Vec<models::Ingredient>, metadata: models::Metadata, sections: Vec<models::Section>, timers: Vec<models::Timer>) -> CooklangRecipe { + CooklangRecipe { + cookware, + ingredients, + metadata, + sections, + timers, + } + } +} + diff --git a/crates/rocie-client/src/models/cookware.rs b/crates/rocie-client/src/models/cookware.rs new file mode 100644 index 0000000..c2dc745 --- /dev/null +++ b/crates/rocie-client/src/models/cookware.rs @@ -0,0 +1,42 @@ +/* + * 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}; + +/// Cookware : A recipe cookware item +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Cookware { + /// Alias + #[serde(rename = "alias", skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + /// Name + #[serde(rename = "name")] + pub name: String, + /// Note + #[serde(rename = "note", skip_serializing_if = "Option::is_none")] + pub note: Option<String>, + /// Amount needed Note that this is a value, not a quantity, so it doesn't have units. + #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")] + pub quantity: Option<u32>, +} + +impl Cookware { + /// A recipe cookware item + pub fn new(name: String) -> Cookware { + Cookware { + alias: None, + name, + note: None, + quantity: None, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient.rs b/crates/rocie-client/src/models/ingredient.rs new file mode 100644 index 0000000..46bdef1 --- /dev/null +++ b/crates/rocie-client/src/models/ingredient.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}; + +/// Ingredient : A recipe ingredient +/// A recipe ingredient +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Ingredient { + IngredientOneOf(models::IngredientOneOf), + IngredientOneOf1(models::IngredientOneOf1), + IngredientOneOf2(models::IngredientOneOf2), +} + +impl Default for Ingredient { + fn default() -> Self { + Self::IngredientOneOf(Default::default()) + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of.rs b/crates/rocie-client/src/models/ingredient_one_of.rs new file mode 100644 index 0000000..5681115 --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of.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}; + +/// IngredientOneOf : This ingredient is a registered product. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOf { + #[serde(rename = "RegisteredProduct")] + pub registered_product: models::IngredientOneOfRegisteredProduct, +} + +impl IngredientOneOf { + /// This ingredient is a registered product. + pub fn new(registered_product: models::IngredientOneOfRegisteredProduct) -> IngredientOneOf { + IngredientOneOf { + registered_product, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of_1.rs b/crates/rocie-client/src/models/ingredient_one_of_1.rs new file mode 100644 index 0000000..e35fa89 --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of_1.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}; + +/// IngredientOneOf1 : This ingredient is a not yet registered product. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOf1 { + #[serde(rename = "NotRegisteredProduct")] + pub not_registered_product: models::IngredientOneOf1NotRegisteredProduct, +} + +impl IngredientOneOf1 { + /// This ingredient is a not yet registered product. + pub fn new(not_registered_product: models::IngredientOneOf1NotRegisteredProduct) -> IngredientOneOf1 { + IngredientOneOf1 { + not_registered_product, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of_1_not_registered_product.rs b/crates/rocie-client/src/models/ingredient_one_of_1_not_registered_product.rs new file mode 100644 index 0000000..bd7938f --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of_1_not_registered_product.rs @@ -0,0 +1,33 @@ +/* + * 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}; + +/// IngredientOneOf1NotRegisteredProduct : This ingredient is a not yet registered product. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOf1NotRegisteredProduct { + #[serde(rename = "name")] + pub name: String, + /// Quantity + #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")] + pub quantity: Option<models::UnitAmount>, +} + +impl IngredientOneOf1NotRegisteredProduct { + /// This ingredient is a not yet registered product. + pub fn new(name: String) -> IngredientOneOf1NotRegisteredProduct { + IngredientOneOf1NotRegisteredProduct { + name, + quantity: None, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of_2.rs b/crates/rocie-client/src/models/ingredient_one_of_2.rs new file mode 100644 index 0000000..646a803 --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of_2.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}; + +/// IngredientOneOf2 : This ingredient is a reference to another recipe. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOf2 { + #[serde(rename = "RecipeReference")] + pub recipe_reference: models::IngredientOneOf2RecipeReference, +} + +impl IngredientOneOf2 { + /// This ingredient is a reference to another recipe. + pub fn new(recipe_reference: models::IngredientOneOf2RecipeReference) -> IngredientOneOf2 { + IngredientOneOf2 { + recipe_reference, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of_2_recipe_reference.rs b/crates/rocie-client/src/models/ingredient_one_of_2_recipe_reference.rs new file mode 100644 index 0000000..5081008 --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of_2_recipe_reference.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}; + +/// IngredientOneOf2RecipeReference : This ingredient is a reference to another recipe. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOf2RecipeReference { + #[serde(rename = "id")] + pub id: models::RecipeId, +} + +impl IngredientOneOf2RecipeReference { + /// This ingredient is a reference to another recipe. + pub fn new(id: models::RecipeId) -> IngredientOneOf2RecipeReference { + IngredientOneOf2RecipeReference { + id, + } + } +} + diff --git a/crates/rocie-client/src/models/ingredient_one_of_registered_product.rs b/crates/rocie-client/src/models/ingredient_one_of_registered_product.rs new file mode 100644 index 0000000..495911a --- /dev/null +++ b/crates/rocie-client/src/models/ingredient_one_of_registered_product.rs @@ -0,0 +1,37 @@ +/* + * 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}; + +/// IngredientOneOfRegisteredProduct : This ingredient is a registered product. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IngredientOneOfRegisteredProduct { + /// Alias + #[serde(rename = "alias", skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[serde(rename = "id")] + pub id: models::ProductId, + /// Quantity + #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")] + pub quantity: Option<models::ProductAmount>, +} + +impl IngredientOneOfRegisteredProduct { + /// This ingredient is a registered product. + pub fn new(id: models::ProductId) -> IngredientOneOfRegisteredProduct { + IngredientOneOfRegisteredProduct { + alias: None, + id, + quantity: None, + } + } +} + diff --git a/crates/rocie-client/src/models/item.rs b/crates/rocie-client/src/models/item.rs new file mode 100644 index 0000000..d3460bc --- /dev/null +++ b/crates/rocie-client/src/models/item.rs @@ -0,0 +1,51 @@ +/* + * 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}; + +/// Item : A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. +/// A step item Except for [`Item::Text`], the value is the index where the item is located in it's corresponding [`Vec`] in the [`Recipe`]. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Item { + ItemOneOf(models::ItemOneOf), + ItemOneOf1(models::ItemOneOf1), + ItemOneOf2(models::ItemOneOf2), + ItemOneOf3(models::ItemOneOf3), + ItemOneOf4(models::ItemOneOf4), +} + +impl Default for Item { + fn default() -> Self { + 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 new file mode 100644 index 0000000..af9bbcc --- /dev/null +++ b/crates/rocie-client/src/models/item_one_of.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// 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, +} + +impl ItemOneOf { + /// Just plain text + pub fn new(r#type: Type, value: String) -> ItemOneOf { + ItemOneOf { + r#type, + value, + } + } +} +/// +#[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 new file mode 100644 index 0000000..82888e7 --- /dev/null +++ b/crates/rocie-client/src/models/item_one_of_1.rs @@ -0,0 +1,42 @@ +/* + * 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 ItemOneOf1 { + #[serde(rename = "index")] + pub index: u32, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ItemOneOf1 { + pub fn new(index: u32, r#type: Type) -> ItemOneOf1 { + ItemOneOf1 { + index, + r#type, + } + } +} +/// +#[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_2.rs b/crates/rocie-client/src/models/item_one_of_2.rs new file mode 100644 index 0000000..93fb342 --- /dev/null +++ b/crates/rocie-client/src/models/item_one_of_2.rs @@ -0,0 +1,42 @@ +/* + * 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 ItemOneOf2 { + #[serde(rename = "index")] + pub index: u32, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ItemOneOf2 { + pub fn new(index: u32, r#type: Type) -> ItemOneOf2 { + ItemOneOf2 { + index, + r#type, + } + } +} +/// +#[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 new file mode 100644 index 0000000..eaae1ad --- /dev/null +++ b/crates/rocie-client/src/models/item_one_of_3.rs @@ -0,0 +1,42 @@ +/* + * 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 ItemOneOf3 { + #[serde(rename = "index")] + pub index: u32, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ItemOneOf3 { + pub fn new(index: u32, r#type: Type) -> ItemOneOf3 { + ItemOneOf3 { + index, + r#type, + } + } +} +/// +#[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 new file mode 100644 index 0000000..2abaf27 --- /dev/null +++ b/crates/rocie-client/src/models/item_one_of_4.rs @@ -0,0 +1,42 @@ +/* + * 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 ItemOneOf4 { + #[serde(rename = "index")] + pub index: u32, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ItemOneOf4 { + pub fn new(index: u32, r#type: Type) -> ItemOneOf4 { + ItemOneOf4 { + index, + r#type, + } + } +} +/// +#[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/login_info.rs b/crates/rocie-client/src/models/login_info.rs index 1f9215b..e99311b 100644 --- a/crates/rocie-client/src/models/login_info.rs +++ b/crates/rocie-client/src/models/login_info.rs @@ -13,16 +13,20 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LoginInfo { - /// The id of the user. - #[serde(rename = "id")] - pub id: models::UserId, /// The password of the user. #[serde(rename = "password")] pub password: String, + /// The user name of the user. + #[serde(rename = "user_name")] + pub user_name: String, } impl LoginInfo { - pub fn new(id: models::UserId, password: String) -> LoginInfo { - LoginInfo { id, password } + pub fn new(password: String, user_name: String) -> LoginInfo { + LoginInfo { + password, + user_name, + } } } + diff --git a/crates/rocie-client/src/models/metadata.rs b/crates/rocie-client/src/models/metadata.rs new file mode 100644 index 0000000..c62007d --- /dev/null +++ b/crates/rocie-client/src/models/metadata.rs @@ -0,0 +1,39 @@ +/* + * 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 Metadata { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option<models::NameAndUrl>, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option<models::NameAndUrl>, + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option<Vec<String>>, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option<String>, +} + +impl Metadata { + pub fn new() -> Metadata { + Metadata { + author: None, + description: None, + source: None, + tags: None, + title: None, + } + } +} + diff --git a/crates/rocie-client/src/models/mod.rs b/crates/rocie-client/src/models/mod.rs index 135d612..53b0c13 100644 --- a/crates/rocie-client/src/models/mod.rs +++ b/crates/rocie-client/src/models/mod.rs @@ -2,8 +2,48 @@ pub mod barcode; pub use self::barcode::Barcode; pub mod barcode_id; pub use self::barcode_id::BarcodeId; +pub mod content; +pub use self::content::Content; +pub mod content_one_of; +pub use self::content_one_of::ContentOneOf; +pub mod content_one_of_1; +pub use self::content_one_of_1::ContentOneOf1; +pub mod cooklang_recipe; +pub use self::cooklang_recipe::CooklangRecipe; +pub mod cookware; +pub use self::cookware::Cookware; +pub mod ingredient; +pub use self::ingredient::Ingredient; +pub mod ingredient_one_of; +pub use self::ingredient_one_of::IngredientOneOf; +pub mod ingredient_one_of_1; +pub use self::ingredient_one_of_1::IngredientOneOf1; +pub mod ingredient_one_of_1_not_registered_product; +pub use self::ingredient_one_of_1_not_registered_product::IngredientOneOf1NotRegisteredProduct; +pub mod ingredient_one_of_2; +pub use self::ingredient_one_of_2::IngredientOneOf2; +pub mod ingredient_one_of_2_recipe_reference; +pub use self::ingredient_one_of_2_recipe_reference::IngredientOneOf2RecipeReference; +pub mod ingredient_one_of_registered_product; +pub use self::ingredient_one_of_registered_product::IngredientOneOfRegisteredProduct; +pub mod item; +pub use self::item::Item; +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_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 login_info; pub use self::login_info::LoginInfo; +pub mod metadata; +pub use self::metadata::Metadata; +pub mod name_and_url; +pub use self::name_and_url::NameAndUrl; pub mod password_hash; pub use self::password_hash::PasswordHash; pub mod product; @@ -24,8 +64,20 @@ pub mod recipe; pub use self::recipe::Recipe; pub mod recipe_id; pub use self::recipe_id::RecipeId; +pub mod recipe_parent; +pub use self::recipe_parent::RecipeParent; +pub mod recipe_parent_id; +pub use self::recipe_parent_id::RecipeParentId; +pub mod recipe_parent_stub; +pub use self::recipe_parent_stub::RecipeParentStub; pub mod recipe_stub; pub use self::recipe_stub::RecipeStub; +pub mod section; +pub use self::section::Section; +pub mod step; +pub use self::step::Step; +pub mod timer; +pub use self::timer::Timer; pub mod unit; pub use self::unit::Unit; pub mod unit_amount; diff --git a/crates/rocie-client/src/models/name_and_url.rs b/crates/rocie-client/src/models/name_and_url.rs new file mode 100644 index 0000000..42ffd79 --- /dev/null +++ b/crates/rocie-client/src/models/name_and_url.rs @@ -0,0 +1,30 @@ +/* + * 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 NameAndUrl { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option<String>, +} + +impl NameAndUrl { + pub fn new() -> NameAndUrl { + NameAndUrl { + name: None, + url: None, + } + } +} + diff --git a/crates/rocie-client/src/models/password_hash.rs b/crates/rocie-client/src/models/password_hash.rs index b73a944..31413bf 100644 --- a/crates/rocie-client/src/models/password_hash.rs +++ b/crates/rocie-client/src/models/password_hash.rs @@ -21,6 +21,9 @@ pub struct PasswordHash { impl PasswordHash { /// This is stored as an PHC password string. This type corresponds to the string representation of a PHC string as described in the [PHC string format specification][1]. PHC strings have the following format: ```text $<id>[$v=<version>][$<param>=<value>(,<param>=<value>)*][$<salt>[$<hash>]] ``` pub fn new(value: String) -> PasswordHash { - PasswordHash { value } + PasswordHash { + value, + } } } + diff --git a/crates/rocie-client/src/models/product.rs b/crates/rocie-client/src/models/product.rs index e2546e0..e5e7da1 100644 --- a/crates/rocie-client/src/models/product.rs +++ b/crates/rocie-client/src/models/product.rs @@ -26,7 +26,7 @@ pub struct Product { /// The name of the product. This should be globally unique, to make searching easier for the user. #[serde(rename = "name")] pub name: String, - /// The parent this product has. This is effectively it's anchor in the product DAG. + /// The parent this product has. This is effectively it's anchor in the product DAG. None means, that it has no parents and as such is in the toplevel. #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] pub parent: Option<models::ProductParentId>, /// The property this product is measured in. (This is probably always either Mass, Volume or Quantity). @@ -36,12 +36,7 @@ pub struct Product { impl Product { /// The base of rocie. Products can be bought and consumed and represent, what you actually have in storage. Not every product is bought, as some can also be obtained by cooking a recipe. - pub fn new( - associated_bar_codes: Vec<models::Barcode>, - id: models::ProductId, - name: String, - unit_property: models::UnitPropertyId, - ) -> Product { + pub fn new(associated_bar_codes: Vec<models::Barcode>, id: models::ProductId, name: String, unit_property: models::UnitPropertyId) -> Product { Product { associated_bar_codes, description: None, @@ -52,3 +47,4 @@ impl Product { } } } + diff --git a/crates/rocie-client/src/models/product_amount.rs b/crates/rocie-client/src/models/product_amount.rs index 66e967b..43ab725 100644 --- a/crates/rocie-client/src/models/product_amount.rs +++ b/crates/rocie-client/src/models/product_amount.rs @@ -21,6 +21,10 @@ pub struct ProductAmount { impl ProductAmount { pub fn new(amount: models::UnitAmount, product_id: models::ProductId) -> ProductAmount { - ProductAmount { amount, product_id } + ProductAmount { + amount, + product_id, + } } } + diff --git a/crates/rocie-client/src/models/product_id.rs b/crates/rocie-client/src/models/product_id.rs index 0f0c3db..0f65bb8 100644 --- a/crates/rocie-client/src/models/product_id.rs +++ b/crates/rocie-client/src/models/product_id.rs @@ -19,6 +19,9 @@ pub struct ProductId { impl ProductId { pub fn new(value: uuid::Uuid) -> ProductId { - ProductId { value } + ProductId { + value, + } } } + diff --git a/crates/rocie-client/src/models/product_parent.rs b/crates/rocie-client/src/models/product_parent.rs index 79aec15..7ce26c9 100644 --- a/crates/rocie-client/src/models/product_parent.rs +++ b/crates/rocie-client/src/models/product_parent.rs @@ -39,3 +39,4 @@ impl ProductParent { } } } + diff --git a/crates/rocie-client/src/models/product_parent_id.rs b/crates/rocie-client/src/models/product_parent_id.rs index 9701ab3..1305117 100644 --- a/crates/rocie-client/src/models/product_parent_id.rs +++ b/crates/rocie-client/src/models/product_parent_id.rs @@ -19,6 +19,9 @@ pub struct ProductParentId { impl ProductParentId { pub fn new(value: uuid::Uuid) -> ProductParentId { - ProductParentId { value } + ProductParentId { + value, + } } } + diff --git a/crates/rocie-client/src/models/product_parent_stub.rs b/crates/rocie-client/src/models/product_parent_stub.rs index 878762e..a874502 100644 --- a/crates/rocie-client/src/models/product_parent_stub.rs +++ b/crates/rocie-client/src/models/product_parent_stub.rs @@ -33,3 +33,4 @@ impl ProductParentStub { } } } + diff --git a/crates/rocie-client/src/models/product_stub.rs b/crates/rocie-client/src/models/product_stub.rs index 2332d0f..76bc086 100644 --- a/crates/rocie-client/src/models/product_stub.rs +++ b/crates/rocie-client/src/models/product_stub.rs @@ -37,3 +37,4 @@ impl ProductStub { } } } + diff --git a/crates/rocie-client/src/models/recipe.rs b/crates/rocie-client/src/models/recipe.rs index e3b9d56..dfbbc03 100644 --- a/crates/rocie-client/src/models/recipe.rs +++ b/crates/rocie-client/src/models/recipe.rs @@ -11,18 +11,32 @@ use crate::models; use serde::{Deserialize, Serialize}; +/// Recipe : An recipe. These are transparently expressed in cooklang. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Recipe { + /// The actual content of this recipe. #[serde(rename = "content")] - pub content: String, + pub content: models::CooklangRecipe, + /// The unique id of this recipe. #[serde(rename = "id")] pub id: models::RecipeId, - #[serde(rename = "path")] - pub path: String, + /// The name of the recipe. This should be globally unique, to make searching easier for the user. + #[serde(rename = "name")] + pub name: String, + /// The parent this recipe has. This is effectively it's anchor in the recipe DAG. None means, that it has no parents and as such is in the toplevel. + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option<models::RecipeParentId>, } impl Recipe { - pub fn new(content: String, id: models::RecipeId, path: String) -> Recipe { - Recipe { content, id, path } + /// An recipe. These are transparently expressed in cooklang. + pub fn new(content: models::CooklangRecipe, id: models::RecipeId, name: String) -> Recipe { + Recipe { + content, + id, + name, + parent: None, + } } } + diff --git a/crates/rocie-client/src/models/recipe_id.rs b/crates/rocie-client/src/models/recipe_id.rs index f08b956..7d13aed 100644 --- a/crates/rocie-client/src/models/recipe_id.rs +++ b/crates/rocie-client/src/models/recipe_id.rs @@ -19,6 +19,9 @@ pub struct RecipeId { impl RecipeId { pub fn new(value: uuid::Uuid) -> RecipeId { - RecipeId { value } + RecipeId { + value, + } } } + diff --git a/crates/rocie-client/src/models/recipe_parent.rs b/crates/rocie-client/src/models/recipe_parent.rs new file mode 100644 index 0000000..50c5113 --- /dev/null +++ b/crates/rocie-client/src/models/recipe_parent.rs @@ -0,0 +1,42 @@ +/* + * 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}; + +/// RecipeParent : The grouping system for recipes. Every recipe can have a related parent, and every parent can have a parent themselves. As such, the recipe list constructs a DAG. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecipeParent { + /// An optional description of this recipe parent. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + /// The id of the recipe parent. + #[serde(rename = "id")] + pub id: models::RecipeParentId, + /// The name of the recipe parent. This should be globally unique, to make searching easier for the user. + #[serde(rename = "name")] + pub name: String, + /// The optional id of the parent of this recipe parent. This must not form a cycle. + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option<models::RecipeParentId>, +} + +impl RecipeParent { + /// The grouping system for recipes. Every recipe can have a related parent, and every parent can have a parent themselves. As such, the recipe list constructs a DAG. + pub fn new(id: models::RecipeParentId, name: String) -> RecipeParent { + RecipeParent { + description: None, + id, + name, + parent: None, + } + } +} + diff --git a/crates/rocie-client/src/models/recipe_parent_id.rs b/crates/rocie-client/src/models/recipe_parent_id.rs new file mode 100644 index 0000000..68f2e87 --- /dev/null +++ b/crates/rocie-client/src/models/recipe_parent_id.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 RecipeParentId { + #[serde(rename = "value")] + pub value: uuid::Uuid, +} + +impl RecipeParentId { + pub fn new(value: uuid::Uuid) -> RecipeParentId { + RecipeParentId { + value, + } + } +} + diff --git a/crates/rocie-client/src/models/recipe_parent_stub.rs b/crates/rocie-client/src/models/recipe_parent_stub.rs new file mode 100644 index 0000000..1e04c06 --- /dev/null +++ b/crates/rocie-client/src/models/recipe_parent_stub.rs @@ -0,0 +1,36 @@ +/* + * 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 RecipeParentStub { + /// A description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + /// The name of the recipe parent + #[serde(rename = "name")] + pub name: String, + /// A parent of this recipe parent, otherwise the parent will be the root of the parent tree. + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option<models::RecipeParentId>, +} + +impl RecipeParentStub { + pub fn new(name: String) -> RecipeParentStub { + RecipeParentStub { + description: None, + name, + parent: None, + } + } +} + diff --git a/crates/rocie-client/src/models/recipe_stub.rs b/crates/rocie-client/src/models/recipe_stub.rs index 205faa6..803c8dd 100644 --- a/crates/rocie-client/src/models/recipe_stub.rs +++ b/crates/rocie-client/src/models/recipe_stub.rs @@ -16,13 +16,21 @@ pub struct RecipeStub { /// The content of this recipe, in cooklang format #[serde(rename = "content")] pub content: String, - /// The path the recipe should have - #[serde(rename = "path")] - pub path: String, + /// The globally unique name of this recipe + #[serde(rename = "name")] + pub name: String, + /// The optional parent of this recipe. + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option<models::RecipeParentId>, } impl RecipeStub { - pub fn new(content: String, path: String) -> RecipeStub { - RecipeStub { content, path } + pub fn new(content: String, name: String) -> RecipeStub { + RecipeStub { + content, + name, + parent: None, + } } } + diff --git a/crates/rocie-client/src/models/refined_recipe.rs b/crates/rocie-client/src/models/refined_recipe.rs new file mode 100644 index 0000000..dc840d1 --- /dev/null +++ b/crates/rocie-client/src/models/refined_recipe.rs @@ -0,0 +1,33 @@ +/* + * 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}; + +/// RefinedRecipe : An refined recipe. This is a decoding of a recipe's cooklang description, already processed in a way to be consumed by a client. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RefinedRecipe { + /// The unique id of this refined recipe's original recipe. + #[serde(rename = "id")] + pub id: models::RecipeId, + #[serde(rename = "ingridients")] + pub ingridients: Vec<models::ProductId>, +} + +impl RefinedRecipe { + /// An refined recipe. This is a decoding of a recipe's cooklang description, already processed in a way to be consumed by a client. + pub fn new(id: models::RecipeId, ingridients: Vec<models::ProductId>) -> RefinedRecipe { + RefinedRecipe { + id, + ingridients, + } + } +} + diff --git a/crates/rocie-client/src/models/section.rs b/crates/rocie-client/src/models/section.rs new file mode 100644 index 0000000..e7a41f3 --- /dev/null +++ b/crates/rocie-client/src/models/section.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// Section : A section holding steps +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Section { + /// Content inside + #[serde(rename = "content")] + pub content: Vec<models::Content>, + /// Name of the section + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option<String>, +} + +impl Section { + /// A section holding steps + pub fn new(content: Vec<models::Content>) -> Section { + Section { + content, + name: None, + } + } +} + diff --git a/crates/rocie-client/src/models/step.rs b/crates/rocie-client/src/models/step.rs new file mode 100644 index 0000000..4ee76f3 --- /dev/null +++ b/crates/rocie-client/src/models/step.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// Step : A step holding step [`Item`]s +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Step { + /// [`Item`]s inside + #[serde(rename = "items")] + pub items: Vec<models::Item>, + /// Step number The step numbers start at 1 in each section and increase with non text step. + #[serde(rename = "number")] + pub number: u32, +} + +impl Step { + /// A step holding step [`Item`]s + pub fn new(items: Vec<models::Item>, number: u32) -> Step { + Step { + items, + number, + } + } +} + diff --git a/crates/rocie-client/src/models/timer.rs b/crates/rocie-client/src/models/timer.rs new file mode 100644 index 0000000..6c06d61 --- /dev/null +++ b/crates/rocie-client/src/models/timer.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// Timer : A recipe timer If created from parsing, at least one of the fields is guaranteed to be [`Some`]. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Timer { + /// Name + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + /// Time quantity + #[serde(rename = "quantity")] + pub quantity: 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 { + Timer { + name: None, + quantity, + } + } +} + diff --git a/crates/rocie-client/src/models/unit.rs b/crates/rocie-client/src/models/unit.rs index 229866d..873cb33 100644 --- a/crates/rocie-client/src/models/unit.rs +++ b/crates/rocie-client/src/models/unit.rs @@ -34,13 +34,7 @@ pub struct Unit { } impl Unit { - pub fn new( - full_name_plural: String, - full_name_singular: String, - id: models::UnitId, - short_name: String, - unit_property: models::UnitPropertyId, - ) -> Unit { + pub fn new(full_name_plural: String, full_name_singular: String, id: models::UnitId, short_name: String, unit_property: models::UnitPropertyId) -> Unit { Unit { description: None, full_name_plural, @@ -51,3 +45,4 @@ impl Unit { } } } + diff --git a/crates/rocie-client/src/models/unit_amount.rs b/crates/rocie-client/src/models/unit_amount.rs index a8e4254..e4b1a54 100644 --- a/crates/rocie-client/src/models/unit_amount.rs +++ b/crates/rocie-client/src/models/unit_amount.rs @@ -21,6 +21,10 @@ pub struct UnitAmount { impl UnitAmount { pub fn new(unit: models::UnitId, value: u32) -> UnitAmount { - UnitAmount { unit, value } + UnitAmount { + unit, + value, + } } } + diff --git a/crates/rocie-client/src/models/unit_id.rs b/crates/rocie-client/src/models/unit_id.rs index 5a09994..8b08d95 100644 --- a/crates/rocie-client/src/models/unit_id.rs +++ b/crates/rocie-client/src/models/unit_id.rs @@ -19,6 +19,9 @@ pub struct UnitId { impl UnitId { pub fn new(value: uuid::Uuid) -> UnitId { - UnitId { value } + UnitId { + value, + } } } + diff --git a/crates/rocie-client/src/models/unit_property.rs b/crates/rocie-client/src/models/unit_property.rs index bfe5d9c..b4dfbe1 100644 --- a/crates/rocie-client/src/models/unit_property.rs +++ b/crates/rocie-client/src/models/unit_property.rs @@ -30,11 +30,7 @@ pub struct UnitProperty { impl UnitProperty { /// An unit property describes a property that can be measured by units. For example velocity, mass or volume. - pub fn new( - id: models::UnitPropertyId, - name: String, - units: Vec<models::UnitId>, - ) -> UnitProperty { + pub fn new(id: models::UnitPropertyId, name: String, units: Vec<models::UnitId>) -> UnitProperty { UnitProperty { description: None, id, @@ -43,3 +39,4 @@ impl UnitProperty { } } } + diff --git a/crates/rocie-client/src/models/unit_property_id.rs b/crates/rocie-client/src/models/unit_property_id.rs index 6e9e50e..aca567c 100644 --- a/crates/rocie-client/src/models/unit_property_id.rs +++ b/crates/rocie-client/src/models/unit_property_id.rs @@ -19,6 +19,9 @@ pub struct UnitPropertyId { impl UnitPropertyId { pub fn new(value: uuid::Uuid) -> UnitPropertyId { - UnitPropertyId { value } + UnitPropertyId { + value, + } } } + diff --git a/crates/rocie-client/src/models/unit_property_stub.rs b/crates/rocie-client/src/models/unit_property_stub.rs index 37ccb64..c43d91e 100644 --- a/crates/rocie-client/src/models/unit_property_stub.rs +++ b/crates/rocie-client/src/models/unit_property_stub.rs @@ -29,3 +29,4 @@ impl UnitPropertyStub { } } } + diff --git a/crates/rocie-client/src/models/unit_stub.rs b/crates/rocie-client/src/models/unit_stub.rs index accad53..162674f 100644 --- a/crates/rocie-client/src/models/unit_stub.rs +++ b/crates/rocie-client/src/models/unit_stub.rs @@ -26,12 +26,7 @@ pub struct UnitStub { } impl UnitStub { - pub fn new( - full_name_plural: String, - full_name_singular: String, - short_name: String, - unit_property: models::UnitPropertyId, - ) -> UnitStub { + pub fn new(full_name_plural: String, full_name_singular: String, short_name: String, unit_property: models::UnitPropertyId) -> UnitStub { UnitStub { description: None, full_name_plural, @@ -41,3 +36,4 @@ impl UnitStub { } } } + diff --git a/crates/rocie-client/src/models/user.rs b/crates/rocie-client/src/models/user.rs index d7bdb99..7397275 100644 --- a/crates/rocie-client/src/models/user.rs +++ b/crates/rocie-client/src/models/user.rs @@ -39,3 +39,4 @@ impl User { } } } + diff --git a/crates/rocie-client/src/models/user_id.rs b/crates/rocie-client/src/models/user_id.rs index 677fb37..3a67fd6 100644 --- a/crates/rocie-client/src/models/user_id.rs +++ b/crates/rocie-client/src/models/user_id.rs @@ -19,6 +19,9 @@ pub struct UserId { impl UserId { pub fn new(value: uuid::Uuid) -> UserId { - UserId { value } + UserId { + value, + } } } + diff --git a/crates/rocie-client/src/models/user_stub.rs b/crates/rocie-client/src/models/user_stub.rs index e49b034..8f620db 100644 --- a/crates/rocie-client/src/models/user_stub.rs +++ b/crates/rocie-client/src/models/user_stub.rs @@ -33,3 +33,4 @@ impl UserStub { } } } + |
