create_shoppingcart/create_shoppingcart.rs
1//! Create Shopping Cart Example
2//!
3
4use tmf_client::common::tmf_error::TMFError;
5
6fn main() -> Result<(), TMFError> {
7 // This example demonstrates how to create a shopping cart using the TMF663 API.
8 // Ensure you have the necessary dependencies and the TMFClient set up in your project.
9
10 use tmf_client::{BlockingOperations, TMFClient};
11 #[cfg(feature = "tmf663")]
12 use tmflib::tmf663::shopping_cart::ShoppingCart;
13
14 // Initialize the TMF client with the base URI of your TMF server
15 let mut client = TMFClient::new("https://localhost", None);
16
17 let cart = ShoppingCart::new();
18
19 let out = client.tmf663().shopping_cart().create(cart)?;
20
21 dbg!(out);
22
23 Ok(())
24}