Skip to main content

TMFClient

Struct TMFClient 

Source
pub struct TMFClient { /* private fields */ }
Expand description

TMF Client

Implementations§

Source§

impl TMFClient

Source

pub fn new(host: impl Into<String>, port: Option<u16>) -> TMFClient

Create a new TMFClient instance

let client = TMFClient::new("http://localhost",Some(8000));
Examples found in repository?
examples/create_site.rs (line 14)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "tmf674")]
11    {
12        let site = GeographicSite::new("Example Bad Site");
13
14        let new_site = TMFClient::new("https://localhost", None)
15            .tmf674()
16            .site()
17            .create(site)?;
18
19        dbg!(new_site);
20    }
21
22    Ok(())
23}
More examples
Hide additional examples
examples/get_organization.rs (line 12)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "blocking")]
11    {
12        let organizations = TMFClient::new("https://localhost", None)
13            .tmf632()
14            .organization()
15            .list(None)?;
16
17        for o in organizations {
18            println!("Name: {} , Id: {}", o.get_name(), o.get_id());
19        }
20    }
21
22    Ok(())
23}
examples/get_customer.rs (line 11)
7fn main() -> Result<(), TMFError> {
8    #[cfg(feature = "blocking")]
9    {
10        use tmflib::{HasId, HasName};
11        let clients = TMFClient::new("https://localhost", None)
12            .tmf629()
13            .customer()
14            .list(None)?;
15
16        for c in clients {
17            println!("Name: {} Id: {}", c.get_name(), c.get_id());
18        }
19    }
20
21    Ok(())
22}
examples/get_product_inventory.rs (line 14)
8fn main() -> Result<(), TMFError> {
9    #[cfg(feature = "tmf637")]
10    {
11        use tmf_client::BlockingOperations;
12        use tmflib::HasName;
13
14        let products = TMFClient::new("https://localhost", None)
15            .tmf637()
16            .product()
17            .list(None)?;
18
19        for product in products {
20            println!("Name: {}", product.get_name())
21        }
22    }
23
24    Ok(())
25}
examples/get_resource_inventory.rs (line 12)
6fn main() -> Result<(), TMFError> {
7    #[cfg(feature = "tmf639")]
8    {
9        use tmf_client::BlockingOperations;
10        use tmflib::HasName;
11
12        let resources = TMFClient::new("https://localhost", None)
13            .tmf639()
14            .resource()
15            .list(None)?;
16
17        for resource in resources {
18            println!("Name: {}", resource.get_name())
19        }
20    }
21
22    Ok(())
23}
examples/get_qualification.rs (line 14)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "tmf645")]
11    {
12        use tmf_client::BlockingOperations;
13
14        let qualifications = TMFClient::new("https://localhost", None)
15            .tmf645()
16            .check_qualifcation()
17            .list(None)?;
18
19        for q in qualifications {
20            println!("Name: {} Id: {}", q.get_description(), q.get_id());
21        }
22    }
23
24    Ok(())
25}
Source

pub fn tmf620(&mut self) -> TMF620

Create access to TMF620 API

let tmf620 = TMFClient::new("http://localhost",None)
    .tmf620();
