use tmflib::tmf620::catalog::Catalog;
use tmflib::tmf620::category::Category;
use tmflib::tmf620::product_offering::ProductOffering;
use tmflib::tmf620::product_offering_price::ProductOfferingPrice;
use tmflib::tmf620::product_specification::ProductSpecification;
use super::{create_tmf, delete_tmf, get_tmf, list_tmf, update_tmf};
use crate::common::tmf_error::TMFError;
#[cfg(not(feature = "blocking"))]
use crate::AsyncOperations;
#[cfg(feature = "blocking")]
use crate::BlockingOperations;
use crate::{Config, HasNew, QueryOptions};
#[derive(Clone, Debug)]
pub struct TMF620Category {
config: Config,
}
impl TMF620Category {
pub fn new(config: Config) -> TMF620Category {
TMF620Category { config }
}
}
#[cfg(feature = "blocking")]
impl BlockingOperations for TMF620Category {
type TMF = Category;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item)
}
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id)
}
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into())
}
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter)
}
fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch)
}
}
#[cfg(not(feature = "blocking"))]
impl AsyncOperations for TMF620Category {
type TMF = Category;
async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item).await
}
async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id).await
}
async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into()).await
}
async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter).await
}
async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch).await
}
}
#[derive(Clone, Debug)]
pub struct TMF620Catalog {
config: Config,
}
impl TMF620Catalog {
pub fn new(config: Config) -> TMF620Catalog {
TMF620Catalog { config }
}
}
#[cfg(feature = "blocking")]
impl BlockingOperations for TMF620Catalog {
type TMF = Catalog;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item)
}
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id)
}
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into())
}
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter)
}
fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch)
}
}
#[cfg(not(feature = "blocking"))]
impl AsyncOperations for TMF620Catalog {
type TMF = Catalog;
async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item).await
}
async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id).await
}
async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into()).await
}
async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter).await
}
async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch).await
}
}
#[derive(Clone, Debug)]
pub struct TMF620ProductOffering {
config: Config,
}
impl TMF620ProductOffering {
pub fn new(config: Config) -> TMF620ProductOffering {
TMF620ProductOffering { config }
}
}
#[cfg(feature = "blocking")]
impl BlockingOperations for TMF620ProductOffering {
type TMF = ProductOffering;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item)
}
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id)
}
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into())
}
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter)
}
fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch)
}
}
#[cfg(not(feature = "blocking"))]
impl AsyncOperations for TMF620ProductOffering {
type TMF = ProductOffering;
async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item).await
}
async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id).await
}
async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into()).await
}
async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter).await
}
async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch).await
}
}
#[derive(Clone, Debug)]
pub struct TMF620ProductOfferingPrice {
config: Config,
}
impl TMF620ProductOfferingPrice {
pub fn new(config: Config) -> TMF620ProductOfferingPrice {
TMF620ProductOfferingPrice { config }
}
}
#[cfg(feature = "blocking")]
impl BlockingOperations for TMF620ProductOfferingPrice {
type TMF = ProductOfferingPrice;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item)
}
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id)
}
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into())
}
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter)
}
fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch)
}
}
#[cfg(not(feature = "blocking"))]
impl AsyncOperations for TMF620ProductOfferingPrice {
type TMF = ProductOfferingPrice;
async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item).await
}
async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id).await
}
async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into()).await
}
async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter).await
}
async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch).await
}
}
#[derive(Clone, Debug)]
pub struct TMF620ProductSpecification {
config: Config,
}
impl TMF620ProductSpecification {
pub fn new(config: Config) -> TMF620ProductSpecification {
TMF620ProductSpecification { config }
}
}
#[cfg(feature = "blocking")]
impl BlockingOperations for TMF620ProductSpecification {
type TMF = ProductSpecification;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item)
}
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id)
}
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into())
}
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter)
}
fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch)
}
}
#[cfg(not(feature = "blocking"))]
impl AsyncOperations for TMF620ProductSpecification {
type TMF = ProductSpecification;
async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
create_tmf(&self.config, item).await
}
async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
delete_tmf(&self.config, id).await
}
async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
get_tmf(&self.config, id.into()).await
}
async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
list_tmf(&self.config, filter).await
}
async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
update_tmf(&self.config, id, patch).await
}
}
#[derive(Clone, Debug)]
pub struct TMF620 {
config: Config,
}
impl HasNew<TMF620> for TMF620 {
fn new(config: Config) -> TMF620 {
TMF620 { config }
}
}
impl TMF620 {
pub fn catalog(&self) -> TMF620Catalog {
TMF620Catalog::new(self.config.clone())
}
pub fn category(&self) -> TMF620Category {
TMF620Category::new(self.config.clone())
}
pub fn product_offering(&self) -> TMF620ProductOffering {
TMF620ProductOffering::new(self.config.clone())
}
pub fn product_offering_price(&self) -> TMF620ProductOfferingPrice {
TMF620ProductOfferingPrice::new(self.config.clone())
}
pub fn product_specification(&self) -> TMF620ProductSpecification {
TMF620ProductSpecification::new(self.config.clone())
}
}