Skip to main content

get_shoppingcart/
get_shoppingcart.rs

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