1use tmflib::tmf620::catalog::Catalog;
4use tmflib::tmf620::category::Category;
5use tmflib::tmf620::product_offering::ProductOffering;
6use tmflib::tmf620::product_offering_price::ProductOfferingPrice;
7use tmflib::tmf620::product_specification::ProductSpecification;
8
9use super::{create_tmf, delete_tmf, get_tmf, list_tmf, update_tmf};
10use crate::common::tmf_error::TMFError;
11#[cfg(not(feature = "blocking"))]
12use crate::AsyncOperations;
13#[cfg(feature = "blocking")]
14use crate::BlockingOperations;
15
16use crate::{Config, HasNew, QueryOptions};
17
18#[derive(Clone, Debug)]
20pub struct TMF620Category {
21 config: Config,
22}
23
24impl TMF620Category {
25 pub fn new(config: Config) -> TMF620Category {
27 TMF620Category { config }
28 }
29}
30
31#[cfg(feature = "blocking")]
32impl BlockingOperations for TMF620Category {
33 type TMF = Category;
34
35 fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
36 create_tmf(&self.config, item)
37 }
38 fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
39 delete_tmf(&self.config, id)
40 }
41 fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
42 get_tmf(&self.config, id.into())
43 }
44 fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
45 list_tmf(&self.config, filter)
46 }
47 fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
48 update_tmf(&self.config, id, patch)
49 }
50}
51
52#[cfg(not(feature = "blocking"))]
53impl AsyncOperations for TMF620Category {
54 type TMF = Category;
55
56 async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
57 create_tmf(&self.config, item).await
58 }
59 async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
60 delete_tmf(&self.config, id).await
61 }
62 async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
63 get_tmf(&self.config, id.into()).await
64 }
65 async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
66 list_tmf(&self.config, filter).await
67 }
68 async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
69 update_tmf(&self.config, id, patch).await
70 }
71}
72
73#[derive(Clone, Debug)]
75pub struct TMF620Catalog {
76 config: Config,
77}
78
79impl TMF620Catalog {
80 pub fn new(config: Config) -> TMF620Catalog {
82 TMF620Catalog { config }
83 }
84}
85
86#[cfg(feature = "blocking")]
87impl BlockingOperations for TMF620Catalog {
88 type TMF = Catalog;
89
90 fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
91 create_tmf(&self.config, item)
92 }
93 fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
94 delete_tmf(&self.config, id)
95 }
96 fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
97 get_tmf(&self.config, id.into())
98 }
99 fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
100 list_tmf(&self.config, filter)
101 }
102 fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
103 update_tmf(&self.config, id, patch)
104 }
105}
106
107#[cfg(not(feature = "blocking"))]
108impl AsyncOperations for TMF620Catalog {
109 type TMF = Catalog;
110
111 async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
112 create_tmf(&self.config, item).await
113 }
114 async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
115 delete_tmf(&self.config, id).await
116 }
117 async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
118 get_tmf(&self.config, id.into()).await
119 }
120 async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
121 list_tmf(&self.config, filter).await
122 }
123 async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
124 update_tmf(&self.config, id, patch).await
125 }
126}
127
128#[derive(Clone, Debug)]
130pub struct TMF620ProductOffering {
131 config: Config,
132}
133
134impl TMF620ProductOffering {
135 pub fn new(config: Config) -> TMF620ProductOffering {
137 TMF620ProductOffering { config }
138 }
139}
140
141#[cfg(feature = "blocking")]
142impl BlockingOperations for TMF620ProductOffering {
143 type TMF = ProductOffering;
144
145 fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
146 create_tmf(&self.config, item)
147 }
148 fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
149 delete_tmf(&self.config, id)
150 }
151 fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
152 get_tmf(&self.config, id.into())
153 }
154 fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
155 list_tmf(&self.config, filter)
156 }
157 fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
158 update_tmf(&self.config, id, patch)
159 }
160}
161
162#[cfg(not(feature = "blocking"))]
163impl AsyncOperations for TMF620ProductOffering {
164 type TMF = ProductOffering;
165
166 async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
167 create_tmf(&self.config, item).await
168 }
169 async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
170 delete_tmf(&self.config, id).await
171 }
172 async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
173 get_tmf(&self.config, id.into()).await
174 }
175 async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
176 list_tmf(&self.config, filter).await
177 }
178 async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
179 update_tmf(&self.config, id, patch).await
180 }
181}
182
183#[derive(Clone, Debug)]
185pub struct TMF620ProductOfferingPrice {
186 config: Config,
187}
188
189impl TMF620ProductOfferingPrice {
190 pub fn new(config: Config) -> TMF620ProductOfferingPrice {
192 TMF620ProductOfferingPrice { config }
193 }
194}
195
196#[cfg(feature = "blocking")]
197impl BlockingOperations for TMF620ProductOfferingPrice {
198 type TMF = ProductOfferingPrice;
199
200 fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
201 create_tmf(&self.config, item)
202 }
203 fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
204 delete_tmf(&self.config, id)
205 }
206 fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
207 get_tmf(&self.config, id.into())
208 }
209 fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
210 list_tmf(&self.config, filter)
211 }
212 fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
213 update_tmf(&self.config, id, patch)
214 }
215}
216
217#[cfg(not(feature = "blocking"))]
218impl AsyncOperations for TMF620ProductOfferingPrice {
219 type TMF = ProductOfferingPrice;
220
221 async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
222 create_tmf(&self.config, item).await
223 }
224 async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
225 delete_tmf(&self.config, id).await
226 }
227 async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
228 get_tmf(&self.config, id.into()).await
229 }
230 async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
231 list_tmf(&self.config, filter).await
232 }
233 async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
234 update_tmf(&self.config, id, patch).await
235 }
236}
237
238#[derive(Clone, Debug)]
240pub struct TMF620ProductSpecification {
241 config: Config,
242}
243
244impl TMF620ProductSpecification {
245 pub fn new(config: Config) -> TMF620ProductSpecification {
247 TMF620ProductSpecification { config }
248 }
249}
250
251#[cfg(feature = "blocking")]
252impl BlockingOperations for TMF620ProductSpecification {
253 type TMF = ProductSpecification;
254
255 fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
256 create_tmf(&self.config, item)
257 }
258 fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
259 delete_tmf(&self.config, id)
260 }
261 fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
262 get_tmf(&self.config, id.into())
263 }
264 fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
265 list_tmf(&self.config, filter)
266 }
267 fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
268 update_tmf(&self.config, id, patch)
269 }
270}
271
272#[cfg(not(feature = "blocking"))]
273impl AsyncOperations for TMF620ProductSpecification {
274 type TMF = ProductSpecification;
275
276 async fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError> {
277 create_tmf(&self.config, item).await
278 }
279 async fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError> {
280 delete_tmf(&self.config, id).await
281 }
282 async fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError> {
283 get_tmf(&self.config, id.into()).await
284 }
285 async fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError> {
286 list_tmf(&self.config, filter).await
287 }
288 async fn update(&self, id: impl Into<String>, patch: Self::TMF) -> Result<Self::TMF, TMFError> {
289 update_tmf(&self.config, id, patch).await
290 }
291}
292
293#[derive(Clone, Debug)]
295pub struct TMF620 {
296 config: Config,
297}
298
299impl HasNew<TMF620> for TMF620 {
300 fn new(config: Config) -> TMF620 {
301 TMF620 { config }
302 }
303}
304
305impl TMF620 {
306 pub fn catalog(&self) -> TMF620Catalog {
308 TMF620Catalog::new(self.config.clone())
309 }
310 pub fn category(&self) -> TMF620Category {
312 TMF620Category::new(self.config.clone())
313 }
314
315 pub fn product_offering(&self) -> TMF620ProductOffering {
317 TMF620ProductOffering::new(self.config.clone())
318 }
319
320 pub fn product_offering_price(&self) -> TMF620ProductOfferingPrice {
322 TMF620ProductOfferingPrice::new(self.config.clone())
323 }
324
325 pub fn product_specification(&self) -> TMF620ProductSpecification {
327 TMF620ProductSpecification::new(self.config.clone())
328 }
329}