Examples found in repository?
examples/get_product_offering.rs (line 15)
8fn main() {
9    #[cfg(feature = "tmf620")]
10    {
11        let mut client = TMFClient::new("https://localhost", None);
12        let filter = QueryOptions::default()
13            //.limit(2)
14            .offset(0);
15        let tmf = client.tmf620().product_offering().list(Some(filter));
16        match tmf {
17            Ok(r) => {
18                // It worked
19                for c in r {
20                    println!("Entry: {} [{}]", c.get_name(), c.get_id())
21                }
22            }
23            Err(e) => {
24                println!("Error: {:?}", e)
25            }
26        }
27    }
28}
More examples
Hide additional examples
examples/get_product_specification.rs (line 15)
8fn main() {
9    #[cfg(feature = "tmf620")]
10    {
11        let mut client = TMFClient::new("https://localhost", None);
12        let filter = QueryOptions::default()
13            //.limit(2)
14            .offset(0);
15        let tmf = client.tmf620().product_specification().list(Some(filter));
16        match tmf {
17            Ok(r) => {
18                // It worked
19                for c in r {
20                    println!("Entry: {} [{}]", c.get_name(), c.get_id())
21                }
22            }
23            Err(e) => {
24                println!("Error: {:?}", e)
25            }
26        }
27    }
28}
examples/get_category.rs (line 13)
6fn main() {
7    #[cfg(feature = "blocking")]
8    {
9        use tmflib::HasName;
10        // Get a list of categories from TMF620
11        let mut client = TMFClient::new("https://localhost", None);
12        let filter = QueryOptions::default().limit(2).offset(0);
13        let tmf = client.tmf620().category().list(Some(filter));
14        match tmf {
15            Ok(r) => {
16                // It worked
17                for c in r {
18                    println!("Entry: {}", c.get_name())
19                }
20            }
21            Err(e) => {
22                println!("Error: {:?}", e)
23            }
24        }
25    }
26}
examples/get_product_offering_price.rs (line 17)
8fn main() {
9    #[cfg(feature = "tmf620")]
10    {
11        use tmf_client::BlockingOperations;
12
13        let mut client = TMFClient::new("https://localhost", None);
14        let filter = QueryOptions::default()
15            //.limit(2)
16            .offset(0);
17        let tmf = client.tmf620().product_offering_price().list(Some(filter));
18        match tmf {
19            Ok(r) => {
20                // It worked
21                for c in r {
22                    println!("Entry: {} [{}]", c.get_name(), c.get_id())
23                }
24            }
25            Err(e) => {
26                println!("Error: {:?}", e)
27            }
28        }
29    }
30}
examples/get_catalog.rs (line 18)
8fn main() {
9    #[cfg(feature = "blocking")]
10    {
11        // print!("Create Client...");
12        let mut client = TMFClient::new("https://localhost", None);
13        // println!("Done!");
14        // print!("Set Options...");
15        let filter = QueryOptions::default().limit(2).offset(0);
16        // println!("Done!");
17        // print!("Get Catalog...");
18        let tmf = client.tmf620().catalog().list(Some(filter));
19        // println!("Done!");
20        match tmf {
21            Ok(r) => {
22                // It worked
23                for c in r {
24                    println!("Entry: {}", c.get_name())
25                }
26            }
27            Err(e) => {
28                println!("Got an Error: {:?}", e)
29            }
30        }
31    }
32}
Source

pub fn tmf622(&mut self) -> TMF622

Create access to TMF622 API

let tmf620 = TMFClient::new("http://localhost",None)
    .tmf622();
Source

pub fn tmf629(&mut self) -> TMF629

Create access to TMF632 API

let tmf632 = TMFClient::new("http://localhost",None)
    .tmf629();
Examples found in repository?
examples/get_customer.rs (line 12)
7fn main() -> Result<(), TMFError> {
8    #[cfg(feature = "blocking")]
9    {
10        use tmflib::{HasId, HasName};
11        let clients = TMFClient::new("https://localhost", None)
12            .tmf629()
13            .customer()
14            .list(None)?;
15
16        for c in clients {
17            println!("Name: {} Id: {}", c.get_name(), c.get_id());
18        }
19    }
20
21    Ok(())
22}
More examples
Hide additional examples
examples/create_customer.rs (line 27)
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}
Source

pub fn tmf632(&mut self) -> TMF632

Create access to TMF632 API

let tmf632 = TMFClient::new("http://localhost",None)
    .tmf632();
