thunkmetrc_client/
lib.rs

1use reqwest::Client;
2use serde_json::Value;
3use std::error::Error;
4
5#[derive(Clone)]
6pub struct MetrcClient {
7    client: Client,
8    base_url: String,
9    vendor_key: String,
10    user_key: String,
11}
12
13impl MetrcClient {
14    pub fn new(base_url: &str, vendor_key: &str, user_key: &str) -> Self {
15        MetrcClient {
16            client: Client::new(),
17            base_url: base_url.trim_end_matches('/').to_string(),
18            vendor_key: vendor_key.to_string(),
19            user_key: user_key.to_string(),
20        }
21    }
22
23    async fn send(&self, method: reqwest::Method, path: &str, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
24        let url = format!("{}{}", self.base_url, path);
25        let mut req = self.client.request(method, &url);
26        req = req.basic_auth(&self.vendor_key, Some(&self.user_key));
27
28        if let Some(b) = body {
29            req = req.json(b);
30        }
31
32        let resp = req.send().await?;
33        let status = resp.status();
34        if !status.is_success() {
35            return Err(format!("API Error: {}", status).into());
36        }
37        if status == reqwest::StatusCode::NO_CONTENT {
38            return Ok(None);
39        }
40        let json: Value = resp.json().await?;
41        Ok(Some(json))
42    }
43
44    /// POST CreateAdditives V1
45    /// Permissions Required:
46    ///   - Manage Plants Additives
47    ///
48    pub async fn plants_create_additives_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
49        let mut path = format!("/plants/v1/additives");
50        let mut query_params = Vec::new();
51        if let Some(p) = license_number {
52            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
53        }
54        if !query_params.is_empty() {
55            path.push_str("?");
56            path.push_str(&query_params.join("&"));
57        }
58        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
59    }
60
61    /// POST CreateAdditives V2
62    /// Records additive usage details applied to specific plants at a Facility.
63    /// 
64    ///   Permissions Required:
65    ///   - Manage Plants Additives
66    ///
67    pub async fn plants_create_additives_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
68        let mut path = format!("/plants/v2/additives");
69        let mut query_params = Vec::new();
70        if let Some(p) = license_number {
71            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
72        }
73        if !query_params.is_empty() {
74            path.push_str("?");
75            path.push_str(&query_params.join("&"));
76        }
77        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
78    }
79
80    /// POST CreateAdditivesBylocation V1
81    /// Permissions Required:
82    ///   - Manage Plants
83    ///   - Manage Plants Additives
84    ///
85    pub async fn plants_create_additives_bylocation_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
86        let mut path = format!("/plants/v1/additives/bylocation");
87        let mut query_params = Vec::new();
88        if let Some(p) = license_number {
89            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
90        }
91        if !query_params.is_empty() {
92            path.push_str("?");
93            path.push_str(&query_params.join("&"));
94        }
95        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
96    }
97
98    /// POST CreateAdditivesBylocation V2
99    /// Records additive usage for plants based on their location within a specified Facility.
100    /// 
101    ///   Permissions Required:
102    ///   - Manage Plants
103    ///   - Manage Plants Additives
104    ///
105    pub async fn plants_create_additives_bylocation_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
106        let mut path = format!("/plants/v2/additives/bylocation");
107        let mut query_params = Vec::new();
108        if let Some(p) = license_number {
109            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
110        }
111        if !query_params.is_empty() {
112            path.push_str("?");
113            path.push_str(&query_params.join("&"));
114        }
115        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
116    }
117
118    /// POST CreateAdditivesBylocationUsingtemplate V2
119    /// Records additive usage for plants by location using a predefined additive template at a specified Facility.
120    /// 
121    ///   Permissions Required:
122    ///   - Manage Plants Additives
123    ///
124    pub async fn plants_create_additives_bylocation_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
125        let mut path = format!("/plants/v2/additives/bylocation/usingtemplate");
126        let mut query_params = Vec::new();
127        if let Some(p) = license_number {
128            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
129        }
130        if !query_params.is_empty() {
131            path.push_str("?");
132            path.push_str(&query_params.join("&"));
133        }
134        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
135    }
136
137    /// POST CreateAdditivesUsingtemplate V2
138    /// Records additive usage for plants using predefined additive templates at a specified Facility.
139    /// 
140    ///   Permissions Required:
141    ///   - Manage Plants Additives
142    ///
143    pub async fn plants_create_additives_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
144        let mut path = format!("/plants/v2/additives/usingtemplate");
145        let mut query_params = Vec::new();
146        if let Some(p) = license_number {
147            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
148        }
149        if !query_params.is_empty() {
150            path.push_str("?");
151            path.push_str(&query_params.join("&"));
152        }
153        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
154    }
155
156    /// POST CreateChangegrowthphases V1
157    /// Permissions Required:
158    ///   - View Veg/Flower Plants
159    ///   - Manage Veg/Flower Plants Inventory
160    ///
161    pub async fn plants_create_changegrowthphases_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
162        let mut path = format!("/plants/v1/changegrowthphases");
163        let mut query_params = Vec::new();
164        if let Some(p) = license_number {
165            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
166        }
167        if !query_params.is_empty() {
168            path.push_str("?");
169            path.push_str(&query_params.join("&"));
170        }
171        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
172    }
173
174    /// POST CreateHarvestplants V1
175    /// NOTE: If HarvestName is excluded from the request body, or if it is passed in as null, the harvest name is auto-generated.
176    /// 
177    ///   Permissions Required:
178    ///   - View Veg/Flower Plants
179    ///   - Manicure/Harvest Veg/Flower Plants
180    ///
181    pub async fn plants_create_harvestplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
182        let mut path = format!("/plants/v1/harvestplants");
183        let mut query_params = Vec::new();
184        if let Some(p) = license_number {
185            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
186        }
187        if !query_params.is_empty() {
188            path.push_str("?");
189            path.push_str(&query_params.join("&"));
190        }
191        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
192    }
193
194    /// POST CreateManicure V2
195    /// Creates harvest product records from plant batches at a specified Facility.
196    /// 
197    ///   Permissions Required:
198    ///   - View Veg/Flower Plants
199    ///   - Manicure/Harvest Veg/Flower Plants
200    ///
201    pub async fn plants_create_manicure_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
202        let mut path = format!("/plants/v2/manicure");
203        let mut query_params = Vec::new();
204        if let Some(p) = license_number {
205            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
206        }
207        if !query_params.is_empty() {
208            path.push_str("?");
209            path.push_str(&query_params.join("&"));
210        }
211        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
212    }
213
214    /// POST CreateManicureplants V1
215    /// Permissions Required:
216    ///   - View Veg/Flower Plants
217    ///   - Manicure/Harvest Veg/Flower Plants
218    ///
219    pub async fn plants_create_manicureplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
220        let mut path = format!("/plants/v1/manicureplants");
221        let mut query_params = Vec::new();
222        if let Some(p) = license_number {
223            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
224        }
225        if !query_params.is_empty() {
226            path.push_str("?");
227            path.push_str(&query_params.join("&"));
228        }
229        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
230    }
231
232    /// POST CreateMoveplants V1
233    /// Permissions Required:
234    ///   - View Veg/Flower Plants
235    ///   - Manage Veg/Flower Plants Inventory
236    ///
237    pub async fn plants_create_moveplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
238        let mut path = format!("/plants/v1/moveplants");
239        let mut query_params = Vec::new();
240        if let Some(p) = license_number {
241            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
242        }
243        if !query_params.is_empty() {
244            path.push_str("?");
245            path.push_str(&query_params.join("&"));
246        }
247        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
248    }
249
250    /// POST CreatePlantbatchPackage V1
251    /// Permissions Required:
252    ///   - View Immature Plants
253    ///   - Manage Immature Plants Inventory
254    ///   - View Veg/Flower Plants
255    ///   - Manage Veg/Flower Plants Inventory
256    ///   - View Packages
257    ///   - Create/Submit/Discontinue Packages
258    ///
259    pub async fn plants_create_plantbatch_package_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
260        let mut path = format!("/plants/v1/create/plantbatch/packages");
261        let mut query_params = Vec::new();
262        if let Some(p) = license_number {
263            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
264        }
265        if !query_params.is_empty() {
266            path.push_str("?");
267            path.push_str(&query_params.join("&"));
268        }
269        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
270    }
271
272    /// POST CreatePlantbatchPackage V2
273    /// Creates packages from plant batches at a specified Facility.
274    /// 
275    ///   Permissions Required:
276    ///   - View Immature Plants
277    ///   - Manage Immature Plants Inventory
278    ///   - View Veg/Flower Plants
279    ///   - Manage Veg/Flower Plants Inventory
280    ///   - View Packages
281    ///   - Create/Submit/Discontinue Packages
282    ///
283    pub async fn plants_create_plantbatch_package_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
284        let mut path = format!("/plants/v2/plantbatch/packages");
285        let mut query_params = Vec::new();
286        if let Some(p) = license_number {
287            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
288        }
289        if !query_params.is_empty() {
290            path.push_str("?");
291            path.push_str(&query_params.join("&"));
292        }
293        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
294    }
295
296    /// POST CreatePlantings V1
297    /// Permissions Required:
298    ///   - View Immature Plants
299    ///   - Manage Immature Plants Inventory
300    ///   - View Veg/Flower Plants
301    ///   - Manage Veg/Flower Plants Inventory
302    ///
303    pub async fn plants_create_plantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
304        let mut path = format!("/plants/v1/create/plantings");
305        let mut query_params = Vec::new();
306        if let Some(p) = license_number {
307            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
308        }
309        if !query_params.is_empty() {
310            path.push_str("?");
311            path.push_str(&query_params.join("&"));
312        }
313        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
314    }
315
316    /// POST CreatePlantings V2
317    /// Creates new plant batches at a specified Facility from existing plant data.
318    /// 
319    ///   Permissions Required:
320    ///   - View Immature Plants
321    ///   - Manage Immature Plants Inventory
322    ///   - View Veg/Flower Plants
323    ///   - Manage Veg/Flower Plants Inventory
324    ///
325    pub async fn plants_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
326        let mut path = format!("/plants/v2/plantings");
327        let mut query_params = Vec::new();
328        if let Some(p) = license_number {
329            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
330        }
331        if !query_params.is_empty() {
332            path.push_str("?");
333            path.push_str(&query_params.join("&"));
334        }
335        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
336    }
337
338    /// POST CreateWaste V1
339    /// Permissions Required:
340    ///   - Manage Plants Waste
341    ///
342    pub async fn plants_create_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
343        let mut path = format!("/plants/v1/waste");
344        let mut query_params = Vec::new();
345        if let Some(p) = license_number {
346            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
347        }
348        if !query_params.is_empty() {
349            path.push_str("?");
350            path.push_str(&query_params.join("&"));
351        }
352        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
353    }
354
355    /// POST CreateWaste V2
356    /// Records waste events for plants at a Facility, including method, reason, and location details.
357    /// 
358    ///   Permissions Required:
359    ///   - Manage Plants Waste
360    ///
361    pub async fn plants_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
362        let mut path = format!("/plants/v2/waste");
363        let mut query_params = Vec::new();
364        if let Some(p) = license_number {
365            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
366        }
367        if !query_params.is_empty() {
368            path.push_str("?");
369            path.push_str(&query_params.join("&"));
370        }
371        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
372    }
373
374    /// DELETE Delete V1
375    /// Permissions Required:
376    ///   - View Veg/Flower Plants
377    ///   - Destroy Veg/Flower Plants
378    ///
379    pub async fn plants_delete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
380        let mut path = format!("/plants/v1");
381        let mut query_params = Vec::new();
382        if let Some(p) = license_number {
383            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
384        }
385        if !query_params.is_empty() {
386            path.push_str("?");
387            path.push_str(&query_params.join("&"));
388        }
389        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
390    }
391
392    /// DELETE Delete V2
393    /// Removes plants from a Facility’s inventory while recording the reason for their disposal.
394    /// 
395    ///   Permissions Required:
396    ///   - View Veg/Flower Plants
397    ///   - Destroy Veg/Flower Plants
398    ///
399    pub async fn plants_delete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
400        let mut path = format!("/plants/v2");
401        let mut query_params = Vec::new();
402        if let Some(p) = license_number {
403            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
404        }
405        if !query_params.is_empty() {
406            path.push_str("?");
407            path.push_str(&query_params.join("&"));
408        }
409        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
410    }
411
412    /// GET Get V1
413    /// Permissions Required:
414    ///   - View Veg/Flower Plants
415    ///
416    pub async fn plants_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
417        let mut path = format!("/plants/v1/{}", urlencoding::encode(id).as_ref());
418        let mut query_params = Vec::new();
419        if let Some(p) = license_number {
420            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
421        }
422        if !query_params.is_empty() {
423            path.push_str("?");
424            path.push_str(&query_params.join("&"));
425        }
426        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
427    }
428
429    /// GET Get V2
430    /// Retrieves a Plant by Id.
431    /// 
432    ///   Permissions Required:
433    ///   - View Veg/Flower Plants
434    ///
435    pub async fn plants_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
436        let mut path = format!("/plants/v2/{}", urlencoding::encode(id).as_ref());
437        let mut query_params = Vec::new();
438        if let Some(p) = license_number {
439            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
440        }
441        if !query_params.is_empty() {
442            path.push_str("?");
443            path.push_str(&query_params.join("&"));
444        }
445        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
446    }
447
448    /// GET GetAdditives V1
449    /// Permissions Required:
450    ///   - View/Manage Plants Additives
451    ///
452    pub async fn plants_get_additives_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
453        let mut path = format!("/plants/v1/additives");
454        let mut query_params = Vec::new();
455        if let Some(p) = last_modified_end {
456            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
457        }
458        if let Some(p) = last_modified_start {
459            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
460        }
461        if let Some(p) = license_number {
462            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
463        }
464        if !query_params.is_empty() {
465            path.push_str("?");
466            path.push_str(&query_params.join("&"));
467        }
468        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
469    }
470
471    /// GET GetAdditives V2
472    /// Retrieves additive records applied to plants at a specified Facility.
473    /// 
474    ///   Permissions Required:
475    ///   - View/Manage Plants Additives
476    ///
477    pub async fn plants_get_additives_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
478        let mut path = format!("/plants/v2/additives");
479        let mut query_params = Vec::new();
480        if let Some(p) = last_modified_end {
481            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
482        }
483        if let Some(p) = last_modified_start {
484            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
485        }
486        if let Some(p) = license_number {
487            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
488        }
489        if let Some(p) = page_number {
490            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
491        }
492        if let Some(p) = page_size {
493            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
494        }
495        if !query_params.is_empty() {
496            path.push_str("?");
497            path.push_str(&query_params.join("&"));
498        }
499        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
500    }
501
502    /// GET GetAdditivesTypes V1
503    /// Permissions Required:
504    ///   -
505    ///
506    pub async fn plants_get_additives_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
507        let mut path = format!("/plants/v1/additives/types");
508        let mut query_params = Vec::new();
509        if let Some(p) = no {
510            query_params.push(format!("No={}", urlencoding::encode(&p)));
511        }
512        if !query_params.is_empty() {
513            path.push_str("?");
514            path.push_str(&query_params.join("&"));
515        }
516        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
517    }
518
519    /// GET GetAdditivesTypes V2
520    /// Retrieves a list of all plant additive types defined within a Facility.
521    /// 
522    ///   Permissions Required:
523    ///   - None
524    ///
525    pub async fn plants_get_additives_types_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
526        let mut path = format!("/plants/v2/additives/types");
527        let mut query_params = Vec::new();
528        if let Some(p) = no {
529            query_params.push(format!("No={}", urlencoding::encode(&p)));
530        }
531        if !query_params.is_empty() {
532            path.push_str("?");
533            path.push_str(&query_params.join("&"));
534        }
535        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
536    }
537
538    /// GET GetByLabel V1
539    /// Permissions Required:
540    ///   - View Veg/Flower Plants
541    ///
542    pub async fn plants_get_by_label_v1(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
543        let mut path = format!("/plants/v1/{}", urlencoding::encode(label).as_ref());
544        let mut query_params = Vec::new();
545        if let Some(p) = license_number {
546            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
547        }
548        if !query_params.is_empty() {
549            path.push_str("?");
550            path.push_str(&query_params.join("&"));
551        }
552        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
553    }
554
555    /// GET GetByLabel V2
556    /// Retrieves a Plant by label.
557    /// 
558    ///   Permissions Required:
559    ///   - View Veg/Flower Plants
560    ///
561    pub async fn plants_get_by_label_v2(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
562        let mut path = format!("/plants/v2/{}", urlencoding::encode(label).as_ref());
563        let mut query_params = Vec::new();
564        if let Some(p) = license_number {
565            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
566        }
567        if !query_params.is_empty() {
568            path.push_str("?");
569            path.push_str(&query_params.join("&"));
570        }
571        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
572    }
573
574    /// GET GetFlowering V1
575    /// Permissions Required:
576    ///   - View Veg/Flower Plants
577    ///
578    pub async fn plants_get_flowering_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
579        let mut path = format!("/plants/v1/flowering");
580        let mut query_params = Vec::new();
581        if let Some(p) = last_modified_end {
582            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
583        }
584        if let Some(p) = last_modified_start {
585            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
586        }
587        if let Some(p) = license_number {
588            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
589        }
590        if !query_params.is_empty() {
591            path.push_str("?");
592            path.push_str(&query_params.join("&"));
593        }
594        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
595    }
596
597    /// GET GetFlowering V2
598    /// Retrieves flowering-phase plants at a specified Facility, optionally filtered by last modified date.
599    /// 
600    ///   Permissions Required:
601    ///   - View Veg/Flower Plants
602    ///
603    pub async fn plants_get_flowering_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
604        let mut path = format!("/plants/v2/flowering");
605        let mut query_params = Vec::new();
606        if let Some(p) = last_modified_end {
607            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
608        }
609        if let Some(p) = last_modified_start {
610            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
611        }
612        if let Some(p) = license_number {
613            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
614        }
615        if let Some(p) = page_number {
616            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
617        }
618        if let Some(p) = page_size {
619            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
620        }
621        if !query_params.is_empty() {
622            path.push_str("?");
623            path.push_str(&query_params.join("&"));
624        }
625        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
626    }
627
628    /// GET GetGrowthPhases V1
629    /// Permissions Required:
630    ///   - None
631    ///
632    pub async fn plants_get_growth_phases_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
633        let mut path = format!("/plants/v1/growthphases");
634        let mut query_params = Vec::new();
635        if let Some(p) = license_number {
636            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
637        }
638        if !query_params.is_empty() {
639            path.push_str("?");
640            path.push_str(&query_params.join("&"));
641        }
642        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
643    }
644
645    /// GET GetGrowthPhases V2
646    /// Retrieves the list of growth phases supported by a specified Facility.
647    /// 
648    ///   Permissions Required:
649    ///   - None
650    ///
651    pub async fn plants_get_growth_phases_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
652        let mut path = format!("/plants/v2/growthphases");
653        let mut query_params = Vec::new();
654        if let Some(p) = license_number {
655            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
656        }
657        if !query_params.is_empty() {
658            path.push_str("?");
659            path.push_str(&query_params.join("&"));
660        }
661        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
662    }
663
664    /// GET GetInactive V1
665    /// Permissions Required:
666    ///   - View Veg/Flower Plants
667    ///
668    pub async fn plants_get_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
669        let mut path = format!("/plants/v1/inactive");
670        let mut query_params = Vec::new();
671        if let Some(p) = last_modified_end {
672            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
673        }
674        if let Some(p) = last_modified_start {
675            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
676        }
677        if let Some(p) = license_number {
678            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
679        }
680        if !query_params.is_empty() {
681            path.push_str("?");
682            path.push_str(&query_params.join("&"));
683        }
684        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
685    }
686
687    /// GET GetInactive V2
688    /// Retrieves inactive plants at a specified Facility.
689    /// 
690    ///   Permissions Required:
691    ///   - View Veg/Flower Plants
692    ///
693    pub async fn plants_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
694        let mut path = format!("/plants/v2/inactive");
695        let mut query_params = Vec::new();
696        if let Some(p) = last_modified_end {
697            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
698        }
699        if let Some(p) = last_modified_start {
700            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
701        }
702        if let Some(p) = license_number {
703            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
704        }
705        if let Some(p) = page_number {
706            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
707        }
708        if let Some(p) = page_size {
709            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
710        }
711        if !query_params.is_empty() {
712            path.push_str("?");
713            path.push_str(&query_params.join("&"));
714        }
715        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
716    }
717
718    /// GET GetMother V2
719    /// Retrieves mother-phase plants at a specified Facility.
720    /// 
721    ///   Permissions Required:
722    ///   - View Mother Plants
723    ///
724    pub async fn plants_get_mother_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
725        let mut path = format!("/plants/v2/mother");
726        let mut query_params = Vec::new();
727        if let Some(p) = last_modified_end {
728            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
729        }
730        if let Some(p) = last_modified_start {
731            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
732        }
733        if let Some(p) = license_number {
734            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
735        }
736        if let Some(p) = page_number {
737            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
738        }
739        if let Some(p) = page_size {
740            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
741        }
742        if !query_params.is_empty() {
743            path.push_str("?");
744            path.push_str(&query_params.join("&"));
745        }
746        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
747    }
748
749    /// GET GetMotherInactive V2
750    /// Retrieves inactive mother-phase plants at a specified Facility.
751    /// 
752    ///   Permissions Required:
753    ///   - View Mother Plants
754    ///
755    pub async fn plants_get_mother_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
756        let mut path = format!("/plants/v2/mother/inactive");
757        let mut query_params = Vec::new();
758        if let Some(p) = last_modified_end {
759            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
760        }
761        if let Some(p) = last_modified_start {
762            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
763        }
764        if let Some(p) = license_number {
765            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
766        }
767        if let Some(p) = page_number {
768            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
769        }
770        if let Some(p) = page_size {
771            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
772        }
773        if !query_params.is_empty() {
774            path.push_str("?");
775            path.push_str(&query_params.join("&"));
776        }
777        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
778    }
779
780    /// GET GetMotherOnhold V2
781    /// Retrieves mother-phase plants currently marked as on hold at a specified Facility.
782    /// 
783    ///   Permissions Required:
784    ///   - View Mother Plants
785    ///
786    pub async fn plants_get_mother_onhold_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
787        let mut path = format!("/plants/v2/mother/onhold");
788        let mut query_params = Vec::new();
789        if let Some(p) = last_modified_end {
790            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
791        }
792        if let Some(p) = last_modified_start {
793            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
794        }
795        if let Some(p) = license_number {
796            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
797        }
798        if let Some(p) = page_number {
799            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
800        }
801        if let Some(p) = page_size {
802            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
803        }
804        if !query_params.is_empty() {
805            path.push_str("?");
806            path.push_str(&query_params.join("&"));
807        }
808        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
809    }
810
811    /// GET GetOnhold V1
812    /// Permissions Required:
813    ///   - View Veg/Flower Plants
814    ///
815    pub async fn plants_get_onhold_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
816        let mut path = format!("/plants/v1/onhold");
817        let mut query_params = Vec::new();
818        if let Some(p) = last_modified_end {
819            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
820        }
821        if let Some(p) = last_modified_start {
822            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
823        }
824        if let Some(p) = license_number {
825            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
826        }
827        if !query_params.is_empty() {
828            path.push_str("?");
829            path.push_str(&query_params.join("&"));
830        }
831        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
832    }
833
834    /// GET GetOnhold V2
835    /// Retrieves plants that are currently on hold at a specified Facility.
836    /// 
837    ///   Permissions Required:
838    ///   - View Veg/Flower Plants
839    ///
840    pub async fn plants_get_onhold_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
841        let mut path = format!("/plants/v2/onhold");
842        let mut query_params = Vec::new();
843        if let Some(p) = last_modified_end {
844            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
845        }
846        if let Some(p) = last_modified_start {
847            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
848        }
849        if let Some(p) = license_number {
850            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
851        }
852        if let Some(p) = page_number {
853            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
854        }
855        if let Some(p) = page_size {
856            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
857        }
858        if !query_params.is_empty() {
859            path.push_str("?");
860            path.push_str(&query_params.join("&"));
861        }
862        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
863    }
864
865    /// GET GetVegetative V1
866    /// Permissions Required:
867    ///   - View Veg/Flower Plants
868    ///
869    pub async fn plants_get_vegetative_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
870        let mut path = format!("/plants/v1/vegetative");
871        let mut query_params = Vec::new();
872        if let Some(p) = last_modified_end {
873            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
874        }
875        if let Some(p) = last_modified_start {
876            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
877        }
878        if let Some(p) = license_number {
879            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
880        }
881        if !query_params.is_empty() {
882            path.push_str("?");
883            path.push_str(&query_params.join("&"));
884        }
885        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
886    }
887
888    /// GET GetVegetative V2
889    /// Retrieves vegetative-phase plants at a specified Facility, optionally filtered by last modified date.
890    /// 
891    ///   Permissions Required:
892    ///   - View Veg/Flower Plants
893    ///
894    pub async fn plants_get_vegetative_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
895        let mut path = format!("/plants/v2/vegetative");
896        let mut query_params = Vec::new();
897        if let Some(p) = last_modified_end {
898            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
899        }
900        if let Some(p) = last_modified_start {
901            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
902        }
903        if let Some(p) = license_number {
904            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
905        }
906        if let Some(p) = page_number {
907            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
908        }
909        if let Some(p) = page_size {
910            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
911        }
912        if !query_params.is_empty() {
913            path.push_str("?");
914            path.push_str(&query_params.join("&"));
915        }
916        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
917    }
918
919    /// GET GetWaste V2
920    /// Retrieves a list of recorded plant waste events for a specific Facility.
921    /// 
922    ///   Permissions Required:
923    ///   - View Plants Waste
924    ///
925    pub async fn plants_get_waste_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
926        let mut path = format!("/plants/v2/waste");
927        let mut query_params = Vec::new();
928        if let Some(p) = license_number {
929            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
930        }
931        if let Some(p) = page_number {
932            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
933        }
934        if let Some(p) = page_size {
935            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
936        }
937        if !query_params.is_empty() {
938            path.push_str("?");
939            path.push_str(&query_params.join("&"));
940        }
941        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
942    }
943
944    /// GET GetWasteMethodsAll V1
945    /// Permissions Required:
946    ///   - None
947    ///
948    pub async fn plants_get_waste_methods_all_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
949        let mut path = format!("/plants/v1/waste/methods/all");
950        let mut query_params = Vec::new();
951        if let Some(p) = no {
952            query_params.push(format!("No={}", urlencoding::encode(&p)));
953        }
954        if !query_params.is_empty() {
955            path.push_str("?");
956            path.push_str(&query_params.join("&"));
957        }
958        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
959    }
960
961    /// GET GetWasteMethodsAll V2
962    /// Retrieves a list of all available plant waste methods for use within a Facility.
963    /// 
964    ///   Permissions Required:
965    ///   - None
966    ///
967    pub async fn plants_get_waste_methods_all_v2(&self, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
968        let mut path = format!("/plants/v2/waste/methods/all");
969        let mut query_params = Vec::new();
970        if let Some(p) = page_number {
971            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
972        }
973        if let Some(p) = page_size {
974            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
975        }
976        if !query_params.is_empty() {
977            path.push_str("?");
978            path.push_str(&query_params.join("&"));
979        }
980        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
981    }
982
983    /// GET GetWastePackage V2
984    /// Retrieves a list of package records linked to the specified plantWasteId for a given facility.
985    /// 
986    ///   Permissions Required:
987    ///   - View Plants Waste
988    ///
989    pub async fn plants_get_waste_package_v2(&self, id: &str, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
990        let mut path = format!("/plants/v2/waste/{}/package", urlencoding::encode(id).as_ref());
991        let mut query_params = Vec::new();
992        if let Some(p) = license_number {
993            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
994        }
995        if let Some(p) = page_number {
996            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
997        }
998        if let Some(p) = page_size {
999            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1000        }
1001        if !query_params.is_empty() {
1002            path.push_str("?");
1003            path.push_str(&query_params.join("&"));
1004        }
1005        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1006    }
1007
1008    /// GET GetWastePlant V2
1009    /// Retrieves a list of plants records linked to the specified plantWasteId for a given facility.
1010    /// 
1011    ///   Permissions Required:
1012    ///   - View Plants Waste
1013    ///
1014    pub async fn plants_get_waste_plant_v2(&self, id: &str, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1015        let mut path = format!("/plants/v2/waste/{}/plant", urlencoding::encode(id).as_ref());
1016        let mut query_params = Vec::new();
1017        if let Some(p) = license_number {
1018            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1019        }
1020        if let Some(p) = page_number {
1021            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1022        }
1023        if let Some(p) = page_size {
1024            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1025        }
1026        if !query_params.is_empty() {
1027            path.push_str("?");
1028            path.push_str(&query_params.join("&"));
1029        }
1030        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1031    }
1032
1033    /// GET GetWasteReasons V1
1034    /// Permissions Required:
1035    ///   - None
1036    ///
1037    pub async fn plants_get_waste_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1038        let mut path = format!("/plants/v1/waste/reasons");
1039        let mut query_params = Vec::new();
1040        if let Some(p) = license_number {
1041            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1042        }
1043        if !query_params.is_empty() {
1044            path.push_str("?");
1045            path.push_str(&query_params.join("&"));
1046        }
1047        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1048    }
1049
1050    /// GET GetWasteReasons V2
1051    /// Retriveves available reasons for recording mature plant waste at a specified Facility.
1052    /// 
1053    ///   Permissions Required:
1054    ///   - None
1055    ///
1056    pub async fn plants_get_waste_reasons_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1057        let mut path = format!("/plants/v2/waste/reasons");
1058        let mut query_params = Vec::new();
1059        if let Some(p) = license_number {
1060            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1061        }
1062        if let Some(p) = page_number {
1063            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1064        }
1065        if let Some(p) = page_size {
1066            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1067        }
1068        if !query_params.is_empty() {
1069            path.push_str("?");
1070            path.push_str(&query_params.join("&"));
1071        }
1072        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1073    }
1074
1075    /// PUT UpdateAdjust V2
1076    /// Adjusts the recorded count of plants at a specified Facility.
1077    /// 
1078    ///   Permissions Required:
1079    ///   - View Veg/Flower Plants
1080    ///   - Manage Veg/Flower Plants Inventory
1081    ///
1082    pub async fn plants_update_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1083        let mut path = format!("/plants/v2/adjust");
1084        let mut query_params = Vec::new();
1085        if let Some(p) = license_number {
1086            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1087        }
1088        if !query_params.is_empty() {
1089            path.push_str("?");
1090            path.push_str(&query_params.join("&"));
1091        }
1092        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1093    }
1094
1095    /// PUT UpdateGrowthphase V2
1096    /// Changes the growth phases of plants within a specified Facility.
1097    /// 
1098    ///   Permissions Required:
1099    ///   - View Veg/Flower Plants
1100    ///   - Manage Veg/Flower Plants Inventory
1101    ///
1102    pub async fn plants_update_growthphase_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1103        let mut path = format!("/plants/v2/growthphase");
1104        let mut query_params = Vec::new();
1105        if let Some(p) = license_number {
1106            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1107        }
1108        if !query_params.is_empty() {
1109            path.push_str("?");
1110            path.push_str(&query_params.join("&"));
1111        }
1112        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1113    }
1114
1115    /// PUT UpdateHarvest V2
1116    /// Processes whole plant Harvest data for a specific Facility. NOTE: If HarvestName is excluded from the request body, or if it is passed in as null, the harvest name is auto-generated.
1117    /// 
1118    ///   Permissions Required:
1119    ///   - View Veg/Flower Plants
1120    ///   - Manicure/Harvest Veg/Flower Plants
1121    ///
1122    pub async fn plants_update_harvest_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1123        let mut path = format!("/plants/v2/harvest");
1124        let mut query_params = Vec::new();
1125        if let Some(p) = license_number {
1126            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1127        }
1128        if !query_params.is_empty() {
1129            path.push_str("?");
1130            path.push_str(&query_params.join("&"));
1131        }
1132        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1133    }
1134
1135    /// PUT UpdateLocation V2
1136    /// Moves plant batches to new locations within a specified Facility.
1137    /// 
1138    ///   Permissions Required:
1139    ///   - View Veg/Flower Plants
1140    ///   - Manage Veg/Flower Plants Inventory
1141    ///
1142    pub async fn plants_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1143        let mut path = format!("/plants/v2/location");
1144        let mut query_params = Vec::new();
1145        if let Some(p) = license_number {
1146            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1147        }
1148        if !query_params.is_empty() {
1149            path.push_str("?");
1150            path.push_str(&query_params.join("&"));
1151        }
1152        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1153    }
1154
1155    /// PUT UpdateMerge V2
1156    /// Merges multiple plant groups into a single group within a Facility.
1157    /// 
1158    ///   Permissions Required:
1159    ///   - View Veg/Flower Plants
1160    ///   - Manicure/Harvest Veg/Flower Plants
1161    ///
1162    pub async fn plants_update_merge_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1163        let mut path = format!("/plants/v2/merge");
1164        let mut query_params = Vec::new();
1165        if let Some(p) = license_number {
1166            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1167        }
1168        if !query_params.is_empty() {
1169            path.push_str("?");
1170            path.push_str(&query_params.join("&"));
1171        }
1172        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1173    }
1174
1175    /// PUT UpdateSplit V2
1176    /// Splits an existing plant group into multiple groups within a Facility.
1177    /// 
1178    ///   Permissions Required:
1179    ///   - View Plant
1180    ///
1181    pub async fn plants_update_split_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1182        let mut path = format!("/plants/v2/split");
1183        let mut query_params = Vec::new();
1184        if let Some(p) = license_number {
1185            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1186        }
1187        if !query_params.is_empty() {
1188            path.push_str("?");
1189            path.push_str(&query_params.join("&"));
1190        }
1191        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1192    }
1193
1194    /// PUT UpdateStrain V2
1195    /// Updates the strain information for plants within a Facility.
1196    /// 
1197    ///   Permissions Required:
1198    ///   - View Veg/Flower Plants
1199    ///   - Manage Veg/Flower Plants Inventory
1200    ///
1201    pub async fn plants_update_strain_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1202        let mut path = format!("/plants/v2/strain");
1203        let mut query_params = Vec::new();
1204        if let Some(p) = license_number {
1205            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1206        }
1207        if !query_params.is_empty() {
1208            path.push_str("?");
1209            path.push_str(&query_params.join("&"));
1210        }
1211        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1212    }
1213
1214    /// PUT UpdateTag V2
1215    /// Replaces existing plant tags with new tags for plants within a Facility.
1216    /// 
1217    ///   Permissions Required:
1218    ///   - View Veg/Flower Plants
1219    ///   - Manage Veg/Flower Plants Inventory
1220    ///
1221    pub async fn plants_update_tag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1222        let mut path = format!("/plants/v2/tag");
1223        let mut query_params = Vec::new();
1224        if let Some(p) = license_number {
1225            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1226        }
1227        if !query_params.is_empty() {
1228            path.push_str("?");
1229            path.push_str(&query_params.join("&"));
1230        }
1231        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1232    }
1233
1234    /// POST CreateAssociate V2
1235    /// Facilitate association of QR codes and Package labels. This will return the count of packages and QR codes associated that were added or replaced.
1236    /// 
1237    ///   Permissions Required:
1238    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
1239    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
1240    ///   - Industry/View Packages
1241    ///   - One of the following: Industry/Facility Type/Can Receive Associate Product Label, Licensee/Receive Associate Product Label or Admin/Employees/Packages Page/Product Labels(Manage)
1242    ///
1243    pub async fn retail_id_create_associate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1244        let mut path = format!("/retailid/v2/associate");
1245        let mut query_params = Vec::new();
1246        if let Some(p) = license_number {
1247            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1248        }
1249        if !query_params.is_empty() {
1250            path.push_str("?");
1251            path.push_str(&query_params.join("&"));
1252        }
1253        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1254    }
1255
1256    /// POST CreateGenerate V2
1257    /// Allows you to generate a specific quantity of QR codes. Id value returned (issuance ID) could be used for printing.
1258    /// 
1259    ///   Permissions Required:
1260    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
1261    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
1262    ///   - Industry/View Packages
1263    ///   - One of the following: Industry/Facility Type/Can Download Product Label, Licensee/Download Product Label or Admin/Employees/Packages Page/Product Labels(Manage)
1264    ///
1265    pub async fn retail_id_create_generate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1266        let mut path = format!("/retailid/v2/generate");
1267        let mut query_params = Vec::new();
1268        if let Some(p) = license_number {
1269            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1270        }
1271        if !query_params.is_empty() {
1272            path.push_str("?");
1273            path.push_str(&query_params.join("&"));
1274        }
1275        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1276    }
1277
1278    /// POST CreateMerge V2
1279    /// Merge and adjust one source to one target Package. First Package detected will be processed as target Package. This requires an action reason with name containing the 'Merge' word and setup with 'Package adjustment' area.
1280    /// 
1281    ///   Permissions Required:
1282    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
1283    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
1284    ///   - Key Value Settings/Retail ID Merge Packages Enabled
1285    ///
1286    pub async fn retail_id_create_merge_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1287        let mut path = format!("/retailid/v2/merge");
1288        let mut query_params = Vec::new();
1289        if let Some(p) = license_number {
1290            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1291        }
1292        if !query_params.is_empty() {
1293            path.push_str("?");
1294            path.push_str(&query_params.join("&"));
1295        }
1296        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1297    }
1298
1299    /// POST CreatePackageInfo V2
1300    /// Retrieves Package information for given list of Package labels.
1301    /// 
1302    ///   Permissions Required:
1303    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
1304    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
1305    ///   - Industry/View Packages
1306    ///   - Admin/Employees/Packages Page/Product Labels(Manage)
1307    ///
1308    pub async fn retail_id_create_package_info_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1309        let mut path = format!("/retailid/v2/packages/info");
1310        let mut query_params = Vec::new();
1311        if let Some(p) = license_number {
1312            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1313        }
1314        if !query_params.is_empty() {
1315            path.push_str("?");
1316            path.push_str(&query_params.join("&"));
1317        }
1318        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1319    }
1320
1321    /// GET GetReceiveByLabel V2
1322    /// Get a list of eaches (Retail ID QR code URL) and sibling tags based on given Package label.
1323    /// 
1324    ///   Permissions Required:
1325    ///   - External Sources(ThirdPartyVendorV2)/Manage RetailId
1326    ///   - WebApi Retail ID Read Write State (All or ReadOnly)
1327    ///   - Industry/View Packages
1328    ///   - One of the following: Industry/Facility Type/Can Receive Associate Product Label, Licensee/Receive Associate Product Label or Admin/Employees/Packages Page/Product Labels(View or Manage)
1329    ///
1330    pub async fn retail_id_get_receive_by_label_v2(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1331        let mut path = format!("/retailid/v2/receive/{}", urlencoding::encode(label).as_ref());
1332        let mut query_params = Vec::new();
1333        if let Some(p) = license_number {
1334            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1335        }
1336        if !query_params.is_empty() {
1337            path.push_str("?");
1338            path.push_str(&query_params.join("&"));
1339        }
1340        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1341    }
1342
1343    /// GET GetReceiveQrByShortCode V2
1344    /// Get a list of eaches (Retail ID QR code URL) and sibling tags based on given short code value (first segment in Retail ID QR code URL).
1345    /// 
1346    ///   Permissions Required:
1347    ///   - External Sources(ThirdPartyVendorV2)/Manage RetailId
1348    ///   - WebApi Retail ID Read Write State (All or ReadOnly)
1349    ///   - Industry/View Packages
1350    ///   - One of the following: Industry/Facility Type/Can Receive Associate Product Label, Licensee/Receive Associate Product Label or Admin/Employees/Packages Page/Product Labels(View or Manage)
1351    ///
1352    pub async fn retail_id_get_receive_qr_by_short_code_v2(&self, short_code: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1353        let mut path = format!("/retailid/v2/receive/qr/{}", urlencoding::encode(short_code).as_ref());
1354        let mut query_params = Vec::new();
1355        if let Some(p) = license_number {
1356            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1357        }
1358        if !query_params.is_empty() {
1359            path.push_str("?");
1360            path.push_str(&query_params.join("&"));
1361        }
1362        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1363    }
1364
1365    /// POST CreateIntegratorSetup V2
1366    /// This endpoint is used to handle the setup of an external integrator for sandbox environments. It processes a request to create a new sandbox user for integration based on an external source's API key. It checks whether the API key is valid, manages the user creation process, and returns an appropriate status based on the current state of the request.
1367    /// 
1368    ///   Permissions Required:
1369    ///   - None
1370    ///
1371    pub async fn sandbox_create_integrator_setup_v2(&self, user_key: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1372        let mut path = format!("/sandbox/v2/integrator/setup");
1373        let mut query_params = Vec::new();
1374        if let Some(p) = user_key {
1375            query_params.push(format!("userKey={}", urlencoding::encode(&p)));
1376        }
1377        if !query_params.is_empty() {
1378            path.push_str("?");
1379            path.push_str(&query_params.join("&"));
1380        }
1381        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1382    }
1383
1384    /// POST Create V2
1385    /// Creates new sublocation records for a Facility.
1386    /// 
1387    ///   Permissions Required:
1388    ///   - Manage Locations
1389    ///
1390    pub async fn sublocations_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1391        let mut path = format!("/sublocations/v2");
1392        let mut query_params = Vec::new();
1393        if let Some(p) = license_number {
1394            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1395        }
1396        if !query_params.is_empty() {
1397            path.push_str("?");
1398            path.push_str(&query_params.join("&"));
1399        }
1400        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1401    }
1402
1403    /// DELETE Delete V2
1404    /// Archives an existing Sublocation record for a Facility.
1405    /// 
1406    ///   Permissions Required:
1407    ///   - Manage Locations
1408    ///
1409    pub async fn sublocations_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1410        let mut path = format!("/sublocations/v2/{}", urlencoding::encode(id).as_ref());
1411        let mut query_params = Vec::new();
1412        if let Some(p) = license_number {
1413            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1414        }
1415        if !query_params.is_empty() {
1416            path.push_str("?");
1417            path.push_str(&query_params.join("&"));
1418        }
1419        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1420    }
1421
1422    /// GET Get V2
1423    /// Retrieves a Sublocation by its Id, with an optional license number.
1424    /// 
1425    ///   Permissions Required:
1426    ///   - Manage Locations
1427    ///
1428    pub async fn sublocations_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1429        let mut path = format!("/sublocations/v2/{}", urlencoding::encode(id).as_ref());
1430        let mut query_params = Vec::new();
1431        if let Some(p) = license_number {
1432            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1433        }
1434        if !query_params.is_empty() {
1435            path.push_str("?");
1436            path.push_str(&query_params.join("&"));
1437        }
1438        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1439    }
1440
1441    /// GET GetActive V2
1442    /// Retrieves a list of active sublocations for the current Facility, optionally filtered by last modified date range.
1443    /// 
1444    ///   Permissions Required:
1445    ///   - Manage Locations
1446    ///
1447    pub async fn sublocations_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1448        let mut path = format!("/sublocations/v2/active");
1449        let mut query_params = Vec::new();
1450        if let Some(p) = last_modified_end {
1451            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1452        }
1453        if let Some(p) = last_modified_start {
1454            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1455        }
1456        if let Some(p) = license_number {
1457            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1458        }
1459        if let Some(p) = page_number {
1460            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1461        }
1462        if let Some(p) = page_size {
1463            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1464        }
1465        if !query_params.is_empty() {
1466            path.push_str("?");
1467            path.push_str(&query_params.join("&"));
1468        }
1469        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1470    }
1471
1472    /// GET GetInactive V2
1473    /// Retrieves a list of inactive sublocations for the specified Facility.
1474    /// 
1475    ///   Permissions Required:
1476    ///   - Manage Locations
1477    ///
1478    pub async fn sublocations_get_inactive_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1479        let mut path = format!("/sublocations/v2/inactive");
1480        let mut query_params = Vec::new();
1481        if let Some(p) = license_number {
1482            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1483        }
1484        if let Some(p) = page_number {
1485            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1486        }
1487        if let Some(p) = page_size {
1488            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1489        }
1490        if !query_params.is_empty() {
1491            path.push_str("?");
1492            path.push_str(&query_params.join("&"));
1493        }
1494        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1495    }
1496
1497    /// PUT Update V2
1498    /// Updates existing sublocation records for a specified Facility.
1499    /// 
1500    ///   Permissions Required:
1501    ///   - Manage Locations
1502    ///
1503    pub async fn sublocations_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1504        let mut path = format!("/sublocations/v2");
1505        let mut query_params = Vec::new();
1506        if let Some(p) = license_number {
1507            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1508        }
1509        if !query_params.is_empty() {
1510            path.push_str("?");
1511            path.push_str(&query_params.join("&"));
1512        }
1513        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1514    }
1515
1516    /// GET GetAll V1
1517    /// This endpoint provides a list of facilities for which the authenticated user has access.
1518    /// 
1519    ///   Permissions Required:
1520    ///   - None
1521    ///
1522    pub async fn facilities_get_all_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1523        let mut path = format!("/facilities/v1");
1524        let mut query_params = Vec::new();
1525        if let Some(p) = no {
1526            query_params.push(format!("No={}", urlencoding::encode(&p)));
1527        }
1528        if !query_params.is_empty() {
1529            path.push_str("?");
1530            path.push_str(&query_params.join("&"));
1531        }
1532        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1533    }
1534
1535    /// GET GetAll V2
1536    /// This endpoint provides a list of facilities for which the authenticated user has access.
1537    /// 
1538    ///   Permissions Required:
1539    ///   - None
1540    ///
1541    pub async fn facilities_get_all_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1542        let mut path = format!("/facilities/v2");
1543        let mut query_params = Vec::new();
1544        if let Some(p) = no {
1545            query_params.push(format!("No={}", urlencoding::encode(&p)));
1546        }
1547        if !query_params.is_empty() {
1548            path.push_str("?");
1549            path.push_str(&query_params.join("&"));
1550        }
1551        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1552    }
1553
1554    /// POST CreateFinish V1
1555    /// Permissions Required:
1556    ///   - View Harvests
1557    ///   - Finish/Discontinue Harvests
1558    ///
1559    pub async fn harvests_create_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1560        let mut path = format!("/harvests/v1/finish");
1561        let mut query_params = Vec::new();
1562        if let Some(p) = license_number {
1563            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1564        }
1565        if !query_params.is_empty() {
1566            path.push_str("?");
1567            path.push_str(&query_params.join("&"));
1568        }
1569        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1570    }
1571
1572    /// POST CreatePackage V1
1573    /// Permissions Required:
1574    ///   - View Harvests
1575    ///   - Manage Harvests
1576    ///   - View Packages
1577    ///   - Create/Submit/Discontinue Packages
1578    ///
1579    pub async fn harvests_create_package_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1580        let mut path = format!("/harvests/v1/create/packages");
1581        let mut query_params = Vec::new();
1582        if let Some(p) = license_number {
1583            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1584        }
1585        if !query_params.is_empty() {
1586            path.push_str("?");
1587            path.push_str(&query_params.join("&"));
1588        }
1589        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1590    }
1591
1592    /// POST CreatePackage V2
1593    /// Creates packages from harvested products for a specified Facility.
1594    /// 
1595    ///   Permissions Required:
1596    ///   - View Harvests
1597    ///   - Manage Harvests
1598    ///   - View Packages
1599    ///   - Create/Submit/Discontinue Packages
1600    ///
1601    pub async fn harvests_create_package_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1602        let mut path = format!("/harvests/v2/packages");
1603        let mut query_params = Vec::new();
1604        if let Some(p) = license_number {
1605            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1606        }
1607        if !query_params.is_empty() {
1608            path.push_str("?");
1609            path.push_str(&query_params.join("&"));
1610        }
1611        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1612    }
1613
1614    /// POST CreatePackageTesting V1
1615    /// Permissions Required:
1616    ///   - View Harvests
1617    ///   - Manage Harvests
1618    ///   - View Packages
1619    ///   - Create/Submit/Discontinue Packages
1620    ///
1621    pub async fn harvests_create_package_testing_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1622        let mut path = format!("/harvests/v1/create/packages/testing");
1623        let mut query_params = Vec::new();
1624        if let Some(p) = license_number {
1625            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1626        }
1627        if !query_params.is_empty() {
1628            path.push_str("?");
1629            path.push_str(&query_params.join("&"));
1630        }
1631        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1632    }
1633
1634    /// POST CreatePackageTesting V2
1635    /// Creates packages for testing from harvested products for a specified Facility.
1636    /// 
1637    ///   Permissions Required:
1638    ///   - View Harvests
1639    ///   - Manage Harvests
1640    ///   - View Packages
1641    ///   - Create/Submit/Discontinue Packages
1642    ///
1643    pub async fn harvests_create_package_testing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1644        let mut path = format!("/harvests/v2/packages/testing");
1645        let mut query_params = Vec::new();
1646        if let Some(p) = license_number {
1647            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1648        }
1649        if !query_params.is_empty() {
1650            path.push_str("?");
1651            path.push_str(&query_params.join("&"));
1652        }
1653        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1654    }
1655
1656    /// POST CreateRemoveWaste V1
1657    /// Permissions Required:
1658    ///   - View Harvests
1659    ///   - Manage Harvests
1660    ///
1661    pub async fn harvests_create_remove_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1662        let mut path = format!("/harvests/v1/removewaste");
1663        let mut query_params = Vec::new();
1664        if let Some(p) = license_number {
1665            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1666        }
1667        if !query_params.is_empty() {
1668            path.push_str("?");
1669            path.push_str(&query_params.join("&"));
1670        }
1671        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1672    }
1673
1674    /// POST CreateUnfinish V1
1675    /// Permissions Required:
1676    ///   - View Harvests
1677    ///   - Finish/Discontinue Harvests
1678    ///
1679    pub async fn harvests_create_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1680        let mut path = format!("/harvests/v1/unfinish");
1681        let mut query_params = Vec::new();
1682        if let Some(p) = license_number {
1683            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1684        }
1685        if !query_params.is_empty() {
1686            path.push_str("?");
1687            path.push_str(&query_params.join("&"));
1688        }
1689        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1690    }
1691
1692    /// POST CreateWaste V2
1693    /// Records Waste from harvests for a specified Facility. NOTE: The IDs passed in the request body are the harvest IDs for which you are documenting waste.
1694    /// 
1695    ///   Permissions Required:
1696    ///   - View Harvests
1697    ///   - Manage Harvests
1698    ///
1699    pub async fn harvests_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1700        let mut path = format!("/harvests/v2/waste");
1701        let mut query_params = Vec::new();
1702        if let Some(p) = license_number {
1703            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1704        }
1705        if !query_params.is_empty() {
1706            path.push_str("?");
1707            path.push_str(&query_params.join("&"));
1708        }
1709        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1710    }
1711
1712    /// DELETE DeleteWaste V2
1713    /// Discontinues a specific harvest waste record by Id for the specified Facility.
1714    /// 
1715    ///   Permissions Required:
1716    ///   - View Harvests
1717    ///   - Discontinue Harvest Waste
1718    ///
1719    pub async fn harvests_delete_waste_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1720        let mut path = format!("/harvests/v2/waste/{}", urlencoding::encode(id).as_ref());
1721        let mut query_params = Vec::new();
1722        if let Some(p) = license_number {
1723            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1724        }
1725        if !query_params.is_empty() {
1726            path.push_str("?");
1727            path.push_str(&query_params.join("&"));
1728        }
1729        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1730    }
1731
1732    /// GET Get V1
1733    /// Permissions Required:
1734    ///   - View Harvests
1735    ///
1736    pub async fn harvests_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1737        let mut path = format!("/harvests/v1/{}", urlencoding::encode(id).as_ref());
1738        let mut query_params = Vec::new();
1739        if let Some(p) = license_number {
1740            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1741        }
1742        if !query_params.is_empty() {
1743            path.push_str("?");
1744            path.push_str(&query_params.join("&"));
1745        }
1746        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1747    }
1748
1749    /// GET Get V2
1750    /// Retrieves a Harvest by its Id, optionally validated against a specified Facility License Number.
1751    /// 
1752    ///   Permissions Required:
1753    ///   - View Harvests
1754    ///
1755    pub async fn harvests_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1756        let mut path = format!("/harvests/v2/{}", urlencoding::encode(id).as_ref());
1757        let mut query_params = Vec::new();
1758        if let Some(p) = license_number {
1759            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1760        }
1761        if !query_params.is_empty() {
1762            path.push_str("?");
1763            path.push_str(&query_params.join("&"));
1764        }
1765        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1766    }
1767
1768    /// GET GetActive V1
1769    /// Permissions Required:
1770    ///   - View Harvests
1771    ///
1772    pub async fn harvests_get_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1773        let mut path = format!("/harvests/v1/active");
1774        let mut query_params = Vec::new();
1775        if let Some(p) = last_modified_end {
1776            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1777        }
1778        if let Some(p) = last_modified_start {
1779            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1780        }
1781        if let Some(p) = license_number {
1782            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1783        }
1784        if !query_params.is_empty() {
1785            path.push_str("?");
1786            path.push_str(&query_params.join("&"));
1787        }
1788        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1789    }
1790
1791    /// GET GetActive V2
1792    /// Retrieves a list of active harvests for a specified Facility.
1793    /// 
1794    ///   Permissions Required:
1795    ///   - View Harvests
1796    ///
1797    pub async fn harvests_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1798        let mut path = format!("/harvests/v2/active");
1799        let mut query_params = Vec::new();
1800        if let Some(p) = last_modified_end {
1801            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1802        }
1803        if let Some(p) = last_modified_start {
1804            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1805        }
1806        if let Some(p) = license_number {
1807            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1808        }
1809        if let Some(p) = page_number {
1810            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1811        }
1812        if let Some(p) = page_size {
1813            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1814        }
1815        if !query_params.is_empty() {
1816            path.push_str("?");
1817            path.push_str(&query_params.join("&"));
1818        }
1819        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1820    }
1821
1822    /// GET GetInactive V1
1823    /// Permissions Required:
1824    ///   - View Harvests
1825    ///
1826    pub async fn harvests_get_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1827        let mut path = format!("/harvests/v1/inactive");
1828        let mut query_params = Vec::new();
1829        if let Some(p) = last_modified_end {
1830            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1831        }
1832        if let Some(p) = last_modified_start {
1833            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1834        }
1835        if let Some(p) = license_number {
1836            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1837        }
1838        if !query_params.is_empty() {
1839            path.push_str("?");
1840            path.push_str(&query_params.join("&"));
1841        }
1842        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1843    }
1844
1845    /// GET GetInactive V2
1846    /// Retrieves a list of inactive harvests for a specified Facility.
1847    /// 
1848    ///   Permissions Required:
1849    ///   - View Harvests
1850    ///
1851    pub async fn harvests_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1852        let mut path = format!("/harvests/v2/inactive");
1853        let mut query_params = Vec::new();
1854        if let Some(p) = last_modified_end {
1855            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1856        }
1857        if let Some(p) = last_modified_start {
1858            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1859        }
1860        if let Some(p) = license_number {
1861            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1862        }
1863        if let Some(p) = page_number {
1864            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1865        }
1866        if let Some(p) = page_size {
1867            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1868        }
1869        if !query_params.is_empty() {
1870            path.push_str("?");
1871            path.push_str(&query_params.join("&"));
1872        }
1873        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1874    }
1875
1876    /// GET GetOnhold V1
1877    /// Permissions Required:
1878    ///   - View Harvests
1879    ///
1880    pub async fn harvests_get_onhold_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1881        let mut path = format!("/harvests/v1/onhold");
1882        let mut query_params = Vec::new();
1883        if let Some(p) = last_modified_end {
1884            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1885        }
1886        if let Some(p) = last_modified_start {
1887            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1888        }
1889        if let Some(p) = license_number {
1890            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1891        }
1892        if !query_params.is_empty() {
1893            path.push_str("?");
1894            path.push_str(&query_params.join("&"));
1895        }
1896        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1897    }
1898
1899    /// GET GetOnhold V2
1900    /// Retrieves a list of harvests on hold for a specified Facility.
1901    /// 
1902    ///   Permissions Required:
1903    ///   - View Harvests
1904    ///
1905    pub async fn harvests_get_onhold_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1906        let mut path = format!("/harvests/v2/onhold");
1907        let mut query_params = Vec::new();
1908        if let Some(p) = last_modified_end {
1909            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1910        }
1911        if let Some(p) = last_modified_start {
1912            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1913        }
1914        if let Some(p) = license_number {
1915            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1916        }
1917        if let Some(p) = page_number {
1918            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1919        }
1920        if let Some(p) = page_size {
1921            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1922        }
1923        if !query_params.is_empty() {
1924            path.push_str("?");
1925            path.push_str(&query_params.join("&"));
1926        }
1927        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1928    }
1929
1930    /// GET GetWaste V2
1931    /// Retrieves a list of Waste records for a specified Harvest, identified by its Harvest Id, within a Facility identified by its License Number.
1932    /// 
1933    ///   Permissions Required:
1934    ///   - View Harvests
1935    ///
1936    pub async fn harvests_get_waste_v2(&self, harvest_id: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1937        let mut path = format!("/harvests/v2/waste");
1938        let mut query_params = Vec::new();
1939        if let Some(p) = harvest_id {
1940            query_params.push(format!("harvestId={}", urlencoding::encode(&p)));
1941        }
1942        if let Some(p) = license_number {
1943            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1944        }
1945        if let Some(p) = page_number {
1946            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1947        }
1948        if let Some(p) = page_size {
1949            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1950        }
1951        if !query_params.is_empty() {
1952            path.push_str("?");
1953            path.push_str(&query_params.join("&"));
1954        }
1955        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1956    }
1957
1958    /// GET GetWasteTypes V1
1959    /// Permissions Required:
1960    ///   - None
1961    ///
1962    pub async fn harvests_get_waste_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1963        let mut path = format!("/harvests/v1/waste/types");
1964        let mut query_params = Vec::new();
1965        if let Some(p) = no {
1966            query_params.push(format!("No={}", urlencoding::encode(&p)));
1967        }
1968        if !query_params.is_empty() {
1969            path.push_str("?");
1970            path.push_str(&query_params.join("&"));
1971        }
1972        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1973    }
1974
1975    /// GET GetWasteTypes V2
1976    /// Retrieves a list of Waste types for harvests.
1977    /// 
1978    ///   Permissions Required:
1979    ///   - None
1980    ///
1981    pub async fn harvests_get_waste_types_v2(&self, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1982        let mut path = format!("/harvests/v2/waste/types");
1983        let mut query_params = Vec::new();
1984        if let Some(p) = page_number {
1985            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1986        }
1987        if let Some(p) = page_size {
1988            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1989        }
1990        if !query_params.is_empty() {
1991            path.push_str("?");
1992            path.push_str(&query_params.join("&"));
1993        }
1994        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1995    }
1996
1997    /// PUT UpdateFinish V2
1998    /// Marks one or more harvests as finished for the specified Facility.
1999    /// 
2000    ///   Permissions Required:
2001    ///   - View Harvests
2002    ///   - Finish/Discontinue Harvests
2003    ///
2004    pub async fn harvests_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2005        let mut path = format!("/harvests/v2/finish");
2006        let mut query_params = Vec::new();
2007        if let Some(p) = license_number {
2008            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2009        }
2010        if !query_params.is_empty() {
2011            path.push_str("?");
2012            path.push_str(&query_params.join("&"));
2013        }
2014        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2015    }
2016
2017    /// PUT UpdateLocation V2
2018    /// Updates the Location of Harvest for a specified Facility.
2019    /// 
2020    ///   Permissions Required:
2021    ///   - View Harvests
2022    ///   - Manage Harvests
2023    ///
2024    pub async fn harvests_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2025        let mut path = format!("/harvests/v2/location");
2026        let mut query_params = Vec::new();
2027        if let Some(p) = license_number {
2028            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2029        }
2030        if !query_params.is_empty() {
2031            path.push_str("?");
2032            path.push_str(&query_params.join("&"));
2033        }
2034        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2035    }
2036
2037    /// PUT UpdateMove V1
2038    /// Permissions Required:
2039    ///   - View Harvests
2040    ///   - Manage Harvests
2041    ///
2042    pub async fn harvests_update_move_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2043        let mut path = format!("/harvests/v1/move");
2044        let mut query_params = Vec::new();
2045        if let Some(p) = license_number {
2046            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2047        }
2048        if !query_params.is_empty() {
2049            path.push_str("?");
2050            path.push_str(&query_params.join("&"));
2051        }
2052        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2053    }
2054
2055    /// PUT UpdateRename V1
2056    /// Permissions Required:
2057    ///   - View Harvests
2058    ///   - Manage Harvests
2059    ///
2060    pub async fn harvests_update_rename_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2061        let mut path = format!("/harvests/v1/rename");
2062        let mut query_params = Vec::new();
2063        if let Some(p) = license_number {
2064            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2065        }
2066        if !query_params.is_empty() {
2067            path.push_str("?");
2068            path.push_str(&query_params.join("&"));
2069        }
2070        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2071    }
2072
2073    /// PUT UpdateRename V2
2074    /// Renames one or more harvests for the specified Facility.
2075    /// 
2076    ///   Permissions Required:
2077    ///   - View Harvests
2078    ///   - Manage Harvests
2079    ///
2080    pub async fn harvests_update_rename_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2081        let mut path = format!("/harvests/v2/rename");
2082        let mut query_params = Vec::new();
2083        if let Some(p) = license_number {
2084            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2085        }
2086        if !query_params.is_empty() {
2087            path.push_str("?");
2088            path.push_str(&query_params.join("&"));
2089        }
2090        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2091    }
2092
2093    /// PUT UpdateRestoreHarvestedPlants V2
2094    /// Restores previously harvested plants to their original state for the specified Facility.
2095    /// 
2096    ///   Permissions Required:
2097    ///   - View Harvests
2098    ///   - Finish/Discontinue Harvests
2099    ///
2100    pub async fn harvests_update_restore_harvested_plants_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2101        let mut path = format!("/harvests/v2/restore/harvestedplants");
2102        let mut query_params = Vec::new();
2103        if let Some(p) = license_number {
2104            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2105        }
2106        if !query_params.is_empty() {
2107            path.push_str("?");
2108            path.push_str(&query_params.join("&"));
2109        }
2110        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2111    }
2112
2113    /// PUT UpdateUnfinish V2
2114    /// Reopens one or more previously finished harvests for the specified Facility.
2115    /// 
2116    ///   Permissions Required:
2117    ///   - View Harvests
2118    ///   - Finish/Discontinue Harvests
2119    ///
2120    pub async fn harvests_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2121        let mut path = format!("/harvests/v2/unfinish");
2122        let mut query_params = Vec::new();
2123        if let Some(p) = license_number {
2124            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2125        }
2126        if !query_params.is_empty() {
2127            path.push_str("?");
2128            path.push_str(&query_params.join("&"));
2129        }
2130        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2131    }
2132
2133    /// POST CreateAdditives V1
2134    /// Permissions Required:
2135    ///   - Manage Plants Additives
2136    ///
2137    pub async fn plant_batches_create_additives_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2138        let mut path = format!("/plantbatches/v1/additives");
2139        let mut query_params = Vec::new();
2140        if let Some(p) = license_number {
2141            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2142        }
2143        if !query_params.is_empty() {
2144            path.push_str("?");
2145            path.push_str(&query_params.join("&"));
2146        }
2147        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2148    }
2149
2150    /// POST CreateAdditives V2
2151    /// Records Additive usage details for plant batches at a specific Facility.
2152    /// 
2153    ///   Permissions Required:
2154    ///   - Manage Plants Additives
2155    ///
2156    pub async fn plant_batches_create_additives_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2157        let mut path = format!("/plantbatches/v2/additives");
2158        let mut query_params = Vec::new();
2159        if let Some(p) = license_number {
2160            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2161        }
2162        if !query_params.is_empty() {
2163            path.push_str("?");
2164            path.push_str(&query_params.join("&"));
2165        }
2166        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2167    }
2168
2169    /// POST CreateAdditivesUsingtemplate V2
2170    /// Records Additive usage for plant batches at a Facility using predefined additive templates.
2171    /// 
2172    ///   Permissions Required:
2173    ///   - Manage Plants Additives
2174    ///
2175    pub async fn plant_batches_create_additives_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2176        let mut path = format!("/plantbatches/v2/additives/usingtemplate");
2177        let mut query_params = Vec::new();
2178        if let Some(p) = license_number {
2179            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2180        }
2181        if !query_params.is_empty() {
2182            path.push_str("?");
2183            path.push_str(&query_params.join("&"));
2184        }
2185        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2186    }
2187
2188    /// POST CreateAdjust V1
2189    /// Permissions Required:
2190    ///   - View Immature Plants
2191    ///   - Manage Immature Plants Inventory
2192    ///
2193    pub async fn plant_batches_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2194        let mut path = format!("/plantbatches/v1/adjust");
2195        let mut query_params = Vec::new();
2196        if let Some(p) = license_number {
2197            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2198        }
2199        if !query_params.is_empty() {
2200            path.push_str("?");
2201            path.push_str(&query_params.join("&"));
2202        }
2203        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2204    }
2205
2206    /// POST CreateAdjust V2
2207    /// Applies Facility specific adjustments to plant batches based on submitted reasons and input data.
2208    /// 
2209    ///   Permissions Required:
2210    ///   - View Immature Plants
2211    ///   - Manage Immature Plants Inventory
2212    ///
2213    pub async fn plant_batches_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2214        let mut path = format!("/plantbatches/v2/adjust");
2215        let mut query_params = Vec::new();
2216        if let Some(p) = license_number {
2217            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2218        }
2219        if !query_params.is_empty() {
2220            path.push_str("?");
2221            path.push_str(&query_params.join("&"));
2222        }
2223        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2224    }
2225
2226    /// POST CreateChangegrowthphase V1
2227    /// Permissions Required:
2228    ///   - View Immature Plants
2229    ///   - Manage Immature Plants Inventory
2230    ///   - View Veg/Flower Plants
2231    ///   - Manage Veg/Flower Plants Inventory
2232    ///
2233    pub async fn plant_batches_create_changegrowthphase_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2234        let mut path = format!("/plantbatches/v1/changegrowthphase");
2235        let mut query_params = Vec::new();
2236        if let Some(p) = license_number {
2237            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2238        }
2239        if !query_params.is_empty() {
2240            path.push_str("?");
2241            path.push_str(&query_params.join("&"));
2242        }
2243        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2244    }
2245
2246    /// POST CreateGrowthphase V2
2247    /// Updates the growth phase of plants at a specified Facility based on tracking information.
2248    /// 
2249    ///   Permissions Required:
2250    ///   - View Immature Plants
2251    ///   - Manage Immature Plants Inventory
2252    ///   - View Veg/Flower Plants
2253    ///   - Manage Veg/Flower Plants Inventory
2254    ///
2255    pub async fn plant_batches_create_growthphase_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2256        let mut path = format!("/plantbatches/v2/growthphase");
2257        let mut query_params = Vec::new();
2258        if let Some(p) = license_number {
2259            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2260        }
2261        if !query_params.is_empty() {
2262            path.push_str("?");
2263            path.push_str(&query_params.join("&"));
2264        }
2265        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2266    }
2267
2268    /// POST CreatePackage V2
2269    /// Creates packages from plant batches at a Facility, with optional support for packaging from mother plants.
2270    /// 
2271    ///   Permissions Required:
2272    ///   - View Immature Plants
2273    ///   - Manage Immature Plants Inventory
2274    ///   - View Packages
2275    ///   - Create/Submit/Discontinue Packages
2276    ///
2277    pub async fn plant_batches_create_package_v2(&self, is_from_mother_plant: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2278        let mut path = format!("/plantbatches/v2/packages");
2279        let mut query_params = Vec::new();
2280        if let Some(p) = is_from_mother_plant {
2281            query_params.push(format!("isFromMotherPlant={}", urlencoding::encode(&p)));
2282        }
2283        if let Some(p) = license_number {
2284            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2285        }
2286        if !query_params.is_empty() {
2287            path.push_str("?");
2288            path.push_str(&query_params.join("&"));
2289        }
2290        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2291    }
2292
2293    /// POST CreatePackageFrommotherplant V1
2294    /// Permissions Required:
2295    ///   - View Immature Plants
2296    ///   - Manage Immature Plants Inventory
2297    ///   - View Packages
2298    ///   - Create/Submit/Discontinue Packages
2299    ///
2300    pub async fn plant_batches_create_package_frommotherplant_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2301        let mut path = format!("/plantbatches/v1/create/packages/frommotherplant");
2302        let mut query_params = Vec::new();
2303        if let Some(p) = license_number {
2304            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2305        }
2306        if !query_params.is_empty() {
2307            path.push_str("?");
2308            path.push_str(&query_params.join("&"));
2309        }
2310        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2311    }
2312
2313    /// POST CreatePackageFrommotherplant V2
2314    /// Creates packages from mother plants at the specified Facility.
2315    /// 
2316    ///   Permissions Required:
2317    ///   - View Immature Plants
2318    ///   - Manage Immature Plants Inventory
2319    ///   - View Packages
2320    ///   - Create/Submit/Discontinue Packages
2321    ///
2322    pub async fn plant_batches_create_package_frommotherplant_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2323        let mut path = format!("/plantbatches/v2/packages/frommotherplant");
2324        let mut query_params = Vec::new();
2325        if let Some(p) = license_number {
2326            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2327        }
2328        if !query_params.is_empty() {
2329            path.push_str("?");
2330            path.push_str(&query_params.join("&"));
2331        }
2332        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2333    }
2334
2335    /// POST CreatePlantings V2
2336    /// Creates new plantings for a Facility by generating plant batches based on provided planting details.
2337    /// 
2338    ///   Permissions Required:
2339    ///   - View Immature Plants
2340    ///   - Manage Immature Plants Inventory
2341    ///
2342    pub async fn plant_batches_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2343        let mut path = format!("/plantbatches/v2/plantings");
2344        let mut query_params = Vec::new();
2345        if let Some(p) = license_number {
2346            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2347        }
2348        if !query_params.is_empty() {
2349            path.push_str("?");
2350            path.push_str(&query_params.join("&"));
2351        }
2352        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2353    }
2354
2355    /// POST CreateSplit V1
2356    /// Permissions Required:
2357    ///   - View Immature Plants
2358    ///   - Manage Immature Plants Inventory
2359    ///
2360    pub async fn plant_batches_create_split_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2361        let mut path = format!("/plantbatches/v1/split");
2362        let mut query_params = Vec::new();
2363        if let Some(p) = license_number {
2364            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2365        }
2366        if !query_params.is_empty() {
2367            path.push_str("?");
2368            path.push_str(&query_params.join("&"));
2369        }
2370        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2371    }
2372
2373    /// POST CreateSplit V2
2374    /// Splits an existing Plant Batch into multiple groups at the specified Facility.
2375    /// 
2376    ///   Permissions Required:
2377    ///   - View Immature Plants
2378    ///   - Manage Immature Plants Inventory
2379    ///
2380    pub async fn plant_batches_create_split_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2381        let mut path = format!("/plantbatches/v2/split");
2382        let mut query_params = Vec::new();
2383        if let Some(p) = license_number {
2384            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2385        }
2386        if !query_params.is_empty() {
2387            path.push_str("?");
2388            path.push_str(&query_params.join("&"));
2389        }
2390        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2391    }
2392
2393    /// POST CreateWaste V1
2394    /// Permissions Required:
2395    ///   - Manage Plants Waste
2396    ///
2397    pub async fn plant_batches_create_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2398        let mut path = format!("/plantbatches/v1/waste");
2399        let mut query_params = Vec::new();
2400        if let Some(p) = license_number {
2401            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2402        }
2403        if !query_params.is_empty() {
2404            path.push_str("?");
2405            path.push_str(&query_params.join("&"));
2406        }
2407        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2408    }
2409
2410    /// POST CreateWaste V2
2411    /// Records waste information for plant batches based on the submitted data for the specified Facility.
2412    /// 
2413    ///   Permissions Required:
2414    ///   - Manage Plants Waste
2415    ///
2416    pub async fn plant_batches_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2417        let mut path = format!("/plantbatches/v2/waste");
2418        let mut query_params = Vec::new();
2419        if let Some(p) = license_number {
2420            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2421        }
2422        if !query_params.is_empty() {
2423            path.push_str("?");
2424            path.push_str(&query_params.join("&"));
2425        }
2426        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2427    }
2428
2429    /// POST Createpackages V1
2430    /// Permissions Required:
2431    ///   - View Immature Plants
2432    ///   - Manage Immature Plants Inventory
2433    ///   - View Packages
2434    ///   - Create/Submit/Discontinue Packages
2435    ///
2436    pub async fn plant_batches_createpackages_v1(&self, is_from_mother_plant: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2437        let mut path = format!("/plantbatches/v1/createpackages");
2438        let mut query_params = Vec::new();
2439        if let Some(p) = is_from_mother_plant {
2440            query_params.push(format!("isFromMotherPlant={}", urlencoding::encode(&p)));
2441        }
2442        if let Some(p) = license_number {
2443            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2444        }
2445        if !query_params.is_empty() {
2446            path.push_str("?");
2447            path.push_str(&query_params.join("&"));
2448        }
2449        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2450    }
2451
2452    /// POST Createplantings V1
2453    /// Permissions Required:
2454    ///   - View Immature Plants
2455    ///   - Manage Immature Plants Inventory
2456    ///
2457    pub async fn plant_batches_createplantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2458        let mut path = format!("/plantbatches/v1/createplantings");
2459        let mut query_params = Vec::new();
2460        if let Some(p) = license_number {
2461            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2462        }
2463        if !query_params.is_empty() {
2464            path.push_str("?");
2465            path.push_str(&query_params.join("&"));
2466        }
2467        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2468    }
2469
2470    /// DELETE Delete V1
2471    /// Permissions Required:
2472    ///   - View Immature Plants
2473    ///   - Destroy Immature Plants
2474    ///
2475    pub async fn plant_batches_delete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2476        let mut path = format!("/plantbatches/v1");
2477        let mut query_params = Vec::new();
2478        if let Some(p) = license_number {
2479            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2480        }
2481        if !query_params.is_empty() {
2482            path.push_str("?");
2483            path.push_str(&query_params.join("&"));
2484        }
2485        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2486    }
2487
2488    /// DELETE Delete V2
2489    /// Completes the destruction of plant batches based on the provided input data.
2490    /// 
2491    ///   Permissions Required:
2492    ///   - View Immature Plants
2493    ///   - Destroy Immature Plants
2494    ///
2495    pub async fn plant_batches_delete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2496        let mut path = format!("/plantbatches/v2");
2497        let mut query_params = Vec::new();
2498        if let Some(p) = license_number {
2499            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2500        }
2501        if !query_params.is_empty() {
2502            path.push_str("?");
2503            path.push_str(&query_params.join("&"));
2504        }
2505        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2506    }
2507
2508    /// GET Get V1
2509    /// Permissions Required:
2510    ///   - View Immature Plants
2511    ///
2512    pub async fn plant_batches_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2513        let mut path = format!("/plantbatches/v1/{}", urlencoding::encode(id).as_ref());
2514        let mut query_params = Vec::new();
2515        if let Some(p) = license_number {
2516            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2517        }
2518        if !query_params.is_empty() {
2519            path.push_str("?");
2520            path.push_str(&query_params.join("&"));
2521        }
2522        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2523    }
2524
2525    /// GET Get V2
2526    /// Retrieves a Plant Batch by Id.
2527    /// 
2528    ///   Permissions Required:
2529    ///   - View Immature Plants
2530    ///
2531    pub async fn plant_batches_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2532        let mut path = format!("/plantbatches/v2/{}", urlencoding::encode(id).as_ref());
2533        let mut query_params = Vec::new();
2534        if let Some(p) = license_number {
2535            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2536        }
2537        if !query_params.is_empty() {
2538            path.push_str("?");
2539            path.push_str(&query_params.join("&"));
2540        }
2541        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2542    }
2543
2544    /// GET GetActive V1
2545    /// Permissions Required:
2546    ///   - View Immature Plants
2547    ///
2548    pub async fn plant_batches_get_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2549        let mut path = format!("/plantbatches/v1/active");
2550        let mut query_params = Vec::new();
2551        if let Some(p) = last_modified_end {
2552            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2553        }
2554        if let Some(p) = last_modified_start {
2555            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2556        }
2557        if let Some(p) = license_number {
2558            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2559        }
2560        if !query_params.is_empty() {
2561            path.push_str("?");
2562            path.push_str(&query_params.join("&"));
2563        }
2564        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2565    }
2566
2567    /// GET GetActive V2
2568    /// Retrieves a list of active plant batches for the specified Facility, optionally filtered by last modified date.
2569    /// 
2570    ///   Permissions Required:
2571    ///   - View Immature Plants
2572    ///
2573    pub async fn plant_batches_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2574        let mut path = format!("/plantbatches/v2/active");
2575        let mut query_params = Vec::new();
2576        if let Some(p) = last_modified_end {
2577            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2578        }
2579        if let Some(p) = last_modified_start {
2580            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2581        }
2582        if let Some(p) = license_number {
2583            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2584        }
2585        if let Some(p) = page_number {
2586            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2587        }
2588        if let Some(p) = page_size {
2589            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2590        }
2591        if !query_params.is_empty() {
2592            path.push_str("?");
2593            path.push_str(&query_params.join("&"));
2594        }
2595        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2596    }
2597
2598    /// GET GetInactive V1
2599    /// Permissions Required:
2600    ///   - View Immature Plants
2601    ///
2602    pub async fn plant_batches_get_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2603        let mut path = format!("/plantbatches/v1/inactive");
2604        let mut query_params = Vec::new();
2605        if let Some(p) = last_modified_end {
2606            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2607        }
2608        if let Some(p) = last_modified_start {
2609            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2610        }
2611        if let Some(p) = license_number {
2612            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2613        }
2614        if !query_params.is_empty() {
2615            path.push_str("?");
2616            path.push_str(&query_params.join("&"));
2617        }
2618        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2619    }
2620
2621    /// GET GetInactive V2
2622    /// Retrieves a list of inactive plant batches for the specified Facility, optionally filtered by last modified date.
2623    /// 
2624    ///   Permissions Required:
2625    ///   - View Immature Plants
2626    ///
2627    pub async fn plant_batches_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2628        let mut path = format!("/plantbatches/v2/inactive");
2629        let mut query_params = Vec::new();
2630        if let Some(p) = last_modified_end {
2631            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2632        }
2633        if let Some(p) = last_modified_start {
2634            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2635        }
2636        if let Some(p) = license_number {
2637            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2638        }
2639        if let Some(p) = page_number {
2640            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2641        }
2642        if let Some(p) = page_size {
2643            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2644        }
2645        if !query_params.is_empty() {
2646            path.push_str("?");
2647            path.push_str(&query_params.join("&"));
2648        }
2649        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2650    }
2651
2652    /// GET GetTypes V1
2653    /// Permissions Required:
2654    ///   - None
2655    ///
2656    pub async fn plant_batches_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2657        let mut path = format!("/plantbatches/v1/types");
2658        let mut query_params = Vec::new();
2659        if let Some(p) = no {
2660            query_params.push(format!("No={}", urlencoding::encode(&p)));
2661        }
2662        if !query_params.is_empty() {
2663            path.push_str("?");
2664            path.push_str(&query_params.join("&"));
2665        }
2666        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2667    }
2668
2669    /// GET GetTypes V2
2670    /// Retrieves a list of plant batch types.
2671    /// 
2672    ///   Permissions Required:
2673    ///   - None
2674    ///
2675    pub async fn plant_batches_get_types_v2(&self, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2676        let mut path = format!("/plantbatches/v2/types");
2677        let mut query_params = Vec::new();
2678        if let Some(p) = page_number {
2679            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2680        }
2681        if let Some(p) = page_size {
2682            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2683        }
2684        if !query_params.is_empty() {
2685            path.push_str("?");
2686            path.push_str(&query_params.join("&"));
2687        }
2688        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2689    }
2690
2691    /// GET GetWaste V2
2692    /// Retrieves waste details associated with plant batches at a specified Facility.
2693    /// 
2694    ///   Permissions Required:
2695    ///   - View Plants Waste
2696    ///
2697    pub async fn plant_batches_get_waste_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2698        let mut path = format!("/plantbatches/v2/waste");
2699        let mut query_params = Vec::new();
2700        if let Some(p) = license_number {
2701            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2702        }
2703        if let Some(p) = page_number {
2704            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2705        }
2706        if let Some(p) = page_size {
2707            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2708        }
2709        if !query_params.is_empty() {
2710            path.push_str("?");
2711            path.push_str(&query_params.join("&"));
2712        }
2713        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2714    }
2715
2716    /// GET GetWasteReasons V1
2717    /// Permissions Required:
2718    ///   - None
2719    ///
2720    pub async fn plant_batches_get_waste_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2721        let mut path = format!("/plantbatches/v1/waste/reasons");
2722        let mut query_params = Vec::new();
2723        if let Some(p) = license_number {
2724            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2725        }
2726        if !query_params.is_empty() {
2727            path.push_str("?");
2728            path.push_str(&query_params.join("&"));
2729        }
2730        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2731    }
2732
2733    /// GET GetWasteReasons V2
2734    /// Retrieves a list of valid waste reasons associated with immature plant batches for the specified Facility.
2735    /// 
2736    ///   Permissions Required:
2737    ///   - None
2738    ///
2739    pub async fn plant_batches_get_waste_reasons_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2740        let mut path = format!("/plantbatches/v2/waste/reasons");
2741        let mut query_params = Vec::new();
2742        if let Some(p) = license_number {
2743            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2744        }
2745        if !query_params.is_empty() {
2746            path.push_str("?");
2747            path.push_str(&query_params.join("&"));
2748        }
2749        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2750    }
2751
2752    /// PUT UpdateLocation V2
2753    /// Moves one or more plant batches to new locations with in a specified Facility.
2754    /// 
2755    ///   Permissions Required:
2756    ///   - View Immature Plants
2757    ///   - Manage Immature Plants
2758    ///
2759    pub async fn plant_batches_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2760        let mut path = format!("/plantbatches/v2/location");
2761        let mut query_params = Vec::new();
2762        if let Some(p) = license_number {
2763            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2764        }
2765        if !query_params.is_empty() {
2766            path.push_str("?");
2767            path.push_str(&query_params.join("&"));
2768        }
2769        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2770    }
2771
2772    /// PUT UpdateMoveplantbatches V1
2773    /// Permissions Required:
2774    ///   - View Immature Plants
2775    ///
2776    pub async fn plant_batches_update_moveplantbatches_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2777        let mut path = format!("/plantbatches/v1/moveplantbatches");
2778        let mut query_params = Vec::new();
2779        if let Some(p) = license_number {
2780            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2781        }
2782        if !query_params.is_empty() {
2783            path.push_str("?");
2784            path.push_str(&query_params.join("&"));
2785        }
2786        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2787    }
2788
2789    /// PUT UpdateName V2
2790    /// Renames plant batches at a specified Facility.
2791    /// 
2792    ///   Permissions Required:
2793    ///   - View Veg/Flower Plants
2794    ///   - Manage Veg/Flower Plants Inventory
2795    ///
2796    pub async fn plant_batches_update_name_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2797        let mut path = format!("/plantbatches/v2/name");
2798        let mut query_params = Vec::new();
2799        if let Some(p) = license_number {
2800            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2801        }
2802        if !query_params.is_empty() {
2803            path.push_str("?");
2804            path.push_str(&query_params.join("&"));
2805        }
2806        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2807    }
2808
2809    /// PUT UpdateStrain V2
2810    /// Changes the strain of plant batches at a specified Facility.
2811    /// 
2812    ///   Permissions Required:
2813    ///   - View Veg/Flower Plants
2814    ///   - Manage Veg/Flower Plants Inventory
2815    ///
2816    pub async fn plant_batches_update_strain_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2817        let mut path = format!("/plantbatches/v2/strain");
2818        let mut query_params = Vec::new();
2819        if let Some(p) = license_number {
2820            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2821        }
2822        if !query_params.is_empty() {
2823            path.push_str("?");
2824            path.push_str(&query_params.join("&"));
2825        }
2826        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2827    }
2828
2829    /// PUT UpdateTag V2
2830    /// Replaces tags for plant batches at a specified Facility.
2831    /// 
2832    ///   Permissions Required:
2833    ///   - View Veg/Flower Plants
2834    ///   - Manage Veg/Flower Plants Inventory
2835    ///
2836    pub async fn plant_batches_update_tag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2837        let mut path = format!("/plantbatches/v2/tag");
2838        let mut query_params = Vec::new();
2839        if let Some(p) = license_number {
2840            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2841        }
2842        if !query_params.is_empty() {
2843            path.push_str("?");
2844            path.push_str(&query_params.join("&"));
2845        }
2846        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2847    }
2848
2849    /// GET GetPackageAvailable V2
2850    /// Returns a list of available package tags. NOTE: This is a premium endpoint.
2851    /// 
2852    ///   Permissions Required:
2853    ///   - Manage Tags
2854    ///
2855    pub async fn tags_get_package_available_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2856        let mut path = format!("/tags/v2/package/available");
2857        let mut query_params = Vec::new();
2858        if let Some(p) = license_number {
2859            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2860        }
2861        if !query_params.is_empty() {
2862            path.push_str("?");
2863            path.push_str(&query_params.join("&"));
2864        }
2865        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2866    }
2867
2868    /// GET GetPlantAvailable V2
2869    /// Returns a list of available plant tags. NOTE: This is a premium endpoint.
2870    /// 
2871    ///   Permissions Required:
2872    ///   - Manage Tags
2873    ///
2874    pub async fn tags_get_plant_available_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2875        let mut path = format!("/tags/v2/plant/available");
2876        let mut query_params = Vec::new();
2877        if let Some(p) = license_number {
2878            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2879        }
2880        if !query_params.is_empty() {
2881            path.push_str("?");
2882            path.push_str(&query_params.join("&"));
2883        }
2884        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2885    }
2886
2887    /// GET GetStaged V2
2888    /// Returns a list of staged tags. NOTE: This is a premium endpoint.
2889    /// 
2890    ///   Permissions Required:
2891    ///   - Manage Tags
2892    ///   - RetailId.AllowPackageStaging Key Value enabled
2893    ///
2894    pub async fn tags_get_staged_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2895        let mut path = format!("/tags/v2/staged");
2896        let mut query_params = Vec::new();
2897        if let Some(p) = license_number {
2898            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2899        }
2900        if !query_params.is_empty() {
2901            path.push_str("?");
2902            path.push_str(&query_params.join("&"));
2903        }
2904        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2905    }
2906
2907    /// POST CreateExternalIncoming V1
2908    /// Permissions Required:
2909    ///   - Transfers
2910    ///
2911    pub async fn transfers_create_external_incoming_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2912        let mut path = format!("/transfers/v1/external/incoming");
2913        let mut query_params = Vec::new();
2914        if let Some(p) = license_number {
2915            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2916        }
2917        if !query_params.is_empty() {
2918            path.push_str("?");
2919            path.push_str(&query_params.join("&"));
2920        }
2921        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2922    }
2923
2924    /// POST CreateExternalIncoming V2
2925    /// Creates external incoming shipment plans for a Facility.
2926    /// 
2927    ///   Permissions Required:
2928    ///   - Manage Transfers
2929    ///
2930    pub async fn transfers_create_external_incoming_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2931        let mut path = format!("/transfers/v2/external/incoming");
2932        let mut query_params = Vec::new();
2933        if let Some(p) = license_number {
2934            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2935        }
2936        if !query_params.is_empty() {
2937            path.push_str("?");
2938            path.push_str(&query_params.join("&"));
2939        }
2940        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2941    }
2942
2943    /// POST CreateTemplates V1
2944    /// Permissions Required:
2945    ///   - Transfer Templates
2946    ///
2947    pub async fn transfers_create_templates_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2948        let mut path = format!("/transfers/v1/templates");
2949        let mut query_params = Vec::new();
2950        if let Some(p) = license_number {
2951            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2952        }
2953        if !query_params.is_empty() {
2954            path.push_str("?");
2955            path.push_str(&query_params.join("&"));
2956        }
2957        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2958    }
2959
2960    /// POST CreateTemplatesOutgoing V2
2961    /// Creates new transfer templates for a Facility.
2962    /// 
2963    ///   Permissions Required:
2964    ///   - Manage Transfer Templates
2965    ///
2966    pub async fn transfers_create_templates_outgoing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2967        let mut path = format!("/transfers/v2/templates/outgoing");
2968        let mut query_params = Vec::new();
2969        if let Some(p) = license_number {
2970            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2971        }
2972        if !query_params.is_empty() {
2973            path.push_str("?");
2974            path.push_str(&query_params.join("&"));
2975        }
2976        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2977    }
2978
2979    /// DELETE DeleteExternalIncoming V1
2980    /// Permissions Required:
2981    ///   - Transfers
2982    ///
2983    pub async fn transfers_delete_external_incoming_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2984        let mut path = format!("/transfers/v1/external/incoming/{}", urlencoding::encode(id).as_ref());
2985        let mut query_params = Vec::new();
2986        if let Some(p) = license_number {
2987            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2988        }
2989        if !query_params.is_empty() {
2990            path.push_str("?");
2991            path.push_str(&query_params.join("&"));
2992        }
2993        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2994    }
2995
2996    /// DELETE DeleteExternalIncoming V2
2997    /// Voids an external incoming shipment plan for a Facility.
2998    /// 
2999    ///   Permissions Required:
3000    ///   - Manage Transfers
3001    ///
3002    pub async fn transfers_delete_external_incoming_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3003        let mut path = format!("/transfers/v2/external/incoming/{}", urlencoding::encode(id).as_ref());
3004        let mut query_params = Vec::new();
3005        if let Some(p) = license_number {
3006            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3007        }
3008        if !query_params.is_empty() {
3009            path.push_str("?");
3010            path.push_str(&query_params.join("&"));
3011        }
3012        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3013    }
3014
3015    /// DELETE DeleteTemplates V1
3016    /// Permissions Required:
3017    ///   - Transfer Templates
3018    ///
3019    pub async fn transfers_delete_templates_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3020        let mut path = format!("/transfers/v1/templates/{}", urlencoding::encode(id).as_ref());
3021        let mut query_params = Vec::new();
3022        if let Some(p) = license_number {
3023            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3024        }
3025        if !query_params.is_empty() {
3026            path.push_str("?");
3027            path.push_str(&query_params.join("&"));
3028        }
3029        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3030    }
3031
3032    /// DELETE DeleteTemplatesOutgoing V2
3033    /// Archives a transfer template for a Facility.
3034    /// 
3035    ///   Permissions Required:
3036    ///   - Manage Transfer Templates
3037    ///
3038    pub async fn transfers_delete_templates_outgoing_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3039        let mut path = format!("/transfers/v2/templates/outgoing/{}", urlencoding::encode(id).as_ref());
3040        let mut query_params = Vec::new();
3041        if let Some(p) = license_number {
3042            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3043        }
3044        if !query_params.is_empty() {
3045            path.push_str("?");
3046            path.push_str(&query_params.join("&"));
3047        }
3048        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3049    }
3050
3051    /// GET GetDeliveriesPackagesStates V1
3052    /// Permissions Required:
3053    ///   - None
3054    ///
3055    pub async fn transfers_get_deliveries_packages_states_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3056        let mut path = format!("/transfers/v1/deliveries/packages/states");
3057        let mut query_params = Vec::new();
3058        if let Some(p) = no {
3059            query_params.push(format!("No={}", urlencoding::encode(&p)));
3060        }
3061        if !query_params.is_empty() {
3062            path.push_str("?");
3063            path.push_str(&query_params.join("&"));
3064        }
3065        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3066    }
3067
3068    /// GET GetDeliveriesPackagesStates V2
3069    /// Returns a list of available shipment Package states.
3070    /// 
3071    ///   Permissions Required:
3072    ///   - None
3073    ///
3074    pub async fn transfers_get_deliveries_packages_states_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3075        let mut path = format!("/transfers/v2/deliveries/packages/states");
3076        let mut query_params = Vec::new();
3077        if let Some(p) = no {
3078            query_params.push(format!("No={}", urlencoding::encode(&p)));
3079        }
3080        if !query_params.is_empty() {
3081            path.push_str("?");
3082            path.push_str(&query_params.join("&"));
3083        }
3084        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3085    }
3086
3087    /// GET GetDelivery V1
3088    /// Please note: that the {id} parameter above represents a Shipment Plan ID.
3089    /// 
3090    ///   Permissions Required:
3091    ///   - Transfers
3092    ///
3093    pub async fn transfers_get_delivery_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3094        let mut path = format!("/transfers/v1/{}/deliveries", urlencoding::encode(id).as_ref());
3095        let mut query_params = Vec::new();
3096        if let Some(p) = no {
3097            query_params.push(format!("No={}", urlencoding::encode(&p)));
3098        }
3099        if !query_params.is_empty() {
3100            path.push_str("?");
3101            path.push_str(&query_params.join("&"));
3102        }
3103        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3104    }
3105
3106    /// GET GetDelivery V2
3107    /// Retrieves a list of shipment deliveries for a given Transfer Id. Please note: The {id} parameter above represents a Transfer Id.
3108    /// 
3109    ///   Permissions Required:
3110    ///   - Manage Transfers
3111    ///   - View Transfers
3112    ///
3113    pub async fn transfers_get_delivery_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3114        let mut path = format!("/transfers/v2/{}/deliveries", urlencoding::encode(id).as_ref());
3115        let mut query_params = Vec::new();
3116        if let Some(p) = page_number {
3117            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3118        }
3119        if let Some(p) = page_size {
3120            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3121        }
3122        if !query_params.is_empty() {
3123            path.push_str("?");
3124            path.push_str(&query_params.join("&"));
3125        }
3126        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3127    }
3128
3129    /// GET GetDeliveryPackage V1
3130    /// Please note: The {id} parameter above represents a Transfer Delivery ID, not a Manifest Number.
3131    /// 
3132    ///   Permissions Required:
3133    ///   - Transfers
3134    ///
3135    pub async fn transfers_get_delivery_package_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3136        let mut path = format!("/transfers/v1/deliveries/{}/packages", urlencoding::encode(id).as_ref());
3137        let mut query_params = Vec::new();
3138        if let Some(p) = no {
3139            query_params.push(format!("No={}", urlencoding::encode(&p)));
3140        }
3141        if !query_params.is_empty() {
3142            path.push_str("?");
3143            path.push_str(&query_params.join("&"));
3144        }
3145        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3146    }
3147
3148    /// GET GetDeliveryPackage V2
3149    /// Retrieves a list of packages associated with a given Transfer Delivery Id. Please note: The {id} parameter above represents a Transfer Delivery Id, not a Manifest Number.
3150    /// 
3151    ///   Permissions Required:
3152    ///   - Manage Transfers
3153    ///   - View Transfers
3154    ///
3155    pub async fn transfers_get_delivery_package_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3156        let mut path = format!("/transfers/v2/deliveries/{}/packages", urlencoding::encode(id).as_ref());
3157        let mut query_params = Vec::new();
3158        if let Some(p) = page_number {
3159            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3160        }
3161        if let Some(p) = page_size {
3162            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3163        }
3164        if !query_params.is_empty() {
3165            path.push_str("?");
3166            path.push_str(&query_params.join("&"));
3167        }
3168        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3169    }
3170
3171    /// GET GetDeliveryPackageRequiredlabtestbatches V1
3172    /// Please note: The {id} parameter above represents a Transfer Delivery Package ID, not a Manifest Number.
3173    /// 
3174    ///   Permissions Required:
3175    ///   - Transfers
3176    ///
3177    pub async fn transfers_get_delivery_package_requiredlabtestbatches_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3178        let mut path = format!("/transfers/v1/deliveries/package/{}/requiredlabtestbatches", urlencoding::encode(id).as_ref());
3179        let mut query_params = Vec::new();
3180        if let Some(p) = no {
3181            query_params.push(format!("No={}", urlencoding::encode(&p)));
3182        }
3183        if !query_params.is_empty() {
3184            path.push_str("?");
3185            path.push_str(&query_params.join("&"));
3186        }
3187        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3188    }
3189
3190    /// GET GetDeliveryPackageRequiredlabtestbatches V2
3191    /// Retrieves a list of required lab test batches for a given Transfer Delivery Package Id. Please note: The {id} parameter above represents a Transfer Delivery Package Id, not a Manifest Number.
3192    /// 
3193    ///   Permissions Required:
3194    ///   - Manage Transfers
3195    ///   - View Transfers
3196    ///
3197    pub async fn transfers_get_delivery_package_requiredlabtestbatches_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3198        let mut path = format!("/transfers/v2/deliveries/package/{}/requiredlabtestbatches", urlencoding::encode(id).as_ref());
3199        let mut query_params = Vec::new();
3200        if let Some(p) = page_number {
3201            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3202        }
3203        if let Some(p) = page_size {
3204            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3205        }
3206        if !query_params.is_empty() {
3207            path.push_str("?");
3208            path.push_str(&query_params.join("&"));
3209        }
3210        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3211    }
3212
3213    /// GET GetDeliveryPackageWholesale V1
3214    /// Please note: The {id} parameter above represents a Transfer Delivery ID, not a Manifest Number.
3215    /// 
3216    ///   Permissions Required:
3217    ///   - Transfers
3218    ///
3219    pub async fn transfers_get_delivery_package_wholesale_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3220        let mut path = format!("/transfers/v1/deliveries/{}/packages/wholesale", urlencoding::encode(id).as_ref());
3221        let mut query_params = Vec::new();
3222        if let Some(p) = no {
3223            query_params.push(format!("No={}", urlencoding::encode(&p)));
3224        }
3225        if !query_params.is_empty() {
3226            path.push_str("?");
3227            path.push_str(&query_params.join("&"));
3228        }
3229        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3230    }
3231
3232    /// GET GetDeliveryPackageWholesale V2
3233    /// Retrieves a list of wholesale shipment packages for a given Transfer Delivery Id. Please note: The {id} parameter above represents a Transfer Delivery Id, not a Manifest Number.
3234    /// 
3235    ///   Permissions Required:
3236    ///   - Manage Transfers
3237    ///   - View Transfers
3238    ///
3239    pub async fn transfers_get_delivery_package_wholesale_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3240        let mut path = format!("/transfers/v2/deliveries/{}/packages/wholesale", urlencoding::encode(id).as_ref());
3241        let mut query_params = Vec::new();
3242        if let Some(p) = page_number {
3243            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3244        }
3245        if let Some(p) = page_size {
3246            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3247        }
3248        if !query_params.is_empty() {
3249            path.push_str("?");
3250            path.push_str(&query_params.join("&"));
3251        }
3252        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3253    }
3254
3255    /// GET GetDeliveryTransporters V1
3256    /// Please note: that the {id} parameter above represents a Shipment Delivery ID.
3257    /// 
3258    ///   Permissions Required:
3259    ///   - Transfers
3260    ///
3261    pub async fn transfers_get_delivery_transporters_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3262        let mut path = format!("/transfers/v1/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
3263        let mut query_params = Vec::new();
3264        if let Some(p) = no {
3265            query_params.push(format!("No={}", urlencoding::encode(&p)));
3266        }
3267        if !query_params.is_empty() {
3268            path.push_str("?");
3269            path.push_str(&query_params.join("&"));
3270        }
3271        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3272    }
3273
3274    /// GET GetDeliveryTransporters V2
3275    /// Retrieves a list of transporters for a given Transfer Delivery Id. Please note: The {id} parameter above represents a Transfer Delivery Id, not a Manifest Number.
3276    /// 
3277    ///   Permissions Required:
3278    ///   - Manage Transfers
3279    ///   - View Transfers
3280    ///
3281    pub async fn transfers_get_delivery_transporters_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3282        let mut path = format!("/transfers/v2/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
3283        let mut query_params = Vec::new();
3284        if let Some(p) = page_number {
3285            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3286        }
3287        if let Some(p) = page_size {
3288            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3289        }
3290        if !query_params.is_empty() {
3291            path.push_str("?");
3292            path.push_str(&query_params.join("&"));
3293        }
3294        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3295    }
3296
3297    /// GET GetDeliveryTransportersDetails V1
3298    /// Please note: The {id} parameter above represents a Shipment Delivery ID.
3299    /// 
3300    ///   Permissions Required:
3301    ///   - Transfers
3302    ///
3303    pub async fn transfers_get_delivery_transporters_details_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3304        let mut path = format!("/transfers/v1/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
3305        let mut query_params = Vec::new();
3306        if let Some(p) = no {
3307            query_params.push(format!("No={}", urlencoding::encode(&p)));
3308        }
3309        if !query_params.is_empty() {
3310            path.push_str("?");
3311            path.push_str(&query_params.join("&"));
3312        }
3313        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3314    }
3315
3316    /// GET GetDeliveryTransportersDetails V2
3317    /// Retrieves a list of transporter details for a given Transfer Delivery Id. Please note: The {id} parameter above represents a Transfer Delivery Id, not a Manifest Number.
3318    /// 
3319    ///   Permissions Required:
3320    ///   - Manage Transfers
3321    ///   - View Transfers
3322    ///
3323    pub async fn transfers_get_delivery_transporters_details_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3324        let mut path = format!("/transfers/v2/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
3325        let mut query_params = Vec::new();
3326        if let Some(p) = page_number {
3327            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3328        }
3329        if let Some(p) = page_size {
3330            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3331        }
3332        if !query_params.is_empty() {
3333            path.push_str("?");
3334            path.push_str(&query_params.join("&"));
3335        }
3336        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3337    }
3338
3339    /// GET GetHub V2
3340    /// Retrieves a list of transfer hub shipments for a Facility, filtered by either last modified or estimated arrival date range.
3341    /// 
3342    ///   Permissions Required:
3343    ///   - Manage Transfers
3344    ///   - View Transfers
3345    ///
3346    pub async fn transfers_get_hub_v2(&self, estimated_arrival_end: Option<String>, estimated_arrival_start: Option<String>, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3347        let mut path = format!("/transfers/v2/hub");
3348        let mut query_params = Vec::new();
3349        if let Some(p) = estimated_arrival_end {
3350            query_params.push(format!("estimatedArrivalEnd={}", urlencoding::encode(&p)));
3351        }
3352        if let Some(p) = estimated_arrival_start {
3353            query_params.push(format!("estimatedArrivalStart={}", urlencoding::encode(&p)));
3354        }
3355        if let Some(p) = last_modified_end {
3356            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3357        }
3358        if let Some(p) = last_modified_start {
3359            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3360        }
3361        if let Some(p) = license_number {
3362            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3363        }
3364        if let Some(p) = page_number {
3365            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3366        }
3367        if let Some(p) = page_size {
3368            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3369        }
3370        if !query_params.is_empty() {
3371            path.push_str("?");
3372            path.push_str(&query_params.join("&"));
3373        }
3374        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3375    }
3376
3377    /// GET GetIncoming V1
3378    /// Permissions Required:
3379    ///   - Transfers
3380    ///
3381    pub async fn transfers_get_incoming_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3382        let mut path = format!("/transfers/v1/incoming");
3383        let mut query_params = Vec::new();
3384        if let Some(p) = last_modified_end {
3385            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3386        }
3387        if let Some(p) = last_modified_start {
3388            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3389        }
3390        if let Some(p) = license_number {
3391            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3392        }
3393        if !query_params.is_empty() {
3394            path.push_str("?");
3395            path.push_str(&query_params.join("&"));
3396        }
3397        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3398    }
3399
3400    /// GET GetIncoming V2
3401    /// Retrieves a list of incoming shipments for a Facility, optionally filtered by last modified date range.
3402    /// 
3403    ///   Permissions Required:
3404    ///   - Manage Transfers
3405    ///   - View Transfers
3406    ///
3407    pub async fn transfers_get_incoming_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3408        let mut path = format!("/transfers/v2/incoming");
3409        let mut query_params = Vec::new();
3410        if let Some(p) = last_modified_end {
3411            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3412        }
3413        if let Some(p) = last_modified_start {
3414            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3415        }
3416        if let Some(p) = license_number {
3417            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3418        }
3419        if let Some(p) = page_number {
3420            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3421        }
3422        if let Some(p) = page_size {
3423            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3424        }
3425        if !query_params.is_empty() {
3426            path.push_str("?");
3427            path.push_str(&query_params.join("&"));
3428        }
3429        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3430    }
3431
3432    /// GET GetOutgoing V1
3433    /// Permissions Required:
3434    ///   - Transfers
3435    ///
3436    pub async fn transfers_get_outgoing_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3437        let mut path = format!("/transfers/v1/outgoing");
3438        let mut query_params = Vec::new();
3439        if let Some(p) = last_modified_end {
3440            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3441        }
3442        if let Some(p) = last_modified_start {
3443            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3444        }
3445        if let Some(p) = license_number {
3446            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3447        }
3448        if !query_params.is_empty() {
3449            path.push_str("?");
3450            path.push_str(&query_params.join("&"));
3451        }
3452        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3453    }
3454
3455    /// GET GetOutgoing V2
3456    /// Retrieves a list of outgoing shipments for a Facility, optionally filtered by last modified date range.
3457    /// 
3458    ///   Permissions Required:
3459    ///   - Manage Transfers
3460    ///   - View Transfers
3461    ///
3462    pub async fn transfers_get_outgoing_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3463        let mut path = format!("/transfers/v2/outgoing");
3464        let mut query_params = Vec::new();
3465        if let Some(p) = last_modified_end {
3466            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3467        }
3468        if let Some(p) = last_modified_start {
3469            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3470        }
3471        if let Some(p) = license_number {
3472            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3473        }
3474        if let Some(p) = page_number {
3475            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3476        }
3477        if let Some(p) = page_size {
3478            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3479        }
3480        if !query_params.is_empty() {
3481            path.push_str("?");
3482            path.push_str(&query_params.join("&"));
3483        }
3484        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3485    }
3486
3487    /// GET GetRejected V1
3488    /// Permissions Required:
3489    ///   - Transfers
3490    ///
3491    pub async fn transfers_get_rejected_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3492        let mut path = format!("/transfers/v1/rejected");
3493        let mut query_params = Vec::new();
3494        if let Some(p) = license_number {
3495            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3496        }
3497        if !query_params.is_empty() {
3498            path.push_str("?");
3499            path.push_str(&query_params.join("&"));
3500        }
3501        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3502    }
3503
3504    /// GET GetRejected V2
3505    /// Retrieves a list of shipments with rejected packages for a Facility.
3506    /// 
3507    ///   Permissions Required:
3508    ///   - Manage Transfers
3509    ///   - View Transfers
3510    ///
3511    pub async fn transfers_get_rejected_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3512        let mut path = format!("/transfers/v2/rejected");
3513        let mut query_params = Vec::new();
3514        if let Some(p) = license_number {
3515            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3516        }
3517        if let Some(p) = page_number {
3518            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3519        }
3520        if let Some(p) = page_size {
3521            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3522        }
3523        if !query_params.is_empty() {
3524            path.push_str("?");
3525            path.push_str(&query_params.join("&"));
3526        }
3527        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3528    }
3529
3530    /// GET GetTemplates V1
3531    /// Permissions Required:
3532    ///   - Transfer Templates
3533    ///
3534    pub async fn transfers_get_templates_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3535        let mut path = format!("/transfers/v1/templates");
3536        let mut query_params = Vec::new();
3537        if let Some(p) = last_modified_end {
3538            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3539        }
3540        if let Some(p) = last_modified_start {
3541            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3542        }
3543        if let Some(p) = license_number {
3544            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3545        }
3546        if !query_params.is_empty() {
3547            path.push_str("?");
3548            path.push_str(&query_params.join("&"));
3549        }
3550        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3551    }
3552
3553    /// GET GetTemplatesDelivery V1
3554    /// Permissions Required:
3555    ///   - Transfer Templates
3556    ///
3557    pub async fn transfers_get_templates_delivery_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3558        let mut path = format!("/transfers/v1/templates/{}/deliveries", urlencoding::encode(id).as_ref());
3559        let mut query_params = Vec::new();
3560        if let Some(p) = no {
3561            query_params.push(format!("No={}", urlencoding::encode(&p)));
3562        }
3563        if !query_params.is_empty() {
3564            path.push_str("?");
3565            path.push_str(&query_params.join("&"));
3566        }
3567        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3568    }
3569
3570    /// GET GetTemplatesDeliveryPackage V1
3571    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
3572    /// 
3573    ///   Permissions Required:
3574    ///   - Transfers
3575    ///
3576    pub async fn transfers_get_templates_delivery_package_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3577        let mut path = format!("/transfers/v1/templates/deliveries/{}/packages", urlencoding::encode(id).as_ref());
3578        let mut query_params = Vec::new();
3579        if let Some(p) = no {
3580            query_params.push(format!("No={}", urlencoding::encode(&p)));
3581        }
3582        if !query_params.is_empty() {
3583            path.push_str("?");
3584            path.push_str(&query_params.join("&"));
3585        }
3586        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3587    }
3588
3589    /// GET GetTemplatesDeliveryTransporters V1
3590    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
3591    /// 
3592    ///   Permissions Required:
3593    ///   - Transfer Templates
3594    ///
3595    pub async fn transfers_get_templates_delivery_transporters_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3596        let mut path = format!("/transfers/v1/templates/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
3597        let mut query_params = Vec::new();
3598        if let Some(p) = no {
3599            query_params.push(format!("No={}", urlencoding::encode(&p)));
3600        }
3601        if !query_params.is_empty() {
3602            path.push_str("?");
3603            path.push_str(&query_params.join("&"));
3604        }
3605        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3606    }
3607
3608    /// GET GetTemplatesDeliveryTransportersDetails V1
3609    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
3610    /// 
3611    ///   Permissions Required:
3612    ///   - Transfer Templates
3613    ///
3614    pub async fn transfers_get_templates_delivery_transporters_details_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3615        let mut path = format!("/transfers/v1/templates/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
3616        let mut query_params = Vec::new();
3617        if let Some(p) = no {
3618            query_params.push(format!("No={}", urlencoding::encode(&p)));
3619        }
3620        if !query_params.is_empty() {
3621            path.push_str("?");
3622            path.push_str(&query_params.join("&"));
3623        }
3624        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3625    }
3626
3627    /// GET GetTemplatesOutgoing V2
3628    /// Retrieves a list of transfer templates for a Facility, optionally filtered by last modified date range.
3629    /// 
3630    ///   Permissions Required:
3631    ///   - Manage Transfer Templates
3632    ///   - View Transfer Templates
3633    ///
3634    pub async fn transfers_get_templates_outgoing_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3635        let mut path = format!("/transfers/v2/templates/outgoing");
3636        let mut query_params = Vec::new();
3637        if let Some(p) = last_modified_end {
3638            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3639        }
3640        if let Some(p) = last_modified_start {
3641            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3642        }
3643        if let Some(p) = license_number {
3644            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3645        }
3646        if let Some(p) = page_number {
3647            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3648        }
3649        if let Some(p) = page_size {
3650            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3651        }
3652        if !query_params.is_empty() {
3653            path.push_str("?");
3654            path.push_str(&query_params.join("&"));
3655        }
3656        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3657    }
3658
3659    /// GET GetTemplatesOutgoingDelivery V2
3660    /// Retrieves a list of deliveries associated with a specific transfer template.
3661    /// 
3662    ///   Permissions Required:
3663    ///   - Manage Transfer Templates
3664    ///   - View Transfer Templates
3665    ///
3666    pub async fn transfers_get_templates_outgoing_delivery_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3667        let mut path = format!("/transfers/v2/templates/outgoing/{}/deliveries", urlencoding::encode(id).as_ref());
3668        let mut query_params = Vec::new();
3669        if let Some(p) = page_number {
3670            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3671        }
3672        if let Some(p) = page_size {
3673            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3674        }
3675        if !query_params.is_empty() {
3676            path.push_str("?");
3677            path.push_str(&query_params.join("&"));
3678        }
3679        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3680    }
3681
3682    /// GET GetTemplatesOutgoingDeliveryPackage V2
3683    /// Retrieves a list of delivery package templates for a given Transfer Template Delivery Id. Please note: The {id} parameter above represents a Transfer Template Delivery Id, not a Manifest Number.
3684    /// 
3685    ///   Permissions Required:
3686    ///   - Manage Transfer Templates
3687    ///   - View Transfer Templates
3688    ///
3689    pub async fn transfers_get_templates_outgoing_delivery_package_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3690        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/packages", urlencoding::encode(id).as_ref());
3691        let mut query_params = Vec::new();
3692        if let Some(p) = page_number {
3693            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3694        }
3695        if let Some(p) = page_size {
3696            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3697        }
3698        if !query_params.is_empty() {
3699            path.push_str("?");
3700            path.push_str(&query_params.join("&"));
3701        }
3702        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3703    }
3704
3705    /// GET GetTemplatesOutgoingDeliveryTransporters V2
3706    /// Retrieves a list of transporter templates for a given Transfer Template Delivery Id. Please note: The {id} parameter above represents a Transfer Template Delivery Id, not a Manifest Number.
3707    /// 
3708    ///   Permissions Required:
3709    ///   - Manage Transfer Templates
3710    ///   - View Transfer Templates
3711    ///
3712    pub async fn transfers_get_templates_outgoing_delivery_transporters_v2(&self, id: &str, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3713        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
3714        let mut query_params = Vec::new();
3715        if let Some(p) = page_number {
3716            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3717        }
3718        if let Some(p) = page_size {
3719            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3720        }
3721        if !query_params.is_empty() {
3722            path.push_str("?");
3723            path.push_str(&query_params.join("&"));
3724        }
3725        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3726    }
3727
3728    /// GET GetTemplatesOutgoingDeliveryTransportersDetails V2
3729    /// Retrieves detailed transporter templates for a given Transfer Template Delivery Id. Please note: The {id} parameter above represents a Transfer Template Delivery Id, not a Manifest Number.
3730    /// 
3731    ///   Permissions Required:
3732    ///   - Manage Transfer Templates
3733    ///   - View Transfer Templates
3734    ///
3735    pub async fn transfers_get_templates_outgoing_delivery_transporters_details_v2(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3736        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
3737        let mut query_params = Vec::new();
3738        if let Some(p) = no {
3739            query_params.push(format!("No={}", urlencoding::encode(&p)));
3740        }
3741        if !query_params.is_empty() {
3742            path.push_str("?");
3743            path.push_str(&query_params.join("&"));
3744        }
3745        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3746    }
3747
3748    /// GET GetTypes V1
3749    /// Permissions Required:
3750    ///   - None
3751    ///
3752    pub async fn transfers_get_types_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3753        let mut path = format!("/transfers/v1/types");
3754        let mut query_params = Vec::new();
3755        if let Some(p) = license_number {
3756            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3757        }
3758        if !query_params.is_empty() {
3759            path.push_str("?");
3760            path.push_str(&query_params.join("&"));
3761        }
3762        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3763    }
3764
3765    /// GET GetTypes V2
3766    /// Retrieves a list of available transfer types for a Facility based on its license number.
3767    /// 
3768    ///   Permissions Required:
3769    ///   - None
3770    ///
3771    pub async fn transfers_get_types_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3772        let mut path = format!("/transfers/v2/types");
3773        let mut query_params = Vec::new();
3774        if let Some(p) = license_number {
3775            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3776        }
3777        if let Some(p) = page_number {
3778            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3779        }
3780        if let Some(p) = page_size {
3781            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3782        }
3783        if !query_params.is_empty() {
3784            path.push_str("?");
3785            path.push_str(&query_params.join("&"));
3786        }
3787        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3788    }
3789
3790    /// PUT UpdateExternalIncoming V1
3791    /// Permissions Required:
3792    ///   - Transfers
3793    ///
3794    pub async fn transfers_update_external_incoming_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3795        let mut path = format!("/transfers/v1/external/incoming");
3796        let mut query_params = Vec::new();
3797        if let Some(p) = license_number {
3798            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3799        }
3800        if !query_params.is_empty() {
3801            path.push_str("?");
3802            path.push_str(&query_params.join("&"));
3803        }
3804        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3805    }
3806
3807    /// PUT UpdateExternalIncoming V2
3808    /// Updates external incoming shipment plans for a Facility.
3809    /// 
3810    ///   Permissions Required:
3811    ///   - Manage Transfers
3812    ///
3813    pub async fn transfers_update_external_incoming_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3814        let mut path = format!("/transfers/v2/external/incoming");
3815        let mut query_params = Vec::new();
3816        if let Some(p) = license_number {
3817            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3818        }
3819        if !query_params.is_empty() {
3820            path.push_str("?");
3821            path.push_str(&query_params.join("&"));
3822        }
3823        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3824    }
3825
3826    /// PUT UpdateTemplates V1
3827    /// Permissions Required:
3828    ///   - Transfer Templates
3829    ///
3830    pub async fn transfers_update_templates_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3831        let mut path = format!("/transfers/v1/templates");
3832        let mut query_params = Vec::new();
3833        if let Some(p) = license_number {
3834            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3835        }
3836        if !query_params.is_empty() {
3837            path.push_str("?");
3838            path.push_str(&query_params.join("&"));
3839        }
3840        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3841    }
3842
3843    /// PUT UpdateTemplatesOutgoing V2
3844    /// Updates existing transfer templates for a Facility.
3845    /// 
3846    ///   Permissions Required:
3847    ///   - Manage Transfer Templates
3848    ///
3849    pub async fn transfers_update_templates_outgoing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3850        let mut path = format!("/transfers/v2/templates/outgoing");
3851        let mut query_params = Vec::new();
3852        if let Some(p) = license_number {
3853            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3854        }
3855        if !query_params.is_empty() {
3856            path.push_str("?");
3857            path.push_str(&query_params.join("&"));
3858        }
3859        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3860    }
3861
3862    /// GET GetActive V1
3863    /// Permissions Required:
3864    ///   - None
3865    ///
3866    pub async fn units_of_measure_get_active_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3867        let mut path = format!("/unitsofmeasure/v1/active");
3868        let mut query_params = Vec::new();
3869        if let Some(p) = no {
3870            query_params.push(format!("No={}", urlencoding::encode(&p)));
3871        }
3872        if !query_params.is_empty() {
3873            path.push_str("?");
3874            path.push_str(&query_params.join("&"));
3875        }
3876        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3877    }
3878
3879    /// GET GetActive V2
3880    /// Retrieves all active units of measure.
3881    /// 
3882    ///   Permissions Required:
3883    ///   - None
3884    ///
3885    pub async fn units_of_measure_get_active_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3886        let mut path = format!("/unitsofmeasure/v2/active");
3887        let mut query_params = Vec::new();
3888        if let Some(p) = no {
3889            query_params.push(format!("No={}", urlencoding::encode(&p)));
3890        }
3891        if !query_params.is_empty() {
3892            path.push_str("?");
3893            path.push_str(&query_params.join("&"));
3894        }
3895        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3896    }
3897
3898    /// GET GetInactive V2
3899    /// Retrieves all inactive units of measure.
3900    /// 
3901    ///   Permissions Required:
3902    ///   - None
3903    ///
3904    pub async fn units_of_measure_get_inactive_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3905        let mut path = format!("/unitsofmeasure/v2/inactive");
3906        let mut query_params = Vec::new();
3907        if let Some(p) = no {
3908            query_params.push(format!("No={}", urlencoding::encode(&p)));
3909        }
3910        if !query_params.is_empty() {
3911            path.push_str("?");
3912            path.push_str(&query_params.join("&"));
3913        }
3914        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3915    }
3916
3917    /// GET GetAll V2
3918    /// Retrieves all available waste methods.
3919    /// 
3920    ///   Permissions Required:
3921    ///   - None
3922    ///
3923    pub async fn waste_methods_get_all_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3924        let mut path = format!("/wastemethods/v2");
3925        let mut query_params = Vec::new();
3926        if let Some(p) = no {
3927            query_params.push(format!("No={}", urlencoding::encode(&p)));
3928        }
3929        if !query_params.is_empty() {
3930            path.push_str("?");
3931            path.push_str(&query_params.join("&"));
3932        }
3933        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3934    }
3935
3936    /// GET GetByCaregiverLicenseNumber V1
3937    /// Data returned by this endpoint is cached for up to one minute.
3938    /// 
3939    ///   Permissions Required:
3940    ///   - Lookup Caregivers
3941    ///
3942    pub async fn caregivers_status_get_by_caregiver_license_number_v1(&self, caregiver_license_number: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3943        let mut path = format!("/caregivers/v1/status/{}", urlencoding::encode(caregiver_license_number).as_ref());
3944        let mut query_params = Vec::new();
3945        if let Some(p) = license_number {
3946            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3947        }
3948        if !query_params.is_empty() {
3949            path.push_str("?");
3950            path.push_str(&query_params.join("&"));
3951        }
3952        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3953    }
3954
3955    /// GET GetByCaregiverLicenseNumber V2
3956    /// Retrieves the status of a Caregiver by their License Number for a specified Facility. Data returned by this endpoint is cached for up to one minute.
3957    /// 
3958    ///   Permissions Required:
3959    ///   - Lookup Caregivers
3960    ///
3961    pub async fn caregivers_status_get_by_caregiver_license_number_v2(&self, caregiver_license_number: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3962        let mut path = format!("/caregivers/v2/status/{}", urlencoding::encode(caregiver_license_number).as_ref());
3963        let mut query_params = Vec::new();
3964        if let Some(p) = license_number {
3965            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3966        }
3967        if !query_params.is_empty() {
3968            path.push_str("?");
3969            path.push_str(&query_params.join("&"));
3970        }
3971        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3972    }
3973
3974    /// GET GetAll V1
3975    /// Permissions Required:
3976    ///   - Manage Employees
3977    ///
3978    pub async fn employees_get_all_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3979        let mut path = format!("/employees/v1");
3980        let mut query_params = Vec::new();
3981        if let Some(p) = license_number {
3982            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3983        }
3984        if !query_params.is_empty() {
3985            path.push_str("?");
3986            path.push_str(&query_params.join("&"));
3987        }
3988        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3989    }
3990
3991    /// GET GetAll V2
3992    /// Retrieves a list of employees for a specified Facility.
3993    /// 
3994    ///   Permissions Required:
3995    ///   - Manage Employees
3996    ///   - View Employees
3997    ///
3998    pub async fn employees_get_all_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3999        let mut path = format!("/employees/v2");
4000        let mut query_params = Vec::new();
4001        if let Some(p) = license_number {
4002            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4003        }
4004        if let Some(p) = page_number {
4005            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4006        }
4007        if let Some(p) = page_size {
4008            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4009        }
4010        if !query_params.is_empty() {
4011            path.push_str("?");
4012            path.push_str(&query_params.join("&"));
4013        }
4014        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4015    }
4016
4017    /// GET GetPermissions V2
4018    /// Retrieves the permissions of a specified Employee, identified by their Employee License Number, for a given Facility.
4019    /// 
4020    ///   Permissions Required:
4021    ///   - Manage Employees
4022    ///
4023    pub async fn employees_get_permissions_v2(&self, employee_license_number: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4024        let mut path = format!("/employees/v2/permissions");
4025        let mut query_params = Vec::new();
4026        if let Some(p) = employee_license_number {
4027            query_params.push(format!("employeeLicenseNumber={}", urlencoding::encode(&p)));
4028        }
4029        if let Some(p) = license_number {
4030            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4031        }
4032        if !query_params.is_empty() {
4033            path.push_str("?");
4034            path.push_str(&query_params.join("&"));
4035        }
4036        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4037    }
4038
4039    /// POST Create V1
4040    /// NOTE: To include a photo with an item, first use POST /items/v1/photo to POST the photo, and then use the returned ID in the request body in this endpoint.
4041    /// 
4042    ///   Permissions Required:
4043    ///   - Manage Items
4044    ///
4045    pub async fn items_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4046        let mut path = format!("/items/v1/create");
4047        let mut query_params = Vec::new();
4048        if let Some(p) = license_number {
4049            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4050        }
4051        if !query_params.is_empty() {
4052            path.push_str("?");
4053            path.push_str(&query_params.join("&"));
4054        }
4055        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4056    }
4057
4058    /// POST Create V2
4059    /// Creates one or more new products for the specified Facility. NOTE: To include a photo with an item, first use POST /items/v2/photo to POST the photo, and then use the returned Id in the request body in this endpoint.
4060    /// 
4061    ///   Permissions Required:
4062    ///   - Manage Items
4063    ///
4064    pub async fn items_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4065        let mut path = format!("/items/v2");
4066        let mut query_params = Vec::new();
4067        if let Some(p) = license_number {
4068            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4069        }
4070        if !query_params.is_empty() {
4071            path.push_str("?");
4072            path.push_str(&query_params.join("&"));
4073        }
4074        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4075    }
4076
4077    /// POST CreateBrand V2
4078    /// Creates one or more new item brands for the specified Facility identified by the License Number.
4079    /// 
4080    ///   Permissions Required:
4081    ///   - Manage Items
4082    ///
4083    pub async fn items_create_brand_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4084        let mut path = format!("/items/v2/brand");
4085        let mut query_params = Vec::new();
4086        if let Some(p) = license_number {
4087            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4088        }
4089        if !query_params.is_empty() {
4090            path.push_str("?");
4091            path.push_str(&query_params.join("&"));
4092        }
4093        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4094    }
4095
4096    /// POST CreateFile V2
4097    /// Uploads one or more image or PDF files for products, labels, packaging, or documents at the specified Facility.
4098    /// 
4099    ///   Permissions Required:
4100    ///   - Manage Items
4101    ///
4102    pub async fn items_create_file_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4103        let mut path = format!("/items/v2/file");
4104        let mut query_params = Vec::new();
4105        if let Some(p) = license_number {
4106            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4107        }
4108        if !query_params.is_empty() {
4109            path.push_str("?");
4110            path.push_str(&query_params.join("&"));
4111        }
4112        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4113    }
4114
4115    /// POST CreatePhoto V1
4116    /// This endpoint allows only BMP, GIF, JPG, and PNG files and uploaded files can be no more than 5 MB in size.
4117    /// 
4118    ///   Permissions Required:
4119    ///   - Manage Items
4120    ///
4121    pub async fn items_create_photo_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4122        let mut path = format!("/items/v1/photo");
4123        let mut query_params = Vec::new();
4124        if let Some(p) = license_number {
4125            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4126        }
4127        if !query_params.is_empty() {
4128            path.push_str("?");
4129            path.push_str(&query_params.join("&"));
4130        }
4131        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4132    }
4133
4134    /// POST CreatePhoto V2
4135    /// This endpoint allows only BMP, GIF, JPG, and PNG files and uploaded files can be no more than 5 MB in size.
4136    /// 
4137    ///   Permissions Required:
4138    ///   - Manage Items
4139    ///
4140    pub async fn items_create_photo_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4141        let mut path = format!("/items/v2/photo");
4142        let mut query_params = Vec::new();
4143        if let Some(p) = license_number {
4144            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4145        }
4146        if !query_params.is_empty() {
4147            path.push_str("?");
4148            path.push_str(&query_params.join("&"));
4149        }
4150        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4151    }
4152
4153    /// POST CreateUpdate V1
4154    /// Permissions Required:
4155    ///   - Manage Items
4156    ///
4157    pub async fn items_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4158        let mut path = format!("/items/v1/update");
4159        let mut query_params = Vec::new();
4160        if let Some(p) = license_number {
4161            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4162        }
4163        if !query_params.is_empty() {
4164            path.push_str("?");
4165            path.push_str(&query_params.join("&"));
4166        }
4167        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4168    }
4169
4170    /// DELETE Delete V1
4171    /// Permissions Required:
4172    ///   - Manage Items
4173    ///
4174    pub async fn items_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4175        let mut path = format!("/items/v1/{}", urlencoding::encode(id).as_ref());
4176        let mut query_params = Vec::new();
4177        if let Some(p) = license_number {
4178            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4179        }
4180        if !query_params.is_empty() {
4181            path.push_str("?");
4182            path.push_str(&query_params.join("&"));
4183        }
4184        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4185    }
4186
4187    /// DELETE Delete V2
4188    /// Archives the specified Product by Id for the given Facility License Number.
4189    /// 
4190    ///   Permissions Required:
4191    ///   - Manage Items
4192    ///
4193    pub async fn items_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4194        let mut path = format!("/items/v2/{}", urlencoding::encode(id).as_ref());
4195        let mut query_params = Vec::new();
4196        if let Some(p) = license_number {
4197            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4198        }
4199        if !query_params.is_empty() {
4200            path.push_str("?");
4201            path.push_str(&query_params.join("&"));
4202        }
4203        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4204    }
4205
4206    /// DELETE DeleteBrand V2
4207    /// Archives the specified Item Brand by Id for the given Facility License Number.
4208    /// 
4209    ///   Permissions Required:
4210    ///   - Manage Items
4211    ///
4212    pub async fn items_delete_brand_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4213        let mut path = format!("/items/v2/brand/{}", urlencoding::encode(id).as_ref());
4214        let mut query_params = Vec::new();
4215        if let Some(p) = license_number {
4216            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4217        }
4218        if !query_params.is_empty() {
4219            path.push_str("?");
4220            path.push_str(&query_params.join("&"));
4221        }
4222        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4223    }
4224
4225    /// GET Get V1
4226    /// Permissions Required:
4227    ///   - Manage Items
4228    ///
4229    pub async fn items_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4230        let mut path = format!("/items/v1/{}", urlencoding::encode(id).as_ref());
4231        let mut query_params = Vec::new();
4232        if let Some(p) = license_number {
4233            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4234        }
4235        if !query_params.is_empty() {
4236            path.push_str("?");
4237            path.push_str(&query_params.join("&"));
4238        }
4239        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4240    }
4241
4242    /// GET Get V2
4243    /// Retrieves detailed information about a specific Item by Id.
4244    /// 
4245    ///   Permissions Required:
4246    ///   - Manage Items
4247    ///
4248    pub async fn items_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4249        let mut path = format!("/items/v2/{}", urlencoding::encode(id).as_ref());
4250        let mut query_params = Vec::new();
4251        if let Some(p) = license_number {
4252            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4253        }
4254        if !query_params.is_empty() {
4255            path.push_str("?");
4256            path.push_str(&query_params.join("&"));
4257        }
4258        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4259    }
4260
4261    /// GET GetActive V1
4262    /// Permissions Required:
4263    ///   - Manage Items
4264    ///
4265    pub async fn items_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4266        let mut path = format!("/items/v1/active");
4267        let mut query_params = Vec::new();
4268        if let Some(p) = license_number {
4269            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4270        }
4271        if !query_params.is_empty() {
4272            path.push_str("?");
4273            path.push_str(&query_params.join("&"));
4274        }
4275        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4276    }
4277
4278    /// GET GetActive V2
4279    /// Returns a list of active items for the specified Facility.
4280    /// 
4281    ///   Permissions Required:
4282    ///   - Manage Items
4283    ///
4284    pub async fn items_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4285        let mut path = format!("/items/v2/active");
4286        let mut query_params = Vec::new();
4287        if let Some(p) = last_modified_end {
4288            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4289        }
4290        if let Some(p) = last_modified_start {
4291            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4292        }
4293        if let Some(p) = license_number {
4294            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4295        }
4296        if let Some(p) = page_number {
4297            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4298        }
4299        if let Some(p) = page_size {
4300            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4301        }
4302        if !query_params.is_empty() {
4303            path.push_str("?");
4304            path.push_str(&query_params.join("&"));
4305        }
4306        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4307    }
4308
4309    /// GET GetBrands V1
4310    /// Permissions Required:
4311    ///   - Manage Items
4312    ///
4313    pub async fn items_get_brands_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4314        let mut path = format!("/items/v1/brands");
4315        let mut query_params = Vec::new();
4316        if let Some(p) = license_number {
4317            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4318        }
4319        if !query_params.is_empty() {
4320            path.push_str("?");
4321            path.push_str(&query_params.join("&"));
4322        }
4323        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4324    }
4325
4326    /// GET GetBrands V2
4327    /// Retrieves a list of active item brands for the specified Facility.
4328    /// 
4329    ///   Permissions Required:
4330    ///   - Manage Items
4331    ///
4332    pub async fn items_get_brands_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4333        let mut path = format!("/items/v2/brands");
4334        let mut query_params = Vec::new();
4335        if let Some(p) = license_number {
4336            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4337        }
4338        if let Some(p) = page_number {
4339            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4340        }
4341        if let Some(p) = page_size {
4342            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4343        }
4344        if !query_params.is_empty() {
4345            path.push_str("?");
4346            path.push_str(&query_params.join("&"));
4347        }
4348        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4349    }
4350
4351    /// GET GetCategories V1
4352    /// Permissions Required:
4353    ///   - None
4354    ///
4355    pub async fn items_get_categories_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4356        let mut path = format!("/items/v1/categories");
4357        let mut query_params = Vec::new();
4358        if let Some(p) = license_number {
4359            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4360        }
4361        if !query_params.is_empty() {
4362            path.push_str("?");
4363            path.push_str(&query_params.join("&"));
4364        }
4365        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4366    }
4367
4368    /// GET GetCategories V2
4369    /// Retrieves a list of item categories.
4370    /// 
4371    ///   Permissions Required:
4372    ///   - None
4373    ///
4374    pub async fn items_get_categories_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4375        let mut path = format!("/items/v2/categories");
4376        let mut query_params = Vec::new();
4377        if let Some(p) = license_number {
4378            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4379        }
4380        if let Some(p) = page_number {
4381            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4382        }
4383        if let Some(p) = page_size {
4384            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4385        }
4386        if !query_params.is_empty() {
4387            path.push_str("?");
4388            path.push_str(&query_params.join("&"));
4389        }
4390        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4391    }
4392
4393    /// GET GetFile V2
4394    /// Retrieves a file by its Id for the specified Facility.
4395    /// 
4396    ///   Permissions Required:
4397    ///   - Manage Items
4398    ///
4399    pub async fn items_get_file_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4400        let mut path = format!("/items/v2/file/{}", urlencoding::encode(id).as_ref());
4401        let mut query_params = Vec::new();
4402        if let Some(p) = license_number {
4403            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4404        }
4405        if !query_params.is_empty() {
4406            path.push_str("?");
4407            path.push_str(&query_params.join("&"));
4408        }
4409        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4410    }
4411
4412    /// GET GetInactive V1
4413    /// Permissions Required:
4414    ///   - Manage Items
4415    ///
4416    pub async fn items_get_inactive_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4417        let mut path = format!("/items/v1/inactive");
4418        let mut query_params = Vec::new();
4419        if let Some(p) = license_number {
4420            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4421        }
4422        if !query_params.is_empty() {
4423            path.push_str("?");
4424            path.push_str(&query_params.join("&"));
4425        }
4426        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4427    }
4428
4429    /// GET GetInactive V2
4430    /// Retrieves a list of inactive items for the specified Facility.
4431    /// 
4432    ///   Permissions Required:
4433    ///   - Manage Items
4434    ///
4435    pub async fn items_get_inactive_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4436        let mut path = format!("/items/v2/inactive");
4437        let mut query_params = Vec::new();
4438        if let Some(p) = license_number {
4439            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4440        }
4441        if let Some(p) = page_number {
4442            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4443        }
4444        if let Some(p) = page_size {
4445            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4446        }
4447        if !query_params.is_empty() {
4448            path.push_str("?");
4449            path.push_str(&query_params.join("&"));
4450        }
4451        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4452    }
4453
4454    /// GET GetPhoto V1
4455    /// Permissions Required:
4456    ///   - Manage Items
4457    ///
4458    pub async fn items_get_photo_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4459        let mut path = format!("/items/v1/photo/{}", urlencoding::encode(id).as_ref());
4460        let mut query_params = Vec::new();
4461        if let Some(p) = license_number {
4462            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4463        }
4464        if !query_params.is_empty() {
4465            path.push_str("?");
4466            path.push_str(&query_params.join("&"));
4467        }
4468        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4469    }
4470
4471    /// GET GetPhoto V2
4472    /// Retrieves an image by its Id for the specified Facility.
4473    /// 
4474    ///   Permissions Required:
4475    ///   - Manage Items
4476    ///
4477    pub async fn items_get_photo_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4478        let mut path = format!("/items/v2/photo/{}", urlencoding::encode(id).as_ref());
4479        let mut query_params = Vec::new();
4480        if let Some(p) = license_number {
4481            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4482        }
4483        if !query_params.is_empty() {
4484            path.push_str("?");
4485            path.push_str(&query_params.join("&"));
4486        }
4487        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4488    }
4489
4490    /// PUT Update V2
4491    /// Updates one or more existing products for the specified Facility.
4492    /// 
4493    ///   Permissions Required:
4494    ///   - Manage Items
4495    ///
4496    pub async fn items_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4497        let mut path = format!("/items/v2");
4498        let mut query_params = Vec::new();
4499        if let Some(p) = license_number {
4500            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4501        }
4502        if !query_params.is_empty() {
4503            path.push_str("?");
4504            path.push_str(&query_params.join("&"));
4505        }
4506        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4507    }
4508
4509    /// PUT UpdateBrand V2
4510    /// Updates one or more existing item brands for the specified Facility.
4511    /// 
4512    ///   Permissions Required:
4513    ///   - Manage Items
4514    ///
4515    pub async fn items_update_brand_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4516        let mut path = format!("/items/v2/brand");
4517        let mut query_params = Vec::new();
4518        if let Some(p) = license_number {
4519            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4520        }
4521        if !query_params.is_empty() {
4522            path.push_str("?");
4523            path.push_str(&query_params.join("&"));
4524        }
4525        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4526    }
4527
4528    /// POST Create V1
4529    /// Permissions Required:
4530    ///   - Manage Locations
4531    ///
4532    pub async fn locations_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4533        let mut path = format!("/locations/v1/create");
4534        let mut query_params = Vec::new();
4535        if let Some(p) = license_number {
4536            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4537        }
4538        if !query_params.is_empty() {
4539            path.push_str("?");
4540            path.push_str(&query_params.join("&"));
4541        }
4542        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4543    }
4544
4545    /// POST Create V2
4546    /// Creates new locations for a specified Facility.
4547    /// 
4548    ///   Permissions Required:
4549    ///   - Manage Locations
4550    ///
4551    pub async fn locations_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4552        let mut path = format!("/locations/v2");
4553        let mut query_params = Vec::new();
4554        if let Some(p) = license_number {
4555            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4556        }
4557        if !query_params.is_empty() {
4558            path.push_str("?");
4559            path.push_str(&query_params.join("&"));
4560        }
4561        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4562    }
4563
4564    /// POST CreateUpdate V1
4565    /// Permissions Required:
4566    ///   - Manage Locations
4567    ///
4568    pub async fn locations_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4569        let mut path = format!("/locations/v1/update");
4570        let mut query_params = Vec::new();
4571        if let Some(p) = license_number {
4572            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4573        }
4574        if !query_params.is_empty() {
4575            path.push_str("?");
4576            path.push_str(&query_params.join("&"));
4577        }
4578        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4579    }
4580
4581    /// DELETE Delete V1
4582    /// Permissions Required:
4583    ///   - Manage Locations
4584    ///
4585    pub async fn locations_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4586        let mut path = format!("/locations/v1/{}", urlencoding::encode(id).as_ref());
4587        let mut query_params = Vec::new();
4588        if let Some(p) = license_number {
4589            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4590        }
4591        if !query_params.is_empty() {
4592            path.push_str("?");
4593            path.push_str(&query_params.join("&"));
4594        }
4595        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4596    }
4597
4598    /// DELETE Delete V2
4599    /// Archives a specified Location, identified by its Id, for a Facility.
4600    /// 
4601    ///   Permissions Required:
4602    ///   - Manage Locations
4603    ///
4604    pub async fn locations_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4605        let mut path = format!("/locations/v2/{}", urlencoding::encode(id).as_ref());
4606        let mut query_params = Vec::new();
4607        if let Some(p) = license_number {
4608            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4609        }
4610        if !query_params.is_empty() {
4611            path.push_str("?");
4612            path.push_str(&query_params.join("&"));
4613        }
4614        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4615    }
4616
4617    /// GET Get V1
4618    /// Permissions Required:
4619    ///   - Manage Locations
4620    ///
4621    pub async fn locations_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4622        let mut path = format!("/locations/v1/{}", urlencoding::encode(id).as_ref());
4623        let mut query_params = Vec::new();
4624        if let Some(p) = license_number {
4625            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4626        }
4627        if !query_params.is_empty() {
4628            path.push_str("?");
4629            path.push_str(&query_params.join("&"));
4630        }
4631        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4632    }
4633
4634    /// GET Get V2
4635    /// Retrieves a Location by its Id.
4636    /// 
4637    ///   Permissions Required:
4638    ///   - Manage Locations
4639    ///
4640    pub async fn locations_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4641        let mut path = format!("/locations/v2/{}", urlencoding::encode(id).as_ref());
4642        let mut query_params = Vec::new();
4643        if let Some(p) = license_number {
4644            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4645        }
4646        if !query_params.is_empty() {
4647            path.push_str("?");
4648            path.push_str(&query_params.join("&"));
4649        }
4650        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4651    }
4652
4653    /// GET GetActive V1
4654    /// Permissions Required:
4655    ///   - Manage Locations
4656    ///
4657    pub async fn locations_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4658        let mut path = format!("/locations/v1/active");
4659        let mut query_params = Vec::new();
4660        if let Some(p) = license_number {
4661            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4662        }
4663        if !query_params.is_empty() {
4664            path.push_str("?");
4665            path.push_str(&query_params.join("&"));
4666        }
4667        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4668    }
4669
4670    /// GET GetActive V2
4671    /// Retrieves a list of active locations for a specified Facility.
4672    /// 
4673    ///   Permissions Required:
4674    ///   - Manage Locations
4675    ///
4676    pub async fn locations_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4677        let mut path = format!("/locations/v2/active");
4678        let mut query_params = Vec::new();
4679        if let Some(p) = last_modified_end {
4680            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4681        }
4682        if let Some(p) = last_modified_start {
4683            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4684        }
4685        if let Some(p) = license_number {
4686            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4687        }
4688        if let Some(p) = page_number {
4689            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4690        }
4691        if let Some(p) = page_size {
4692            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4693        }
4694        if !query_params.is_empty() {
4695            path.push_str("?");
4696            path.push_str(&query_params.join("&"));
4697        }
4698        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4699    }
4700
4701    /// GET GetInactive V2
4702    /// Retrieves a list of inactive locations for a specified Facility.
4703    /// 
4704    ///   Permissions Required:
4705    ///   - Manage Locations
4706    ///
4707    pub async fn locations_get_inactive_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4708        let mut path = format!("/locations/v2/inactive");
4709        let mut query_params = Vec::new();
4710        if let Some(p) = license_number {
4711            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4712        }
4713        if let Some(p) = page_number {
4714            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4715        }
4716        if let Some(p) = page_size {
4717            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4718        }
4719        if !query_params.is_empty() {
4720            path.push_str("?");
4721            path.push_str(&query_params.join("&"));
4722        }
4723        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4724    }
4725
4726    /// GET GetTypes V1
4727    /// Permissions Required:
4728    ///   - Manage Locations
4729    ///
4730    pub async fn locations_get_types_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4731        let mut path = format!("/locations/v1/types");
4732        let mut query_params = Vec::new();
4733        if let Some(p) = license_number {
4734            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4735        }
4736        if !query_params.is_empty() {
4737            path.push_str("?");
4738            path.push_str(&query_params.join("&"));
4739        }
4740        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4741    }
4742
4743    /// GET GetTypes V2
4744    /// Retrieves a list of active location types for a specified Facility.
4745    /// 
4746    ///   Permissions Required:
4747    ///   - Manage Locations
4748    ///
4749    pub async fn locations_get_types_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4750        let mut path = format!("/locations/v2/types");
4751        let mut query_params = Vec::new();
4752        if let Some(p) = license_number {
4753            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4754        }
4755        if let Some(p) = page_number {
4756            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4757        }
4758        if let Some(p) = page_size {
4759            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4760        }
4761        if !query_params.is_empty() {
4762            path.push_str("?");
4763            path.push_str(&query_params.join("&"));
4764        }
4765        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4766    }
4767
4768    /// PUT Update V2
4769    /// Updates existing locations for a specified Facility.
4770    /// 
4771    ///   Permissions Required:
4772    ///   - Manage Locations
4773    ///
4774    pub async fn locations_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4775        let mut path = format!("/locations/v2");
4776        let mut query_params = Vec::new();
4777        if let Some(p) = license_number {
4778            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4779        }
4780        if !query_params.is_empty() {
4781            path.push_str("?");
4782            path.push_str(&query_params.join("&"));
4783        }
4784        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4785    }
4786
4787    /// POST Create V1
4788    /// Permissions Required:
4789    ///   - View Packages
4790    ///   - Create/Submit/Discontinue Packages
4791    ///
4792    pub async fn packages_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4793        let mut path = format!("/packages/v1/create");
4794        let mut query_params = Vec::new();
4795        if let Some(p) = license_number {
4796            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4797        }
4798        if !query_params.is_empty() {
4799            path.push_str("?");
4800            path.push_str(&query_params.join("&"));
4801        }
4802        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4803    }
4804
4805    /// POST Create V2
4806    /// Creates new packages for a specified Facility.
4807    /// 
4808    ///   Permissions Required:
4809    ///   - View Packages
4810    ///   - Create/Submit/Discontinue Packages
4811    ///
4812    pub async fn packages_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4813        let mut path = format!("/packages/v2");
4814        let mut query_params = Vec::new();
4815        if let Some(p) = license_number {
4816            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4817        }
4818        if !query_params.is_empty() {
4819            path.push_str("?");
4820            path.push_str(&query_params.join("&"));
4821        }
4822        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4823    }
4824
4825    /// POST CreateAdjust V1
4826    /// Permissions Required:
4827    ///   - View Packages
4828    ///   - Manage Packages Inventory
4829    ///
4830    pub async fn packages_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4831        let mut path = format!("/packages/v1/adjust");
4832        let mut query_params = Vec::new();
4833        if let Some(p) = license_number {
4834            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4835        }
4836        if !query_params.is_empty() {
4837            path.push_str("?");
4838            path.push_str(&query_params.join("&"));
4839        }
4840        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4841    }
4842
4843    /// POST CreateAdjust V2
4844    /// Records a list of adjustments for packages at a specific Facility.
4845    /// 
4846    ///   Permissions Required:
4847    ///   - View Packages
4848    ///   - Manage Packages Inventory
4849    ///
4850    pub async fn packages_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4851        let mut path = format!("/packages/v2/adjust");
4852        let mut query_params = Vec::new();
4853        if let Some(p) = license_number {
4854            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4855        }
4856        if !query_params.is_empty() {
4857            path.push_str("?");
4858            path.push_str(&query_params.join("&"));
4859        }
4860        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4861    }
4862
4863    /// POST CreateChangeItem V1
4864    /// Permissions Required:
4865    ///   - View Packages
4866    ///   - Create/Submit/Discontinue Packages
4867    ///
4868    pub async fn packages_create_change_item_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4869        let mut path = format!("/packages/v1/change/item");
4870        let mut query_params = Vec::new();
4871        if let Some(p) = license_number {
4872            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4873        }
4874        if !query_params.is_empty() {
4875            path.push_str("?");
4876            path.push_str(&query_params.join("&"));
4877        }
4878        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4879    }
4880
4881    /// POST CreateChangeLocation V1
4882    /// Permissions Required:
4883    ///   - View Packages
4884    ///   - Create/Submit/Discontinue Packages
4885    ///
4886    pub async fn packages_create_change_location_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4887        let mut path = format!("/packages/v1/change/locations");
4888        let mut query_params = Vec::new();
4889        if let Some(p) = license_number {
4890            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4891        }
4892        if !query_params.is_empty() {
4893            path.push_str("?");
4894            path.push_str(&query_params.join("&"));
4895        }
4896        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4897    }
4898
4899    /// POST CreateFinish V1
4900    /// Permissions Required:
4901    ///   - View Packages
4902    ///   - Manage Packages Inventory
4903    ///
4904    pub async fn packages_create_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4905        let mut path = format!("/packages/v1/finish");
4906        let mut query_params = Vec::new();
4907        if let Some(p) = license_number {
4908            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4909        }
4910        if !query_params.is_empty() {
4911            path.push_str("?");
4912            path.push_str(&query_params.join("&"));
4913        }
4914        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4915    }
4916
4917    /// POST CreatePlantings V1
4918    /// Permissions Required:
4919    ///   - View Immature Plants
4920    ///   - Manage Immature Plants
4921    ///   - View Packages
4922    ///   - Manage Packages Inventory
4923    ///
4924    pub async fn packages_create_plantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4925        let mut path = format!("/packages/v1/create/plantings");
4926        let mut query_params = Vec::new();
4927        if let Some(p) = license_number {
4928            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4929        }
4930        if !query_params.is_empty() {
4931            path.push_str("?");
4932            path.push_str(&query_params.join("&"));
4933        }
4934        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4935    }
4936
4937    /// POST CreatePlantings V2
4938    /// Creates new plantings from packages for a specified Facility.
4939    /// 
4940    ///   Permissions Required:
4941    ///   - View Immature Plants
4942    ///   - Manage Immature Plants
4943    ///   - View Packages
4944    ///   - Manage Packages Inventory
4945    ///
4946    pub async fn packages_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4947        let mut path = format!("/packages/v2/plantings");
4948        let mut query_params = Vec::new();
4949        if let Some(p) = license_number {
4950            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4951        }
4952        if !query_params.is_empty() {
4953            path.push_str("?");
4954            path.push_str(&query_params.join("&"));
4955        }
4956        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4957    }
4958
4959    /// POST CreateRemediate V1
4960    /// Permissions Required:
4961    ///   - View Packages
4962    ///   - Manage Packages Inventory
4963    ///
4964    pub async fn packages_create_remediate_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4965        let mut path = format!("/packages/v1/remediate");
4966        let mut query_params = Vec::new();
4967        if let Some(p) = license_number {
4968            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4969        }
4970        if !query_params.is_empty() {
4971            path.push_str("?");
4972            path.push_str(&query_params.join("&"));
4973        }
4974        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4975    }
4976
4977    /// POST CreateTesting V1
4978    /// Permissions Required:
4979    ///   - View Packages
4980    ///   - Create/Submit/Discontinue Packages
4981    ///
4982    pub async fn packages_create_testing_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4983        let mut path = format!("/packages/v1/create/testing");
4984        let mut query_params = Vec::new();
4985        if let Some(p) = license_number {
4986            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4987        }
4988        if !query_params.is_empty() {
4989            path.push_str("?");
4990            path.push_str(&query_params.join("&"));
4991        }
4992        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4993    }
4994
4995    /// POST CreateTesting V2
4996    /// Creates new packages for testing for a specified Facility.
4997    /// 
4998    ///   Permissions Required:
4999    ///   - View Packages
5000    ///   - Create/Submit/Discontinue Packages
5001    ///
5002    pub async fn packages_create_testing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5003        let mut path = format!("/packages/v2/testing");
5004        let mut query_params = Vec::new();
5005        if let Some(p) = license_number {
5006            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5007        }
5008        if !query_params.is_empty() {
5009            path.push_str("?");
5010            path.push_str(&query_params.join("&"));
5011        }
5012        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5013    }
5014
5015    /// POST CreateUnfinish V1
5016    /// Permissions Required:
5017    ///   - View Packages
5018    ///   - Manage Packages Inventory
5019    ///
5020    pub async fn packages_create_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5021        let mut path = format!("/packages/v1/unfinish");
5022        let mut query_params = Vec::new();
5023        if let Some(p) = license_number {
5024            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5025        }
5026        if !query_params.is_empty() {
5027            path.push_str("?");
5028            path.push_str(&query_params.join("&"));
5029        }
5030        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5031    }
5032
5033    /// DELETE Delete V2
5034    /// Discontinues a Package at a specific Facility.
5035    /// 
5036    ///   Permissions Required:
5037    ///   - View Packages
5038    ///   - Create/Submit/Discontinue Packages
5039    ///
5040    pub async fn packages_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5041        let mut path = format!("/packages/v2/{}", urlencoding::encode(id).as_ref());
5042        let mut query_params = Vec::new();
5043        if let Some(p) = license_number {
5044            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5045        }
5046        if !query_params.is_empty() {
5047            path.push_str("?");
5048            path.push_str(&query_params.join("&"));
5049        }
5050        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5051    }
5052
5053    /// GET Get V1
5054    /// Permissions Required:
5055    ///   - View Packages
5056    ///
5057    pub async fn packages_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5058        let mut path = format!("/packages/v1/{}", urlencoding::encode(id).as_ref());
5059        let mut query_params = Vec::new();
5060        if let Some(p) = license_number {
5061            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5062        }
5063        if !query_params.is_empty() {
5064            path.push_str("?");
5065            path.push_str(&query_params.join("&"));
5066        }
5067        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5068    }
5069
5070    /// GET Get V2
5071    /// Retrieves a Package by its Id.
5072    /// 
5073    ///   Permissions Required:
5074    ///   - View Packages
5075    ///
5076    pub async fn packages_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5077        let mut path = format!("/packages/v2/{}", urlencoding::encode(id).as_ref());
5078        let mut query_params = Vec::new();
5079        if let Some(p) = license_number {
5080            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5081        }
5082        if !query_params.is_empty() {
5083            path.push_str("?");
5084            path.push_str(&query_params.join("&"));
5085        }
5086        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5087    }
5088
5089    /// GET GetActive V1
5090    /// Permissions Required:
5091    ///   - View Packages
5092    ///
5093    pub async fn packages_get_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5094        let mut path = format!("/packages/v1/active");
5095        let mut query_params = Vec::new();
5096        if let Some(p) = last_modified_end {
5097            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5098        }
5099        if let Some(p) = last_modified_start {
5100            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5101        }
5102        if let Some(p) = license_number {
5103            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5104        }
5105        if !query_params.is_empty() {
5106            path.push_str("?");
5107            path.push_str(&query_params.join("&"));
5108        }
5109        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5110    }
5111
5112    /// GET GetActive V2
5113    /// Retrieves a list of active packages for a specified Facility.
5114    /// 
5115    ///   Permissions Required:
5116    ///   - View Packages
5117    ///
5118    pub async fn packages_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5119        let mut path = format!("/packages/v2/active");
5120        let mut query_params = Vec::new();
5121        if let Some(p) = last_modified_end {
5122            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5123        }
5124        if let Some(p) = last_modified_start {
5125            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5126        }
5127        if let Some(p) = license_number {
5128            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5129        }
5130        if let Some(p) = page_number {
5131            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5132        }
5133        if let Some(p) = page_size {
5134            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5135        }
5136        if !query_params.is_empty() {
5137            path.push_str("?");
5138            path.push_str(&query_params.join("&"));
5139        }
5140        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5141    }
5142
5143    /// GET GetAdjustReasons V1
5144    /// Permissions Required:
5145    ///   - None
5146    ///
5147    pub async fn packages_get_adjust_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5148        let mut path = format!("/packages/v1/adjust/reasons");
5149        let mut query_params = Vec::new();
5150        if let Some(p) = license_number {
5151            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5152        }
5153        if !query_params.is_empty() {
5154            path.push_str("?");
5155            path.push_str(&query_params.join("&"));
5156        }
5157        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5158    }
5159
5160    /// GET GetAdjustReasons V2
5161    /// Retrieves a list of adjustment reasons for packages at a specified Facility.
5162    /// 
5163    ///   Permissions Required:
5164    ///   - None
5165    ///
5166    pub async fn packages_get_adjust_reasons_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5167        let mut path = format!("/packages/v2/adjust/reasons");
5168        let mut query_params = Vec::new();
5169        if let Some(p) = license_number {
5170            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5171        }
5172        if let Some(p) = page_number {
5173            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5174        }
5175        if let Some(p) = page_size {
5176            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5177        }
5178        if !query_params.is_empty() {
5179            path.push_str("?");
5180            path.push_str(&query_params.join("&"));
5181        }
5182        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5183    }
5184
5185    /// GET GetByLabel V1
5186    /// Permissions Required:
5187    ///   - View Packages
5188    ///
5189    pub async fn packages_get_by_label_v1(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5190        let mut path = format!("/packages/v1/{}", urlencoding::encode(label).as_ref());
5191        let mut query_params = Vec::new();
5192        if let Some(p) = license_number {
5193            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5194        }
5195        if !query_params.is_empty() {
5196            path.push_str("?");
5197            path.push_str(&query_params.join("&"));
5198        }
5199        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5200    }
5201
5202    /// GET GetByLabel V2
5203    /// Retrieves a Package by its label.
5204    /// 
5205    ///   Permissions Required:
5206    ///   - View Packages
5207    ///
5208    pub async fn packages_get_by_label_v2(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5209        let mut path = format!("/packages/v2/{}", urlencoding::encode(label).as_ref());
5210        let mut query_params = Vec::new();
5211        if let Some(p) = license_number {
5212            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5213        }
5214        if !query_params.is_empty() {
5215            path.push_str("?");
5216            path.push_str(&query_params.join("&"));
5217        }
5218        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5219    }
5220
5221    /// GET GetInactive V1
5222    /// Permissions Required:
5223    ///   - View Packages
5224    ///
5225    pub async fn packages_get_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5226        let mut path = format!("/packages/v1/inactive");
5227        let mut query_params = Vec::new();
5228        if let Some(p) = last_modified_end {
5229            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5230        }
5231        if let Some(p) = last_modified_start {
5232            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5233        }
5234        if let Some(p) = license_number {
5235            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5236        }
5237        if !query_params.is_empty() {
5238            path.push_str("?");
5239            path.push_str(&query_params.join("&"));
5240        }
5241        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5242    }
5243
5244    /// GET GetInactive V2
5245    /// Retrieves a list of inactive packages for a specified Facility.
5246    /// 
5247    ///   Permissions Required:
5248    ///   - View Packages
5249    ///
5250    pub async fn packages_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5251        let mut path = format!("/packages/v2/inactive");
5252        let mut query_params = Vec::new();
5253        if let Some(p) = last_modified_end {
5254            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5255        }
5256        if let Some(p) = last_modified_start {
5257            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5258        }
5259        if let Some(p) = license_number {
5260            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5261        }
5262        if let Some(p) = page_number {
5263            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5264        }
5265        if let Some(p) = page_size {
5266            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5267        }
5268        if !query_params.is_empty() {
5269            path.push_str("?");
5270            path.push_str(&query_params.join("&"));
5271        }
5272        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5273    }
5274
5275    /// GET GetIntransit V2
5276    /// Retrieves a list of packages in transit for a specified Facility.
5277    /// 
5278    ///   Permissions Required:
5279    ///   - View Packages
5280    ///
5281    pub async fn packages_get_intransit_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5282        let mut path = format!("/packages/v2/intransit");
5283        let mut query_params = Vec::new();
5284        if let Some(p) = last_modified_end {
5285            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5286        }
5287        if let Some(p) = last_modified_start {
5288            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5289        }
5290        if let Some(p) = license_number {
5291            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5292        }
5293        if let Some(p) = page_number {
5294            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5295        }
5296        if let Some(p) = page_size {
5297            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5298        }
5299        if !query_params.is_empty() {
5300            path.push_str("?");
5301            path.push_str(&query_params.join("&"));
5302        }
5303        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5304    }
5305
5306    /// GET GetLabsamples V2
5307    /// Retrieves a list of lab sample packages created or sent for testing for a specified Facility.
5308    /// 
5309    ///   Permissions Required:
5310    ///   - View Packages
5311    ///
5312    pub async fn packages_get_labsamples_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5313        let mut path = format!("/packages/v2/labsamples");
5314        let mut query_params = Vec::new();
5315        if let Some(p) = last_modified_end {
5316            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5317        }
5318        if let Some(p) = last_modified_start {
5319            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5320        }
5321        if let Some(p) = license_number {
5322            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5323        }
5324        if let Some(p) = page_number {
5325            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5326        }
5327        if let Some(p) = page_size {
5328            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5329        }
5330        if !query_params.is_empty() {
5331            path.push_str("?");
5332            path.push_str(&query_params.join("&"));
5333        }
5334        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5335    }
5336
5337    /// GET GetOnhold V1
5338    /// Permissions Required:
5339    ///   - View Packages
5340    ///
5341    pub async fn packages_get_onhold_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5342        let mut path = format!("/packages/v1/onhold");
5343        let mut query_params = Vec::new();
5344        if let Some(p) = last_modified_end {
5345            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5346        }
5347        if let Some(p) = last_modified_start {
5348            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5349        }
5350        if let Some(p) = license_number {
5351            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5352        }
5353        if !query_params.is_empty() {
5354            path.push_str("?");
5355            path.push_str(&query_params.join("&"));
5356        }
5357        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5358    }
5359
5360    /// GET GetOnhold V2
5361    /// Retrieves a list of packages on hold for a specified Facility.
5362    /// 
5363    ///   Permissions Required:
5364    ///   - View Packages
5365    ///
5366    pub async fn packages_get_onhold_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5367        let mut path = format!("/packages/v2/onhold");
5368        let mut query_params = Vec::new();
5369        if let Some(p) = last_modified_end {
5370            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5371        }
5372        if let Some(p) = last_modified_start {
5373            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5374        }
5375        if let Some(p) = license_number {
5376            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5377        }
5378        if let Some(p) = page_number {
5379            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5380        }
5381        if let Some(p) = page_size {
5382            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5383        }
5384        if !query_params.is_empty() {
5385            path.push_str("?");
5386            path.push_str(&query_params.join("&"));
5387        }
5388        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5389    }
5390
5391    /// GET GetSourceHarvest V2
5392    /// Retrieves the source harvests for a Package by its Id.
5393    /// 
5394    ///   Permissions Required:
5395    ///   - View Package Source Harvests
5396    ///
5397    pub async fn packages_get_source_harvest_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5398        let mut path = format!("/packages/v2/{}/source/harvests", urlencoding::encode(id).as_ref());
5399        let mut query_params = Vec::new();
5400        if let Some(p) = license_number {
5401            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5402        }
5403        if !query_params.is_empty() {
5404            path.push_str("?");
5405            path.push_str(&query_params.join("&"));
5406        }
5407        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5408    }
5409
5410    /// GET GetTransferred V2
5411    /// Retrieves a list of transferred packages for a specific Facility.
5412    /// 
5413    ///   Permissions Required:
5414    ///   - View Packages
5415    ///
5416    pub async fn packages_get_transferred_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5417        let mut path = format!("/packages/v2/transferred");
5418        let mut query_params = Vec::new();
5419        if let Some(p) = last_modified_end {
5420            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5421        }
5422        if let Some(p) = last_modified_start {
5423            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5424        }
5425        if let Some(p) = license_number {
5426            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5427        }
5428        if let Some(p) = page_number {
5429            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5430        }
5431        if let Some(p) = page_size {
5432            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5433        }
5434        if !query_params.is_empty() {
5435            path.push_str("?");
5436            path.push_str(&query_params.join("&"));
5437        }
5438        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5439    }
5440
5441    /// GET GetTypes V1
5442    /// Permissions Required:
5443    ///   - None
5444    ///
5445    pub async fn packages_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5446        let mut path = format!("/packages/v1/types");
5447        let mut query_params = Vec::new();
5448        if let Some(p) = no {
5449            query_params.push(format!("No={}", urlencoding::encode(&p)));
5450        }
5451        if !query_params.is_empty() {
5452            path.push_str("?");
5453            path.push_str(&query_params.join("&"));
5454        }
5455        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5456    }
5457
5458    /// GET GetTypes V2
5459    /// Retrieves a list of available Package types.
5460    /// 
5461    ///   Permissions Required:
5462    ///   - None
5463    ///
5464    pub async fn packages_get_types_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5465        let mut path = format!("/packages/v2/types");
5466        let mut query_params = Vec::new();
5467        if let Some(p) = no {
5468            query_params.push(format!("No={}", urlencoding::encode(&p)));
5469        }
5470        if !query_params.is_empty() {
5471            path.push_str("?");
5472            path.push_str(&query_params.join("&"));
5473        }
5474        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5475    }
5476
5477    /// PUT UpdateAdjust V2
5478    /// Set the final quantity for a Package.
5479    /// 
5480    ///   Permissions Required:
5481    ///   - View Packages
5482    ///   - Manage Packages Inventory
5483    ///
5484    pub async fn packages_update_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5485        let mut path = format!("/packages/v2/adjust");
5486        let mut query_params = Vec::new();
5487        if let Some(p) = license_number {
5488            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5489        }
5490        if !query_params.is_empty() {
5491            path.push_str("?");
5492            path.push_str(&query_params.join("&"));
5493        }
5494        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5495    }
5496
5497    /// PUT UpdateChangeNote V1
5498    /// Permissions Required:
5499    ///   - View Packages
5500    ///   - Manage Packages Inventory
5501    ///   - Manage Package Notes
5502    ///
5503    pub async fn packages_update_change_note_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5504        let mut path = format!("/packages/v1/change/note");
5505        let mut query_params = Vec::new();
5506        if let Some(p) = license_number {
5507            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5508        }
5509        if !query_params.is_empty() {
5510            path.push_str("?");
5511            path.push_str(&query_params.join("&"));
5512        }
5513        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5514    }
5515
5516    /// PUT UpdateDecontaminate V2
5517    /// Updates the Product decontaminate information for a list of packages at a specific Facility.
5518    /// 
5519    ///   Permissions Required:
5520    ///   - View Packages
5521    ///   - Manage Packages Inventory
5522    ///
5523    pub async fn packages_update_decontaminate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5524        let mut path = format!("/packages/v2/decontaminate");
5525        let mut query_params = Vec::new();
5526        if let Some(p) = license_number {
5527            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5528        }
5529        if !query_params.is_empty() {
5530            path.push_str("?");
5531            path.push_str(&query_params.join("&"));
5532        }
5533        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5534    }
5535
5536    /// PUT UpdateDonationFlag V2
5537    /// Flags one or more packages for donation at the specified Facility.
5538    /// 
5539    ///   Permissions Required:
5540    ///   - View Packages
5541    ///   - Manage Packages Inventory
5542    ///
5543    pub async fn packages_update_donation_flag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5544        let mut path = format!("/packages/v2/donation/flag");
5545        let mut query_params = Vec::new();
5546        if let Some(p) = license_number {
5547            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5548        }
5549        if !query_params.is_empty() {
5550            path.push_str("?");
5551            path.push_str(&query_params.join("&"));
5552        }
5553        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5554    }
5555
5556    /// PUT UpdateDonationUnflag V2
5557    /// Removes the donation flag from one or more packages at the specified Facility.
5558    /// 
5559    ///   Permissions Required:
5560    ///   - View Packages
5561    ///   - Manage Packages Inventory
5562    ///
5563    pub async fn packages_update_donation_unflag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5564        let mut path = format!("/packages/v2/donation/unflag");
5565        let mut query_params = Vec::new();
5566        if let Some(p) = license_number {
5567            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5568        }
5569        if !query_params.is_empty() {
5570            path.push_str("?");
5571            path.push_str(&query_params.join("&"));
5572        }
5573        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5574    }
5575
5576    /// PUT UpdateExternalid V2
5577    /// Updates the external identifiers for one or more packages at the specified Facility.
5578    /// 
5579    ///   Permissions Required:
5580    ///   - View Packages
5581    ///   - Manage Package Inventory
5582    ///   - External Id Enabled
5583    ///
5584    pub async fn packages_update_externalid_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5585        let mut path = format!("/packages/v2/externalid");
5586        let mut query_params = Vec::new();
5587        if let Some(p) = license_number {
5588            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5589        }
5590        if !query_params.is_empty() {
5591            path.push_str("?");
5592            path.push_str(&query_params.join("&"));
5593        }
5594        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5595    }
5596
5597    /// PUT UpdateFinish V2
5598    /// Updates a list of packages as finished for a specific Facility.
5599    /// 
5600    ///   Permissions Required:
5601    ///   - View Packages
5602    ///   - Manage Packages Inventory
5603    ///
5604    pub async fn packages_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5605        let mut path = format!("/packages/v2/finish");
5606        let mut query_params = Vec::new();
5607        if let Some(p) = license_number {
5608            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5609        }
5610        if !query_params.is_empty() {
5611            path.push_str("?");
5612            path.push_str(&query_params.join("&"));
5613        }
5614        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5615    }
5616
5617    /// PUT UpdateItem V2
5618    /// Updates the associated Item for one or more packages at the specified Facility.
5619    /// 
5620    ///   Permissions Required:
5621    ///   - View Packages
5622    ///   - Create/Submit/Discontinue Packages
5623    ///
5624    pub async fn packages_update_item_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5625        let mut path = format!("/packages/v2/item");
5626        let mut query_params = Vec::new();
5627        if let Some(p) = license_number {
5628            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5629        }
5630        if !query_params.is_empty() {
5631            path.push_str("?");
5632            path.push_str(&query_params.join("&"));
5633        }
5634        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5635    }
5636
5637    /// PUT UpdateLabTestRequired V2
5638    /// Updates the list of required lab test batches for one or more packages at the specified Facility.
5639    /// 
5640    ///   Permissions Required:
5641    ///   - View Packages
5642    ///   - Create/Submit/Discontinue Packages
5643    ///
5644    pub async fn packages_update_lab_test_required_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5645        let mut path = format!("/packages/v2/labtests/required");
5646        let mut query_params = Vec::new();
5647        if let Some(p) = license_number {
5648            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5649        }
5650        if !query_params.is_empty() {
5651            path.push_str("?");
5652            path.push_str(&query_params.join("&"));
5653        }
5654        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5655    }
5656
5657    /// PUT UpdateLocation V2
5658    /// Updates the Location and Sublocation for one or more packages at the specified Facility.
5659    /// 
5660    ///   Permissions Required:
5661    ///   - View Packages
5662    ///   - Create/Submit/Discontinue Packages
5663    ///
5664    pub async fn packages_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5665        let mut path = format!("/packages/v2/location");
5666        let mut query_params = Vec::new();
5667        if let Some(p) = license_number {
5668            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5669        }
5670        if !query_params.is_empty() {
5671            path.push_str("?");
5672            path.push_str(&query_params.join("&"));
5673        }
5674        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5675    }
5676
5677    /// PUT UpdateNote V2
5678    /// Updates notes associated with one or more packages for the specified Facility.
5679    /// 
5680    ///   Permissions Required:
5681    ///   - View Packages
5682    ///   - Manage Packages Inventory
5683    ///   - Manage Package Notes
5684    ///
5685    pub async fn packages_update_note_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5686        let mut path = format!("/packages/v2/note");
5687        let mut query_params = Vec::new();
5688        if let Some(p) = license_number {
5689            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5690        }
5691        if !query_params.is_empty() {
5692            path.push_str("?");
5693            path.push_str(&query_params.join("&"));
5694        }
5695        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5696    }
5697
5698    /// PUT UpdateRemediate V2
5699    /// Updates a list of Product remediations for packages at a specific Facility.
5700    /// 
5701    ///   Permissions Required:
5702    ///   - View Packages
5703    ///   - Manage Packages Inventory
5704    ///
5705    pub async fn packages_update_remediate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5706        let mut path = format!("/packages/v2/remediate");
5707        let mut query_params = Vec::new();
5708        if let Some(p) = license_number {
5709            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5710        }
5711        if !query_params.is_empty() {
5712            path.push_str("?");
5713            path.push_str(&query_params.join("&"));
5714        }
5715        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5716    }
5717
5718    /// PUT UpdateTradesampleFlag V2
5719    /// Flags or unflags one or more packages at the specified Facility as trade samples.
5720    /// 
5721    ///   Permissions Required:
5722    ///   - View Packages
5723    ///   - Manage Packages Inventory
5724    ///
5725    pub async fn packages_update_tradesample_flag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5726        let mut path = format!("/packages/v2/tradesample/flag");
5727        let mut query_params = Vec::new();
5728        if let Some(p) = license_number {
5729            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5730        }
5731        if !query_params.is_empty() {
5732            path.push_str("?");
5733            path.push_str(&query_params.join("&"));
5734        }
5735        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5736    }
5737
5738    /// PUT UpdateTradesampleUnflag V2
5739    /// Removes the trade sample flag from one or more packages at the specified Facility.
5740    /// 
5741    ///   Permissions Required:
5742    ///   - View Packages
5743    ///   - Manage Packages Inventory
5744    ///
5745    pub async fn packages_update_tradesample_unflag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5746        let mut path = format!("/packages/v2/tradesample/unflag");
5747        let mut query_params = Vec::new();
5748        if let Some(p) = license_number {
5749            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5750        }
5751        if !query_params.is_empty() {
5752            path.push_str("?");
5753            path.push_str(&query_params.join("&"));
5754        }
5755        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5756    }
5757
5758    /// PUT UpdateUnfinish V2
5759    /// Updates a list of packages as unfinished for a specific Facility.
5760    /// 
5761    ///   Permissions Required:
5762    ///   - View Packages
5763    ///   - Manage Packages Inventory
5764    ///
5765    pub async fn packages_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5766        let mut path = format!("/packages/v2/unfinish");
5767        let mut query_params = Vec::new();
5768        if let Some(p) = license_number {
5769            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5770        }
5771        if !query_params.is_empty() {
5772            path.push_str("?");
5773            path.push_str(&query_params.join("&"));
5774        }
5775        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5776    }
5777
5778    /// PUT UpdateUsebydate V2
5779    /// Updates the use-by date for one or more packages at the specified Facility.
5780    /// 
5781    ///   Permissions Required:
5782    ///   - View Packages
5783    ///   - Create/Submit/Discontinue Packages
5784    ///
5785    pub async fn packages_update_usebydate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5786        let mut path = format!("/packages/v2/usebydate");
5787        let mut query_params = Vec::new();
5788        if let Some(p) = license_number {
5789            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5790        }
5791        if !query_params.is_empty() {
5792            path.push_str("?");
5793            path.push_str(&query_params.join("&"));
5794        }
5795        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5796    }
5797
5798    /// POST Create V1
5799    /// Permissions Required:
5800    ///   - ManagePatientsCheckIns
5801    ///
5802    pub async fn patient_check_ins_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5803        let mut path = format!("/patient-checkins/v1");
5804        let mut query_params = Vec::new();
5805        if let Some(p) = license_number {
5806            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5807        }
5808        if !query_params.is_empty() {
5809            path.push_str("?");
5810            path.push_str(&query_params.join("&"));
5811        }
5812        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5813    }
5814
5815    /// POST Create V2
5816    /// Records patient check-ins for a specified Facility.
5817    /// 
5818    ///   Permissions Required:
5819    ///   - ManagePatientsCheckIns
5820    ///
5821    pub async fn patient_check_ins_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5822        let mut path = format!("/patient-checkins/v2");
5823        let mut query_params = Vec::new();
5824        if let Some(p) = license_number {
5825            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5826        }
5827        if !query_params.is_empty() {
5828            path.push_str("?");
5829            path.push_str(&query_params.join("&"));
5830        }
5831        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5832    }
5833
5834    /// DELETE Delete V1
5835    /// Permissions Required:
5836    ///   - ManagePatientsCheckIns
5837    ///
5838    pub async fn patient_check_ins_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5839        let mut path = format!("/patient-checkins/v1/{}", urlencoding::encode(id).as_ref());
5840        let mut query_params = Vec::new();
5841        if let Some(p) = license_number {
5842            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5843        }
5844        if !query_params.is_empty() {
5845            path.push_str("?");
5846            path.push_str(&query_params.join("&"));
5847        }
5848        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5849    }
5850
5851    /// DELETE Delete V2
5852    /// Archives a Patient Check-In, identified by its Id, for a specified Facility.
5853    /// 
5854    ///   Permissions Required:
5855    ///   - ManagePatientsCheckIns
5856    ///
5857    pub async fn patient_check_ins_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5858        let mut path = format!("/patient-checkins/v2/{}", urlencoding::encode(id).as_ref());
5859        let mut query_params = Vec::new();
5860        if let Some(p) = license_number {
5861            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5862        }
5863        if !query_params.is_empty() {
5864            path.push_str("?");
5865            path.push_str(&query_params.join("&"));
5866        }
5867        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5868    }
5869
5870    /// GET GetAll V1
5871    /// Permissions Required:
5872    ///   - ManagePatientsCheckIns
5873    ///
5874    pub async fn patient_check_ins_get_all_v1(&self, checkin_date_end: Option<String>, checkin_date_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5875        let mut path = format!("/patient-checkins/v1");
5876        let mut query_params = Vec::new();
5877        if let Some(p) = checkin_date_end {
5878            query_params.push(format!("checkinDateEnd={}", urlencoding::encode(&p)));
5879        }
5880        if let Some(p) = checkin_date_start {
5881            query_params.push(format!("checkinDateStart={}", urlencoding::encode(&p)));
5882        }
5883        if let Some(p) = license_number {
5884            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5885        }
5886        if !query_params.is_empty() {
5887            path.push_str("?");
5888            path.push_str(&query_params.join("&"));
5889        }
5890        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5891    }
5892
5893    /// GET GetAll V2
5894    /// Retrieves a list of patient check-ins for a specified Facility.
5895    /// 
5896    ///   Permissions Required:
5897    ///   - ManagePatientsCheckIns
5898    ///
5899    pub async fn patient_check_ins_get_all_v2(&self, checkin_date_end: Option<String>, checkin_date_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5900        let mut path = format!("/patient-checkins/v2");
5901        let mut query_params = Vec::new();
5902        if let Some(p) = checkin_date_end {
5903            query_params.push(format!("checkinDateEnd={}", urlencoding::encode(&p)));
5904        }
5905        if let Some(p) = checkin_date_start {
5906            query_params.push(format!("checkinDateStart={}", urlencoding::encode(&p)));
5907        }
5908        if let Some(p) = license_number {
5909            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5910        }
5911        if !query_params.is_empty() {
5912            path.push_str("?");
5913            path.push_str(&query_params.join("&"));
5914        }
5915        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5916    }
5917
5918    /// GET GetLocations V1
5919    /// Permissions Required:
5920    ///   - None
5921    ///
5922    pub async fn patient_check_ins_get_locations_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5923        let mut path = format!("/patient-checkins/v1/locations");
5924        let mut query_params = Vec::new();
5925        if let Some(p) = no {
5926            query_params.push(format!("No={}", urlencoding::encode(&p)));
5927        }
5928        if !query_params.is_empty() {
5929            path.push_str("?");
5930            path.push_str(&query_params.join("&"));
5931        }
5932        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5933    }
5934
5935    /// GET GetLocations V2
5936    /// Retrieves a list of Patient Check-In locations.
5937    /// 
5938    ///   Permissions Required:
5939    ///   - None
5940    ///
5941    pub async fn patient_check_ins_get_locations_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5942        let mut path = format!("/patient-checkins/v2/locations");
5943        let mut query_params = Vec::new();
5944        if let Some(p) = no {
5945            query_params.push(format!("No={}", urlencoding::encode(&p)));
5946        }
5947        if !query_params.is_empty() {
5948            path.push_str("?");
5949            path.push_str(&query_params.join("&"));
5950        }
5951        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5952    }
5953
5954    /// PUT Update V1
5955    /// Permissions Required:
5956    ///   - ManagePatientsCheckIns
5957    ///
5958    pub async fn patient_check_ins_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5959        let mut path = format!("/patient-checkins/v1");
5960        let mut query_params = Vec::new();
5961        if let Some(p) = license_number {
5962            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5963        }
5964        if !query_params.is_empty() {
5965            path.push_str("?");
5966            path.push_str(&query_params.join("&"));
5967        }
5968        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5969    }
5970
5971    /// PUT Update V2
5972    /// Updates patient check-ins for a specified Facility.
5973    /// 
5974    ///   Permissions Required:
5975    ///   - ManagePatientsCheckIns
5976    ///
5977    pub async fn patient_check_ins_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5978        let mut path = format!("/patient-checkins/v2");
5979        let mut query_params = Vec::new();
5980        if let Some(p) = license_number {
5981            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5982        }
5983        if !query_params.is_empty() {
5984            path.push_str("?");
5985            path.push_str(&query_params.join("&"));
5986        }
5987        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5988    }
5989
5990    /// POST Create V2
5991    /// Adds new patients to a specified Facility.
5992    /// 
5993    ///   Permissions Required:
5994    ///   - Manage Patients
5995    ///
5996    pub async fn patients_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5997        let mut path = format!("/patients/v2");
5998        let mut query_params = Vec::new();
5999        if let Some(p) = license_number {
6000            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6001        }
6002        if !query_params.is_empty() {
6003            path.push_str("?");
6004            path.push_str(&query_params.join("&"));
6005        }
6006        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6007    }
6008
6009    /// POST CreateAdd V1
6010    /// Permissions Required:
6011    ///   - Manage Patients
6012    ///
6013    pub async fn patients_create_add_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6014        let mut path = format!("/patients/v1/add");
6015        let mut query_params = Vec::new();
6016        if let Some(p) = license_number {
6017            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6018        }
6019        if !query_params.is_empty() {
6020            path.push_str("?");
6021            path.push_str(&query_params.join("&"));
6022        }
6023        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6024    }
6025
6026    /// POST CreateUpdate V1
6027    /// Permissions Required:
6028    ///   - Manage Patients
6029    ///
6030    pub async fn patients_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6031        let mut path = format!("/patients/v1/update");
6032        let mut query_params = Vec::new();
6033        if let Some(p) = license_number {
6034            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6035        }
6036        if !query_params.is_empty() {
6037            path.push_str("?");
6038            path.push_str(&query_params.join("&"));
6039        }
6040        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6041    }
6042
6043    /// DELETE Delete V1
6044    /// Permissions Required:
6045    ///   - Manage Patients
6046    ///
6047    pub async fn patients_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6048        let mut path = format!("/patients/v1/{}", urlencoding::encode(id).as_ref());
6049        let mut query_params = Vec::new();
6050        if let Some(p) = license_number {
6051            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6052        }
6053        if !query_params.is_empty() {
6054            path.push_str("?");
6055            path.push_str(&query_params.join("&"));
6056        }
6057        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6058    }
6059
6060    /// DELETE Delete V2
6061    /// Removes a Patient, identified by an Id, from a specified Facility.
6062    /// 
6063    ///   Permissions Required:
6064    ///   - Manage Patients
6065    ///
6066    pub async fn patients_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6067        let mut path = format!("/patients/v2/{}", urlencoding::encode(id).as_ref());
6068        let mut query_params = Vec::new();
6069        if let Some(p) = license_number {
6070            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6071        }
6072        if !query_params.is_empty() {
6073            path.push_str("?");
6074            path.push_str(&query_params.join("&"));
6075        }
6076        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6077    }
6078
6079    /// GET Get V1
6080    /// Permissions Required:
6081    ///   - Manage Patients
6082    ///
6083    pub async fn patients_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6084        let mut path = format!("/patients/v1/{}", urlencoding::encode(id).as_ref());
6085        let mut query_params = Vec::new();
6086        if let Some(p) = license_number {
6087            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6088        }
6089        if !query_params.is_empty() {
6090            path.push_str("?");
6091            path.push_str(&query_params.join("&"));
6092        }
6093        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6094    }
6095
6096    /// GET Get V2
6097    /// Retrieves a Patient by Id.
6098    /// 
6099    ///   Permissions Required:
6100    ///   - Manage Patients
6101    ///
6102    pub async fn patients_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6103        let mut path = format!("/patients/v2/{}", urlencoding::encode(id).as_ref());
6104        let mut query_params = Vec::new();
6105        if let Some(p) = license_number {
6106            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6107        }
6108        if !query_params.is_empty() {
6109            path.push_str("?");
6110            path.push_str(&query_params.join("&"));
6111        }
6112        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6113    }
6114
6115    /// GET GetActive V1
6116    /// Permissions Required:
6117    ///   - Manage Patients
6118    ///
6119    pub async fn patients_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6120        let mut path = format!("/patients/v1/active");
6121        let mut query_params = Vec::new();
6122        if let Some(p) = license_number {
6123            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6124        }
6125        if !query_params.is_empty() {
6126            path.push_str("?");
6127            path.push_str(&query_params.join("&"));
6128        }
6129        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6130    }
6131
6132    /// GET GetActive V2
6133    /// Retrieves a list of active patients for a specified Facility.
6134    /// 
6135    ///   Permissions Required:
6136    ///   - Manage Patients
6137    ///
6138    pub async fn patients_get_active_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6139        let mut path = format!("/patients/v2/active");
6140        let mut query_params = Vec::new();
6141        if let Some(p) = license_number {
6142            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6143        }
6144        if let Some(p) = page_number {
6145            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6146        }
6147        if let Some(p) = page_size {
6148            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6149        }
6150        if !query_params.is_empty() {
6151            path.push_str("?");
6152            path.push_str(&query_params.join("&"));
6153        }
6154        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6155    }
6156
6157    /// PUT Update V2
6158    /// Updates Patient information for a specified Facility.
6159    /// 
6160    ///   Permissions Required:
6161    ///   - Manage Patients
6162    ///
6163    pub async fn patients_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6164        let mut path = format!("/patients/v2");
6165        let mut query_params = Vec::new();
6166        if let Some(p) = license_number {
6167            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6168        }
6169        if !query_params.is_empty() {
6170            path.push_str("?");
6171            path.push_str(&query_params.join("&"));
6172        }
6173        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6174    }
6175
6176    /// GET GetStatusesByPatientLicenseNumber V1
6177    /// Data returned by this endpoint is cached for up to one minute.
6178    /// 
6179    ///   Permissions Required:
6180    ///   - Lookup Patients
6181    ///
6182    pub async fn patients_status_get_statuses_by_patient_license_number_v1(&self, patient_license_number: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6183        let mut path = format!("/patients/v1/statuses/{}", urlencoding::encode(patient_license_number).as_ref());
6184        let mut query_params = Vec::new();
6185        if let Some(p) = license_number {
6186            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6187        }
6188        if !query_params.is_empty() {
6189            path.push_str("?");
6190            path.push_str(&query_params.join("&"));
6191        }
6192        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6193    }
6194
6195    /// GET GetStatusesByPatientLicenseNumber V2
6196    /// Retrieves a list of statuses for a Patient License Number for a specified Facility. Data returned by this endpoint is cached for up to one minute.
6197    /// 
6198    ///   Permissions Required:
6199    ///   - Lookup Patients
6200    ///
6201    pub async fn patients_status_get_statuses_by_patient_license_number_v2(&self, patient_license_number: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6202        let mut path = format!("/patients/v2/statuses/{}", urlencoding::encode(patient_license_number).as_ref());
6203        let mut query_params = Vec::new();
6204        if let Some(p) = license_number {
6205            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6206        }
6207        if !query_params.is_empty() {
6208            path.push_str("?");
6209            path.push_str(&query_params.join("&"));
6210        }
6211        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6212    }
6213
6214    /// POST Create V2
6215    /// Creates new additive templates for a specified Facility.
6216    /// 
6217    ///   Permissions Required:
6218    ///   - Manage Additives
6219    ///
6220    pub async fn additives_templates_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6221        let mut path = format!("/additivestemplates/v2");
6222        let mut query_params = Vec::new();
6223        if let Some(p) = license_number {
6224            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6225        }
6226        if !query_params.is_empty() {
6227            path.push_str("?");
6228            path.push_str(&query_params.join("&"));
6229        }
6230        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6231    }
6232
6233    /// GET Get V2
6234    /// Retrieves an Additive Template by its Id.
6235    /// 
6236    ///   Permissions Required:
6237    ///   - Manage Additives
6238    ///
6239    pub async fn additives_templates_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6240        let mut path = format!("/additivestemplates/v2/{}", urlencoding::encode(id).as_ref());
6241        let mut query_params = Vec::new();
6242        if let Some(p) = license_number {
6243            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6244        }
6245        if !query_params.is_empty() {
6246            path.push_str("?");
6247            path.push_str(&query_params.join("&"));
6248        }
6249        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6250    }
6251
6252    /// GET GetActive V2
6253    /// Retrieves a list of active additive templates for a specified Facility.
6254    /// 
6255    ///   Permissions Required:
6256    ///   - Manage Additives
6257    ///
6258    pub async fn additives_templates_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6259        let mut path = format!("/additivestemplates/v2/active");
6260        let mut query_params = Vec::new();
6261        if let Some(p) = last_modified_end {
6262            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6263        }
6264        if let Some(p) = last_modified_start {
6265            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6266        }
6267        if let Some(p) = license_number {
6268            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6269        }
6270        if let Some(p) = page_number {
6271            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6272        }
6273        if let Some(p) = page_size {
6274            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6275        }
6276        if !query_params.is_empty() {
6277            path.push_str("?");
6278            path.push_str(&query_params.join("&"));
6279        }
6280        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6281    }
6282
6283    /// GET GetInactive V2
6284    /// Retrieves a list of inactive additive templates for a specified Facility.
6285    /// 
6286    ///   Permissions Required:
6287    ///   - Manage Additives
6288    ///
6289    pub async fn additives_templates_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6290        let mut path = format!("/additivestemplates/v2/inactive");
6291        let mut query_params = Vec::new();
6292        if let Some(p) = last_modified_end {
6293            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6294        }
6295        if let Some(p) = last_modified_start {
6296            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6297        }
6298        if let Some(p) = license_number {
6299            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6300        }
6301        if let Some(p) = page_number {
6302            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6303        }
6304        if let Some(p) = page_size {
6305            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6306        }
6307        if !query_params.is_empty() {
6308            path.push_str("?");
6309            path.push_str(&query_params.join("&"));
6310        }
6311        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6312    }
6313
6314    /// PUT Update V2
6315    /// Updates existing additive templates for a specified Facility.
6316    /// 
6317    ///   Permissions Required:
6318    ///   - Manage Additives
6319    ///
6320    pub async fn additives_templates_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6321        let mut path = format!("/additivestemplates/v2");
6322        let mut query_params = Vec::new();
6323        if let Some(p) = license_number {
6324            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6325        }
6326        if !query_params.is_empty() {
6327            path.push_str("?");
6328            path.push_str(&query_params.join("&"));
6329        }
6330        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6331    }
6332
6333    /// POST CreateRecord V1
6334    /// Permissions Required:
6335    ///   - View Packages
6336    ///   - Manage Packages Inventory
6337    ///
6338    pub async fn lab_tests_create_record_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6339        let mut path = format!("/labtests/v1/record");
6340        let mut query_params = Vec::new();
6341        if let Some(p) = license_number {
6342            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6343        }
6344        if !query_params.is_empty() {
6345            path.push_str("?");
6346            path.push_str(&query_params.join("&"));
6347        }
6348        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6349    }
6350
6351    /// POST CreateRecord V2
6352    /// Submits Lab Test results for one or more packages. NOTE: This endpoint allows only PDF files, and uploaded files can be no more than 5 MB in size. The Label element in the request is a Package Label.
6353    /// 
6354    ///   Permissions Required:
6355    ///   - View Packages
6356    ///   - Manage Packages Inventory
6357    ///
6358    pub async fn lab_tests_create_record_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6359        let mut path = format!("/labtests/v2/record");
6360        let mut query_params = Vec::new();
6361        if let Some(p) = license_number {
6362            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6363        }
6364        if !query_params.is_empty() {
6365            path.push_str("?");
6366            path.push_str(&query_params.join("&"));
6367        }
6368        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6369    }
6370
6371    /// GET GetBatches V2
6372    /// Retrieves a list of Lab Test batches.
6373    /// 
6374    ///   Permissions Required:
6375    ///   - None
6376    ///
6377    pub async fn lab_tests_get_batches_v2(&self, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6378        let mut path = format!("/labtests/v2/batches");
6379        let mut query_params = Vec::new();
6380        if let Some(p) = page_number {
6381            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6382        }
6383        if let Some(p) = page_size {
6384            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6385        }
6386        if !query_params.is_empty() {
6387            path.push_str("?");
6388            path.push_str(&query_params.join("&"));
6389        }
6390        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6391    }
6392
6393    /// GET GetLabtestdocument V1
6394    /// Permissions Required:
6395    ///   - View Packages
6396    ///   - Manage Packages Inventory
6397    ///
6398    pub async fn lab_tests_get_labtestdocument_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6399        let mut path = format!("/labtests/v1/labtestdocument/{}", urlencoding::encode(id).as_ref());
6400        let mut query_params = Vec::new();
6401        if let Some(p) = license_number {
6402            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6403        }
6404        if !query_params.is_empty() {
6405            path.push_str("?");
6406            path.push_str(&query_params.join("&"));
6407        }
6408        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6409    }
6410
6411    /// GET GetLabtestdocument V2
6412    /// Retrieves a specific Lab Test result document by its Id for a given Facility.
6413    /// 
6414    ///   Permissions Required:
6415    ///   - View Packages
6416    ///   - Manage Packages Inventory
6417    ///
6418    pub async fn lab_tests_get_labtestdocument_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6419        let mut path = format!("/labtests/v2/labtestdocument/{}", urlencoding::encode(id).as_ref());
6420        let mut query_params = Vec::new();
6421        if let Some(p) = license_number {
6422            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6423        }
6424        if !query_params.is_empty() {
6425            path.push_str("?");
6426            path.push_str(&query_params.join("&"));
6427        }
6428        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6429    }
6430
6431    /// GET GetResults V1
6432    /// Permissions Required:
6433    ///   - View Packages
6434    ///
6435    pub async fn lab_tests_get_results_v1(&self, license_number: Option<String>, package_id: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6436        let mut path = format!("/labtests/v1/results");
6437        let mut query_params = Vec::new();
6438        if let Some(p) = license_number {
6439            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6440        }
6441        if let Some(p) = package_id {
6442            query_params.push(format!("packageId={}", urlencoding::encode(&p)));
6443        }
6444        if !query_params.is_empty() {
6445            path.push_str("?");
6446            path.push_str(&query_params.join("&"));
6447        }
6448        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6449    }
6450
6451    /// GET GetResults V2
6452    /// Retrieves Lab Test results for a specified Package.
6453    /// 
6454    ///   Permissions Required:
6455    ///   - View Packages
6456    ///   - Manage Packages Inventory
6457    ///
6458    pub async fn lab_tests_get_results_v2(&self, license_number: Option<String>, package_id: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6459        let mut path = format!("/labtests/v2/results");
6460        let mut query_params = Vec::new();
6461        if let Some(p) = license_number {
6462            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6463        }
6464        if let Some(p) = package_id {
6465            query_params.push(format!("packageId={}", urlencoding::encode(&p)));
6466        }
6467        if let Some(p) = page_number {
6468            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6469        }
6470        if let Some(p) = page_size {
6471            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6472        }
6473        if !query_params.is_empty() {
6474            path.push_str("?");
6475            path.push_str(&query_params.join("&"));
6476        }
6477        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6478    }
6479
6480    /// GET GetStates V1
6481    /// Permissions Required:
6482    ///   - None
6483    ///
6484    pub async fn lab_tests_get_states_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6485        let mut path = format!("/labtests/v1/states");
6486        let mut query_params = Vec::new();
6487        if let Some(p) = no {
6488            query_params.push(format!("No={}", urlencoding::encode(&p)));
6489        }
6490        if !query_params.is_empty() {
6491            path.push_str("?");
6492            path.push_str(&query_params.join("&"));
6493        }
6494        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6495    }
6496
6497    /// GET GetStates V2
6498    /// Returns a list of all lab testing states.
6499    /// 
6500    ///   Permissions Required:
6501    ///   - None
6502    ///
6503    pub async fn lab_tests_get_states_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6504        let mut path = format!("/labtests/v2/states");
6505        let mut query_params = Vec::new();
6506        if let Some(p) = no {
6507            query_params.push(format!("No={}", urlencoding::encode(&p)));
6508        }
6509        if !query_params.is_empty() {
6510            path.push_str("?");
6511            path.push_str(&query_params.join("&"));
6512        }
6513        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6514    }
6515
6516    /// GET GetTypes V1
6517    /// Permissions Required:
6518    ///   - None
6519    ///
6520    pub async fn lab_tests_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6521        let mut path = format!("/labtests/v1/types");
6522        let mut query_params = Vec::new();
6523        if let Some(p) = no {
6524            query_params.push(format!("No={}", urlencoding::encode(&p)));
6525        }
6526        if !query_params.is_empty() {
6527            path.push_str("?");
6528            path.push_str(&query_params.join("&"));
6529        }
6530        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6531    }
6532
6533    /// GET GetTypes V2
6534    /// Returns a list of Lab Test types.
6535    /// 
6536    ///   Permissions Required:
6537    ///   - None
6538    ///
6539    pub async fn lab_tests_get_types_v2(&self, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6540        let mut path = format!("/labtests/v2/types");
6541        let mut query_params = Vec::new();
6542        if let Some(p) = page_number {
6543            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6544        }
6545        if let Some(p) = page_size {
6546            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6547        }
6548        if !query_params.is_empty() {
6549            path.push_str("?");
6550            path.push_str(&query_params.join("&"));
6551        }
6552        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6553    }
6554
6555    /// PUT UpdateLabtestdocument V1
6556    /// Permissions Required:
6557    ///   - View Packages
6558    ///   - Manage Packages Inventory
6559    ///
6560    pub async fn lab_tests_update_labtestdocument_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6561        let mut path = format!("/labtests/v1/labtestdocument");
6562        let mut query_params = Vec::new();
6563        if let Some(p) = license_number {
6564            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6565        }
6566        if !query_params.is_empty() {
6567            path.push_str("?");
6568            path.push_str(&query_params.join("&"));
6569        }
6570        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6571    }
6572
6573    /// PUT UpdateLabtestdocument V2
6574    /// Updates one or more documents for previously submitted lab tests.
6575    /// 
6576    ///   Permissions Required:
6577    ///   - View Packages
6578    ///   - Manage Packages Inventory
6579    ///
6580    pub async fn lab_tests_update_labtestdocument_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6581        let mut path = format!("/labtests/v2/labtestdocument");
6582        let mut query_params = Vec::new();
6583        if let Some(p) = license_number {
6584            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6585        }
6586        if !query_params.is_empty() {
6587            path.push_str("?");
6588            path.push_str(&query_params.join("&"));
6589        }
6590        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6591    }
6592
6593    /// PUT UpdateResultRelease V1
6594    /// Permissions Required:
6595    ///   - View Packages
6596    ///   - Manage Packages Inventory
6597    ///
6598    pub async fn lab_tests_update_result_release_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6599        let mut path = format!("/labtests/v1/results/release");
6600        let mut query_params = Vec::new();
6601        if let Some(p) = license_number {
6602            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6603        }
6604        if !query_params.is_empty() {
6605            path.push_str("?");
6606            path.push_str(&query_params.join("&"));
6607        }
6608        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6609    }
6610
6611    /// PUT UpdateResultRelease V2
6612    /// Releases Lab Test results for one or more packages.
6613    /// 
6614    ///   Permissions Required:
6615    ///   - View Packages
6616    ///   - Manage Packages Inventory
6617    ///
6618    pub async fn lab_tests_update_result_release_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6619        let mut path = format!("/labtests/v2/results/release");
6620        let mut query_params = Vec::new();
6621        if let Some(p) = license_number {
6622            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6623        }
6624        if !query_params.is_empty() {
6625            path.push_str("?");
6626            path.push_str(&query_params.join("&"));
6627        }
6628        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6629    }
6630
6631    /// POST CreateAdjust V1
6632    /// Permissions Required:
6633    ///   - ManageProcessingJobs
6634    ///
6635    pub async fn processing_jobs_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6636        let mut path = format!("/processing/v1/adjust");
6637        let mut query_params = Vec::new();
6638        if let Some(p) = license_number {
6639            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6640        }
6641        if !query_params.is_empty() {
6642            path.push_str("?");
6643            path.push_str(&query_params.join("&"));
6644        }
6645        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6646    }
6647
6648    /// POST CreateAdjust V2
6649    /// Adjusts the details of existing processing jobs at a Facility, including units of measure and associated packages.
6650    /// 
6651    ///   Permissions Required:
6652    ///   - Manage Processing Job
6653    ///
6654    pub async fn processing_jobs_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6655        let mut path = format!("/processing/v2/adjust");
6656        let mut query_params = Vec::new();
6657        if let Some(p) = license_number {
6658            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6659        }
6660        if !query_params.is_empty() {
6661            path.push_str("?");
6662            path.push_str(&query_params.join("&"));
6663        }
6664        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6665    }
6666
6667    /// POST CreateJobtypes V1
6668    /// Permissions Required:
6669    ///   - Manage Processing Job
6670    ///
6671    pub async fn processing_jobs_create_jobtypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6672        let mut path = format!("/processing/v1/jobtypes");
6673        let mut query_params = Vec::new();
6674        if let Some(p) = license_number {
6675            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6676        }
6677        if !query_params.is_empty() {
6678            path.push_str("?");
6679            path.push_str(&query_params.join("&"));
6680        }
6681        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6682    }
6683
6684    /// POST CreateJobtypes V2
6685    /// Creates new processing job types for a Facility, including name, category, description, steps, and attributes.
6686    /// 
6687    ///   Permissions Required:
6688    ///   - Manage Processing Job
6689    ///
6690    pub async fn processing_jobs_create_jobtypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6691        let mut path = format!("/processing/v2/jobtypes");
6692        let mut query_params = Vec::new();
6693        if let Some(p) = license_number {
6694            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6695        }
6696        if !query_params.is_empty() {
6697            path.push_str("?");
6698            path.push_str(&query_params.join("&"));
6699        }
6700        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6701    }
6702
6703    /// POST CreateStart V1
6704    /// Permissions Required:
6705    ///   - ManageProcessingJobs
6706    ///
6707    pub async fn processing_jobs_create_start_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6708        let mut path = format!("/processing/v1/start");
6709        let mut query_params = Vec::new();
6710        if let Some(p) = license_number {
6711            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6712        }
6713        if !query_params.is_empty() {
6714            path.push_str("?");
6715            path.push_str(&query_params.join("&"));
6716        }
6717        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6718    }
6719
6720    /// POST CreateStart V2
6721    /// Initiates new processing jobs at a Facility, including job details and associated packages.
6722    /// 
6723    ///   Permissions Required:
6724    ///   - Manage Processing Job
6725    ///
6726    pub async fn processing_jobs_create_start_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6727        let mut path = format!("/processing/v2/start");
6728        let mut query_params = Vec::new();
6729        if let Some(p) = license_number {
6730            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6731        }
6732        if !query_params.is_empty() {
6733            path.push_str("?");
6734            path.push_str(&query_params.join("&"));
6735        }
6736        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6737    }
6738
6739    /// POST Createpackages V1
6740    /// Permissions Required:
6741    ///   - ManageProcessingJobs
6742    ///
6743    pub async fn processing_jobs_createpackages_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6744        let mut path = format!("/processing/v1/createpackages");
6745        let mut query_params = Vec::new();
6746        if let Some(p) = license_number {
6747            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6748        }
6749        if !query_params.is_empty() {
6750            path.push_str("?");
6751            path.push_str(&query_params.join("&"));
6752        }
6753        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6754    }
6755
6756    /// POST Createpackages V2
6757    /// Creates packages from processing jobs at a Facility, including optional location and note assignments.
6758    /// 
6759    ///   Permissions Required:
6760    ///   - Manage Processing Job
6761    ///
6762    pub async fn processing_jobs_createpackages_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6763        let mut path = format!("/processing/v2/createpackages");
6764        let mut query_params = Vec::new();
6765        if let Some(p) = license_number {
6766            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6767        }
6768        if !query_params.is_empty() {
6769            path.push_str("?");
6770            path.push_str(&query_params.join("&"));
6771        }
6772        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6773    }
6774
6775    /// DELETE Delete V1
6776    /// Permissions Required:
6777    ///   - Manage Processing Job
6778    ///
6779    pub async fn processing_jobs_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6780        let mut path = format!("/processing/v1/{}", urlencoding::encode(id).as_ref());
6781        let mut query_params = Vec::new();
6782        if let Some(p) = license_number {
6783            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6784        }
6785        if !query_params.is_empty() {
6786            path.push_str("?");
6787            path.push_str(&query_params.join("&"));
6788        }
6789        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6790    }
6791
6792    /// DELETE Delete V2
6793    /// Archives a Processing Job at a Facility by marking it as inactive and removing it from active use.
6794    /// 
6795    ///   Permissions Required:
6796    ///   - Manage Processing Job
6797    ///
6798    pub async fn processing_jobs_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6799        let mut path = format!("/processing/v2/{}", urlencoding::encode(id).as_ref());
6800        let mut query_params = Vec::new();
6801        if let Some(p) = license_number {
6802            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6803        }
6804        if !query_params.is_empty() {
6805            path.push_str("?");
6806            path.push_str(&query_params.join("&"));
6807        }
6808        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6809    }
6810
6811    /// DELETE DeleteJobtypes V1
6812    /// Permissions Required:
6813    ///   - Manage Processing Job
6814    ///
6815    pub async fn processing_jobs_delete_jobtypes_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6816        let mut path = format!("/processing/v1/jobtypes/{}", urlencoding::encode(id).as_ref());
6817        let mut query_params = Vec::new();
6818        if let Some(p) = license_number {
6819            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6820        }
6821        if !query_params.is_empty() {
6822            path.push_str("?");
6823            path.push_str(&query_params.join("&"));
6824        }
6825        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6826    }
6827
6828    /// DELETE DeleteJobtypes V2
6829    /// Archives a Processing Job Type at a Facility, making it inactive for future use.
6830    /// 
6831    ///   Permissions Required:
6832    ///   - Manage Processing Job
6833    ///
6834    pub async fn processing_jobs_delete_jobtypes_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6835        let mut path = format!("/processing/v2/jobtypes/{}", urlencoding::encode(id).as_ref());
6836        let mut query_params = Vec::new();
6837        if let Some(p) = license_number {
6838            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6839        }
6840        if !query_params.is_empty() {
6841            path.push_str("?");
6842            path.push_str(&query_params.join("&"));
6843        }
6844        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6845    }
6846
6847    /// GET Get V1
6848    /// Permissions Required:
6849    ///   - Manage Processing Job
6850    ///
6851    pub async fn processing_jobs_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6852        let mut path = format!("/processing/v1/{}", urlencoding::encode(id).as_ref());
6853        let mut query_params = Vec::new();
6854        if let Some(p) = license_number {
6855            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6856        }
6857        if !query_params.is_empty() {
6858            path.push_str("?");
6859            path.push_str(&query_params.join("&"));
6860        }
6861        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6862    }
6863
6864    /// GET Get V2
6865    /// Retrieves a ProcessingJob by Id.
6866    /// 
6867    ///   Permissions Required:
6868    ///   - Manage Processing Job
6869    ///
6870    pub async fn processing_jobs_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6871        let mut path = format!("/processing/v2/{}", urlencoding::encode(id).as_ref());
6872        let mut query_params = Vec::new();
6873        if let Some(p) = license_number {
6874            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6875        }
6876        if !query_params.is_empty() {
6877            path.push_str("?");
6878            path.push_str(&query_params.join("&"));
6879        }
6880        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6881    }
6882
6883    /// GET GetActive V1
6884    /// Permissions Required:
6885    ///   - Manage Processing Job
6886    ///
6887    pub async fn processing_jobs_get_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6888        let mut path = format!("/processing/v1/active");
6889        let mut query_params = Vec::new();
6890        if let Some(p) = last_modified_end {
6891            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6892        }
6893        if let Some(p) = last_modified_start {
6894            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6895        }
6896        if let Some(p) = license_number {
6897            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6898        }
6899        if !query_params.is_empty() {
6900            path.push_str("?");
6901            path.push_str(&query_params.join("&"));
6902        }
6903        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6904    }
6905
6906    /// GET GetActive V2
6907    /// Retrieves active processing jobs at a specified Facility.
6908    /// 
6909    ///   Permissions Required:
6910    ///   - Manage Processing Job
6911    ///
6912    pub async fn processing_jobs_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6913        let mut path = format!("/processing/v2/active");
6914        let mut query_params = Vec::new();
6915        if let Some(p) = last_modified_end {
6916            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6917        }
6918        if let Some(p) = last_modified_start {
6919            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6920        }
6921        if let Some(p) = license_number {
6922            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6923        }
6924        if let Some(p) = page_number {
6925            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6926        }
6927        if let Some(p) = page_size {
6928            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6929        }
6930        if !query_params.is_empty() {
6931            path.push_str("?");
6932            path.push_str(&query_params.join("&"));
6933        }
6934        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6935    }
6936
6937    /// GET GetInactive V1
6938    /// Permissions Required:
6939    ///   - Manage Processing Job
6940    ///
6941    pub async fn processing_jobs_get_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6942        let mut path = format!("/processing/v1/inactive");
6943        let mut query_params = Vec::new();
6944        if let Some(p) = last_modified_end {
6945            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6946        }
6947        if let Some(p) = last_modified_start {
6948            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6949        }
6950        if let Some(p) = license_number {
6951            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6952        }
6953        if !query_params.is_empty() {
6954            path.push_str("?");
6955            path.push_str(&query_params.join("&"));
6956        }
6957        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6958    }
6959
6960    /// GET GetInactive V2
6961    /// Retrieves inactive processing jobs at a specified Facility.
6962    /// 
6963    ///   Permissions Required:
6964    ///   - Manage Processing Job
6965    ///
6966    pub async fn processing_jobs_get_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6967        let mut path = format!("/processing/v2/inactive");
6968        let mut query_params = Vec::new();
6969        if let Some(p) = last_modified_end {
6970            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6971        }
6972        if let Some(p) = last_modified_start {
6973            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6974        }
6975        if let Some(p) = license_number {
6976            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6977        }
6978        if let Some(p) = page_number {
6979            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6980        }
6981        if let Some(p) = page_size {
6982            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6983        }
6984        if !query_params.is_empty() {
6985            path.push_str("?");
6986            path.push_str(&query_params.join("&"));
6987        }
6988        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6989    }
6990
6991    /// GET GetJobtypesActive V1
6992    /// Permissions Required:
6993    ///   - Manage Processing Job
6994    ///
6995    pub async fn processing_jobs_get_jobtypes_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6996        let mut path = format!("/processing/v1/jobtypes/active");
6997        let mut query_params = Vec::new();
6998        if let Some(p) = last_modified_end {
6999            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7000        }
7001        if let Some(p) = last_modified_start {
7002            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7003        }
7004        if let Some(p) = license_number {
7005            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7006        }
7007        if !query_params.is_empty() {
7008            path.push_str("?");
7009            path.push_str(&query_params.join("&"));
7010        }
7011        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7012    }
7013
7014    /// GET GetJobtypesActive V2
7015    /// Retrieves a list of all active processing job types defined within a Facility.
7016    /// 
7017    ///   Permissions Required:
7018    ///   - Manage Processing Job
7019    ///
7020    pub async fn processing_jobs_get_jobtypes_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7021        let mut path = format!("/processing/v2/jobtypes/active");
7022        let mut query_params = Vec::new();
7023        if let Some(p) = last_modified_end {
7024            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7025        }
7026        if let Some(p) = last_modified_start {
7027            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7028        }
7029        if let Some(p) = license_number {
7030            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7031        }
7032        if let Some(p) = page_number {
7033            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7034        }
7035        if let Some(p) = page_size {
7036            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7037        }
7038        if !query_params.is_empty() {
7039            path.push_str("?");
7040            path.push_str(&query_params.join("&"));
7041        }
7042        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7043    }
7044
7045    /// GET GetJobtypesAttributes V1
7046    /// Permissions Required:
7047    ///   - Manage Processing Job
7048    ///
7049    pub async fn processing_jobs_get_jobtypes_attributes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7050        let mut path = format!("/processing/v1/jobtypes/attributes");
7051        let mut query_params = Vec::new();
7052        if let Some(p) = license_number {
7053            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7054        }
7055        if !query_params.is_empty() {
7056            path.push_str("?");
7057            path.push_str(&query_params.join("&"));
7058        }
7059        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7060    }
7061
7062    /// GET GetJobtypesAttributes V2
7063    /// Retrieves all processing job attributes available for a Facility.
7064    /// 
7065    ///   Permissions Required:
7066    ///   - Manage Processing Job
7067    ///
7068    pub async fn processing_jobs_get_jobtypes_attributes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7069        let mut path = format!("/processing/v2/jobtypes/attributes");
7070        let mut query_params = Vec::new();
7071        if let Some(p) = license_number {
7072            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7073        }
7074        if !query_params.is_empty() {
7075            path.push_str("?");
7076            path.push_str(&query_params.join("&"));
7077        }
7078        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7079    }
7080
7081    /// GET GetJobtypesCategories V1
7082    /// Permissions Required:
7083    ///   - Manage Processing Job
7084    ///
7085    pub async fn processing_jobs_get_jobtypes_categories_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7086        let mut path = format!("/processing/v1/jobtypes/categories");
7087        let mut query_params = Vec::new();
7088        if let Some(p) = license_number {
7089            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7090        }
7091        if !query_params.is_empty() {
7092            path.push_str("?");
7093            path.push_str(&query_params.join("&"));
7094        }
7095        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7096    }
7097
7098    /// GET GetJobtypesCategories V2
7099    /// Retrieves all processing job categories available for a specified Facility.
7100    /// 
7101    ///   Permissions Required:
7102    ///   - Manage Processing Job
7103    ///
7104    pub async fn processing_jobs_get_jobtypes_categories_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7105        let mut path = format!("/processing/v2/jobtypes/categories");
7106        let mut query_params = Vec::new();
7107        if let Some(p) = license_number {
7108            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7109        }
7110        if !query_params.is_empty() {
7111            path.push_str("?");
7112            path.push_str(&query_params.join("&"));
7113        }
7114        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7115    }
7116
7117    /// GET GetJobtypesInactive V1
7118    /// Permissions Required:
7119    ///   - Manage Processing Job
7120    ///
7121    pub async fn processing_jobs_get_jobtypes_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7122        let mut path = format!("/processing/v1/jobtypes/inactive");
7123        let mut query_params = Vec::new();
7124        if let Some(p) = last_modified_end {
7125            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7126        }
7127        if let Some(p) = last_modified_start {
7128            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7129        }
7130        if let Some(p) = license_number {
7131            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7132        }
7133        if !query_params.is_empty() {
7134            path.push_str("?");
7135            path.push_str(&query_params.join("&"));
7136        }
7137        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7138    }
7139
7140    /// GET GetJobtypesInactive V2
7141    /// Retrieves a list of all inactive processing job types defined within a Facility.
7142    /// 
7143    ///   Permissions Required:
7144    ///   - Manage Processing Job
7145    ///
7146    pub async fn processing_jobs_get_jobtypes_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7147        let mut path = format!("/processing/v2/jobtypes/inactive");
7148        let mut query_params = Vec::new();
7149        if let Some(p) = last_modified_end {
7150            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7151        }
7152        if let Some(p) = last_modified_start {
7153            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7154        }
7155        if let Some(p) = license_number {
7156            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7157        }
7158        if let Some(p) = page_number {
7159            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7160        }
7161        if let Some(p) = page_size {
7162            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7163        }
7164        if !query_params.is_empty() {
7165            path.push_str("?");
7166            path.push_str(&query_params.join("&"));
7167        }
7168        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7169    }
7170
7171    /// PUT UpdateFinish V1
7172    /// Permissions Required:
7173    ///   - Manage Processing Job
7174    ///
7175    pub async fn processing_jobs_update_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7176        let mut path = format!("/processing/v1/finish");
7177        let mut query_params = Vec::new();
7178        if let Some(p) = license_number {
7179            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7180        }
7181        if !query_params.is_empty() {
7182            path.push_str("?");
7183            path.push_str(&query_params.join("&"));
7184        }
7185        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7186    }
7187
7188    /// PUT UpdateFinish V2
7189    /// Completes processing jobs at a Facility by recording final notes and waste measurements.
7190    /// 
7191    ///   Permissions Required:
7192    ///   - Manage Processing Job
7193    ///
7194    pub async fn processing_jobs_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7195        let mut path = format!("/processing/v2/finish");
7196        let mut query_params = Vec::new();
7197        if let Some(p) = license_number {
7198            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7199        }
7200        if !query_params.is_empty() {
7201            path.push_str("?");
7202            path.push_str(&query_params.join("&"));
7203        }
7204        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7205    }
7206
7207    /// PUT UpdateJobtypes V1
7208    /// Permissions Required:
7209    ///   - Manage Processing Job
7210    ///
7211    pub async fn processing_jobs_update_jobtypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7212        let mut path = format!("/processing/v1/jobtypes");
7213        let mut query_params = Vec::new();
7214        if let Some(p) = license_number {
7215            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7216        }
7217        if !query_params.is_empty() {
7218            path.push_str("?");
7219            path.push_str(&query_params.join("&"));
7220        }
7221        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7222    }
7223
7224    /// PUT UpdateJobtypes V2
7225    /// Updates existing processing job types at a Facility, including their name, category, description, steps, and attributes.
7226    /// 
7227    ///   Permissions Required:
7228    ///   - Manage Processing Job
7229    ///
7230    pub async fn processing_jobs_update_jobtypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7231        let mut path = format!("/processing/v2/jobtypes");
7232        let mut query_params = Vec::new();
7233        if let Some(p) = license_number {
7234            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7235        }
7236        if !query_params.is_empty() {
7237            path.push_str("?");
7238            path.push_str(&query_params.join("&"));
7239        }
7240        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7241    }
7242
7243    /// PUT UpdateUnfinish V1
7244    /// Permissions Required:
7245    ///   - Manage Processing Job
7246    ///
7247    pub async fn processing_jobs_update_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7248        let mut path = format!("/processing/v1/unfinish");
7249        let mut query_params = Vec::new();
7250        if let Some(p) = license_number {
7251            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7252        }
7253        if !query_params.is_empty() {
7254            path.push_str("?");
7255            path.push_str(&query_params.join("&"));
7256        }
7257        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7258    }
7259
7260    /// PUT UpdateUnfinish V2
7261    /// Reopens previously completed processing jobs at a Facility to allow further updates or corrections.
7262    /// 
7263    ///   Permissions Required:
7264    ///   - Manage Processing Job
7265    ///
7266    pub async fn processing_jobs_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7267        let mut path = format!("/processing/v2/unfinish");
7268        let mut query_params = Vec::new();
7269        if let Some(p) = license_number {
7270            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7271        }
7272        if !query_params.is_empty() {
7273            path.push_str("?");
7274            path.push_str(&query_params.join("&"));
7275        }
7276        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7277    }
7278
7279    /// POST CreateDelivery V1
7280    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7281    /// 
7282    ///   Permissions Required:
7283    ///   - Sales Delivery
7284    ///
7285    pub async fn sales_create_delivery_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7286        let mut path = format!("/sales/v1/deliveries");
7287        let mut query_params = Vec::new();
7288        if let Some(p) = license_number {
7289            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7290        }
7291        if !query_params.is_empty() {
7292            path.push_str("?");
7293            path.push_str(&query_params.join("&"));
7294        }
7295        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7296    }
7297
7298    /// POST CreateDelivery V2
7299    /// Records new sales delivery entries for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7300    /// 
7301    ///   Permissions Required:
7302    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7303    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7304    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7305    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
7306    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
7307    ///
7308    pub async fn sales_create_delivery_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7309        let mut path = format!("/sales/v2/deliveries");
7310        let mut query_params = Vec::new();
7311        if let Some(p) = license_number {
7312            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7313        }
7314        if !query_params.is_empty() {
7315            path.push_str("?");
7316            path.push_str(&query_params.join("&"));
7317        }
7318        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7319    }
7320
7321    /// POST CreateDeliveryRetailer V1
7322    /// Please note: The DateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7323    /// 
7324    ///   Permissions Required:
7325    ///   - Retailer Delivery
7326    ///
7327    pub async fn sales_create_delivery_retailer_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7328        let mut path = format!("/sales/v1/deliveries/retailer");
7329        let mut query_params = Vec::new();
7330        if let Some(p) = license_number {
7331            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7332        }
7333        if !query_params.is_empty() {
7334            path.push_str("?");
7335            path.push_str(&query_params.join("&"));
7336        }
7337        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7338    }
7339
7340    /// POST CreateDeliveryRetailer V2
7341    /// Records retailer delivery data for a given License Number, including delivery destinations. Please note: The DateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7342    /// 
7343    ///   Permissions Required:
7344    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7345    ///   - Industry/Facility Type/Retailer Delivery
7346    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7347    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7348    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
7349    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
7350    ///   - Manage Retailer Delivery
7351    ///
7352    pub async fn sales_create_delivery_retailer_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7353        let mut path = format!("/sales/v2/deliveries/retailer");
7354        let mut query_params = Vec::new();
7355        if let Some(p) = license_number {
7356            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7357        }
7358        if !query_params.is_empty() {
7359            path.push_str("?");
7360            path.push_str(&query_params.join("&"));
7361        }
7362        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7363    }
7364
7365    /// POST CreateDeliveryRetailerDepart V1
7366    /// Permissions Required:
7367    ///   - Retailer Delivery
7368    ///
7369    pub async fn sales_create_delivery_retailer_depart_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7370        let mut path = format!("/sales/v1/deliveries/retailer/depart");
7371        let mut query_params = Vec::new();
7372        if let Some(p) = license_number {
7373            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7374        }
7375        if !query_params.is_empty() {
7376            path.push_str("?");
7377            path.push_str(&query_params.join("&"));
7378        }
7379        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7380    }
7381
7382    /// POST CreateDeliveryRetailerDepart V2
7383    /// Processes the departure of retailer deliveries for a Facility using the provided License Number and delivery data.
7384    /// 
7385    ///   Permissions Required:
7386    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7387    ///   - Industry/Facility Type/Retailer Delivery
7388    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7389    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7390    ///   - Manage Retailer Delivery
7391    ///
7392    pub async fn sales_create_delivery_retailer_depart_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7393        let mut path = format!("/sales/v2/deliveries/retailer/depart");
7394        let mut query_params = Vec::new();
7395        if let Some(p) = license_number {
7396            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7397        }
7398        if !query_params.is_empty() {
7399            path.push_str("?");
7400            path.push_str(&query_params.join("&"));
7401        }
7402        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7403    }
7404
7405    /// POST CreateDeliveryRetailerEnd V1
7406    /// Please note: The ActualArrivalDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7407    /// 
7408    ///   Permissions Required:
7409    ///   - Retailer Delivery
7410    ///
7411    pub async fn sales_create_delivery_retailer_end_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7412        let mut path = format!("/sales/v1/deliveries/retailer/end");
7413        let mut query_params = Vec::new();
7414        if let Some(p) = license_number {
7415            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7416        }
7417        if !query_params.is_empty() {
7418            path.push_str("?");
7419            path.push_str(&query_params.join("&"));
7420        }
7421        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7422    }
7423
7424    /// POST CreateDeliveryRetailerEnd V2
7425    /// Ends retailer delivery records for a given License Number. Please note: The ActualArrivalDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7426    /// 
7427    ///   Permissions Required:
7428    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7429    ///   - Industry/Facility Type/Retailer Delivery
7430    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7431    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7432    ///   - Manage Retailer Delivery
7433    ///
7434    pub async fn sales_create_delivery_retailer_end_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7435        let mut path = format!("/sales/v2/deliveries/retailer/end");
7436        let mut query_params = Vec::new();
7437        if let Some(p) = license_number {
7438            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7439        }
7440        if !query_params.is_empty() {
7441            path.push_str("?");
7442            path.push_str(&query_params.join("&"));
7443        }
7444        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7445    }
7446
7447    /// POST CreateDeliveryRetailerRestock V1
7448    /// Please note: The DateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7449    /// 
7450    ///   Permissions Required:
7451    ///   - Retailer Delivery
7452    ///
7453    pub async fn sales_create_delivery_retailer_restock_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7454        let mut path = format!("/sales/v1/deliveries/retailer/restock");
7455        let mut query_params = Vec::new();
7456        if let Some(p) = license_number {
7457            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7458        }
7459        if !query_params.is_empty() {
7460            path.push_str("?");
7461            path.push_str(&query_params.join("&"));
7462        }
7463        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7464    }
7465
7466    /// POST CreateDeliveryRetailerRestock V2
7467    /// Records restock deliveries for retailer facilities using the provided License Number. Please note: The DateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7468    /// 
7469    ///   Permissions Required:
7470    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7471    ///   - Industry/Facility Type/Retailer Delivery
7472    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7473    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7474    ///   - Manage Retailer Delivery
7475    ///
7476    pub async fn sales_create_delivery_retailer_restock_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7477        let mut path = format!("/sales/v2/deliveries/retailer/restock");
7478        let mut query_params = Vec::new();
7479        if let Some(p) = license_number {
7480            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7481        }
7482        if !query_params.is_empty() {
7483            path.push_str("?");
7484            path.push_str(&query_params.join("&"));
7485        }
7486        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7487    }
7488
7489    /// POST CreateDeliveryRetailerSale V1
7490    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7491    /// 
7492    ///   Permissions Required:
7493    ///   - Retailer Delivery
7494    ///
7495    pub async fn sales_create_delivery_retailer_sale_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7496        let mut path = format!("/sales/v1/deliveries/retailer/sale");
7497        let mut query_params = Vec::new();
7498        if let Some(p) = license_number {
7499            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7500        }
7501        if !query_params.is_empty() {
7502            path.push_str("?");
7503            path.push_str(&query_params.join("&"));
7504        }
7505        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7506    }
7507
7508    /// POST CreateDeliveryRetailerSale V2
7509    /// Records sales deliveries originating from a retailer delivery for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7510    /// 
7511    ///   Permissions Required:
7512    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7513    ///   - Industry/Facility Type/Retailer Delivery
7514    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7515    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7516    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
7517    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
7518    ///
7519    pub async fn sales_create_delivery_retailer_sale_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7520        let mut path = format!("/sales/v2/deliveries/retailer/sale");
7521        let mut query_params = Vec::new();
7522        if let Some(p) = license_number {
7523            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7524        }
7525        if !query_params.is_empty() {
7526            path.push_str("?");
7527            path.push_str(&query_params.join("&"));
7528        }
7529        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7530    }
7531
7532    /// POST CreateReceipt V1
7533    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
7534    /// 
7535    ///   Permissions Required:
7536    ///   - Sales
7537    ///
7538    pub async fn sales_create_receipt_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7539        let mut path = format!("/sales/v1/receipts");
7540        let mut query_params = Vec::new();
7541        if let Some(p) = license_number {
7542            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7543        }
7544        if !query_params.is_empty() {
7545            path.push_str("?");
7546            path.push_str(&query_params.join("&"));
7547        }
7548        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7549    }
7550
7551    /// POST CreateReceipt V2
7552    /// Records a list of sales deliveries for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
7553    /// 
7554    ///   Permissions Required:
7555    ///   - External Sources(ThirdPartyVendorV2)/Sales (Write)
7556    ///   - Industry/Facility Type/Consumer Sales or Industry/Facility Type/Patient Sales or Industry/Facility Type/External Patient Sales or Industry/Facility Type/Caregiver Sales
7557    ///   - Industry/Facility Type/Advanced Sales
7558    ///   - WebApi Sales Read Write State (All or WriteOnly)
7559    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
7560    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
7561    ///
7562    pub async fn sales_create_receipt_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7563        let mut path = format!("/sales/v2/receipts");
7564        let mut query_params = Vec::new();
7565        if let Some(p) = license_number {
7566            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7567        }
7568        if !query_params.is_empty() {
7569            path.push_str("?");
7570            path.push_str(&query_params.join("&"));
7571        }
7572        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7573    }
7574
7575    /// POST CreateTransactionByDate V1
7576    /// Permissions Required:
7577    ///   - Sales
7578    ///
7579    pub async fn sales_create_transaction_by_date_v1(&self, date: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7580        let mut path = format!("/sales/v1/transactions/{}", urlencoding::encode(date).as_ref());
7581        let mut query_params = Vec::new();
7582        if let Some(p) = license_number {
7583            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7584        }
7585        if !query_params.is_empty() {
7586            path.push_str("?");
7587            path.push_str(&query_params.join("&"));
7588        }
7589        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7590    }
7591
7592    /// DELETE DeleteDelivery V1
7593    /// Permissions Required:
7594    ///   - Sales Delivery
7595    ///
7596    pub async fn sales_delete_delivery_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7597        let mut path = format!("/sales/v1/deliveries/{}", urlencoding::encode(id).as_ref());
7598        let mut query_params = Vec::new();
7599        if let Some(p) = license_number {
7600            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7601        }
7602        if !query_params.is_empty() {
7603            path.push_str("?");
7604            path.push_str(&query_params.join("&"));
7605        }
7606        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7607    }
7608
7609    /// DELETE DeleteDelivery V2
7610    /// Voids a sales delivery for a Facility using the provided License Number and delivery Id.
7611    /// 
7612    ///   Permissions Required:
7613    ///   - Manage Sales Delivery
7614    ///
7615    pub async fn sales_delete_delivery_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7616        let mut path = format!("/sales/v2/deliveries/{}", urlencoding::encode(id).as_ref());
7617        let mut query_params = Vec::new();
7618        if let Some(p) = license_number {
7619            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7620        }
7621        if !query_params.is_empty() {
7622            path.push_str("?");
7623            path.push_str(&query_params.join("&"));
7624        }
7625        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7626    }
7627
7628    /// DELETE DeleteDeliveryRetailer V1
7629    /// Permissions Required:
7630    ///   - Retailer Delivery
7631    ///
7632    pub async fn sales_delete_delivery_retailer_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7633        let mut path = format!("/sales/v1/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
7634        let mut query_params = Vec::new();
7635        if let Some(p) = license_number {
7636            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7637        }
7638        if !query_params.is_empty() {
7639            path.push_str("?");
7640            path.push_str(&query_params.join("&"));
7641        }
7642        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7643    }
7644
7645    /// DELETE DeleteDeliveryRetailer V2
7646    /// Voids a retailer delivery for a Facility using the provided License Number and delivery Id.
7647    /// 
7648    ///   Permissions Required:
7649    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
7650    ///   - Industry/Facility Type/Retailer Delivery
7651    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
7652    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
7653    ///   - Manage Retailer Delivery
7654    ///
7655    pub async fn sales_delete_delivery_retailer_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7656        let mut path = format!("/sales/v2/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
7657        let mut query_params = Vec::new();
7658        if let Some(p) = license_number {
7659            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7660        }
7661        if !query_params.is_empty() {
7662            path.push_str("?");
7663            path.push_str(&query_params.join("&"));
7664        }
7665        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7666    }
7667
7668    /// DELETE DeleteReceipt V1
7669    /// Permissions Required:
7670    ///   - Sales
7671    ///
7672    pub async fn sales_delete_receipt_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7673        let mut path = format!("/sales/v1/receipts/{}", urlencoding::encode(id).as_ref());
7674        let mut query_params = Vec::new();
7675        if let Some(p) = license_number {
7676            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7677        }
7678        if !query_params.is_empty() {
7679            path.push_str("?");
7680            path.push_str(&query_params.join("&"));
7681        }
7682        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7683    }
7684
7685    /// DELETE DeleteReceipt V2
7686    /// Archives a sales receipt for a Facility using the provided License Number and receipt Id.
7687    /// 
7688    ///   Permissions Required:
7689    ///   - Manage Sales
7690    ///
7691    pub async fn sales_delete_receipt_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7692        let mut path = format!("/sales/v2/receipts/{}", urlencoding::encode(id).as_ref());
7693        let mut query_params = Vec::new();
7694        if let Some(p) = license_number {
7695            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7696        }
7697        if !query_params.is_empty() {
7698            path.push_str("?");
7699            path.push_str(&query_params.join("&"));
7700        }
7701        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7702    }
7703
7704    /// GET GetCounties V1
7705    /// Permissions Required:
7706    ///   - None
7707    ///
7708    pub async fn sales_get_counties_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7709        let mut path = format!("/sales/v1/counties");
7710        let mut query_params = Vec::new();
7711        if let Some(p) = no {
7712            query_params.push(format!("No={}", urlencoding::encode(&p)));
7713        }
7714        if !query_params.is_empty() {
7715            path.push_str("?");
7716            path.push_str(&query_params.join("&"));
7717        }
7718        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7719    }
7720
7721    /// GET GetCounties V2
7722    /// Returns a list of counties available for sales deliveries.
7723    /// 
7724    ///   Permissions Required:
7725    ///   - None
7726    ///
7727    pub async fn sales_get_counties_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7728        let mut path = format!("/sales/v2/counties");
7729        let mut query_params = Vec::new();
7730        if let Some(p) = no {
7731            query_params.push(format!("No={}", urlencoding::encode(&p)));
7732        }
7733        if !query_params.is_empty() {
7734            path.push_str("?");
7735            path.push_str(&query_params.join("&"));
7736        }
7737        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7738    }
7739
7740    /// GET GetCustomertypes V1
7741    /// Permissions Required:
7742    ///   - None
7743    ///
7744    pub async fn sales_get_customertypes_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7745        let mut path = format!("/sales/v1/customertypes");
7746        let mut query_params = Vec::new();
7747        if let Some(p) = no {
7748            query_params.push(format!("No={}", urlencoding::encode(&p)));
7749        }
7750        if !query_params.is_empty() {
7751            path.push_str("?");
7752            path.push_str(&query_params.join("&"));
7753        }
7754        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7755    }
7756
7757    /// GET GetCustomertypes V2
7758    /// Returns a list of customer types.
7759    /// 
7760    ///   Permissions Required:
7761    ///   - None
7762    ///
7763    pub async fn sales_get_customertypes_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7764        let mut path = format!("/sales/v2/customertypes");
7765        let mut query_params = Vec::new();
7766        if let Some(p) = no {
7767            query_params.push(format!("No={}", urlencoding::encode(&p)));
7768        }
7769        if !query_params.is_empty() {
7770            path.push_str("?");
7771            path.push_str(&query_params.join("&"));
7772        }
7773        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7774    }
7775
7776    /// GET GetDeliveriesActive V1
7777    /// Permissions Required:
7778    ///   - Sales Delivery
7779    ///
7780    pub async fn sales_get_deliveries_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7781        let mut path = format!("/sales/v1/deliveries/active");
7782        let mut query_params = Vec::new();
7783        if let Some(p) = last_modified_end {
7784            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7785        }
7786        if let Some(p) = last_modified_start {
7787            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7788        }
7789        if let Some(p) = license_number {
7790            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7791        }
7792        if let Some(p) = sales_date_end {
7793            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
7794        }
7795        if let Some(p) = sales_date_start {
7796            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
7797        }
7798        if !query_params.is_empty() {
7799            path.push_str("?");
7800            path.push_str(&query_params.join("&"));
7801        }
7802        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7803    }
7804
7805    /// GET GetDeliveriesActive V2
7806    /// Returns a list of active sales deliveries for a Facility, filtered by optional sales or last modified date ranges.
7807    /// 
7808    ///   Permissions Required:
7809    ///   - View Sales Delivery
7810    ///   - Manage Sales Delivery
7811    ///
7812    pub async fn sales_get_deliveries_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7813        let mut path = format!("/sales/v2/deliveries/active");
7814        let mut query_params = Vec::new();
7815        if let Some(p) = last_modified_end {
7816            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7817        }
7818        if let Some(p) = last_modified_start {
7819            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7820        }
7821        if let Some(p) = license_number {
7822            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7823        }
7824        if let Some(p) = page_number {
7825            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7826        }
7827        if let Some(p) = page_size {
7828            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7829        }
7830        if let Some(p) = sales_date_end {
7831            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
7832        }
7833        if let Some(p) = sales_date_start {
7834            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
7835        }
7836        if !query_params.is_empty() {
7837            path.push_str("?");
7838            path.push_str(&query_params.join("&"));
7839        }
7840        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7841    }
7842
7843    /// GET GetDeliveriesInactive V1
7844    /// Permissions Required:
7845    ///   - Sales Delivery
7846    ///
7847    pub async fn sales_get_deliveries_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7848        let mut path = format!("/sales/v1/deliveries/inactive");
7849        let mut query_params = Vec::new();
7850        if let Some(p) = last_modified_end {
7851            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7852        }
7853        if let Some(p) = last_modified_start {
7854            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7855        }
7856        if let Some(p) = license_number {
7857            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7858        }
7859        if let Some(p) = sales_date_end {
7860            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
7861        }
7862        if let Some(p) = sales_date_start {
7863            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
7864        }
7865        if !query_params.is_empty() {
7866            path.push_str("?");
7867            path.push_str(&query_params.join("&"));
7868        }
7869        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7870    }
7871
7872    /// GET GetDeliveriesInactive V2
7873    /// Returns a list of inactive sales deliveries for a Facility, filtered by optional sales or last modified date ranges.
7874    /// 
7875    ///   Permissions Required:
7876    ///   - View Sales Delivery
7877    ///   - Manage Sales Delivery
7878    ///
7879    pub async fn sales_get_deliveries_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7880        let mut path = format!("/sales/v2/deliveries/inactive");
7881        let mut query_params = Vec::new();
7882        if let Some(p) = last_modified_end {
7883            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7884        }
7885        if let Some(p) = last_modified_start {
7886            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7887        }
7888        if let Some(p) = license_number {
7889            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7890        }
7891        if let Some(p) = page_number {
7892            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7893        }
7894        if let Some(p) = page_size {
7895            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7896        }
7897        if let Some(p) = sales_date_end {
7898            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
7899        }
7900        if let Some(p) = sales_date_start {
7901            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
7902        }
7903        if !query_params.is_empty() {
7904            path.push_str("?");
7905            path.push_str(&query_params.join("&"));
7906        }
7907        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7908    }
7909
7910    /// GET GetDeliveriesRetailerActive V1
7911    /// Permissions Required:
7912    ///   - Retailer Delivery
7913    ///
7914    pub async fn sales_get_deliveries_retailer_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7915        let mut path = format!("/sales/v1/deliveries/retailer/active");
7916        let mut query_params = Vec::new();
7917        if let Some(p) = last_modified_end {
7918            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7919        }
7920        if let Some(p) = last_modified_start {
7921            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7922        }
7923        if let Some(p) = license_number {
7924            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7925        }
7926        if !query_params.is_empty() {
7927            path.push_str("?");
7928            path.push_str(&query_params.join("&"));
7929        }
7930        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7931    }
7932
7933    /// GET GetDeliveriesRetailerActive V2
7934    /// Returns a list of active retailer deliveries for a Facility, optionally filtered by last modified date range
7935    /// 
7936    ///   Permissions Required:
7937    ///   - View Retailer Delivery
7938    ///   - Manage Retailer Delivery
7939    ///
7940    pub async fn sales_get_deliveries_retailer_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7941        let mut path = format!("/sales/v2/deliveries/retailer/active");
7942        let mut query_params = Vec::new();
7943        if let Some(p) = last_modified_end {
7944            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7945        }
7946        if let Some(p) = last_modified_start {
7947            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7948        }
7949        if let Some(p) = license_number {
7950            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7951        }
7952        if let Some(p) = page_number {
7953            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7954        }
7955        if let Some(p) = page_size {
7956            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7957        }
7958        if !query_params.is_empty() {
7959            path.push_str("?");
7960            path.push_str(&query_params.join("&"));
7961        }
7962        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7963    }
7964
7965    /// GET GetDeliveriesRetailerInactive V1
7966    /// Permissions Required:
7967    ///   - Retailer Delivery
7968    ///
7969    pub async fn sales_get_deliveries_retailer_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7970        let mut path = format!("/sales/v1/deliveries/retailer/inactive");
7971        let mut query_params = Vec::new();
7972        if let Some(p) = last_modified_end {
7973            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7974        }
7975        if let Some(p) = last_modified_start {
7976            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7977        }
7978        if let Some(p) = license_number {
7979            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7980        }
7981        if !query_params.is_empty() {
7982            path.push_str("?");
7983            path.push_str(&query_params.join("&"));
7984        }
7985        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7986    }
7987
7988    /// GET GetDeliveriesRetailerInactive V2
7989    /// Returns a list of inactive retailer deliveries for a Facility, optionally filtered by last modified date range
7990    /// 
7991    ///   Permissions Required:
7992    ///   - View Retailer Delivery
7993    ///   - Manage Retailer Delivery
7994    ///
7995    pub async fn sales_get_deliveries_retailer_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7996        let mut path = format!("/sales/v2/deliveries/retailer/inactive");
7997        let mut query_params = Vec::new();
7998        if let Some(p) = last_modified_end {
7999            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8000        }
8001        if let Some(p) = last_modified_start {
8002            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8003        }
8004        if let Some(p) = license_number {
8005            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8006        }
8007        if let Some(p) = page_number {
8008            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8009        }
8010        if let Some(p) = page_size {
8011            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8012        }
8013        if !query_params.is_empty() {
8014            path.push_str("?");
8015            path.push_str(&query_params.join("&"));
8016        }
8017        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8018    }
8019
8020    /// GET GetDeliveriesReturnreasons V1
8021    /// Permissions Required:
8022    ///   -
8023    ///
8024    pub async fn sales_get_deliveries_returnreasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8025        let mut path = format!("/sales/v1/deliveries/returnreasons");
8026        let mut query_params = Vec::new();
8027        if let Some(p) = license_number {
8028            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8029        }
8030        if !query_params.is_empty() {
8031            path.push_str("?");
8032            path.push_str(&query_params.join("&"));
8033        }
8034        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8035    }
8036
8037    /// GET GetDeliveriesReturnreasons V2
8038    /// Returns a list of return reasons for sales deliveries based on the provided License Number.
8039    /// 
8040    ///   Permissions Required:
8041    ///   - Sales Delivery
8042    ///
8043    pub async fn sales_get_deliveries_returnreasons_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8044        let mut path = format!("/sales/v2/deliveries/returnreasons");
8045        let mut query_params = Vec::new();
8046        if let Some(p) = license_number {
8047            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8048        }
8049        if let Some(p) = page_number {
8050            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8051        }
8052        if let Some(p) = page_size {
8053            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8054        }
8055        if !query_params.is_empty() {
8056            path.push_str("?");
8057            path.push_str(&query_params.join("&"));
8058        }
8059        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8060    }
8061
8062    /// GET GetDelivery V1
8063    /// Permissions Required:
8064    ///   - Sales Delivery
8065    ///
8066    pub async fn sales_get_delivery_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8067        let mut path = format!("/sales/v1/deliveries/{}", urlencoding::encode(id).as_ref());
8068        let mut query_params = Vec::new();
8069        if let Some(p) = license_number {
8070            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8071        }
8072        if !query_params.is_empty() {
8073            path.push_str("?");
8074            path.push_str(&query_params.join("&"));
8075        }
8076        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8077    }
8078
8079    /// GET GetDelivery V2
8080    /// Retrieves a sales delivery record by its Id, with an optional License Number.
8081    /// 
8082    ///   Permissions Required:
8083    ///   - View Sales Delivery
8084    ///   - Manage Sales Delivery
8085    ///
8086    pub async fn sales_get_delivery_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8087        let mut path = format!("/sales/v2/deliveries/{}", urlencoding::encode(id).as_ref());
8088        let mut query_params = Vec::new();
8089        if let Some(p) = license_number {
8090            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8091        }
8092        if !query_params.is_empty() {
8093            path.push_str("?");
8094            path.push_str(&query_params.join("&"));
8095        }
8096        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8097    }
8098
8099    /// GET GetDeliveryRetailer V1
8100    /// Permissions Required:
8101    ///   - Retailer Delivery
8102    ///
8103    pub async fn sales_get_delivery_retailer_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8104        let mut path = format!("/sales/v1/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
8105        let mut query_params = Vec::new();
8106        if let Some(p) = license_number {
8107            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8108        }
8109        if !query_params.is_empty() {
8110            path.push_str("?");
8111            path.push_str(&query_params.join("&"));
8112        }
8113        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8114    }
8115
8116    /// GET GetDeliveryRetailer V2
8117    /// Retrieves a retailer delivery record by its ID, with an optional License Number.
8118    /// 
8119    ///   Permissions Required:
8120    ///   - View Retailer Delivery
8121    ///   - Manage Retailer Delivery
8122    ///
8123    pub async fn sales_get_delivery_retailer_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8124        let mut path = format!("/sales/v2/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
8125        let mut query_params = Vec::new();
8126        if let Some(p) = license_number {
8127            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8128        }
8129        if !query_params.is_empty() {
8130            path.push_str("?");
8131            path.push_str(&query_params.join("&"));
8132        }
8133        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8134    }
8135
8136    /// GET GetPatientRegistrationsLocations V1
8137    /// Permissions Required:
8138    ///   -
8139    ///
8140    pub async fn sales_get_patient_registrations_locations_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8141        let mut path = format!("/sales/v1/patientregistration/locations");
8142        let mut query_params = Vec::new();
8143        if let Some(p) = no {
8144            query_params.push(format!("No={}", urlencoding::encode(&p)));
8145        }
8146        if !query_params.is_empty() {
8147            path.push_str("?");
8148            path.push_str(&query_params.join("&"));
8149        }
8150        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8151    }
8152
8153    /// GET GetPatientRegistrationsLocations V2
8154    /// Returns a list of valid Patient registration locations for sales.
8155    /// 
8156    ///   Permissions Required:
8157    ///   -
8158    ///
8159    pub async fn sales_get_patient_registrations_locations_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8160        let mut path = format!("/sales/v2/patientregistration/locations");
8161        let mut query_params = Vec::new();
8162        if let Some(p) = no {
8163            query_params.push(format!("No={}", urlencoding::encode(&p)));
8164        }
8165        if !query_params.is_empty() {
8166            path.push_str("?");
8167            path.push_str(&query_params.join("&"));
8168        }
8169        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8170    }
8171
8172    /// GET GetPaymenttypes V1
8173    /// Permissions Required:
8174    ///   - Sales Delivery
8175    ///
8176    pub async fn sales_get_paymenttypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8177        let mut path = format!("/sales/v1/paymenttypes");
8178        let mut query_params = Vec::new();
8179        if let Some(p) = license_number {
8180            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8181        }
8182        if !query_params.is_empty() {
8183            path.push_str("?");
8184            path.push_str(&query_params.join("&"));
8185        }
8186        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8187    }
8188
8189    /// GET GetPaymenttypes V2
8190    /// Returns a list of available payment types for the specified License Number.
8191    /// 
8192    ///   Permissions Required:
8193    ///   - View Sales Delivery
8194    ///   - Manage Sales Delivery
8195    ///
8196    pub async fn sales_get_paymenttypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8197        let mut path = format!("/sales/v2/paymenttypes");
8198        let mut query_params = Vec::new();
8199        if let Some(p) = license_number {
8200            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8201        }
8202        if !query_params.is_empty() {
8203            path.push_str("?");
8204            path.push_str(&query_params.join("&"));
8205        }
8206        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8207    }
8208
8209    /// GET GetReceipt V1
8210    /// Permissions Required:
8211    ///   - Sales
8212    ///
8213    pub async fn sales_get_receipt_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8214        let mut path = format!("/sales/v1/receipts/{}", urlencoding::encode(id).as_ref());
8215        let mut query_params = Vec::new();
8216        if let Some(p) = license_number {
8217            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8218        }
8219        if !query_params.is_empty() {
8220            path.push_str("?");
8221            path.push_str(&query_params.join("&"));
8222        }
8223        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8224    }
8225
8226    /// GET GetReceipt V2
8227    /// Retrieves a sales receipt by its Id, with an optional License Number.
8228    /// 
8229    ///   Permissions Required:
8230    ///   - View Sales
8231    ///   - Manage Sales
8232    ///
8233    pub async fn sales_get_receipt_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8234        let mut path = format!("/sales/v2/receipts/{}", urlencoding::encode(id).as_ref());
8235        let mut query_params = Vec::new();
8236        if let Some(p) = license_number {
8237            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8238        }
8239        if !query_params.is_empty() {
8240            path.push_str("?");
8241            path.push_str(&query_params.join("&"));
8242        }
8243        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8244    }
8245
8246    /// GET GetReceiptsActive V1
8247    /// Permissions Required:
8248    ///   - Sales
8249    ///
8250    pub async fn sales_get_receipts_active_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8251        let mut path = format!("/sales/v1/receipts/active");
8252        let mut query_params = Vec::new();
8253        if let Some(p) = last_modified_end {
8254            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8255        }
8256        if let Some(p) = last_modified_start {
8257            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8258        }
8259        if let Some(p) = license_number {
8260            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8261        }
8262        if let Some(p) = sales_date_end {
8263            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
8264        }
8265        if let Some(p) = sales_date_start {
8266            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
8267        }
8268        if !query_params.is_empty() {
8269            path.push_str("?");
8270            path.push_str(&query_params.join("&"));
8271        }
8272        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8273    }
8274
8275    /// GET GetReceiptsActive V2
8276    /// Returns a list of active sales receipts for a Facility, filtered by optional sales or last modified date ranges.
8277    /// 
8278    ///   Permissions Required:
8279    ///   - View Sales
8280    ///   - Manage Sales
8281    ///
8282    pub async fn sales_get_receipts_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8283        let mut path = format!("/sales/v2/receipts/active");
8284        let mut query_params = Vec::new();
8285        if let Some(p) = last_modified_end {
8286            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8287        }
8288        if let Some(p) = last_modified_start {
8289            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8290        }
8291        if let Some(p) = license_number {
8292            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8293        }
8294        if let Some(p) = page_number {
8295            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8296        }
8297        if let Some(p) = page_size {
8298            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8299        }
8300        if let Some(p) = sales_date_end {
8301            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
8302        }
8303        if let Some(p) = sales_date_start {
8304            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
8305        }
8306        if !query_params.is_empty() {
8307            path.push_str("?");
8308            path.push_str(&query_params.join("&"));
8309        }
8310        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8311    }
8312
8313    /// GET GetReceiptsExternalByExternalNumber V2
8314    /// Retrieves a Sales Receipt by its external number, with an optional License Number.
8315    /// 
8316    ///   Permissions Required:
8317    ///   - View Sales
8318    ///   - Manage Sales
8319    ///
8320    pub async fn sales_get_receipts_external_by_external_number_v2(&self, external_number: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8321        let mut path = format!("/sales/v2/receipts/external/{}", urlencoding::encode(external_number).as_ref());
8322        let mut query_params = Vec::new();
8323        if let Some(p) = license_number {
8324            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8325        }
8326        if !query_params.is_empty() {
8327            path.push_str("?");
8328            path.push_str(&query_params.join("&"));
8329        }
8330        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8331    }
8332
8333    /// GET GetReceiptsInactive V1
8334    /// Permissions Required:
8335    ///   - Sales
8336    ///
8337    pub async fn sales_get_receipts_inactive_v1(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8338        let mut path = format!("/sales/v1/receipts/inactive");
8339        let mut query_params = Vec::new();
8340        if let Some(p) = last_modified_end {
8341            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8342        }
8343        if let Some(p) = last_modified_start {
8344            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8345        }
8346        if let Some(p) = license_number {
8347            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8348        }
8349        if let Some(p) = sales_date_end {
8350            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
8351        }
8352        if let Some(p) = sales_date_start {
8353            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
8354        }
8355        if !query_params.is_empty() {
8356            path.push_str("?");
8357            path.push_str(&query_params.join("&"));
8358        }
8359        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8360    }
8361
8362    /// GET GetReceiptsInactive V2
8363    /// Returns a list of inactive sales receipts for a Facility, filtered by optional sales or last modified date ranges.
8364    /// 
8365    ///   Permissions Required:
8366    ///   - View Sales
8367    ///   - Manage Sales
8368    ///
8369    pub async fn sales_get_receipts_inactive_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, sales_date_end: Option<String>, sales_date_start: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8370        let mut path = format!("/sales/v2/receipts/inactive");
8371        let mut query_params = Vec::new();
8372        if let Some(p) = last_modified_end {
8373            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8374        }
8375        if let Some(p) = last_modified_start {
8376            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8377        }
8378        if let Some(p) = license_number {
8379            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8380        }
8381        if let Some(p) = page_number {
8382            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8383        }
8384        if let Some(p) = page_size {
8385            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8386        }
8387        if let Some(p) = sales_date_end {
8388            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
8389        }
8390        if let Some(p) = sales_date_start {
8391            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
8392        }
8393        if !query_params.is_empty() {
8394            path.push_str("?");
8395            path.push_str(&query_params.join("&"));
8396        }
8397        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8398    }
8399
8400    /// GET GetTransactions V1
8401    /// Permissions Required:
8402    ///   - Sales
8403    ///
8404    pub async fn sales_get_transactions_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8405        let mut path = format!("/sales/v1/transactions");
8406        let mut query_params = Vec::new();
8407        if let Some(p) = license_number {
8408            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8409        }
8410        if !query_params.is_empty() {
8411            path.push_str("?");
8412            path.push_str(&query_params.join("&"));
8413        }
8414        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8415    }
8416
8417    /// GET GetTransactionsBySalesDateStartAndSalesDateEnd V1
8418    /// Permissions Required:
8419    ///   - Sales
8420    ///
8421    pub async fn sales_get_transactions_by_sales_date_start_and_sales_date_end_v1(&self, sales_date_start: &str, sales_date_end: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8422        let mut path = format!("/sales/v1/transactions/{}/{}", urlencoding::encode(sales_date_start).as_ref(), urlencoding::encode(sales_date_end).as_ref());
8423        let mut query_params = Vec::new();
8424        if let Some(p) = license_number {
8425            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8426        }
8427        if !query_params.is_empty() {
8428            path.push_str("?");
8429            path.push_str(&query_params.join("&"));
8430        }
8431        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8432    }
8433
8434    /// PUT UpdateDelivery V1
8435    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
8436    /// 
8437    ///   Permissions Required:
8438    ///   - Sales Delivery
8439    ///
8440    pub async fn sales_update_delivery_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8441        let mut path = format!("/sales/v1/deliveries");
8442        let mut query_params = Vec::new();
8443        if let Some(p) = license_number {
8444            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8445        }
8446        if !query_params.is_empty() {
8447            path.push_str("?");
8448            path.push_str(&query_params.join("&"));
8449        }
8450        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8451    }
8452
8453    /// PUT UpdateDelivery V2
8454    /// Updates sales delivery records for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
8455    /// 
8456    ///   Permissions Required:
8457    ///   - Manage Sales Delivery
8458    ///
8459    pub async fn sales_update_delivery_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8460        let mut path = format!("/sales/v2/deliveries");
8461        let mut query_params = Vec::new();
8462        if let Some(p) = license_number {
8463            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8464        }
8465        if !query_params.is_empty() {
8466            path.push_str("?");
8467            path.push_str(&query_params.join("&"));
8468        }
8469        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8470    }
8471
8472    /// PUT UpdateDeliveryComplete V1
8473    /// Permissions Required:
8474    ///   - Sales Delivery
8475    ///
8476    pub async fn sales_update_delivery_complete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8477        let mut path = format!("/sales/v1/deliveries/complete");
8478        let mut query_params = Vec::new();
8479        if let Some(p) = license_number {
8480            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8481        }
8482        if !query_params.is_empty() {
8483            path.push_str("?");
8484            path.push_str(&query_params.join("&"));
8485        }
8486        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8487    }
8488
8489    /// PUT UpdateDeliveryComplete V2
8490    /// Completes a list of sales deliveries for a Facility using the provided License Number and delivery data.
8491    /// 
8492    ///   Permissions Required:
8493    ///   - Manage Sales Delivery
8494    ///
8495    pub async fn sales_update_delivery_complete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8496        let mut path = format!("/sales/v2/deliveries/complete");
8497        let mut query_params = Vec::new();
8498        if let Some(p) = license_number {
8499            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8500        }
8501        if !query_params.is_empty() {
8502            path.push_str("?");
8503            path.push_str(&query_params.join("&"));
8504        }
8505        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8506    }
8507
8508    /// PUT UpdateDeliveryHub V1
8509    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
8510    /// 
8511    ///   Permissions Required:
8512    ///   - Sales Delivery
8513    ///
8514    pub async fn sales_update_delivery_hub_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8515        let mut path = format!("/sales/v1/deliveries/hub");
8516        let mut query_params = Vec::new();
8517        if let Some(p) = license_number {
8518            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8519        }
8520        if !query_params.is_empty() {
8521            path.push_str("?");
8522            path.push_str(&query_params.join("&"));
8523        }
8524        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8525    }
8526
8527    /// PUT UpdateDeliveryHub V2
8528    /// Updates hub transporter details for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
8529    /// 
8530    ///   Permissions Required:
8531    ///   - Manage Sales Delivery, Manage Sales Delivery Hub
8532    ///
8533    pub async fn sales_update_delivery_hub_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8534        let mut path = format!("/sales/v2/deliveries/hub");
8535        let mut query_params = Vec::new();
8536        if let Some(p) = license_number {
8537            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8538        }
8539        if !query_params.is_empty() {
8540            path.push_str("?");
8541            path.push_str(&query_params.join("&"));
8542        }
8543        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8544    }
8545
8546    /// PUT UpdateDeliveryHubAccept V1
8547    /// Permissions Required:
8548    ///   - Sales
8549    ///
8550    pub async fn sales_update_delivery_hub_accept_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8551        let mut path = format!("/sales/v1/deliveries/hub/accept");
8552        let mut query_params = Vec::new();
8553        if let Some(p) = license_number {
8554            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8555        }
8556        if !query_params.is_empty() {
8557            path.push_str("?");
8558            path.push_str(&query_params.join("&"));
8559        }
8560        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8561    }
8562
8563    /// PUT UpdateDeliveryHubAccept V2
8564    /// Accepts a list of hub sales deliveries for a Facility based on the provided License Number and delivery data.
8565    /// 
8566    ///   Permissions Required:
8567    ///   - Manage Sales Delivery Hub
8568    ///
8569    pub async fn sales_update_delivery_hub_accept_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8570        let mut path = format!("/sales/v2/deliveries/hub/accept");
8571        let mut query_params = Vec::new();
8572        if let Some(p) = license_number {
8573            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8574        }
8575        if !query_params.is_empty() {
8576            path.push_str("?");
8577            path.push_str(&query_params.join("&"));
8578        }
8579        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8580    }
8581
8582    /// PUT UpdateDeliveryHubDepart V1
8583    /// Permissions Required:
8584    ///   - Sales
8585    ///
8586    pub async fn sales_update_delivery_hub_depart_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8587        let mut path = format!("/sales/v1/deliveries/hub/depart");
8588        let mut query_params = Vec::new();
8589        if let Some(p) = license_number {
8590            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8591        }
8592        if !query_params.is_empty() {
8593            path.push_str("?");
8594            path.push_str(&query_params.join("&"));
8595        }
8596        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8597    }
8598
8599    /// PUT UpdateDeliveryHubDepart V2
8600    /// Processes the departure of hub sales deliveries for a Facility using the provided License Number and delivery data.
8601    /// 
8602    ///   Permissions Required:
8603    ///   - Manage Sales Delivery Hub
8604    ///
8605    pub async fn sales_update_delivery_hub_depart_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8606        let mut path = format!("/sales/v2/deliveries/hub/depart");
8607        let mut query_params = Vec::new();
8608        if let Some(p) = license_number {
8609            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8610        }
8611        if !query_params.is_empty() {
8612            path.push_str("?");
8613            path.push_str(&query_params.join("&"));
8614        }
8615        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8616    }
8617
8618    /// PUT UpdateDeliveryHubVerifyID V1
8619    /// Permissions Required:
8620    ///   - Sales
8621    ///
8622    pub async fn sales_update_delivery_hub_verify_id_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8623        let mut path = format!("/sales/v1/deliveries/hub/verifyID");
8624        let mut query_params = Vec::new();
8625        if let Some(p) = license_number {
8626            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8627        }
8628        if !query_params.is_empty() {
8629            path.push_str("?");
8630            path.push_str(&query_params.join("&"));
8631        }
8632        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8633    }
8634
8635    /// PUT UpdateDeliveryHubVerifyID V2
8636    /// Verifies identification for a list of hub sales deliveries using the provided License Number and delivery data.
8637    /// 
8638    ///   Permissions Required:
8639    ///   - Manage Sales Delivery Hub
8640    ///
8641    pub async fn sales_update_delivery_hub_verify_id_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8642        let mut path = format!("/sales/v2/deliveries/hub/verifyID");
8643        let mut query_params = Vec::new();
8644        if let Some(p) = license_number {
8645            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8646        }
8647        if !query_params.is_empty() {
8648            path.push_str("?");
8649            path.push_str(&query_params.join("&"));
8650        }
8651        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8652    }
8653
8654    /// PUT UpdateDeliveryRetailer V1
8655    /// Please note: The DateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
8656    /// 
8657    ///   Permissions Required:
8658    ///   - Retailer Delivery
8659    ///
8660    pub async fn sales_update_delivery_retailer_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8661        let mut path = format!("/sales/v1/deliveries/retailer");
8662        let mut query_params = Vec::new();
8663        if let Some(p) = license_number {
8664            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8665        }
8666        if !query_params.is_empty() {
8667            path.push_str("?");
8668            path.push_str(&query_params.join("&"));
8669        }
8670        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8671    }
8672
8673    /// PUT UpdateDeliveryRetailer V2
8674    /// Updates retailer delivery records for a given License Number. Please note: The DateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
8675    /// 
8676    ///   Permissions Required:
8677    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
8678    ///   - Industry/Facility Type/Retailer Delivery
8679    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
8680    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
8681    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
8682    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
8683    ///   - Manage Retailer Delivery
8684    ///
8685    pub async fn sales_update_delivery_retailer_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8686        let mut path = format!("/sales/v2/deliveries/retailer");
8687        let mut query_params = Vec::new();
8688        if let Some(p) = license_number {
8689            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8690        }
8691        if !query_params.is_empty() {
8692            path.push_str("?");
8693            path.push_str(&query_params.join("&"));
8694        }
8695        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8696    }
8697
8698    /// PUT UpdateReceipt V1
8699    /// Please note: The SalesDateTime field must be the actual date and time of the transaction without time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be Pacific Standard (or Daylight Savings) Time and not in UTC.
8700    /// 
8701    ///   Permissions Required:
8702    ///   - Sales
8703    ///
8704    pub async fn sales_update_receipt_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8705        let mut path = format!("/sales/v1/receipts");
8706        let mut query_params = Vec::new();
8707        if let Some(p) = license_number {
8708            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8709        }
8710        if !query_params.is_empty() {
8711            path.push_str("?");
8712            path.push_str(&query_params.join("&"));
8713        }
8714        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8715    }
8716
8717    /// PUT UpdateReceipt V2
8718    /// Updates sales receipt records for a given License Number. Please note: The SalesDateTime field must be the actual date and time of the transaction without the time zone. This date/time must already be in the same time zone as the Facility recording the sales. For example, if the Facility is in Pacific Time, then this time must be in Pacific Standard (or Daylight Savings) Time and not in UTC.
8719    /// 
8720    ///   Permissions Required:
8721    ///   - Manage Sales
8722    ///
8723    pub async fn sales_update_receipt_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8724        let mut path = format!("/sales/v2/receipts");
8725        let mut query_params = Vec::new();
8726        if let Some(p) = license_number {
8727            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8728        }
8729        if !query_params.is_empty() {
8730            path.push_str("?");
8731            path.push_str(&query_params.join("&"));
8732        }
8733        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8734    }
8735
8736    /// PUT UpdateReceiptFinalize V2
8737    /// Finalizes a list of sales receipts for a Facility using the provided License Number and receipt data.
8738    /// 
8739    ///   Permissions Required:
8740    ///   - Manage Sales
8741    ///
8742    pub async fn sales_update_receipt_finalize_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8743        let mut path = format!("/sales/v2/receipts/finalize");
8744        let mut query_params = Vec::new();
8745        if let Some(p) = license_number {
8746            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8747        }
8748        if !query_params.is_empty() {
8749            path.push_str("?");
8750            path.push_str(&query_params.join("&"));
8751        }
8752        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8753    }
8754
8755    /// PUT UpdateReceiptUnfinalize V2
8756    /// Unfinalizes a list of sales receipts for a Facility using the provided License Number and receipt data.
8757    /// 
8758    ///   Permissions Required:
8759    ///   - Manage Sales
8760    ///
8761    pub async fn sales_update_receipt_unfinalize_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8762        let mut path = format!("/sales/v2/receipts/unfinalize");
8763        let mut query_params = Vec::new();
8764        if let Some(p) = license_number {
8765            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8766        }
8767        if !query_params.is_empty() {
8768            path.push_str("?");
8769            path.push_str(&query_params.join("&"));
8770        }
8771        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8772    }
8773
8774    /// PUT UpdateTransactionByDate V1
8775    /// Permissions Required:
8776    ///   - Sales
8777    ///
8778    pub async fn sales_update_transaction_by_date_v1(&self, date: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8779        let mut path = format!("/sales/v1/transactions/{}", urlencoding::encode(date).as_ref());
8780        let mut query_params = Vec::new();
8781        if let Some(p) = license_number {
8782            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8783        }
8784        if !query_params.is_empty() {
8785            path.push_str("?");
8786            path.push_str(&query_params.join("&"));
8787        }
8788        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8789    }
8790
8791    /// POST Create V1
8792    /// Permissions Required:
8793    ///   - Manage Strains
8794    ///
8795    pub async fn strains_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8796        let mut path = format!("/strains/v1/create");
8797        let mut query_params = Vec::new();
8798        if let Some(p) = license_number {
8799            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8800        }
8801        if !query_params.is_empty() {
8802            path.push_str("?");
8803            path.push_str(&query_params.join("&"));
8804        }
8805        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8806    }
8807
8808    /// POST Create V2
8809    /// Creates new strain records for a specified Facility.
8810    /// 
8811    ///   Permissions Required:
8812    ///   - Manage Strains
8813    ///
8814    pub async fn strains_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8815        let mut path = format!("/strains/v2");
8816        let mut query_params = Vec::new();
8817        if let Some(p) = license_number {
8818            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8819        }
8820        if !query_params.is_empty() {
8821            path.push_str("?");
8822            path.push_str(&query_params.join("&"));
8823        }
8824        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8825    }
8826
8827    /// POST CreateUpdate V1
8828    /// Permissions Required:
8829    ///   - Manage Strains
8830    ///
8831    pub async fn strains_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8832        let mut path = format!("/strains/v1/update");
8833        let mut query_params = Vec::new();
8834        if let Some(p) = license_number {
8835            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8836        }
8837        if !query_params.is_empty() {
8838            path.push_str("?");
8839            path.push_str(&query_params.join("&"));
8840        }
8841        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8842    }
8843
8844    /// DELETE Delete V1
8845    /// Permissions Required:
8846    ///   - Manage Strains
8847    ///
8848    pub async fn strains_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8849        let mut path = format!("/strains/v1/{}", urlencoding::encode(id).as_ref());
8850        let mut query_params = Vec::new();
8851        if let Some(p) = license_number {
8852            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8853        }
8854        if !query_params.is_empty() {
8855            path.push_str("?");
8856            path.push_str(&query_params.join("&"));
8857        }
8858        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8859    }
8860
8861    /// DELETE Delete V2
8862    /// Archives an existing strain record for a Facility
8863    /// 
8864    ///   Permissions Required:
8865    ///   - Manage Strains
8866    ///
8867    pub async fn strains_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8868        let mut path = format!("/strains/v2/{}", urlencoding::encode(id).as_ref());
8869        let mut query_params = Vec::new();
8870        if let Some(p) = license_number {
8871            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8872        }
8873        if !query_params.is_empty() {
8874            path.push_str("?");
8875            path.push_str(&query_params.join("&"));
8876        }
8877        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8878    }
8879
8880    /// GET Get V1
8881    /// Permissions Required:
8882    ///   - Manage Strains
8883    ///
8884    pub async fn strains_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8885        let mut path = format!("/strains/v1/{}", urlencoding::encode(id).as_ref());
8886        let mut query_params = Vec::new();
8887        if let Some(p) = license_number {
8888            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8889        }
8890        if !query_params.is_empty() {
8891            path.push_str("?");
8892            path.push_str(&query_params.join("&"));
8893        }
8894        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8895    }
8896
8897    /// GET Get V2
8898    /// Retrieves a Strain record by its Id, with an optional license number.
8899    /// 
8900    ///   Permissions Required:
8901    ///   - Manage Strains
8902    ///
8903    pub async fn strains_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8904        let mut path = format!("/strains/v2/{}", urlencoding::encode(id).as_ref());
8905        let mut query_params = Vec::new();
8906        if let Some(p) = license_number {
8907            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8908        }
8909        if !query_params.is_empty() {
8910            path.push_str("?");
8911            path.push_str(&query_params.join("&"));
8912        }
8913        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8914    }
8915
8916    /// GET GetActive V1
8917    /// Permissions Required:
8918    ///   - Manage Strains
8919    ///
8920    pub async fn strains_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8921        let mut path = format!("/strains/v1/active");
8922        let mut query_params = Vec::new();
8923        if let Some(p) = license_number {
8924            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8925        }
8926        if !query_params.is_empty() {
8927            path.push_str("?");
8928            path.push_str(&query_params.join("&"));
8929        }
8930        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8931    }
8932
8933    /// GET GetActive V2
8934    /// Retrieves a list of active strains for the current Facility, optionally filtered by last modified date range.
8935    /// 
8936    ///   Permissions Required:
8937    ///   - Manage Strains
8938    ///
8939    pub async fn strains_get_active_v2(&self, last_modified_end: Option<String>, last_modified_start: Option<String>, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8940        let mut path = format!("/strains/v2/active");
8941        let mut query_params = Vec::new();
8942        if let Some(p) = last_modified_end {
8943            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8944        }
8945        if let Some(p) = last_modified_start {
8946            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8947        }
8948        if let Some(p) = license_number {
8949            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8950        }
8951        if let Some(p) = page_number {
8952            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8953        }
8954        if let Some(p) = page_size {
8955            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8956        }
8957        if !query_params.is_empty() {
8958            path.push_str("?");
8959            path.push_str(&query_params.join("&"));
8960        }
8961        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8962    }
8963
8964    /// GET GetInactive V2
8965    /// Retrieves a list of inactive strains for the current Facility, optionally filtered by last modified date range.
8966    /// 
8967    ///   Permissions Required:
8968    ///   - Manage Strains
8969    ///
8970    pub async fn strains_get_inactive_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8971        let mut path = format!("/strains/v2/inactive");
8972        let mut query_params = Vec::new();
8973        if let Some(p) = license_number {
8974            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8975        }
8976        if let Some(p) = page_number {
8977            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8978        }
8979        if let Some(p) = page_size {
8980            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8981        }
8982        if !query_params.is_empty() {
8983            path.push_str("?");
8984            path.push_str(&query_params.join("&"));
8985        }
8986        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8987    }
8988
8989    /// PUT Update V2
8990    /// Updates existing strain records for a specified Facility.
8991    /// 
8992    ///   Permissions Required:
8993    ///   - Manage Strains
8994    ///
8995    pub async fn strains_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8996        let mut path = format!("/strains/v2");
8997        let mut query_params = Vec::new();
8998        if let Some(p) = license_number {
8999            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9000        }
9001        if !query_params.is_empty() {
9002            path.push_str("?");
9003            path.push_str(&query_params.join("&"));
9004        }
9005        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9006    }
9007
9008    /// POST CreateDriver V2
9009    /// Creates new driver records for a Facility.
9010    /// 
9011    ///   Permissions Required:
9012    ///   - Manage Transporters
9013    ///
9014    pub async fn transporters_create_driver_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9015        let mut path = format!("/transporters/v2/drivers");
9016        let mut query_params = Vec::new();
9017        if let Some(p) = license_number {
9018            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9019        }
9020        if !query_params.is_empty() {
9021            path.push_str("?");
9022            path.push_str(&query_params.join("&"));
9023        }
9024        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9025    }
9026
9027    /// POST CreateVehicle V2
9028    /// Creates new vehicle records for a Facility.
9029    /// 
9030    ///   Permissions Required:
9031    ///   - Manage Transporters
9032    ///
9033    pub async fn transporters_create_vehicle_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9034        let mut path = format!("/transporters/v2/vehicles");
9035        let mut query_params = Vec::new();
9036        if let Some(p) = license_number {
9037            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9038        }
9039        if !query_params.is_empty() {
9040            path.push_str("?");
9041            path.push_str(&query_params.join("&"));
9042        }
9043        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9044    }
9045
9046    /// DELETE DeleteDriver V2
9047    /// Archives a Driver record for a Facility.  Please note: The {id} parameter above represents a Driver Id.
9048    /// 
9049    ///   Permissions Required:
9050    ///   - Manage Transporters
9051    ///
9052    pub async fn transporters_delete_driver_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9053        let mut path = format!("/transporters/v2/drivers/{}", urlencoding::encode(id).as_ref());
9054        let mut query_params = Vec::new();
9055        if let Some(p) = license_number {
9056            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9057        }
9058        if !query_params.is_empty() {
9059            path.push_str("?");
9060            path.push_str(&query_params.join("&"));
9061        }
9062        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9063    }
9064
9065    /// DELETE DeleteVehicle V2
9066    /// Archives a Vehicle for a facility.  Please note: The {id} parameter above represents a Vehicle Id.
9067    /// 
9068    ///   Permissions Required:
9069    ///   - Manage Transporters
9070    ///
9071    pub async fn transporters_delete_vehicle_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9072        let mut path = format!("/transporters/v2/vehicles/{}", urlencoding::encode(id).as_ref());
9073        let mut query_params = Vec::new();
9074        if let Some(p) = license_number {
9075            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9076        }
9077        if !query_params.is_empty() {
9078            path.push_str("?");
9079            path.push_str(&query_params.join("&"));
9080        }
9081        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9082    }
9083
9084    /// GET GetDriver V2
9085    /// Retrieves a Driver by its Id, with an optional license number. Please note: The {id} parameter above represents a Driver Id.
9086    /// 
9087    ///   Permissions Required:
9088    ///   - Transporters
9089    ///
9090    pub async fn transporters_get_driver_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9091        let mut path = format!("/transporters/v2/drivers/{}", urlencoding::encode(id).as_ref());
9092        let mut query_params = Vec::new();
9093        if let Some(p) = license_number {
9094            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9095        }
9096        if !query_params.is_empty() {
9097            path.push_str("?");
9098            path.push_str(&query_params.join("&"));
9099        }
9100        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9101    }
9102
9103    /// GET GetDrivers V2
9104    /// Retrieves a list of drivers for a Facility.
9105    /// 
9106    ///   Permissions Required:
9107    ///   - Transporters
9108    ///
9109    pub async fn transporters_get_drivers_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9110        let mut path = format!("/transporters/v2/drivers");
9111        let mut query_params = Vec::new();
9112        if let Some(p) = license_number {
9113            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9114        }
9115        if let Some(p) = page_number {
9116            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
9117        }
9118        if let Some(p) = page_size {
9119            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
9120        }
9121        if !query_params.is_empty() {
9122            path.push_str("?");
9123            path.push_str(&query_params.join("&"));
9124        }
9125        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9126    }
9127
9128    /// GET GetVehicle V2
9129    /// Retrieves a Vehicle by its Id, with an optional license number. Please note: The {id} parameter above represents a Vehicle Id.
9130    /// 
9131    ///   Permissions Required:
9132    ///   - Transporters
9133    ///
9134    pub async fn transporters_get_vehicle_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9135        let mut path = format!("/transporters/v2/vehicles/{}", urlencoding::encode(id).as_ref());
9136        let mut query_params = Vec::new();
9137        if let Some(p) = license_number {
9138            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9139        }
9140        if !query_params.is_empty() {
9141            path.push_str("?");
9142            path.push_str(&query_params.join("&"));
9143        }
9144        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9145    }
9146
9147    /// GET GetVehicles V2
9148    /// Retrieves a list of vehicles for a Facility.
9149    /// 
9150    ///   Permissions Required:
9151    ///   - Transporters
9152    ///
9153    pub async fn transporters_get_vehicles_v2(&self, license_number: Option<String>, page_number: Option<String>, page_size: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9154        let mut path = format!("/transporters/v2/vehicles");
9155        let mut query_params = Vec::new();
9156        if let Some(p) = license_number {
9157            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9158        }
9159        if let Some(p) = page_number {
9160            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
9161        }
9162        if let Some(p) = page_size {
9163            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
9164        }
9165        if !query_params.is_empty() {
9166            path.push_str("?");
9167            path.push_str(&query_params.join("&"));
9168        }
9169        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9170    }
9171
9172    /// PUT UpdateDriver V2
9173    /// Updates existing driver records for a Facility.
9174    /// 
9175    ///   Permissions Required:
9176    ///   - Manage Transporters
9177    ///
9178    pub async fn transporters_update_driver_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9179        let mut path = format!("/transporters/v2/drivers");
9180        let mut query_params = Vec::new();
9181        if let Some(p) = license_number {
9182            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9183        }
9184        if !query_params.is_empty() {
9185            path.push_str("?");
9186            path.push_str(&query_params.join("&"));
9187        }
9188        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9189    }
9190
9191    /// PUT UpdateVehicle V2
9192    /// Updates existing vehicle records for a facility.
9193    /// 
9194    ///   Permissions Required:
9195    ///   - Manage Transporters
9196    ///
9197    pub async fn transporters_update_vehicle_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9198        let mut path = format!("/transporters/v2/vehicles");
9199        let mut query_params = Vec::new();
9200        if let Some(p) = license_number {
9201            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9202        }
9203        if !query_params.is_empty() {
9204            path.push_str("?");
9205            path.push_str(&query_params.join("&"));
9206        }
9207        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9208    }
9209
9210}