Skip to main content

create_customer/
create_customer.rs

1//! Create Customer Example
2
3use tmf_client::common::tmf_error::TMFError;
4#[cfg(feature = "tmf629")]
5use tmf_client::TMFClient;
6
7#[cfg(not(feature = "blocking"))]
8use tmf_client::AsyncOperations;
9
10#[cfg(feature = "tmf629")]
11use tmflib::tmf629::customer::Customer;
12#[cfg(feature = "tmf629")]
13use tmflib::tmf632::organization_v4::Organization;
14
15use tmf_client::DEFAULT_PORT;
16
17fn main() -> Result<(), TMFError> {
18    #[cfg(feature = "tmf629")]
19    {
20        use tmf_client::BlockingOperations;
21
22        let org = Organization::new("An Organization Example");
23
24        let customer = Customer::new(org);
25
26        let new_customer = TMFClient::new("https://localhost", Some(DEFAULT_PORT))
27            .tmf629()
28            .customer()
29            .create(customer)?;
30
31        dbg!(new_customer);
32    }
33    Ok(())
34}