Examples found in repository?
examples/get_organization.rs (line 13)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "blocking")]
11    {
12        let organizations = TMFClient::new("https://localhost", None)
13            .tmf632()
14            .organization()
15            .list(None)?;
16
17        for o in organizations {
18            println!("Name: {} , Id: {}", o.get_name(), o.get_id());
19        }
20    }
21
22    Ok(())
23}
More examples
Hide additional examples
examples/create_individual.rs (line 23)
13fn main() -> Result<(), TMFError> {
14    #[cfg(feature = "tmf632")]
15    {
16        let individual = Individual::new("John Example Citizen")
17            .email("John.q.cititzen@example.com")
18            .gender("Male")
19            .title("Master");
20
21        let mut client = TMFClient::new("https://localhost", Some(DEFAULT_PORT));
22
23        let new_individual = client.tmf632().individual().create(individual)?;
24
25        dbg!(new_individual);
26    }
27
28    Ok(())
29}
examples/create_organization.rs (line 17)
7fn main() -> Result<(), TMFError> {
8    #[cfg(feature = "blocking")]
9    {
10        use tmf_client::DEFAULT_PORT;
11        let org = Organization::new("An Organization");
12
13        #[cfg(feature = "tmf632")]
14        use tmflib::tmf632::organization_v4::Organization;
15
16        let client = TMFClient::new("https://localhost", Some(DEFAULT_PORT))
17            .tmf632()
18            .organization()
19            .create(org)?;
20
21        dbg!(client);
22    }
23
24    Ok(())
25}
examples/get_individual.rs (line 13)
7fn main() -> Result<(), TMFError> {
8    #[cfg(feature = "blocking")]
9    {
10        use tmflib::{HasId, HasName};
11        let mut client = TMFClient::new("https://localhost", None);
12
13        let individuals = client.tmf632().individual().list(None)?;
14
15        for i in individuals {
16            println!(
17                "Name: {} Id: {}, Gender: {}",
18                i.get_name(),
19                i.get_id(),
20                i.gender.unwrap_or("Gender not set".to_string())
21            );
22        }
23    }
24
25    Ok(())
26}
Source

pub fn tmf633(&mut self) -> TMF633

Create access to TMF633 API

let tmf633 = TMFClient::new("http://localhost",None)
    .tmf633();
Source

pub fn tmf637(&mut self) -> TMF637

Create access to TMF637 API

let tmf637 = TMFClient::new("http://localhost",None)
    .tmf637();
Examples found in repository?
examples/get_product_inventory.rs (line 15)
8fn main() -> Result<(), TMFError> {
9    #[cfg(feature = "tmf637")]
10    {
11        use tmf_client::BlockingOperations;
12        use tmflib::HasName;
13
14        let products = TMFClient::new("https://localhost", None)
15            .tmf637()
16            .product()
17            .list(None)?;
18
19        for product in products {
20            println!("Name: {}", product.get_name())
21        }
22    }
23
24    Ok(())
25}
Source

pub fn tmf638(&mut self) -> TMF638

Create access to TMF638 API

let tmf638 = TMFClient::new("http://localhost",None)
    .tmf638();
Examples found in repository?
examples/get_service_inventory.rs (line 19)
8fn main() -> Result<(), TMFError> {
9    #[cfg(feature = "blocking")]
10    {
11        use tmf_client::QueryOptions;
12
13        let opt = QueryOptions::default()
14            // .name("SD L3 Service CFS Instance #0123087452")
15            .limit(1)
16            .offset(1);
17
18        let services = TMFClient::new("https://localhost", None)
19            .tmf638()
20            .service()
21            // .list(Some(opt))?;
22            .list(Some(opt))?;
23
24        let service = services.first().unwrap();
25
26        let bandwidth = service.get_characteristics("bandwidth");
27
28        dbg!(bandwidth);
29    }
30
31    Ok(())
32}
Source

pub fn tmf639(&mut self) -> TMF639

Create access to TMF639 API

let tmf639 = TMFClient::new("http://localhost",None)
    .tmf639();
Examples found in repository?
examples/get_resource_inventory.rs (line 13)
6fn main() -> Result<(), TMFError> {
7    #[cfg(feature = "tmf639")]
8    {
9        use tmf_client::BlockingOperations;
10        use tmflib::HasName;
11
12        let resources = TMFClient::new("https://localhost", None)
13            .tmf639()
14            .resource()
15            .list(None)?;
16
17        for resource in resources {
18            println!("Name: {}", resource.get_name())
19        }
20    }
21
22    Ok(())
23}
Source

pub fn tmf645(&mut self) -> TMF645

Create access to TMF645 API

let tmf645 = TMFClient::new("http://localhost",None)
    .tmf645();
Examples found in repository?
examples/get_qualification.rs (line 15)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "tmf645")]
11    {
12        use tmf_client::BlockingOperations;
13
14        let qualifications = TMFClient::new("https://localhost", None)
15            .tmf645()
16            .check_qualifcation()
17            .list(None)?;
18
19        for q in qualifications {
20            println!("Name: {} Id: {}", q.get_description(), q.get_id());
21        }
22    }
23
24    Ok(())
25}
More examples
Hide additional examples
examples/create_qualification.rs (line 18)
8fn main() -> Result<(), TMFError> {
9    #[cfg(feature = "blocking")]
10    {
11        use tmf_client::TMFClient;
12        use tmf_client::DEFAULT_PORT;
13        use tmflib::tmf645::check_service_qualification::CheckServiceQualification;
14
15        let qualification = CheckServiceQualification::new("A Qualification Example");
16
17        let new_qual = TMFClient::new("https://localhost", Some(DEFAULT_PORT))
18            .tmf645()
19            .check_qualifcation()
20            .create(qualification)?;
21
22        dbg!(new_qual);
23    }
24    Ok(())
25}
Source

pub fn tmf648(&mut self) -> TMF648

Create access to TMF648 API

let tmf648 = TMFClient::new("http://localhost",None)
    .tmf648();
Examples found in repository?
examples/create_quote.rs (line 16)
6fn main() -> Result<(), TMFError> {
7    #[cfg(feature = "tmf632")]
8    {
9        #[cfg(feature = "tmf648")]
10        use tmflib::tmf648::quote::Quote;
11
12        use tmf_client::{BlockingOperations, TMFClient};
13        let quote = Quote::new();
14
15        let new_quote = TMFClient::new("https://localhost", None)
16            .tmf648()
17            .quote()
18            .create(quote)?;
19
20        dbg!(new_quote);
21    }
22
23    Ok(())
24}
More examples
Hide additional examples
examples/get_quote.rs (line 12)
5fn main() -> Result<(), TMFError> {
6    #[cfg(feature = "tmf648")]
7    {
8        use tmf_client::BlockingOperations;
9
10        let mut client = TMFClient::new("https://localhost", None);
11
12        let quotes = client.tmf648().quote().list(None)?;
13
14        for i in quotes {
15            use tmflib::{HasDescription, HasName};
16
17            println!("Name: {}, \tDesc: {}", &i.get_name(), i.get_description());
18        }
19    }
20
21    Ok(())
22}
Source

pub fn tmf663(&mut self) -> TMF663

Create access to TMF663 API

let tmf663 = TMFClient::new("http://localhost",None)
    .tmf663();
Examples found in repository?
examples/create_shoppingcart.rs (line 19)
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}
More examples
Hide additional examples
examples/get_shoppingcart.rs (line 21)
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}
Source

pub fn tmf674(&mut self) -> TMF674

Create access to TMF674 API

let tmf674 = TMFClient::new("http://localhost",None)
    .tmf674();
Examples found in repository?
examples/create_site.rs (line 15)
9fn main() -> Result<(), TMFError> {
10    #[cfg(feature = "tmf674")]
11    {
12        let site = GeographicSite::new("Example Bad Site");
13
14        let new_site = TMFClient::new("https://localhost", None)
15            .tmf674()
16            .site()
17            .create(site)?;
18
19        dbg!(new_site);
20    }
21
22    Ok(())
23}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more