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 CreateDelivery V1
45    /// 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.
46    /// 
47    ///   Permissions Required:
48    ///   - Sales Delivery
49    ///
50    pub async fn sales_create_delivery_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
51        let mut path = format!("/sales/v1/deliveries");
52        let mut query_params = Vec::new();
53        if let Some(p) = license_number {
54            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
55        }
56        if !query_params.is_empty() {
57            path.push_str("?");
58            path.push_str(&query_params.join("&"));
59        }
60        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
61    }
62
63    /// POST CreateDelivery V2
64    /// 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.
65    /// 
66    ///   Permissions Required:
67    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
68    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
69    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
70    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
71    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
72    ///
73    pub async fn sales_create_delivery_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
74        let mut path = format!("/sales/v2/deliveries");
75        let mut query_params = Vec::new();
76        if let Some(p) = license_number {
77            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
78        }
79        if !query_params.is_empty() {
80            path.push_str("?");
81            path.push_str(&query_params.join("&"));
82        }
83        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
84    }
85
86    /// POST CreateDeliveryRetailer V1
87    /// 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.
88    /// 
89    ///   Permissions Required:
90    ///   - Retailer Delivery
91    ///
92    pub async fn sales_create_delivery_retailer_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
93        let mut path = format!("/sales/v1/deliveries/retailer");
94        let mut query_params = Vec::new();
95        if let Some(p) = license_number {
96            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
97        }
98        if !query_params.is_empty() {
99            path.push_str("?");
100            path.push_str(&query_params.join("&"));
101        }
102        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
103    }
104
105    /// POST CreateDeliveryRetailer V2
106    /// 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.
107    /// 
108    ///   Permissions Required:
109    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
110    ///   - Industry/Facility Type/Retailer Delivery
111    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
112    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
113    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
114    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
115    ///   - Manage Retailer Delivery
116    ///
117    pub async fn sales_create_delivery_retailer_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
118        let mut path = format!("/sales/v2/deliveries/retailer");
119        let mut query_params = Vec::new();
120        if let Some(p) = license_number {
121            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
122        }
123        if !query_params.is_empty() {
124            path.push_str("?");
125            path.push_str(&query_params.join("&"));
126        }
127        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
128    }
129
130    /// POST CreateDeliveryRetailerDepart V1
131    /// Permissions Required:
132    ///   - Retailer Delivery
133    ///
134    pub async fn sales_create_delivery_retailer_depart_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
135        let mut path = format!("/sales/v1/deliveries/retailer/depart");
136        let mut query_params = Vec::new();
137        if let Some(p) = license_number {
138            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
139        }
140        if !query_params.is_empty() {
141            path.push_str("?");
142            path.push_str(&query_params.join("&"));
143        }
144        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
145    }
146
147    /// POST CreateDeliveryRetailerDepart V2
148    /// Processes the departure of retailer deliveries for a Facility using the provided License Number and delivery data.
149    /// 
150    ///   Permissions Required:
151    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
152    ///   - Industry/Facility Type/Retailer Delivery
153    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
154    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
155    ///   - Manage Retailer Delivery
156    ///
157    pub async fn sales_create_delivery_retailer_depart_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
158        let mut path = format!("/sales/v2/deliveries/retailer/depart");
159        let mut query_params = Vec::new();
160        if let Some(p) = license_number {
161            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
162        }
163        if !query_params.is_empty() {
164            path.push_str("?");
165            path.push_str(&query_params.join("&"));
166        }
167        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
168    }
169
170    /// POST CreateDeliveryRetailerEnd V1
171    /// 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.
172    /// 
173    ///   Permissions Required:
174    ///   - Retailer Delivery
175    ///
176    pub async fn sales_create_delivery_retailer_end_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
177        let mut path = format!("/sales/v1/deliveries/retailer/end");
178        let mut query_params = Vec::new();
179        if let Some(p) = license_number {
180            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
181        }
182        if !query_params.is_empty() {
183            path.push_str("?");
184            path.push_str(&query_params.join("&"));
185        }
186        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
187    }
188
189    /// POST CreateDeliveryRetailerEnd V2
190    /// 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.
191    /// 
192    ///   Permissions Required:
193    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
194    ///   - Industry/Facility Type/Retailer Delivery
195    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
196    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
197    ///   - Manage Retailer Delivery
198    ///
199    pub async fn sales_create_delivery_retailer_end_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
200        let mut path = format!("/sales/v2/deliveries/retailer/end");
201        let mut query_params = Vec::new();
202        if let Some(p) = license_number {
203            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
204        }
205        if !query_params.is_empty() {
206            path.push_str("?");
207            path.push_str(&query_params.join("&"));
208        }
209        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
210    }
211
212    /// POST CreateDeliveryRetailerRestock V1
213    /// 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.
214    /// 
215    ///   Permissions Required:
216    ///   - Retailer Delivery
217    ///
218    pub async fn sales_create_delivery_retailer_restock_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
219        let mut path = format!("/sales/v1/deliveries/retailer/restock");
220        let mut query_params = Vec::new();
221        if let Some(p) = license_number {
222            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
223        }
224        if !query_params.is_empty() {
225            path.push_str("?");
226            path.push_str(&query_params.join("&"));
227        }
228        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
229    }
230
231    /// POST CreateDeliveryRetailerRestock V2
232    /// 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.
233    /// 
234    ///   Permissions Required:
235    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
236    ///   - Industry/Facility Type/Retailer Delivery
237    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
238    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
239    ///   - Manage Retailer Delivery
240    ///
241    pub async fn sales_create_delivery_retailer_restock_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
242        let mut path = format!("/sales/v2/deliveries/retailer/restock");
243        let mut query_params = Vec::new();
244        if let Some(p) = license_number {
245            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
246        }
247        if !query_params.is_empty() {
248            path.push_str("?");
249            path.push_str(&query_params.join("&"));
250        }
251        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
252    }
253
254    /// POST CreateDeliveryRetailerSale V1
255    /// 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.
256    /// 
257    ///   Permissions Required:
258    ///   - Retailer Delivery
259    ///
260    pub async fn sales_create_delivery_retailer_sale_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
261        let mut path = format!("/sales/v1/deliveries/retailer/sale");
262        let mut query_params = Vec::new();
263        if let Some(p) = license_number {
264            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
265        }
266        if !query_params.is_empty() {
267            path.push_str("?");
268            path.push_str(&query_params.join("&"));
269        }
270        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
271    }
272
273    /// POST CreateDeliveryRetailerSale V2
274    /// 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.
275    /// 
276    ///   Permissions Required:
277    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
278    ///   - Industry/Facility Type/Retailer Delivery
279    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
280    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
281    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
282    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
283    ///
284    pub async fn sales_create_delivery_retailer_sale_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
285        let mut path = format!("/sales/v2/deliveries/retailer/sale");
286        let mut query_params = Vec::new();
287        if let Some(p) = license_number {
288            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
289        }
290        if !query_params.is_empty() {
291            path.push_str("?");
292            path.push_str(&query_params.join("&"));
293        }
294        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
295    }
296
297    /// POST CreateReceipt V1
298    /// 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.
299    /// 
300    ///   Permissions Required:
301    ///   - Sales
302    ///
303    pub async fn sales_create_receipt_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
304        let mut path = format!("/sales/v1/receipts");
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 CreateReceipt V2
317    /// 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.
318    /// 
319    ///   Permissions Required:
320    ///   - External Sources(ThirdPartyVendorV2)/Sales (Write)
321    ///   - Industry/Facility Type/Consumer Sales or Industry/Facility Type/Patient Sales or Industry/Facility Type/External Patient Sales or Industry/Facility Type/Caregiver Sales
322    ///   - Industry/Facility Type/Advanced Sales
323    ///   - WebApi Sales Read Write State (All or WriteOnly)
324    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
325    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
326    ///
327    pub async fn sales_create_receipt_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
328        let mut path = format!("/sales/v2/receipts");
329        let mut query_params = Vec::new();
330        if let Some(p) = license_number {
331            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
332        }
333        if !query_params.is_empty() {
334            path.push_str("?");
335            path.push_str(&query_params.join("&"));
336        }
337        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
338    }
339
340    /// POST CreateTransactionByDate V1
341    /// Permissions Required:
342    ///   - Sales
343    ///
344    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>> {
345        let mut path = format!("/sales/v1/transactions/{}", urlencoding::encode(date).as_ref());
346        let mut query_params = Vec::new();
347        if let Some(p) = license_number {
348            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
349        }
350        if !query_params.is_empty() {
351            path.push_str("?");
352            path.push_str(&query_params.join("&"));
353        }
354        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
355    }
356
357    /// DELETE DeleteDelivery V1
358    /// Permissions Required:
359    ///   - Sales Delivery
360    ///
361    pub async fn sales_delete_delivery_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
362        let mut path = format!("/sales/v1/deliveries/{}", urlencoding::encode(id).as_ref());
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::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
372    }
373
374    /// DELETE DeleteDelivery V2
375    /// Voids a sales delivery for a Facility using the provided License Number and delivery Id.
376    /// 
377    ///   Permissions Required:
378    ///   - Manage Sales Delivery
379    ///
380    pub async fn sales_delete_delivery_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
381        let mut path = format!("/sales/v2/deliveries/{}", urlencoding::encode(id).as_ref());
382        let mut query_params = Vec::new();
383        if let Some(p) = license_number {
384            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
385        }
386        if !query_params.is_empty() {
387            path.push_str("?");
388            path.push_str(&query_params.join("&"));
389        }
390        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
391    }
392
393    /// DELETE DeleteDeliveryRetailer V1
394    /// Permissions Required:
395    ///   - Retailer Delivery
396    ///
397    pub async fn sales_delete_delivery_retailer_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
398        let mut path = format!("/sales/v1/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
399        let mut query_params = Vec::new();
400        if let Some(p) = license_number {
401            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
402        }
403        if !query_params.is_empty() {
404            path.push_str("?");
405            path.push_str(&query_params.join("&"));
406        }
407        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
408    }
409
410    /// DELETE DeleteDeliveryRetailer V2
411    /// Voids a retailer delivery for a Facility using the provided License Number and delivery Id.
412    /// 
413    ///   Permissions Required:
414    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
415    ///   - Industry/Facility Type/Retailer Delivery
416    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
417    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
418    ///   - Manage Retailer Delivery
419    ///
420    pub async fn sales_delete_delivery_retailer_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
421        let mut path = format!("/sales/v2/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
422        let mut query_params = Vec::new();
423        if let Some(p) = license_number {
424            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
425        }
426        if !query_params.is_empty() {
427            path.push_str("?");
428            path.push_str(&query_params.join("&"));
429        }
430        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
431    }
432
433    /// DELETE DeleteReceipt V1
434    /// Permissions Required:
435    ///   - Sales
436    ///
437    pub async fn sales_delete_receipt_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
438        let mut path = format!("/sales/v1/receipts/{}", urlencoding::encode(id).as_ref());
439        let mut query_params = Vec::new();
440        if let Some(p) = license_number {
441            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
442        }
443        if !query_params.is_empty() {
444            path.push_str("?");
445            path.push_str(&query_params.join("&"));
446        }
447        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
448    }
449
450    /// DELETE DeleteReceipt V2
451    /// Archives a sales receipt for a Facility using the provided License Number and receipt Id.
452    /// 
453    ///   Permissions Required:
454    ///   - Manage Sales
455    ///
456    pub async fn sales_delete_receipt_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
457        let mut path = format!("/sales/v2/receipts/{}", urlencoding::encode(id).as_ref());
458        let mut query_params = Vec::new();
459        if let Some(p) = license_number {
460            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
461        }
462        if !query_params.is_empty() {
463            path.push_str("?");
464            path.push_str(&query_params.join("&"));
465        }
466        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
467    }
468
469    /// GET GetCounties V1
470    /// Permissions Required:
471    ///   - None
472    ///
473    pub async fn sales_get_counties_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
474        let mut path = format!("/sales/v1/counties");
475        let mut query_params = Vec::new();
476        if let Some(p) = no {
477            query_params.push(format!("No={}", urlencoding::encode(&p)));
478        }
479        if !query_params.is_empty() {
480            path.push_str("?");
481            path.push_str(&query_params.join("&"));
482        }
483        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
484    }
485
486    /// GET GetCounties V2
487    /// Returns a list of counties available for sales deliveries.
488    /// 
489    ///   Permissions Required:
490    ///   - None
491    ///
492    pub async fn sales_get_counties_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
493        let mut path = format!("/sales/v2/counties");
494        let mut query_params = Vec::new();
495        if let Some(p) = no {
496            query_params.push(format!("No={}", urlencoding::encode(&p)));
497        }
498        if !query_params.is_empty() {
499            path.push_str("?");
500            path.push_str(&query_params.join("&"));
501        }
502        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
503    }
504
505    /// GET GetCustomertypes V1
506    /// Permissions Required:
507    ///   - None
508    ///
509    pub async fn sales_get_customertypes_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
510        let mut path = format!("/sales/v1/customertypes");
511        let mut query_params = Vec::new();
512        if let Some(p) = no {
513            query_params.push(format!("No={}", urlencoding::encode(&p)));
514        }
515        if !query_params.is_empty() {
516            path.push_str("?");
517            path.push_str(&query_params.join("&"));
518        }
519        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
520    }
521
522    /// GET GetCustomertypes V2
523    /// Returns a list of customer types.
524    /// 
525    ///   Permissions Required:
526    ///   - None
527    ///
528    pub async fn sales_get_customertypes_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
529        let mut path = format!("/sales/v2/customertypes");
530        let mut query_params = Vec::new();
531        if let Some(p) = no {
532            query_params.push(format!("No={}", urlencoding::encode(&p)));
533        }
534        if !query_params.is_empty() {
535            path.push_str("?");
536            path.push_str(&query_params.join("&"));
537        }
538        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
539    }
540
541    /// GET GetDeliveriesActive V1
542    /// Permissions Required:
543    ///   - Sales Delivery
544    ///
545    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>> {
546        let mut path = format!("/sales/v1/deliveries/active");
547        let mut query_params = Vec::new();
548        if let Some(p) = last_modified_end {
549            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
550        }
551        if let Some(p) = last_modified_start {
552            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
553        }
554        if let Some(p) = license_number {
555            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
556        }
557        if let Some(p) = sales_date_end {
558            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
559        }
560        if let Some(p) = sales_date_start {
561            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
562        }
563        if !query_params.is_empty() {
564            path.push_str("?");
565            path.push_str(&query_params.join("&"));
566        }
567        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
568    }
569
570    /// GET GetDeliveriesActive V2
571    /// Returns a list of active sales deliveries for a Facility, filtered by optional sales or last modified date ranges.
572    /// 
573    ///   Permissions Required:
574    ///   - View Sales Delivery
575    ///   - Manage Sales Delivery
576    ///
577    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>> {
578        let mut path = format!("/sales/v2/deliveries/active");
579        let mut query_params = Vec::new();
580        if let Some(p) = last_modified_end {
581            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
582        }
583        if let Some(p) = last_modified_start {
584            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
585        }
586        if let Some(p) = license_number {
587            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
588        }
589        if let Some(p) = page_number {
590            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
591        }
592        if let Some(p) = page_size {
593            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
594        }
595        if let Some(p) = sales_date_end {
596            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
597        }
598        if let Some(p) = sales_date_start {
599            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
600        }
601        if !query_params.is_empty() {
602            path.push_str("?");
603            path.push_str(&query_params.join("&"));
604        }
605        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
606    }
607
608    /// GET GetDeliveriesInactive V1
609    /// Permissions Required:
610    ///   - Sales Delivery
611    ///
612    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>> {
613        let mut path = format!("/sales/v1/deliveries/inactive");
614        let mut query_params = Vec::new();
615        if let Some(p) = last_modified_end {
616            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
617        }
618        if let Some(p) = last_modified_start {
619            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
620        }
621        if let Some(p) = license_number {
622            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
623        }
624        if let Some(p) = sales_date_end {
625            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
626        }
627        if let Some(p) = sales_date_start {
628            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
629        }
630        if !query_params.is_empty() {
631            path.push_str("?");
632            path.push_str(&query_params.join("&"));
633        }
634        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
635    }
636
637    /// GET GetDeliveriesInactive V2
638    /// Returns a list of inactive sales deliveries for a Facility, filtered by optional sales or last modified date ranges.
639    /// 
640    ///   Permissions Required:
641    ///   - View Sales Delivery
642    ///   - Manage Sales Delivery
643    ///
644    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>> {
645        let mut path = format!("/sales/v2/deliveries/inactive");
646        let mut query_params = Vec::new();
647        if let Some(p) = last_modified_end {
648            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
649        }
650        if let Some(p) = last_modified_start {
651            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
652        }
653        if let Some(p) = license_number {
654            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
655        }
656        if let Some(p) = page_number {
657            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
658        }
659        if let Some(p) = page_size {
660            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
661        }
662        if let Some(p) = sales_date_end {
663            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
664        }
665        if let Some(p) = sales_date_start {
666            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
667        }
668        if !query_params.is_empty() {
669            path.push_str("?");
670            path.push_str(&query_params.join("&"));
671        }
672        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
673    }
674
675    /// GET GetDeliveriesRetailerActive V1
676    /// Permissions Required:
677    ///   - Retailer Delivery
678    ///
679    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>> {
680        let mut path = format!("/sales/v1/deliveries/retailer/active");
681        let mut query_params = Vec::new();
682        if let Some(p) = last_modified_end {
683            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
684        }
685        if let Some(p) = last_modified_start {
686            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
687        }
688        if let Some(p) = license_number {
689            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
690        }
691        if !query_params.is_empty() {
692            path.push_str("?");
693            path.push_str(&query_params.join("&"));
694        }
695        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
696    }
697
698    /// GET GetDeliveriesRetailerActive V2
699    /// Returns a list of active retailer deliveries for a Facility, optionally filtered by last modified date range
700    /// 
701    ///   Permissions Required:
702    ///   - View Retailer Delivery
703    ///   - Manage Retailer Delivery
704    ///
705    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>> {
706        let mut path = format!("/sales/v2/deliveries/retailer/active");
707        let mut query_params = Vec::new();
708        if let Some(p) = last_modified_end {
709            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
710        }
711        if let Some(p) = last_modified_start {
712            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
713        }
714        if let Some(p) = license_number {
715            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
716        }
717        if let Some(p) = page_number {
718            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
719        }
720        if let Some(p) = page_size {
721            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
722        }
723        if !query_params.is_empty() {
724            path.push_str("?");
725            path.push_str(&query_params.join("&"));
726        }
727        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
728    }
729
730    /// GET GetDeliveriesRetailerInactive V1
731    /// Permissions Required:
732    ///   - Retailer Delivery
733    ///
734    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>> {
735        let mut path = format!("/sales/v1/deliveries/retailer/inactive");
736        let mut query_params = Vec::new();
737        if let Some(p) = last_modified_end {
738            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
739        }
740        if let Some(p) = last_modified_start {
741            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
742        }
743        if let Some(p) = license_number {
744            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
745        }
746        if !query_params.is_empty() {
747            path.push_str("?");
748            path.push_str(&query_params.join("&"));
749        }
750        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
751    }
752
753    /// GET GetDeliveriesRetailerInactive V2
754    /// Returns a list of inactive retailer deliveries for a Facility, optionally filtered by last modified date range
755    /// 
756    ///   Permissions Required:
757    ///   - View Retailer Delivery
758    ///   - Manage Retailer Delivery
759    ///
760    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>> {
761        let mut path = format!("/sales/v2/deliveries/retailer/inactive");
762        let mut query_params = Vec::new();
763        if let Some(p) = last_modified_end {
764            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
765        }
766        if let Some(p) = last_modified_start {
767            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
768        }
769        if let Some(p) = license_number {
770            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
771        }
772        if let Some(p) = page_number {
773            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
774        }
775        if let Some(p) = page_size {
776            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
777        }
778        if !query_params.is_empty() {
779            path.push_str("?");
780            path.push_str(&query_params.join("&"));
781        }
782        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
783    }
784
785    /// GET GetDeliveriesReturnreasons V1
786    /// Permissions Required:
787    ///   -
788    ///
789    pub async fn sales_get_deliveries_returnreasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
790        let mut path = format!("/sales/v1/deliveries/returnreasons");
791        let mut query_params = Vec::new();
792        if let Some(p) = license_number {
793            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
794        }
795        if !query_params.is_empty() {
796            path.push_str("?");
797            path.push_str(&query_params.join("&"));
798        }
799        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
800    }
801
802    /// GET GetDeliveriesReturnreasons V2
803    /// Returns a list of return reasons for sales deliveries based on the provided License Number.
804    /// 
805    ///   Permissions Required:
806    ///   - Sales Delivery
807    ///
808    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>> {
809        let mut path = format!("/sales/v2/deliveries/returnreasons");
810        let mut query_params = Vec::new();
811        if let Some(p) = license_number {
812            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
813        }
814        if let Some(p) = page_number {
815            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
816        }
817        if let Some(p) = page_size {
818            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
819        }
820        if !query_params.is_empty() {
821            path.push_str("?");
822            path.push_str(&query_params.join("&"));
823        }
824        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
825    }
826
827    /// GET GetDelivery V1
828    /// Permissions Required:
829    ///   - Sales Delivery
830    ///
831    pub async fn sales_get_delivery_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
832        let mut path = format!("/sales/v1/deliveries/{}", urlencoding::encode(id).as_ref());
833        let mut query_params = Vec::new();
834        if let Some(p) = license_number {
835            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
836        }
837        if !query_params.is_empty() {
838            path.push_str("?");
839            path.push_str(&query_params.join("&"));
840        }
841        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
842    }
843
844    /// GET GetDelivery V2
845    /// Retrieves a sales delivery record by its Id, with an optional License Number.
846    /// 
847    ///   Permissions Required:
848    ///   - View Sales Delivery
849    ///   - Manage Sales Delivery
850    ///
851    pub async fn sales_get_delivery_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
852        let mut path = format!("/sales/v2/deliveries/{}", urlencoding::encode(id).as_ref());
853        let mut query_params = Vec::new();
854        if let Some(p) = license_number {
855            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
856        }
857        if !query_params.is_empty() {
858            path.push_str("?");
859            path.push_str(&query_params.join("&"));
860        }
861        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
862    }
863
864    /// GET GetDeliveryRetailer V1
865    /// Permissions Required:
866    ///   - Retailer Delivery
867    ///
868    pub async fn sales_get_delivery_retailer_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
869        let mut path = format!("/sales/v1/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
870        let mut query_params = Vec::new();
871        if let Some(p) = license_number {
872            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
873        }
874        if !query_params.is_empty() {
875            path.push_str("?");
876            path.push_str(&query_params.join("&"));
877        }
878        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
879    }
880
881    /// GET GetDeliveryRetailer V2
882    /// Retrieves a retailer delivery record by its ID, with an optional License Number.
883    /// 
884    ///   Permissions Required:
885    ///   - View Retailer Delivery
886    ///   - Manage Retailer Delivery
887    ///
888    pub async fn sales_get_delivery_retailer_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
889        let mut path = format!("/sales/v2/deliveries/retailer/{}", urlencoding::encode(id).as_ref());
890        let mut query_params = Vec::new();
891        if let Some(p) = license_number {
892            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
893        }
894        if !query_params.is_empty() {
895            path.push_str("?");
896            path.push_str(&query_params.join("&"));
897        }
898        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
899    }
900
901    /// GET GetPatientRegistrationsLocations V1
902    /// Permissions Required:
903    ///   -
904    ///
905    pub async fn sales_get_patient_registrations_locations_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
906        let mut path = format!("/sales/v1/patientregistration/locations");
907        let mut query_params = Vec::new();
908        if let Some(p) = no {
909            query_params.push(format!("No={}", urlencoding::encode(&p)));
910        }
911        if !query_params.is_empty() {
912            path.push_str("?");
913            path.push_str(&query_params.join("&"));
914        }
915        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
916    }
917
918    /// GET GetPatientRegistrationsLocations V2
919    /// Returns a list of valid Patient registration locations for sales.
920    /// 
921    ///   Permissions Required:
922    ///   -
923    ///
924    pub async fn sales_get_patient_registrations_locations_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
925        let mut path = format!("/sales/v2/patientregistration/locations");
926        let mut query_params = Vec::new();
927        if let Some(p) = no {
928            query_params.push(format!("No={}", urlencoding::encode(&p)));
929        }
930        if !query_params.is_empty() {
931            path.push_str("?");
932            path.push_str(&query_params.join("&"));
933        }
934        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
935    }
936
937    /// GET GetPaymenttypes V1
938    /// Permissions Required:
939    ///   - Sales Delivery
940    ///
941    pub async fn sales_get_paymenttypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
942        let mut path = format!("/sales/v1/paymenttypes");
943        let mut query_params = Vec::new();
944        if let Some(p) = license_number {
945            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
946        }
947        if !query_params.is_empty() {
948            path.push_str("?");
949            path.push_str(&query_params.join("&"));
950        }
951        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
952    }
953
954    /// GET GetPaymenttypes V2
955    /// Returns a list of available payment types for the specified License Number.
956    /// 
957    ///   Permissions Required:
958    ///   - View Sales Delivery
959    ///   - Manage Sales Delivery
960    ///
961    pub async fn sales_get_paymenttypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
962        let mut path = format!("/sales/v2/paymenttypes");
963        let mut query_params = Vec::new();
964        if let Some(p) = license_number {
965            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
966        }
967        if !query_params.is_empty() {
968            path.push_str("?");
969            path.push_str(&query_params.join("&"));
970        }
971        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
972    }
973
974    /// GET GetReceipt V1
975    /// Permissions Required:
976    ///   - Sales
977    ///
978    pub async fn sales_get_receipt_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
979        let mut path = format!("/sales/v1/receipts/{}", urlencoding::encode(id).as_ref());
980        let mut query_params = Vec::new();
981        if let Some(p) = license_number {
982            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
983        }
984        if !query_params.is_empty() {
985            path.push_str("?");
986            path.push_str(&query_params.join("&"));
987        }
988        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
989    }
990
991    /// GET GetReceipt V2
992    /// Retrieves a sales receipt by its Id, with an optional License Number.
993    /// 
994    ///   Permissions Required:
995    ///   - View Sales
996    ///   - Manage Sales
997    ///
998    pub async fn sales_get_receipt_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
999        let mut path = format!("/sales/v2/receipts/{}", urlencoding::encode(id).as_ref());
1000        let mut query_params = Vec::new();
1001        if let Some(p) = license_number {
1002            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1003        }
1004        if !query_params.is_empty() {
1005            path.push_str("?");
1006            path.push_str(&query_params.join("&"));
1007        }
1008        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1009    }
1010
1011    /// GET GetReceiptsActive V1
1012    /// Permissions Required:
1013    ///   - Sales
1014    ///
1015    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>> {
1016        let mut path = format!("/sales/v1/receipts/active");
1017        let mut query_params = Vec::new();
1018        if let Some(p) = last_modified_end {
1019            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1020        }
1021        if let Some(p) = last_modified_start {
1022            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1023        }
1024        if let Some(p) = license_number {
1025            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1026        }
1027        if let Some(p) = sales_date_end {
1028            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
1029        }
1030        if let Some(p) = sales_date_start {
1031            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
1032        }
1033        if !query_params.is_empty() {
1034            path.push_str("?");
1035            path.push_str(&query_params.join("&"));
1036        }
1037        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1038    }
1039
1040    /// GET GetReceiptsActive V2
1041    /// Returns a list of active sales receipts for a Facility, filtered by optional sales or last modified date ranges.
1042    /// 
1043    ///   Permissions Required:
1044    ///   - View Sales
1045    ///   - Manage Sales
1046    ///
1047    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>> {
1048        let mut path = format!("/sales/v2/receipts/active");
1049        let mut query_params = Vec::new();
1050        if let Some(p) = last_modified_end {
1051            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1052        }
1053        if let Some(p) = last_modified_start {
1054            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1055        }
1056        if let Some(p) = license_number {
1057            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1058        }
1059        if let Some(p) = page_number {
1060            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1061        }
1062        if let Some(p) = page_size {
1063            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1064        }
1065        if let Some(p) = sales_date_end {
1066            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
1067        }
1068        if let Some(p) = sales_date_start {
1069            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
1070        }
1071        if !query_params.is_empty() {
1072            path.push_str("?");
1073            path.push_str(&query_params.join("&"));
1074        }
1075        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1076    }
1077
1078    /// GET GetReceiptsExternalByExternalNumber V2
1079    /// Retrieves a Sales Receipt by its external number, with an optional License Number.
1080    /// 
1081    ///   Permissions Required:
1082    ///   - View Sales
1083    ///   - Manage Sales
1084    ///
1085    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>> {
1086        let mut path = format!("/sales/v2/receipts/external/{}", urlencoding::encode(external_number).as_ref());
1087        let mut query_params = Vec::new();
1088        if let Some(p) = license_number {
1089            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1090        }
1091        if !query_params.is_empty() {
1092            path.push_str("?");
1093            path.push_str(&query_params.join("&"));
1094        }
1095        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1096    }
1097
1098    /// GET GetReceiptsInactive V1
1099    /// Permissions Required:
1100    ///   - Sales
1101    ///
1102    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>> {
1103        let mut path = format!("/sales/v1/receipts/inactive");
1104        let mut query_params = Vec::new();
1105        if let Some(p) = last_modified_end {
1106            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1107        }
1108        if let Some(p) = last_modified_start {
1109            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1110        }
1111        if let Some(p) = license_number {
1112            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1113        }
1114        if let Some(p) = sales_date_end {
1115            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
1116        }
1117        if let Some(p) = sales_date_start {
1118            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
1119        }
1120        if !query_params.is_empty() {
1121            path.push_str("?");
1122            path.push_str(&query_params.join("&"));
1123        }
1124        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1125    }
1126
1127    /// GET GetReceiptsInactive V2
1128    /// Returns a list of inactive sales receipts for a Facility, filtered by optional sales or last modified date ranges.
1129    /// 
1130    ///   Permissions Required:
1131    ///   - View Sales
1132    ///   - Manage Sales
1133    ///
1134    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>> {
1135        let mut path = format!("/sales/v2/receipts/inactive");
1136        let mut query_params = Vec::new();
1137        if let Some(p) = last_modified_end {
1138            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1139        }
1140        if let Some(p) = last_modified_start {
1141            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1142        }
1143        if let Some(p) = license_number {
1144            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1145        }
1146        if let Some(p) = page_number {
1147            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1148        }
1149        if let Some(p) = page_size {
1150            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1151        }
1152        if let Some(p) = sales_date_end {
1153            query_params.push(format!("salesDateEnd={}", urlencoding::encode(&p)));
1154        }
1155        if let Some(p) = sales_date_start {
1156            query_params.push(format!("salesDateStart={}", urlencoding::encode(&p)));
1157        }
1158        if !query_params.is_empty() {
1159            path.push_str("?");
1160            path.push_str(&query_params.join("&"));
1161        }
1162        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1163    }
1164
1165    /// GET GetTransactions V1
1166    /// Permissions Required:
1167    ///   - Sales
1168    ///
1169    pub async fn sales_get_transactions_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1170        let mut path = format!("/sales/v1/transactions");
1171        let mut query_params = Vec::new();
1172        if let Some(p) = license_number {
1173            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1174        }
1175        if !query_params.is_empty() {
1176            path.push_str("?");
1177            path.push_str(&query_params.join("&"));
1178        }
1179        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1180    }
1181
1182    /// GET GetTransactionsBySalesDateStartAndSalesDateEnd V1
1183    /// Permissions Required:
1184    ///   - Sales
1185    ///
1186    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>> {
1187        let mut path = format!("/sales/v1/transactions/{}/{}", urlencoding::encode(sales_date_start).as_ref(), urlencoding::encode(sales_date_end).as_ref());
1188        let mut query_params = Vec::new();
1189        if let Some(p) = license_number {
1190            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1191        }
1192        if !query_params.is_empty() {
1193            path.push_str("?");
1194            path.push_str(&query_params.join("&"));
1195        }
1196        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1197    }
1198
1199    /// PUT UpdateDelivery V1
1200    /// 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.
1201    /// 
1202    ///   Permissions Required:
1203    ///   - Sales Delivery
1204    ///
1205    pub async fn sales_update_delivery_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1206        let mut path = format!("/sales/v1/deliveries");
1207        let mut query_params = Vec::new();
1208        if let Some(p) = license_number {
1209            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1210        }
1211        if !query_params.is_empty() {
1212            path.push_str("?");
1213            path.push_str(&query_params.join("&"));
1214        }
1215        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1216    }
1217
1218    /// PUT UpdateDelivery V2
1219    /// 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.
1220    /// 
1221    ///   Permissions Required:
1222    ///   - Manage Sales Delivery
1223    ///
1224    pub async fn sales_update_delivery_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1225        let mut path = format!("/sales/v2/deliveries");
1226        let mut query_params = Vec::new();
1227        if let Some(p) = license_number {
1228            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1229        }
1230        if !query_params.is_empty() {
1231            path.push_str("?");
1232            path.push_str(&query_params.join("&"));
1233        }
1234        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1235    }
1236
1237    /// PUT UpdateDeliveryComplete V1
1238    /// Permissions Required:
1239    ///   - Sales Delivery
1240    ///
1241    pub async fn sales_update_delivery_complete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1242        let mut path = format!("/sales/v1/deliveries/complete");
1243        let mut query_params = Vec::new();
1244        if let Some(p) = license_number {
1245            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1246        }
1247        if !query_params.is_empty() {
1248            path.push_str("?");
1249            path.push_str(&query_params.join("&"));
1250        }
1251        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1252    }
1253
1254    /// PUT UpdateDeliveryComplete V2
1255    /// Completes a list of sales deliveries for a Facility using the provided License Number and delivery data.
1256    /// 
1257    ///   Permissions Required:
1258    ///   - Manage Sales Delivery
1259    ///
1260    pub async fn sales_update_delivery_complete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1261        let mut path = format!("/sales/v2/deliveries/complete");
1262        let mut query_params = Vec::new();
1263        if let Some(p) = license_number {
1264            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1265        }
1266        if !query_params.is_empty() {
1267            path.push_str("?");
1268            path.push_str(&query_params.join("&"));
1269        }
1270        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1271    }
1272
1273    /// PUT UpdateDeliveryHub V1
1274    /// 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.
1275    /// 
1276    ///   Permissions Required:
1277    ///   - Sales Delivery
1278    ///
1279    pub async fn sales_update_delivery_hub_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1280        let mut path = format!("/sales/v1/deliveries/hub");
1281        let mut query_params = Vec::new();
1282        if let Some(p) = license_number {
1283            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1284        }
1285        if !query_params.is_empty() {
1286            path.push_str("?");
1287            path.push_str(&query_params.join("&"));
1288        }
1289        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1290    }
1291
1292    /// PUT UpdateDeliveryHub V2
1293    /// 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.
1294    /// 
1295    ///   Permissions Required:
1296    ///   - Manage Sales Delivery, Manage Sales Delivery Hub
1297    ///
1298    pub async fn sales_update_delivery_hub_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1299        let mut path = format!("/sales/v2/deliveries/hub");
1300        let mut query_params = Vec::new();
1301        if let Some(p) = license_number {
1302            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1303        }
1304        if !query_params.is_empty() {
1305            path.push_str("?");
1306            path.push_str(&query_params.join("&"));
1307        }
1308        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1309    }
1310
1311    /// PUT UpdateDeliveryHubAccept V1
1312    /// Permissions Required:
1313    ///   - Sales
1314    ///
1315    pub async fn sales_update_delivery_hub_accept_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1316        let mut path = format!("/sales/v1/deliveries/hub/accept");
1317        let mut query_params = Vec::new();
1318        if let Some(p) = license_number {
1319            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1320        }
1321        if !query_params.is_empty() {
1322            path.push_str("?");
1323            path.push_str(&query_params.join("&"));
1324        }
1325        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1326    }
1327
1328    /// PUT UpdateDeliveryHubAccept V2
1329    /// Accepts a list of hub sales deliveries for a Facility based on the provided License Number and delivery data.
1330    /// 
1331    ///   Permissions Required:
1332    ///   - Manage Sales Delivery Hub
1333    ///
1334    pub async fn sales_update_delivery_hub_accept_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1335        let mut path = format!("/sales/v2/deliveries/hub/accept");
1336        let mut query_params = Vec::new();
1337        if let Some(p) = license_number {
1338            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1339        }
1340        if !query_params.is_empty() {
1341            path.push_str("?");
1342            path.push_str(&query_params.join("&"));
1343        }
1344        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1345    }
1346
1347    /// PUT UpdateDeliveryHubDepart V1
1348    /// Permissions Required:
1349    ///   - Sales
1350    ///
1351    pub async fn sales_update_delivery_hub_depart_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1352        let mut path = format!("/sales/v1/deliveries/hub/depart");
1353        let mut query_params = Vec::new();
1354        if let Some(p) = license_number {
1355            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1356        }
1357        if !query_params.is_empty() {
1358            path.push_str("?");
1359            path.push_str(&query_params.join("&"));
1360        }
1361        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1362    }
1363
1364    /// PUT UpdateDeliveryHubDepart V2
1365    /// Processes the departure of hub sales deliveries for a Facility using the provided License Number and delivery data.
1366    /// 
1367    ///   Permissions Required:
1368    ///   - Manage Sales Delivery Hub
1369    ///
1370    pub async fn sales_update_delivery_hub_depart_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1371        let mut path = format!("/sales/v2/deliveries/hub/depart");
1372        let mut query_params = Vec::new();
1373        if let Some(p) = license_number {
1374            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1375        }
1376        if !query_params.is_empty() {
1377            path.push_str("?");
1378            path.push_str(&query_params.join("&"));
1379        }
1380        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1381    }
1382
1383    /// PUT UpdateDeliveryHubVerifyID V1
1384    /// Permissions Required:
1385    ///   - Sales
1386    ///
1387    pub async fn sales_update_delivery_hub_verify_id_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1388        let mut path = format!("/sales/v1/deliveries/hub/verifyID");
1389        let mut query_params = Vec::new();
1390        if let Some(p) = license_number {
1391            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1392        }
1393        if !query_params.is_empty() {
1394            path.push_str("?");
1395            path.push_str(&query_params.join("&"));
1396        }
1397        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1398    }
1399
1400    /// PUT UpdateDeliveryHubVerifyID V2
1401    /// Verifies identification for a list of hub sales deliveries using the provided License Number and delivery data.
1402    /// 
1403    ///   Permissions Required:
1404    ///   - Manage Sales Delivery Hub
1405    ///
1406    pub async fn sales_update_delivery_hub_verify_id_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1407        let mut path = format!("/sales/v2/deliveries/hub/verifyID");
1408        let mut query_params = Vec::new();
1409        if let Some(p) = license_number {
1410            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1411        }
1412        if !query_params.is_empty() {
1413            path.push_str("?");
1414            path.push_str(&query_params.join("&"));
1415        }
1416        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1417    }
1418
1419    /// PUT UpdateDeliveryRetailer V1
1420    /// 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.
1421    /// 
1422    ///   Permissions Required:
1423    ///   - Retailer Delivery
1424    ///
1425    pub async fn sales_update_delivery_retailer_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1426        let mut path = format!("/sales/v1/deliveries/retailer");
1427        let mut query_params = Vec::new();
1428        if let Some(p) = license_number {
1429            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1430        }
1431        if !query_params.is_empty() {
1432            path.push_str("?");
1433            path.push_str(&query_params.join("&"));
1434        }
1435        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1436    }
1437
1438    /// PUT UpdateDeliveryRetailer V2
1439    /// 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.
1440    /// 
1441    ///   Permissions Required:
1442    ///   - External Sources(ThirdPartyVendorV2)/Sales Deliveries(Write)
1443    ///   - Industry/Facility Type/Retailer Delivery
1444    ///   - Industry/Facility Type/Consumer Sales Delivery or Industry/Facility Type/Patient Sales Delivery
1445    ///   - WebApi Sales Deliveries Read Write State (All or WriteOnly)
1446    ///   - WebApi Retail ID Read Write State (All or WriteOnly) - Required for RID only.
1447    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write) - Required for RID only.
1448    ///   - Manage Retailer Delivery
1449    ///
1450    pub async fn sales_update_delivery_retailer_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1451        let mut path = format!("/sales/v2/deliveries/retailer");
1452        let mut query_params = Vec::new();
1453        if let Some(p) = license_number {
1454            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1455        }
1456        if !query_params.is_empty() {
1457            path.push_str("?");
1458            path.push_str(&query_params.join("&"));
1459        }
1460        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1461    }
1462
1463    /// PUT UpdateReceipt V1
1464    /// 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.
1465    /// 
1466    ///   Permissions Required:
1467    ///   - Sales
1468    ///
1469    pub async fn sales_update_receipt_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1470        let mut path = format!("/sales/v1/receipts");
1471        let mut query_params = Vec::new();
1472        if let Some(p) = license_number {
1473            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1474        }
1475        if !query_params.is_empty() {
1476            path.push_str("?");
1477            path.push_str(&query_params.join("&"));
1478        }
1479        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1480    }
1481
1482    /// PUT UpdateReceipt V2
1483    /// 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.
1484    /// 
1485    ///   Permissions Required:
1486    ///   - Manage Sales
1487    ///
1488    pub async fn sales_update_receipt_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1489        let mut path = format!("/sales/v2/receipts");
1490        let mut query_params = Vec::new();
1491        if let Some(p) = license_number {
1492            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1493        }
1494        if !query_params.is_empty() {
1495            path.push_str("?");
1496            path.push_str(&query_params.join("&"));
1497        }
1498        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1499    }
1500
1501    /// PUT UpdateReceiptFinalize V2
1502    /// Finalizes a list of sales receipts for a Facility using the provided License Number and receipt data.
1503    /// 
1504    ///   Permissions Required:
1505    ///   - Manage Sales
1506    ///
1507    pub async fn sales_update_receipt_finalize_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1508        let mut path = format!("/sales/v2/receipts/finalize");
1509        let mut query_params = Vec::new();
1510        if let Some(p) = license_number {
1511            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1512        }
1513        if !query_params.is_empty() {
1514            path.push_str("?");
1515            path.push_str(&query_params.join("&"));
1516        }
1517        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1518    }
1519
1520    /// PUT UpdateReceiptUnfinalize V2
1521    /// Unfinalizes a list of sales receipts for a Facility using the provided License Number and receipt data.
1522    /// 
1523    ///   Permissions Required:
1524    ///   - Manage Sales
1525    ///
1526    pub async fn sales_update_receipt_unfinalize_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1527        let mut path = format!("/sales/v2/receipts/unfinalize");
1528        let mut query_params = Vec::new();
1529        if let Some(p) = license_number {
1530            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1531        }
1532        if !query_params.is_empty() {
1533            path.push_str("?");
1534            path.push_str(&query_params.join("&"));
1535        }
1536        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1537    }
1538
1539    /// PUT UpdateTransactionByDate V1
1540    /// Permissions Required:
1541    ///   - Sales
1542    ///
1543    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>> {
1544        let mut path = format!("/sales/v1/transactions/{}", urlencoding::encode(date).as_ref());
1545        let mut query_params = Vec::new();
1546        if let Some(p) = license_number {
1547            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1548        }
1549        if !query_params.is_empty() {
1550            path.push_str("?");
1551            path.push_str(&query_params.join("&"));
1552        }
1553        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1554    }
1555
1556    /// POST Create V1
1557    /// Permissions Required:
1558    ///   - Manage Strains
1559    ///
1560    pub async fn strains_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1561        let mut path = format!("/strains/v1/create");
1562        let mut query_params = Vec::new();
1563        if let Some(p) = license_number {
1564            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1565        }
1566        if !query_params.is_empty() {
1567            path.push_str("?");
1568            path.push_str(&query_params.join("&"));
1569        }
1570        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1571    }
1572
1573    /// POST Create V2
1574    /// Creates new strain records for a specified Facility.
1575    /// 
1576    ///   Permissions Required:
1577    ///   - Manage Strains
1578    ///
1579    pub async fn strains_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1580        let mut path = format!("/strains/v2");
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 CreateUpdate V1
1593    /// Permissions Required:
1594    ///   - Manage Strains
1595    ///
1596    pub async fn strains_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1597        let mut path = format!("/strains/v1/update");
1598        let mut query_params = Vec::new();
1599        if let Some(p) = license_number {
1600            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1601        }
1602        if !query_params.is_empty() {
1603            path.push_str("?");
1604            path.push_str(&query_params.join("&"));
1605        }
1606        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1607    }
1608
1609    /// DELETE Delete V1
1610    /// Permissions Required:
1611    ///   - Manage Strains
1612    ///
1613    pub async fn strains_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1614        let mut path = format!("/strains/v1/{}", urlencoding::encode(id).as_ref());
1615        let mut query_params = Vec::new();
1616        if let Some(p) = license_number {
1617            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1618        }
1619        if !query_params.is_empty() {
1620            path.push_str("?");
1621            path.push_str(&query_params.join("&"));
1622        }
1623        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1624    }
1625
1626    /// DELETE Delete V2
1627    /// Archives an existing strain record for a Facility
1628    /// 
1629    ///   Permissions Required:
1630    ///   - Manage Strains
1631    ///
1632    pub async fn strains_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1633        let mut path = format!("/strains/v2/{}", urlencoding::encode(id).as_ref());
1634        let mut query_params = Vec::new();
1635        if let Some(p) = license_number {
1636            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1637        }
1638        if !query_params.is_empty() {
1639            path.push_str("?");
1640            path.push_str(&query_params.join("&"));
1641        }
1642        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1643    }
1644
1645    /// GET Get V1
1646    /// Permissions Required:
1647    ///   - Manage Strains
1648    ///
1649    pub async fn strains_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1650        let mut path = format!("/strains/v1/{}", urlencoding::encode(id).as_ref());
1651        let mut query_params = Vec::new();
1652        if let Some(p) = license_number {
1653            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1654        }
1655        if !query_params.is_empty() {
1656            path.push_str("?");
1657            path.push_str(&query_params.join("&"));
1658        }
1659        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1660    }
1661
1662    /// GET Get V2
1663    /// Retrieves a Strain record by its Id, with an optional license number.
1664    /// 
1665    ///   Permissions Required:
1666    ///   - Manage Strains
1667    ///
1668    pub async fn strains_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1669        let mut path = format!("/strains/v2/{}", urlencoding::encode(id).as_ref());
1670        let mut query_params = Vec::new();
1671        if let Some(p) = license_number {
1672            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1673        }
1674        if !query_params.is_empty() {
1675            path.push_str("?");
1676            path.push_str(&query_params.join("&"));
1677        }
1678        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1679    }
1680
1681    /// GET GetActive V1
1682    /// Permissions Required:
1683    ///   - Manage Strains
1684    ///
1685    pub async fn strains_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1686        let mut path = format!("/strains/v1/active");
1687        let mut query_params = Vec::new();
1688        if let Some(p) = license_number {
1689            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1690        }
1691        if !query_params.is_empty() {
1692            path.push_str("?");
1693            path.push_str(&query_params.join("&"));
1694        }
1695        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1696    }
1697
1698    /// GET GetActive V2
1699    /// Retrieves a list of active strains for the current Facility, optionally filtered by last modified date range.
1700    /// 
1701    ///   Permissions Required:
1702    ///   - Manage Strains
1703    ///
1704    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>> {
1705        let mut path = format!("/strains/v2/active");
1706        let mut query_params = Vec::new();
1707        if let Some(p) = last_modified_end {
1708            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
1709        }
1710        if let Some(p) = last_modified_start {
1711            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
1712        }
1713        if let Some(p) = license_number {
1714            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1715        }
1716        if let Some(p) = page_number {
1717            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1718        }
1719        if let Some(p) = page_size {
1720            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1721        }
1722        if !query_params.is_empty() {
1723            path.push_str("?");
1724            path.push_str(&query_params.join("&"));
1725        }
1726        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1727    }
1728
1729    /// GET GetInactive V2
1730    /// Retrieves a list of inactive strains for the current Facility, optionally filtered by last modified date range.
1731    /// 
1732    ///   Permissions Required:
1733    ///   - Manage Strains
1734    ///
1735    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>> {
1736        let mut path = format!("/strains/v2/inactive");
1737        let mut query_params = Vec::new();
1738        if let Some(p) = license_number {
1739            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1740        }
1741        if let Some(p) = page_number {
1742            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
1743        }
1744        if let Some(p) = page_size {
1745            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
1746        }
1747        if !query_params.is_empty() {
1748            path.push_str("?");
1749            path.push_str(&query_params.join("&"));
1750        }
1751        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1752    }
1753
1754    /// PUT Update V2
1755    /// Updates existing strain records for a specified Facility.
1756    /// 
1757    ///   Permissions Required:
1758    ///   - Manage Strains
1759    ///
1760    pub async fn strains_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1761        let mut path = format!("/strains/v2");
1762        let mut query_params = Vec::new();
1763        if let Some(p) = license_number {
1764            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1765        }
1766        if !query_params.is_empty() {
1767            path.push_str("?");
1768            path.push_str(&query_params.join("&"));
1769        }
1770        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1771    }
1772
1773    /// GET GetPackageAvailable V2
1774    /// Returns a list of available package tags. NOTE: This is a premium endpoint.
1775    /// 
1776    ///   Permissions Required:
1777    ///   - Manage Tags
1778    ///
1779    pub async fn tags_get_package_available_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1780        let mut path = format!("/tags/v2/package/available");
1781        let mut query_params = Vec::new();
1782        if let Some(p) = license_number {
1783            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1784        }
1785        if !query_params.is_empty() {
1786            path.push_str("?");
1787            path.push_str(&query_params.join("&"));
1788        }
1789        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1790    }
1791
1792    /// GET GetPlantAvailable V2
1793    /// Returns a list of available plant tags. NOTE: This is a premium endpoint.
1794    /// 
1795    ///   Permissions Required:
1796    ///   - Manage Tags
1797    ///
1798    pub async fn tags_get_plant_available_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1799        let mut path = format!("/tags/v2/plant/available");
1800        let mut query_params = Vec::new();
1801        if let Some(p) = license_number {
1802            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1803        }
1804        if !query_params.is_empty() {
1805            path.push_str("?");
1806            path.push_str(&query_params.join("&"));
1807        }
1808        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1809    }
1810
1811    /// GET GetStaged V2
1812    /// Returns a list of staged tags. NOTE: This is a premium endpoint.
1813    /// 
1814    ///   Permissions Required:
1815    ///   - Manage Tags
1816    ///   - RetailId.AllowPackageStaging Key Value enabled
1817    ///
1818    pub async fn tags_get_staged_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1819        let mut path = format!("/tags/v2/staged");
1820        let mut query_params = Vec::new();
1821        if let Some(p) = license_number {
1822            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1823        }
1824        if !query_params.is_empty() {
1825            path.push_str("?");
1826            path.push_str(&query_params.join("&"));
1827        }
1828        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1829    }
1830
1831    /// POST CreateExternalIncoming V1
1832    /// Permissions Required:
1833    ///   - Transfers
1834    ///
1835    pub async fn transfers_create_external_incoming_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1836        let mut path = format!("/transfers/v1/external/incoming");
1837        let mut query_params = Vec::new();
1838        if let Some(p) = license_number {
1839            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1840        }
1841        if !query_params.is_empty() {
1842            path.push_str("?");
1843            path.push_str(&query_params.join("&"));
1844        }
1845        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1846    }
1847
1848    /// POST CreateExternalIncoming V2
1849    /// Creates external incoming shipment plans for a Facility.
1850    /// 
1851    ///   Permissions Required:
1852    ///   - Manage Transfers
1853    ///
1854    pub async fn transfers_create_external_incoming_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1855        let mut path = format!("/transfers/v2/external/incoming");
1856        let mut query_params = Vec::new();
1857        if let Some(p) = license_number {
1858            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1859        }
1860        if !query_params.is_empty() {
1861            path.push_str("?");
1862            path.push_str(&query_params.join("&"));
1863        }
1864        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1865    }
1866
1867    /// POST CreateTemplates V1
1868    /// Permissions Required:
1869    ///   - Transfer Templates
1870    ///
1871    pub async fn transfers_create_templates_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1872        let mut path = format!("/transfers/v1/templates");
1873        let mut query_params = Vec::new();
1874        if let Some(p) = license_number {
1875            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1876        }
1877        if !query_params.is_empty() {
1878            path.push_str("?");
1879            path.push_str(&query_params.join("&"));
1880        }
1881        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1882    }
1883
1884    /// POST CreateTemplatesOutgoing V2
1885    /// Creates new transfer templates for a Facility.
1886    /// 
1887    ///   Permissions Required:
1888    ///   - Manage Transfer Templates
1889    ///
1890    pub async fn transfers_create_templates_outgoing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1891        let mut path = format!("/transfers/v2/templates/outgoing");
1892        let mut query_params = Vec::new();
1893        if let Some(p) = license_number {
1894            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1895        }
1896        if !query_params.is_empty() {
1897            path.push_str("?");
1898            path.push_str(&query_params.join("&"));
1899        }
1900        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1901    }
1902
1903    /// DELETE DeleteExternalIncoming V1
1904    /// Permissions Required:
1905    ///   - Transfers
1906    ///
1907    pub async fn transfers_delete_external_incoming_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1908        let mut path = format!("/transfers/v1/external/incoming/{}", urlencoding::encode(id).as_ref());
1909        let mut query_params = Vec::new();
1910        if let Some(p) = license_number {
1911            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1912        }
1913        if !query_params.is_empty() {
1914            path.push_str("?");
1915            path.push_str(&query_params.join("&"));
1916        }
1917        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1918    }
1919
1920    /// DELETE DeleteExternalIncoming V2
1921    /// Voids an external incoming shipment plan for a Facility.
1922    /// 
1923    ///   Permissions Required:
1924    ///   - Manage Transfers
1925    ///
1926    pub async fn transfers_delete_external_incoming_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1927        let mut path = format!("/transfers/v2/external/incoming/{}", urlencoding::encode(id).as_ref());
1928        let mut query_params = Vec::new();
1929        if let Some(p) = license_number {
1930            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1931        }
1932        if !query_params.is_empty() {
1933            path.push_str("?");
1934            path.push_str(&query_params.join("&"));
1935        }
1936        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1937    }
1938
1939    /// DELETE DeleteTemplates V1
1940    /// Permissions Required:
1941    ///   - Transfer Templates
1942    ///
1943    pub async fn transfers_delete_templates_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1944        let mut path = format!("/transfers/v1/templates/{}", urlencoding::encode(id).as_ref());
1945        let mut query_params = Vec::new();
1946        if let Some(p) = license_number {
1947            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
1948        }
1949        if !query_params.is_empty() {
1950            path.push_str("?");
1951            path.push_str(&query_params.join("&"));
1952        }
1953        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1954    }
1955
1956    /// DELETE DeleteTemplatesOutgoing V2
1957    /// Archives a transfer template for a Facility.
1958    /// 
1959    ///   Permissions Required:
1960    ///   - Manage Transfer Templates
1961    ///
1962    pub async fn transfers_delete_templates_outgoing_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1963        let mut path = format!("/transfers/v2/templates/outgoing/{}", urlencoding::encode(id).as_ref());
1964        let mut query_params = Vec::new();
1965        if let Some(p) = license_number {
1966            query_params.push(format!("licenseNumber={}", 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::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1973    }
1974
1975    /// GET GetDeliveriesPackagesStates V1
1976    /// Permissions Required:
1977    ///   - None
1978    ///
1979    pub async fn transfers_get_deliveries_packages_states_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1980        let mut path = format!("/transfers/v1/deliveries/packages/states");
1981        let mut query_params = Vec::new();
1982        if let Some(p) = no {
1983            query_params.push(format!("No={}", urlencoding::encode(&p)));
1984        }
1985        if !query_params.is_empty() {
1986            path.push_str("?");
1987            path.push_str(&query_params.join("&"));
1988        }
1989        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
1990    }
1991
1992    /// GET GetDeliveriesPackagesStates V2
1993    /// Returns a list of available shipment Package states.
1994    /// 
1995    ///   Permissions Required:
1996    ///   - None
1997    ///
1998    pub async fn transfers_get_deliveries_packages_states_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
1999        let mut path = format!("/transfers/v2/deliveries/packages/states");
2000        let mut query_params = Vec::new();
2001        if let Some(p) = no {
2002            query_params.push(format!("No={}", urlencoding::encode(&p)));
2003        }
2004        if !query_params.is_empty() {
2005            path.push_str("?");
2006            path.push_str(&query_params.join("&"));
2007        }
2008        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2009    }
2010
2011    /// GET GetDelivery V1
2012    /// Please note: that the {id} parameter above represents a Shipment Plan ID.
2013    /// 
2014    ///   Permissions Required:
2015    ///   - Transfers
2016    ///
2017    pub async fn transfers_get_delivery_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2018        let mut path = format!("/transfers/v1/{}/deliveries", urlencoding::encode(id).as_ref());
2019        let mut query_params = Vec::new();
2020        if let Some(p) = no {
2021            query_params.push(format!("No={}", urlencoding::encode(&p)));
2022        }
2023        if !query_params.is_empty() {
2024            path.push_str("?");
2025            path.push_str(&query_params.join("&"));
2026        }
2027        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2028    }
2029
2030    /// GET GetDelivery V2
2031    /// Retrieves a list of shipment deliveries for a given Transfer Id. Please note: The {id} parameter above represents a Transfer Id.
2032    /// 
2033    ///   Permissions Required:
2034    ///   - Manage Transfers
2035    ///   - View Transfers
2036    ///
2037    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>> {
2038        let mut path = format!("/transfers/v2/{}/deliveries", urlencoding::encode(id).as_ref());
2039        let mut query_params = Vec::new();
2040        if let Some(p) = page_number {
2041            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2042        }
2043        if let Some(p) = page_size {
2044            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2045        }
2046        if !query_params.is_empty() {
2047            path.push_str("?");
2048            path.push_str(&query_params.join("&"));
2049        }
2050        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2051    }
2052
2053    /// GET GetDeliveryPackage V1
2054    /// Please note: The {id} parameter above represents a Transfer Delivery ID, not a Manifest Number.
2055    /// 
2056    ///   Permissions Required:
2057    ///   - Transfers
2058    ///
2059    pub async fn transfers_get_delivery_package_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2060        let mut path = format!("/transfers/v1/deliveries/{}/packages", urlencoding::encode(id).as_ref());
2061        let mut query_params = Vec::new();
2062        if let Some(p) = no {
2063            query_params.push(format!("No={}", urlencoding::encode(&p)));
2064        }
2065        if !query_params.is_empty() {
2066            path.push_str("?");
2067            path.push_str(&query_params.join("&"));
2068        }
2069        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2070    }
2071
2072    /// GET GetDeliveryPackage V2
2073    /// 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.
2074    /// 
2075    ///   Permissions Required:
2076    ///   - Manage Transfers
2077    ///   - View Transfers
2078    ///
2079    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>> {
2080        let mut path = format!("/transfers/v2/deliveries/{}/packages", urlencoding::encode(id).as_ref());
2081        let mut query_params = Vec::new();
2082        if let Some(p) = page_number {
2083            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2084        }
2085        if let Some(p) = page_size {
2086            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2087        }
2088        if !query_params.is_empty() {
2089            path.push_str("?");
2090            path.push_str(&query_params.join("&"));
2091        }
2092        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2093    }
2094
2095    /// GET GetDeliveryPackageRequiredlabtestbatches V1
2096    /// Please note: The {id} parameter above represents a Transfer Delivery Package ID, not a Manifest Number.
2097    /// 
2098    ///   Permissions Required:
2099    ///   - Transfers
2100    ///
2101    pub async fn transfers_get_delivery_package_requiredlabtestbatches_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2102        let mut path = format!("/transfers/v1/deliveries/package/{}/requiredlabtestbatches", urlencoding::encode(id).as_ref());
2103        let mut query_params = Vec::new();
2104        if let Some(p) = no {
2105            query_params.push(format!("No={}", urlencoding::encode(&p)));
2106        }
2107        if !query_params.is_empty() {
2108            path.push_str("?");
2109            path.push_str(&query_params.join("&"));
2110        }
2111        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2112    }
2113
2114    /// GET GetDeliveryPackageRequiredlabtestbatches V2
2115    /// 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.
2116    /// 
2117    ///   Permissions Required:
2118    ///   - Manage Transfers
2119    ///   - View Transfers
2120    ///
2121    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>> {
2122        let mut path = format!("/transfers/v2/deliveries/package/{}/requiredlabtestbatches", urlencoding::encode(id).as_ref());
2123        let mut query_params = Vec::new();
2124        if let Some(p) = page_number {
2125            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2126        }
2127        if let Some(p) = page_size {
2128            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2129        }
2130        if !query_params.is_empty() {
2131            path.push_str("?");
2132            path.push_str(&query_params.join("&"));
2133        }
2134        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2135    }
2136
2137    /// GET GetDeliveryPackageWholesale V1
2138    /// Please note: The {id} parameter above represents a Transfer Delivery ID, not a Manifest Number.
2139    /// 
2140    ///   Permissions Required:
2141    ///   - Transfers
2142    ///
2143    pub async fn transfers_get_delivery_package_wholesale_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2144        let mut path = format!("/transfers/v1/deliveries/{}/packages/wholesale", urlencoding::encode(id).as_ref());
2145        let mut query_params = Vec::new();
2146        if let Some(p) = no {
2147            query_params.push(format!("No={}", urlencoding::encode(&p)));
2148        }
2149        if !query_params.is_empty() {
2150            path.push_str("?");
2151            path.push_str(&query_params.join("&"));
2152        }
2153        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2154    }
2155
2156    /// GET GetDeliveryPackageWholesale V2
2157    /// 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.
2158    /// 
2159    ///   Permissions Required:
2160    ///   - Manage Transfers
2161    ///   - View Transfers
2162    ///
2163    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>> {
2164        let mut path = format!("/transfers/v2/deliveries/{}/packages/wholesale", urlencoding::encode(id).as_ref());
2165        let mut query_params = Vec::new();
2166        if let Some(p) = page_number {
2167            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2168        }
2169        if let Some(p) = page_size {
2170            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2171        }
2172        if !query_params.is_empty() {
2173            path.push_str("?");
2174            path.push_str(&query_params.join("&"));
2175        }
2176        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2177    }
2178
2179    /// GET GetDeliveryTransporters V1
2180    /// Please note: that the {id} parameter above represents a Shipment Delivery ID.
2181    /// 
2182    ///   Permissions Required:
2183    ///   - Transfers
2184    ///
2185    pub async fn transfers_get_delivery_transporters_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2186        let mut path = format!("/transfers/v1/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
2187        let mut query_params = Vec::new();
2188        if let Some(p) = no {
2189            query_params.push(format!("No={}", urlencoding::encode(&p)));
2190        }
2191        if !query_params.is_empty() {
2192            path.push_str("?");
2193            path.push_str(&query_params.join("&"));
2194        }
2195        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2196    }
2197
2198    /// GET GetDeliveryTransporters V2
2199    /// 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.
2200    /// 
2201    ///   Permissions Required:
2202    ///   - Manage Transfers
2203    ///   - View Transfers
2204    ///
2205    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>> {
2206        let mut path = format!("/transfers/v2/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
2207        let mut query_params = Vec::new();
2208        if let Some(p) = page_number {
2209            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2210        }
2211        if let Some(p) = page_size {
2212            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2213        }
2214        if !query_params.is_empty() {
2215            path.push_str("?");
2216            path.push_str(&query_params.join("&"));
2217        }
2218        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2219    }
2220
2221    /// GET GetDeliveryTransportersDetails V1
2222    /// Please note: The {id} parameter above represents a Shipment Delivery ID.
2223    /// 
2224    ///   Permissions Required:
2225    ///   - Transfers
2226    ///
2227    pub async fn transfers_get_delivery_transporters_details_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2228        let mut path = format!("/transfers/v1/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
2229        let mut query_params = Vec::new();
2230        if let Some(p) = no {
2231            query_params.push(format!("No={}", urlencoding::encode(&p)));
2232        }
2233        if !query_params.is_empty() {
2234            path.push_str("?");
2235            path.push_str(&query_params.join("&"));
2236        }
2237        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2238    }
2239
2240    /// GET GetDeliveryTransportersDetails V2
2241    /// 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.
2242    /// 
2243    ///   Permissions Required:
2244    ///   - Manage Transfers
2245    ///   - View Transfers
2246    ///
2247    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>> {
2248        let mut path = format!("/transfers/v2/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
2249        let mut query_params = Vec::new();
2250        if let Some(p) = page_number {
2251            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2252        }
2253        if let Some(p) = page_size {
2254            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2255        }
2256        if !query_params.is_empty() {
2257            path.push_str("?");
2258            path.push_str(&query_params.join("&"));
2259        }
2260        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2261    }
2262
2263    /// GET GetHub V2
2264    /// Retrieves a list of transfer hub shipments for a Facility, filtered by either last modified or estimated arrival date range.
2265    /// 
2266    ///   Permissions Required:
2267    ///   - Manage Transfers
2268    ///   - View Transfers
2269    ///
2270    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>> {
2271        let mut path = format!("/transfers/v2/hub");
2272        let mut query_params = Vec::new();
2273        if let Some(p) = estimated_arrival_end {
2274            query_params.push(format!("estimatedArrivalEnd={}", urlencoding::encode(&p)));
2275        }
2276        if let Some(p) = estimated_arrival_start {
2277            query_params.push(format!("estimatedArrivalStart={}", urlencoding::encode(&p)));
2278        }
2279        if let Some(p) = last_modified_end {
2280            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2281        }
2282        if let Some(p) = last_modified_start {
2283            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2284        }
2285        if let Some(p) = license_number {
2286            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2287        }
2288        if let Some(p) = page_number {
2289            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2290        }
2291        if let Some(p) = page_size {
2292            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2293        }
2294        if !query_params.is_empty() {
2295            path.push_str("?");
2296            path.push_str(&query_params.join("&"));
2297        }
2298        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2299    }
2300
2301    /// GET GetIncoming V1
2302    /// Permissions Required:
2303    ///   - Transfers
2304    ///
2305    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>> {
2306        let mut path = format!("/transfers/v1/incoming");
2307        let mut query_params = Vec::new();
2308        if let Some(p) = last_modified_end {
2309            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2310        }
2311        if let Some(p) = last_modified_start {
2312            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2313        }
2314        if let Some(p) = license_number {
2315            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2316        }
2317        if !query_params.is_empty() {
2318            path.push_str("?");
2319            path.push_str(&query_params.join("&"));
2320        }
2321        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2322    }
2323
2324    /// GET GetIncoming V2
2325    /// Retrieves a list of incoming shipments for a Facility, optionally filtered by last modified date range.
2326    /// 
2327    ///   Permissions Required:
2328    ///   - Manage Transfers
2329    ///   - View Transfers
2330    ///
2331    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>> {
2332        let mut path = format!("/transfers/v2/incoming");
2333        let mut query_params = Vec::new();
2334        if let Some(p) = last_modified_end {
2335            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2336        }
2337        if let Some(p) = last_modified_start {
2338            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2339        }
2340        if let Some(p) = license_number {
2341            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2342        }
2343        if let Some(p) = page_number {
2344            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2345        }
2346        if let Some(p) = page_size {
2347            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2348        }
2349        if !query_params.is_empty() {
2350            path.push_str("?");
2351            path.push_str(&query_params.join("&"));
2352        }
2353        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2354    }
2355
2356    /// GET GetOutgoing V1
2357    /// Permissions Required:
2358    ///   - Transfers
2359    ///
2360    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>> {
2361        let mut path = format!("/transfers/v1/outgoing");
2362        let mut query_params = Vec::new();
2363        if let Some(p) = last_modified_end {
2364            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2365        }
2366        if let Some(p) = last_modified_start {
2367            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2368        }
2369        if let Some(p) = license_number {
2370            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2371        }
2372        if !query_params.is_empty() {
2373            path.push_str("?");
2374            path.push_str(&query_params.join("&"));
2375        }
2376        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2377    }
2378
2379    /// GET GetOutgoing V2
2380    /// Retrieves a list of outgoing shipments for a Facility, optionally filtered by last modified date range.
2381    /// 
2382    ///   Permissions Required:
2383    ///   - Manage Transfers
2384    ///   - View Transfers
2385    ///
2386    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>> {
2387        let mut path = format!("/transfers/v2/outgoing");
2388        let mut query_params = Vec::new();
2389        if let Some(p) = last_modified_end {
2390            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2391        }
2392        if let Some(p) = last_modified_start {
2393            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2394        }
2395        if let Some(p) = license_number {
2396            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2397        }
2398        if let Some(p) = page_number {
2399            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2400        }
2401        if let Some(p) = page_size {
2402            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2403        }
2404        if !query_params.is_empty() {
2405            path.push_str("?");
2406            path.push_str(&query_params.join("&"));
2407        }
2408        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2409    }
2410
2411    /// GET GetRejected V1
2412    /// Permissions Required:
2413    ///   - Transfers
2414    ///
2415    pub async fn transfers_get_rejected_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2416        let mut path = format!("/transfers/v1/rejected");
2417        let mut query_params = Vec::new();
2418        if let Some(p) = license_number {
2419            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2420        }
2421        if !query_params.is_empty() {
2422            path.push_str("?");
2423            path.push_str(&query_params.join("&"));
2424        }
2425        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2426    }
2427
2428    /// GET GetRejected V2
2429    /// Retrieves a list of shipments with rejected packages for a Facility.
2430    /// 
2431    ///   Permissions Required:
2432    ///   - Manage Transfers
2433    ///   - View Transfers
2434    ///
2435    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>> {
2436        let mut path = format!("/transfers/v2/rejected");
2437        let mut query_params = Vec::new();
2438        if let Some(p) = license_number {
2439            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2440        }
2441        if let Some(p) = page_number {
2442            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2443        }
2444        if let Some(p) = page_size {
2445            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2446        }
2447        if !query_params.is_empty() {
2448            path.push_str("?");
2449            path.push_str(&query_params.join("&"));
2450        }
2451        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2452    }
2453
2454    /// GET GetTemplates V1
2455    /// Permissions Required:
2456    ///   - Transfer Templates
2457    ///
2458    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>> {
2459        let mut path = format!("/transfers/v1/templates");
2460        let mut query_params = Vec::new();
2461        if let Some(p) = last_modified_end {
2462            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2463        }
2464        if let Some(p) = last_modified_start {
2465            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2466        }
2467        if let Some(p) = license_number {
2468            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2469        }
2470        if !query_params.is_empty() {
2471            path.push_str("?");
2472            path.push_str(&query_params.join("&"));
2473        }
2474        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2475    }
2476
2477    /// GET GetTemplatesDelivery V1
2478    /// Permissions Required:
2479    ///   - Transfer Templates
2480    ///
2481    pub async fn transfers_get_templates_delivery_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2482        let mut path = format!("/transfers/v1/templates/{}/deliveries", urlencoding::encode(id).as_ref());
2483        let mut query_params = Vec::new();
2484        if let Some(p) = no {
2485            query_params.push(format!("No={}", urlencoding::encode(&p)));
2486        }
2487        if !query_params.is_empty() {
2488            path.push_str("?");
2489            path.push_str(&query_params.join("&"));
2490        }
2491        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2492    }
2493
2494    /// GET GetTemplatesDeliveryPackage V1
2495    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
2496    /// 
2497    ///   Permissions Required:
2498    ///   - Transfers
2499    ///
2500    pub async fn transfers_get_templates_delivery_package_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2501        let mut path = format!("/transfers/v1/templates/deliveries/{}/packages", urlencoding::encode(id).as_ref());
2502        let mut query_params = Vec::new();
2503        if let Some(p) = no {
2504            query_params.push(format!("No={}", urlencoding::encode(&p)));
2505        }
2506        if !query_params.is_empty() {
2507            path.push_str("?");
2508            path.push_str(&query_params.join("&"));
2509        }
2510        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2511    }
2512
2513    /// GET GetTemplatesDeliveryTransporters V1
2514    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
2515    /// 
2516    ///   Permissions Required:
2517    ///   - Transfer Templates
2518    ///
2519    pub async fn transfers_get_templates_delivery_transporters_v1(&self, id: &str, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2520        let mut path = format!("/transfers/v1/templates/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
2521        let mut query_params = Vec::new();
2522        if let Some(p) = no {
2523            query_params.push(format!("No={}", urlencoding::encode(&p)));
2524        }
2525        if !query_params.is_empty() {
2526            path.push_str("?");
2527            path.push_str(&query_params.join("&"));
2528        }
2529        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2530    }
2531
2532    /// GET GetTemplatesDeliveryTransportersDetails V1
2533    /// Please note: The {id} parameter above represents a Transfer Template Delivery ID, not a Manifest Number.
2534    /// 
2535    ///   Permissions Required:
2536    ///   - Transfer Templates
2537    ///
2538    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>> {
2539        let mut path = format!("/transfers/v1/templates/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
2540        let mut query_params = Vec::new();
2541        if let Some(p) = no {
2542            query_params.push(format!("No={}", urlencoding::encode(&p)));
2543        }
2544        if !query_params.is_empty() {
2545            path.push_str("?");
2546            path.push_str(&query_params.join("&"));
2547        }
2548        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2549    }
2550
2551    /// GET GetTemplatesOutgoing V2
2552    /// Retrieves a list of transfer templates for a Facility, optionally filtered by last modified date range.
2553    /// 
2554    ///   Permissions Required:
2555    ///   - Manage Transfer Templates
2556    ///   - View Transfer Templates
2557    ///
2558    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>> {
2559        let mut path = format!("/transfers/v2/templates/outgoing");
2560        let mut query_params = Vec::new();
2561        if let Some(p) = last_modified_end {
2562            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
2563        }
2564        if let Some(p) = last_modified_start {
2565            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
2566        }
2567        if let Some(p) = license_number {
2568            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2569        }
2570        if let Some(p) = page_number {
2571            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2572        }
2573        if let Some(p) = page_size {
2574            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2575        }
2576        if !query_params.is_empty() {
2577            path.push_str("?");
2578            path.push_str(&query_params.join("&"));
2579        }
2580        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2581    }
2582
2583    /// GET GetTemplatesOutgoingDelivery V2
2584    /// Retrieves a list of deliveries associated with a specific transfer template.
2585    /// 
2586    ///   Permissions Required:
2587    ///   - Manage Transfer Templates
2588    ///   - View Transfer Templates
2589    ///
2590    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>> {
2591        let mut path = format!("/transfers/v2/templates/outgoing/{}/deliveries", urlencoding::encode(id).as_ref());
2592        let mut query_params = Vec::new();
2593        if let Some(p) = page_number {
2594            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2595        }
2596        if let Some(p) = page_size {
2597            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2598        }
2599        if !query_params.is_empty() {
2600            path.push_str("?");
2601            path.push_str(&query_params.join("&"));
2602        }
2603        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2604    }
2605
2606    /// GET GetTemplatesOutgoingDeliveryPackage V2
2607    /// 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.
2608    /// 
2609    ///   Permissions Required:
2610    ///   - Manage Transfer Templates
2611    ///   - View Transfer Templates
2612    ///
2613    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>> {
2614        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/packages", urlencoding::encode(id).as_ref());
2615        let mut query_params = Vec::new();
2616        if let Some(p) = page_number {
2617            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2618        }
2619        if let Some(p) = page_size {
2620            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2621        }
2622        if !query_params.is_empty() {
2623            path.push_str("?");
2624            path.push_str(&query_params.join("&"));
2625        }
2626        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2627    }
2628
2629    /// GET GetTemplatesOutgoingDeliveryTransporters V2
2630    /// 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.
2631    /// 
2632    ///   Permissions Required:
2633    ///   - Manage Transfer Templates
2634    ///   - View Transfer Templates
2635    ///
2636    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>> {
2637        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/transporters", urlencoding::encode(id).as_ref());
2638        let mut query_params = Vec::new();
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 GetTemplatesOutgoingDeliveryTransportersDetails V2
2653    /// 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.
2654    /// 
2655    ///   Permissions Required:
2656    ///   - Manage Transfer Templates
2657    ///   - View Transfer Templates
2658    ///
2659    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>> {
2660        let mut path = format!("/transfers/v2/templates/outgoing/deliveries/{}/transporters/details", urlencoding::encode(id).as_ref());
2661        let mut query_params = Vec::new();
2662        if let Some(p) = no {
2663            query_params.push(format!("No={}", urlencoding::encode(&p)));
2664        }
2665        if !query_params.is_empty() {
2666            path.push_str("?");
2667            path.push_str(&query_params.join("&"));
2668        }
2669        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2670    }
2671
2672    /// GET GetTypes V1
2673    /// Permissions Required:
2674    ///   - None
2675    ///
2676    pub async fn transfers_get_types_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2677        let mut path = format!("/transfers/v1/types");
2678        let mut query_params = Vec::new();
2679        if let Some(p) = license_number {
2680            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2681        }
2682        if !query_params.is_empty() {
2683            path.push_str("?");
2684            path.push_str(&query_params.join("&"));
2685        }
2686        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2687    }
2688
2689    /// GET GetTypes V2
2690    /// Retrieves a list of available transfer types for a Facility based on its license number.
2691    /// 
2692    ///   Permissions Required:
2693    ///   - None
2694    ///
2695    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>> {
2696        let mut path = format!("/transfers/v2/types");
2697        let mut query_params = Vec::new();
2698        if let Some(p) = license_number {
2699            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2700        }
2701        if let Some(p) = page_number {
2702            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2703        }
2704        if let Some(p) = page_size {
2705            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2706        }
2707        if !query_params.is_empty() {
2708            path.push_str("?");
2709            path.push_str(&query_params.join("&"));
2710        }
2711        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2712    }
2713
2714    /// PUT UpdateExternalIncoming V1
2715    /// Permissions Required:
2716    ///   - Transfers
2717    ///
2718    pub async fn transfers_update_external_incoming_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2719        let mut path = format!("/transfers/v1/external/incoming");
2720        let mut query_params = Vec::new();
2721        if let Some(p) = license_number {
2722            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2723        }
2724        if !query_params.is_empty() {
2725            path.push_str("?");
2726            path.push_str(&query_params.join("&"));
2727        }
2728        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2729    }
2730
2731    /// PUT UpdateExternalIncoming V2
2732    /// Updates external incoming shipment plans for a Facility.
2733    /// 
2734    ///   Permissions Required:
2735    ///   - Manage Transfers
2736    ///
2737    pub async fn transfers_update_external_incoming_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2738        let mut path = format!("/transfers/v2/external/incoming");
2739        let mut query_params = Vec::new();
2740        if let Some(p) = license_number {
2741            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2742        }
2743        if !query_params.is_empty() {
2744            path.push_str("?");
2745            path.push_str(&query_params.join("&"));
2746        }
2747        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2748    }
2749
2750    /// PUT UpdateTemplates V1
2751    /// Permissions Required:
2752    ///   - Transfer Templates
2753    ///
2754    pub async fn transfers_update_templates_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2755        let mut path = format!("/transfers/v1/templates");
2756        let mut query_params = Vec::new();
2757        if let Some(p) = license_number {
2758            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2759        }
2760        if !query_params.is_empty() {
2761            path.push_str("?");
2762            path.push_str(&query_params.join("&"));
2763        }
2764        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2765    }
2766
2767    /// PUT UpdateTemplatesOutgoing V2
2768    /// Updates existing transfer templates for a Facility.
2769    /// 
2770    ///   Permissions Required:
2771    ///   - Manage Transfer Templates
2772    ///
2773    pub async fn transfers_update_templates_outgoing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2774        let mut path = format!("/transfers/v2/templates/outgoing");
2775        let mut query_params = Vec::new();
2776        if let Some(p) = license_number {
2777            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2778        }
2779        if !query_params.is_empty() {
2780            path.push_str("?");
2781            path.push_str(&query_params.join("&"));
2782        }
2783        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2784    }
2785
2786    /// POST CreateDriver V2
2787    /// Creates new driver records for a Facility.
2788    /// 
2789    ///   Permissions Required:
2790    ///   - Manage Transporters
2791    ///
2792    pub async fn transporters_create_driver_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2793        let mut path = format!("/transporters/v2/drivers");
2794        let mut query_params = Vec::new();
2795        if let Some(p) = license_number {
2796            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2797        }
2798        if !query_params.is_empty() {
2799            path.push_str("?");
2800            path.push_str(&query_params.join("&"));
2801        }
2802        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2803    }
2804
2805    /// POST CreateVehicle V2
2806    /// Creates new vehicle records for a Facility.
2807    /// 
2808    ///   Permissions Required:
2809    ///   - Manage Transporters
2810    ///
2811    pub async fn transporters_create_vehicle_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2812        let mut path = format!("/transporters/v2/vehicles");
2813        let mut query_params = Vec::new();
2814        if let Some(p) = license_number {
2815            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2816        }
2817        if !query_params.is_empty() {
2818            path.push_str("?");
2819            path.push_str(&query_params.join("&"));
2820        }
2821        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2822    }
2823
2824    /// DELETE DeleteDriver V2
2825    /// Archives a Driver record for a Facility.  Please note: The {id} parameter above represents a Driver Id.
2826    /// 
2827    ///   Permissions Required:
2828    ///   - Manage Transporters
2829    ///
2830    pub async fn transporters_delete_driver_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2831        let mut path = format!("/transporters/v2/drivers/{}", urlencoding::encode(id).as_ref());
2832        let mut query_params = Vec::new();
2833        if let Some(p) = license_number {
2834            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2835        }
2836        if !query_params.is_empty() {
2837            path.push_str("?");
2838            path.push_str(&query_params.join("&"));
2839        }
2840        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2841    }
2842
2843    /// DELETE DeleteVehicle V2
2844    /// Archives a Vehicle for a facility.  Please note: The {id} parameter above represents a Vehicle Id.
2845    /// 
2846    ///   Permissions Required:
2847    ///   - Manage Transporters
2848    ///
2849    pub async fn transporters_delete_vehicle_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2850        let mut path = format!("/transporters/v2/vehicles/{}", urlencoding::encode(id).as_ref());
2851        let mut query_params = Vec::new();
2852        if let Some(p) = license_number {
2853            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2854        }
2855        if !query_params.is_empty() {
2856            path.push_str("?");
2857            path.push_str(&query_params.join("&"));
2858        }
2859        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2860    }
2861
2862    /// GET GetDriver V2
2863    /// Retrieves a Driver by its Id, with an optional license number. Please note: The {id} parameter above represents a Driver Id.
2864    /// 
2865    ///   Permissions Required:
2866    ///   - Transporters
2867    ///
2868    pub async fn transporters_get_driver_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2869        let mut path = format!("/transporters/v2/drivers/{}", urlencoding::encode(id).as_ref());
2870        let mut query_params = Vec::new();
2871        if let Some(p) = license_number {
2872            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2873        }
2874        if !query_params.is_empty() {
2875            path.push_str("?");
2876            path.push_str(&query_params.join("&"));
2877        }
2878        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2879    }
2880
2881    /// GET GetDrivers V2
2882    /// Retrieves a list of drivers for a Facility.
2883    /// 
2884    ///   Permissions Required:
2885    ///   - Transporters
2886    ///
2887    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>> {
2888        let mut path = format!("/transporters/v2/drivers");
2889        let mut query_params = Vec::new();
2890        if let Some(p) = license_number {
2891            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2892        }
2893        if let Some(p) = page_number {
2894            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2895        }
2896        if let Some(p) = page_size {
2897            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2898        }
2899        if !query_params.is_empty() {
2900            path.push_str("?");
2901            path.push_str(&query_params.join("&"));
2902        }
2903        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2904    }
2905
2906    /// GET GetVehicle V2
2907    /// Retrieves a Vehicle by its Id, with an optional license number. Please note: The {id} parameter above represents a Vehicle Id.
2908    /// 
2909    ///   Permissions Required:
2910    ///   - Transporters
2911    ///
2912    pub async fn transporters_get_vehicle_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2913        let mut path = format!("/transporters/v2/vehicles/{}", urlencoding::encode(id).as_ref());
2914        let mut query_params = Vec::new();
2915        if let Some(p) = license_number {
2916            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2917        }
2918        if !query_params.is_empty() {
2919            path.push_str("?");
2920            path.push_str(&query_params.join("&"));
2921        }
2922        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2923    }
2924
2925    /// GET GetVehicles V2
2926    /// Retrieves a list of vehicles for a Facility.
2927    /// 
2928    ///   Permissions Required:
2929    ///   - Transporters
2930    ///
2931    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>> {
2932        let mut path = format!("/transporters/v2/vehicles");
2933        let mut query_params = Vec::new();
2934        if let Some(p) = license_number {
2935            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2936        }
2937        if let Some(p) = page_number {
2938            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
2939        }
2940        if let Some(p) = page_size {
2941            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
2942        }
2943        if !query_params.is_empty() {
2944            path.push_str("?");
2945            path.push_str(&query_params.join("&"));
2946        }
2947        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2948    }
2949
2950    /// PUT UpdateDriver V2
2951    /// Updates existing driver records for a Facility.
2952    /// 
2953    ///   Permissions Required:
2954    ///   - Manage Transporters
2955    ///
2956    pub async fn transporters_update_driver_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2957        let mut path = format!("/transporters/v2/drivers");
2958        let mut query_params = Vec::new();
2959        if let Some(p) = license_number {
2960            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2961        }
2962        if !query_params.is_empty() {
2963            path.push_str("?");
2964            path.push_str(&query_params.join("&"));
2965        }
2966        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2967    }
2968
2969    /// PUT UpdateVehicle V2
2970    /// Updates existing vehicle records for a facility.
2971    /// 
2972    ///   Permissions Required:
2973    ///   - Manage Transporters
2974    ///
2975    pub async fn transporters_update_vehicle_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2976        let mut path = format!("/transporters/v2/vehicles");
2977        let mut query_params = Vec::new();
2978        if let Some(p) = license_number {
2979            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2980        }
2981        if !query_params.is_empty() {
2982            path.push_str("?");
2983            path.push_str(&query_params.join("&"));
2984        }
2985        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
2986    }
2987
2988    /// POST Create V1
2989    /// Permissions Required:
2990    ///   - Manage Locations
2991    ///
2992    pub async fn locations_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
2993        let mut path = format!("/locations/v1/create");
2994        let mut query_params = Vec::new();
2995        if let Some(p) = license_number {
2996            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
2997        }
2998        if !query_params.is_empty() {
2999            path.push_str("?");
3000            path.push_str(&query_params.join("&"));
3001        }
3002        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3003    }
3004
3005    /// POST Create V2
3006    /// Creates new locations for a specified Facility.
3007    /// 
3008    ///   Permissions Required:
3009    ///   - Manage Locations
3010    ///
3011    pub async fn locations_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3012        let mut path = format!("/locations/v2");
3013        let mut query_params = Vec::new();
3014        if let Some(p) = license_number {
3015            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3016        }
3017        if !query_params.is_empty() {
3018            path.push_str("?");
3019            path.push_str(&query_params.join("&"));
3020        }
3021        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3022    }
3023
3024    /// POST CreateUpdate V1
3025    /// Permissions Required:
3026    ///   - Manage Locations
3027    ///
3028    pub async fn locations_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3029        let mut path = format!("/locations/v1/update");
3030        let mut query_params = Vec::new();
3031        if let Some(p) = license_number {
3032            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3033        }
3034        if !query_params.is_empty() {
3035            path.push_str("?");
3036            path.push_str(&query_params.join("&"));
3037        }
3038        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3039    }
3040
3041    /// DELETE Delete V1
3042    /// Permissions Required:
3043    ///   - Manage Locations
3044    ///
3045    pub async fn locations_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3046        let mut path = format!("/locations/v1/{}", urlencoding::encode(id).as_ref());
3047        let mut query_params = Vec::new();
3048        if let Some(p) = license_number {
3049            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3050        }
3051        if !query_params.is_empty() {
3052            path.push_str("?");
3053            path.push_str(&query_params.join("&"));
3054        }
3055        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3056    }
3057
3058    /// DELETE Delete V2
3059    /// Archives a specified Location, identified by its Id, for a Facility.
3060    /// 
3061    ///   Permissions Required:
3062    ///   - Manage Locations
3063    ///
3064    pub async fn locations_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3065        let mut path = format!("/locations/v2/{}", urlencoding::encode(id).as_ref());
3066        let mut query_params = Vec::new();
3067        if let Some(p) = license_number {
3068            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3069        }
3070        if !query_params.is_empty() {
3071            path.push_str("?");
3072            path.push_str(&query_params.join("&"));
3073        }
3074        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3075    }
3076
3077    /// GET Get V1
3078    /// Permissions Required:
3079    ///   - Manage Locations
3080    ///
3081    pub async fn locations_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3082        let mut path = format!("/locations/v1/{}", urlencoding::encode(id).as_ref());
3083        let mut query_params = Vec::new();
3084        if let Some(p) = license_number {
3085            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3086        }
3087        if !query_params.is_empty() {
3088            path.push_str("?");
3089            path.push_str(&query_params.join("&"));
3090        }
3091        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3092    }
3093
3094    /// GET Get V2
3095    /// Retrieves a Location by its Id.
3096    /// 
3097    ///   Permissions Required:
3098    ///   - Manage Locations
3099    ///
3100    pub async fn locations_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3101        let mut path = format!("/locations/v2/{}", urlencoding::encode(id).as_ref());
3102        let mut query_params = Vec::new();
3103        if let Some(p) = license_number {
3104            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3105        }
3106        if !query_params.is_empty() {
3107            path.push_str("?");
3108            path.push_str(&query_params.join("&"));
3109        }
3110        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3111    }
3112
3113    /// GET GetActive V1
3114    /// Permissions Required:
3115    ///   - Manage Locations
3116    ///
3117    pub async fn locations_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3118        let mut path = format!("/locations/v1/active");
3119        let mut query_params = Vec::new();
3120        if let Some(p) = license_number {
3121            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3122        }
3123        if !query_params.is_empty() {
3124            path.push_str("?");
3125            path.push_str(&query_params.join("&"));
3126        }
3127        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3128    }
3129
3130    /// GET GetActive V2
3131    /// Retrieves a list of active locations for a specified Facility.
3132    /// 
3133    ///   Permissions Required:
3134    ///   - Manage Locations
3135    ///
3136    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>> {
3137        let mut path = format!("/locations/v2/active");
3138        let mut query_params = Vec::new();
3139        if let Some(p) = last_modified_end {
3140            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3141        }
3142        if let Some(p) = last_modified_start {
3143            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3144        }
3145        if let Some(p) = license_number {
3146            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3147        }
3148        if let Some(p) = page_number {
3149            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3150        }
3151        if let Some(p) = page_size {
3152            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3153        }
3154        if !query_params.is_empty() {
3155            path.push_str("?");
3156            path.push_str(&query_params.join("&"));
3157        }
3158        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3159    }
3160
3161    /// GET GetInactive V2
3162    /// Retrieves a list of inactive locations for a specified Facility.
3163    /// 
3164    ///   Permissions Required:
3165    ///   - Manage Locations
3166    ///
3167    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>> {
3168        let mut path = format!("/locations/v2/inactive");
3169        let mut query_params = Vec::new();
3170        if let Some(p) = license_number {
3171            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3172        }
3173        if let Some(p) = page_number {
3174            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3175        }
3176        if let Some(p) = page_size {
3177            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3178        }
3179        if !query_params.is_empty() {
3180            path.push_str("?");
3181            path.push_str(&query_params.join("&"));
3182        }
3183        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3184    }
3185
3186    /// GET GetTypes V1
3187    /// Permissions Required:
3188    ///   - Manage Locations
3189    ///
3190    pub async fn locations_get_types_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3191        let mut path = format!("/locations/v1/types");
3192        let mut query_params = Vec::new();
3193        if let Some(p) = license_number {
3194            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3195        }
3196        if !query_params.is_empty() {
3197            path.push_str("?");
3198            path.push_str(&query_params.join("&"));
3199        }
3200        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3201    }
3202
3203    /// GET GetTypes V2
3204    /// Retrieves a list of active location types for a specified Facility.
3205    /// 
3206    ///   Permissions Required:
3207    ///   - Manage Locations
3208    ///
3209    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>> {
3210        let mut path = format!("/locations/v2/types");
3211        let mut query_params = Vec::new();
3212        if let Some(p) = license_number {
3213            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3214        }
3215        if let Some(p) = page_number {
3216            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3217        }
3218        if let Some(p) = page_size {
3219            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3220        }
3221        if !query_params.is_empty() {
3222            path.push_str("?");
3223            path.push_str(&query_params.join("&"));
3224        }
3225        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3226    }
3227
3228    /// PUT Update V2
3229    /// Updates existing locations for a specified Facility.
3230    /// 
3231    ///   Permissions Required:
3232    ///   - Manage Locations
3233    ///
3234    pub async fn locations_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3235        let mut path = format!("/locations/v2");
3236        let mut query_params = Vec::new();
3237        if let Some(p) = license_number {
3238            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3239        }
3240        if !query_params.is_empty() {
3241            path.push_str("?");
3242            path.push_str(&query_params.join("&"));
3243        }
3244        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3245    }
3246
3247    /// POST Create V1
3248    /// Permissions Required:
3249    ///   - View Packages
3250    ///   - Create/Submit/Discontinue Packages
3251    ///
3252    pub async fn packages_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3253        let mut path = format!("/packages/v1/create");
3254        let mut query_params = Vec::new();
3255        if let Some(p) = license_number {
3256            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3257        }
3258        if !query_params.is_empty() {
3259            path.push_str("?");
3260            path.push_str(&query_params.join("&"));
3261        }
3262        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3263    }
3264
3265    /// POST Create V2
3266    /// Creates new packages for a specified Facility.
3267    /// 
3268    ///   Permissions Required:
3269    ///   - View Packages
3270    ///   - Create/Submit/Discontinue Packages
3271    ///
3272    pub async fn packages_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3273        let mut path = format!("/packages/v2");
3274        let mut query_params = Vec::new();
3275        if let Some(p) = license_number {
3276            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3277        }
3278        if !query_params.is_empty() {
3279            path.push_str("?");
3280            path.push_str(&query_params.join("&"));
3281        }
3282        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3283    }
3284
3285    /// POST CreateAdjust V1
3286    /// Permissions Required:
3287    ///   - View Packages
3288    ///   - Manage Packages Inventory
3289    ///
3290    pub async fn packages_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3291        let mut path = format!("/packages/v1/adjust");
3292        let mut query_params = Vec::new();
3293        if let Some(p) = license_number {
3294            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3295        }
3296        if !query_params.is_empty() {
3297            path.push_str("?");
3298            path.push_str(&query_params.join("&"));
3299        }
3300        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3301    }
3302
3303    /// POST CreateAdjust V2
3304    /// Records a list of adjustments for packages at a specific Facility.
3305    /// 
3306    ///   Permissions Required:
3307    ///   - View Packages
3308    ///   - Manage Packages Inventory
3309    ///
3310    pub async fn packages_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3311        let mut path = format!("/packages/v2/adjust");
3312        let mut query_params = Vec::new();
3313        if let Some(p) = license_number {
3314            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3315        }
3316        if !query_params.is_empty() {
3317            path.push_str("?");
3318            path.push_str(&query_params.join("&"));
3319        }
3320        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3321    }
3322
3323    /// POST CreateChangeItem V1
3324    /// Permissions Required:
3325    ///   - View Packages
3326    ///   - Create/Submit/Discontinue Packages
3327    ///
3328    pub async fn packages_create_change_item_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3329        let mut path = format!("/packages/v1/change/item");
3330        let mut query_params = Vec::new();
3331        if let Some(p) = license_number {
3332            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3333        }
3334        if !query_params.is_empty() {
3335            path.push_str("?");
3336            path.push_str(&query_params.join("&"));
3337        }
3338        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3339    }
3340
3341    /// POST CreateChangeLocation V1
3342    /// Permissions Required:
3343    ///   - View Packages
3344    ///   - Create/Submit/Discontinue Packages
3345    ///
3346    pub async fn packages_create_change_location_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3347        let mut path = format!("/packages/v1/change/locations");
3348        let mut query_params = Vec::new();
3349        if let Some(p) = license_number {
3350            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3351        }
3352        if !query_params.is_empty() {
3353            path.push_str("?");
3354            path.push_str(&query_params.join("&"));
3355        }
3356        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3357    }
3358
3359    /// POST CreateFinish V1
3360    /// Permissions Required:
3361    ///   - View Packages
3362    ///   - Manage Packages Inventory
3363    ///
3364    pub async fn packages_create_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3365        let mut path = format!("/packages/v1/finish");
3366        let mut query_params = Vec::new();
3367        if let Some(p) = license_number {
3368            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3375    }
3376
3377    /// POST CreatePlantings V1
3378    /// Permissions Required:
3379    ///   - View Immature Plants
3380    ///   - Manage Immature Plants
3381    ///   - View Packages
3382    ///   - Manage Packages Inventory
3383    ///
3384    pub async fn packages_create_plantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3385        let mut path = format!("/packages/v1/create/plantings");
3386        let mut query_params = Vec::new();
3387        if let Some(p) = license_number {
3388            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3389        }
3390        if !query_params.is_empty() {
3391            path.push_str("?");
3392            path.push_str(&query_params.join("&"));
3393        }
3394        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3395    }
3396
3397    /// POST CreatePlantings V2
3398    /// Creates new plantings from packages for a specified Facility.
3399    /// 
3400    ///   Permissions Required:
3401    ///   - View Immature Plants
3402    ///   - Manage Immature Plants
3403    ///   - View Packages
3404    ///   - Manage Packages Inventory
3405    ///
3406    pub async fn packages_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3407        let mut path = format!("/packages/v2/plantings");
3408        let mut query_params = Vec::new();
3409        if let Some(p) = license_number {
3410            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3411        }
3412        if !query_params.is_empty() {
3413            path.push_str("?");
3414            path.push_str(&query_params.join("&"));
3415        }
3416        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3417    }
3418
3419    /// POST CreateRemediate V1
3420    /// Permissions Required:
3421    ///   - View Packages
3422    ///   - Manage Packages Inventory
3423    ///
3424    pub async fn packages_create_remediate_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3425        let mut path = format!("/packages/v1/remediate");
3426        let mut query_params = Vec::new();
3427        if let Some(p) = license_number {
3428            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3429        }
3430        if !query_params.is_empty() {
3431            path.push_str("?");
3432            path.push_str(&query_params.join("&"));
3433        }
3434        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3435    }
3436
3437    /// POST CreateTesting V1
3438    /// Permissions Required:
3439    ///   - View Packages
3440    ///   - Create/Submit/Discontinue Packages
3441    ///
3442    pub async fn packages_create_testing_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3443        let mut path = format!("/packages/v1/create/testing");
3444        let mut query_params = Vec::new();
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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3453    }
3454
3455    /// POST CreateTesting V2
3456    /// Creates new packages for testing for a specified Facility.
3457    /// 
3458    ///   Permissions Required:
3459    ///   - View Packages
3460    ///   - Create/Submit/Discontinue Packages
3461    ///
3462    pub async fn packages_create_testing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3463        let mut path = format!("/packages/v2/testing");
3464        let mut query_params = Vec::new();
3465        if let Some(p) = license_number {
3466            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3467        }
3468        if !query_params.is_empty() {
3469            path.push_str("?");
3470            path.push_str(&query_params.join("&"));
3471        }
3472        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3473    }
3474
3475    /// POST CreateUnfinish V1
3476    /// Permissions Required:
3477    ///   - View Packages
3478    ///   - Manage Packages Inventory
3479    ///
3480    pub async fn packages_create_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3481        let mut path = format!("/packages/v1/unfinish");
3482        let mut query_params = Vec::new();
3483        if let Some(p) = license_number {
3484            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3485        }
3486        if !query_params.is_empty() {
3487            path.push_str("?");
3488            path.push_str(&query_params.join("&"));
3489        }
3490        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3491    }
3492
3493    /// DELETE Delete V2
3494    /// Discontinues a Package at a specific Facility.
3495    /// 
3496    ///   Permissions Required:
3497    ///   - View Packages
3498    ///   - Create/Submit/Discontinue Packages
3499    ///
3500    pub async fn packages_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3501        let mut path = format!("/packages/v2/{}", urlencoding::encode(id).as_ref());
3502        let mut query_params = Vec::new();
3503        if let Some(p) = license_number {
3504            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3505        }
3506        if !query_params.is_empty() {
3507            path.push_str("?");
3508            path.push_str(&query_params.join("&"));
3509        }
3510        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3511    }
3512
3513    /// GET Get V1
3514    /// Permissions Required:
3515    ///   - View Packages
3516    ///
3517    pub async fn packages_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3518        let mut path = format!("/packages/v1/{}", urlencoding::encode(id).as_ref());
3519        let mut query_params = Vec::new();
3520        if let Some(p) = license_number {
3521            query_params.push(format!("licenseNumber={}", 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 Get V2
3531    /// Retrieves a Package by its Id.
3532    /// 
3533    ///   Permissions Required:
3534    ///   - View Packages
3535    ///
3536    pub async fn packages_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3537        let mut path = format!("/packages/v2/{}", urlencoding::encode(id).as_ref());
3538        let mut query_params = Vec::new();
3539        if let Some(p) = license_number {
3540            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3541        }
3542        if !query_params.is_empty() {
3543            path.push_str("?");
3544            path.push_str(&query_params.join("&"));
3545        }
3546        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3547    }
3548
3549    /// GET GetActive V1
3550    /// Permissions Required:
3551    ///   - View Packages
3552    ///
3553    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>> {
3554        let mut path = format!("/packages/v1/active");
3555        let mut query_params = Vec::new();
3556        if let Some(p) = last_modified_end {
3557            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3558        }
3559        if let Some(p) = last_modified_start {
3560            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3561        }
3562        if let Some(p) = license_number {
3563            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3564        }
3565        if !query_params.is_empty() {
3566            path.push_str("?");
3567            path.push_str(&query_params.join("&"));
3568        }
3569        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3570    }
3571
3572    /// GET GetActive V2
3573    /// Retrieves a list of active packages for a specified Facility.
3574    /// 
3575    ///   Permissions Required:
3576    ///   - View Packages
3577    ///
3578    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>> {
3579        let mut path = format!("/packages/v2/active");
3580        let mut query_params = Vec::new();
3581        if let Some(p) = last_modified_end {
3582            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3583        }
3584        if let Some(p) = last_modified_start {
3585            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3586        }
3587        if let Some(p) = license_number {
3588            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3589        }
3590        if let Some(p) = page_number {
3591            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3592        }
3593        if let Some(p) = page_size {
3594            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3595        }
3596        if !query_params.is_empty() {
3597            path.push_str("?");
3598            path.push_str(&query_params.join("&"));
3599        }
3600        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3601    }
3602
3603    /// GET GetAdjustReasons V1
3604    /// Permissions Required:
3605    ///   - None
3606    ///
3607    pub async fn packages_get_adjust_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3608        let mut path = format!("/packages/v1/adjust/reasons");
3609        let mut query_params = Vec::new();
3610        if let Some(p) = license_number {
3611            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3612        }
3613        if !query_params.is_empty() {
3614            path.push_str("?");
3615            path.push_str(&query_params.join("&"));
3616        }
3617        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3618    }
3619
3620    /// GET GetAdjustReasons V2
3621    /// Retrieves a list of adjustment reasons for packages at a specified Facility.
3622    /// 
3623    ///   Permissions Required:
3624    ///   - None
3625    ///
3626    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>> {
3627        let mut path = format!("/packages/v2/adjust/reasons");
3628        let mut query_params = Vec::new();
3629        if let Some(p) = license_number {
3630            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3631        }
3632        if let Some(p) = page_number {
3633            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3634        }
3635        if let Some(p) = page_size {
3636            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3637        }
3638        if !query_params.is_empty() {
3639            path.push_str("?");
3640            path.push_str(&query_params.join("&"));
3641        }
3642        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3643    }
3644
3645    /// GET GetByLabel V1
3646    /// Permissions Required:
3647    ///   - View Packages
3648    ///
3649    pub async fn packages_get_by_label_v1(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3650        let mut path = format!("/packages/v1/{}", urlencoding::encode(label).as_ref());
3651        let mut query_params = Vec::new();
3652        if let Some(p) = license_number {
3653            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3654        }
3655        if !query_params.is_empty() {
3656            path.push_str("?");
3657            path.push_str(&query_params.join("&"));
3658        }
3659        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3660    }
3661
3662    /// GET GetByLabel V2
3663    /// Retrieves a Package by its label.
3664    /// 
3665    ///   Permissions Required:
3666    ///   - View Packages
3667    ///
3668    pub async fn packages_get_by_label_v2(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3669        let mut path = format!("/packages/v2/{}", urlencoding::encode(label).as_ref());
3670        let mut query_params = Vec::new();
3671        if let Some(p) = license_number {
3672            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3673        }
3674        if !query_params.is_empty() {
3675            path.push_str("?");
3676            path.push_str(&query_params.join("&"));
3677        }
3678        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3679    }
3680
3681    /// GET GetInactive V1
3682    /// Permissions Required:
3683    ///   - View Packages
3684    ///
3685    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>> {
3686        let mut path = format!("/packages/v1/inactive");
3687        let mut query_params = Vec::new();
3688        if let Some(p) = last_modified_end {
3689            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3690        }
3691        if let Some(p) = last_modified_start {
3692            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3693        }
3694        if let Some(p) = license_number {
3695            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3696        }
3697        if !query_params.is_empty() {
3698            path.push_str("?");
3699            path.push_str(&query_params.join("&"));
3700        }
3701        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3702    }
3703
3704    /// GET GetInactive V2
3705    /// Retrieves a list of inactive packages for a specified Facility.
3706    /// 
3707    ///   Permissions Required:
3708    ///   - View Packages
3709    ///
3710    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>> {
3711        let mut path = format!("/packages/v2/inactive");
3712        let mut query_params = Vec::new();
3713        if let Some(p) = last_modified_end {
3714            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3715        }
3716        if let Some(p) = last_modified_start {
3717            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3718        }
3719        if let Some(p) = license_number {
3720            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3721        }
3722        if let Some(p) = page_number {
3723            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3724        }
3725        if let Some(p) = page_size {
3726            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3727        }
3728        if !query_params.is_empty() {
3729            path.push_str("?");
3730            path.push_str(&query_params.join("&"));
3731        }
3732        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3733    }
3734
3735    /// GET GetIntransit V2
3736    /// Retrieves a list of packages in transit for a specified Facility.
3737    /// 
3738    ///   Permissions Required:
3739    ///   - View Packages
3740    ///
3741    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>> {
3742        let mut path = format!("/packages/v2/intransit");
3743        let mut query_params = Vec::new();
3744        if let Some(p) = last_modified_end {
3745            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3746        }
3747        if let Some(p) = last_modified_start {
3748            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3749        }
3750        if let Some(p) = license_number {
3751            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3752        }
3753        if let Some(p) = page_number {
3754            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3755        }
3756        if let Some(p) = page_size {
3757            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3758        }
3759        if !query_params.is_empty() {
3760            path.push_str("?");
3761            path.push_str(&query_params.join("&"));
3762        }
3763        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3764    }
3765
3766    /// GET GetLabsamples V2
3767    /// Retrieves a list of lab sample packages created or sent for testing for a specified Facility.
3768    /// 
3769    ///   Permissions Required:
3770    ///   - View Packages
3771    ///
3772    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>> {
3773        let mut path = format!("/packages/v2/labsamples");
3774        let mut query_params = Vec::new();
3775        if let Some(p) = last_modified_end {
3776            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3777        }
3778        if let Some(p) = last_modified_start {
3779            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3780        }
3781        if let Some(p) = license_number {
3782            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3783        }
3784        if let Some(p) = page_number {
3785            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3786        }
3787        if let Some(p) = page_size {
3788            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3789        }
3790        if !query_params.is_empty() {
3791            path.push_str("?");
3792            path.push_str(&query_params.join("&"));
3793        }
3794        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3795    }
3796
3797    /// GET GetOnhold V1
3798    /// Permissions Required:
3799    ///   - View Packages
3800    ///
3801    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>> {
3802        let mut path = format!("/packages/v1/onhold");
3803        let mut query_params = Vec::new();
3804        if let Some(p) = last_modified_end {
3805            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3806        }
3807        if let Some(p) = last_modified_start {
3808            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3809        }
3810        if let Some(p) = license_number {
3811            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3812        }
3813        if !query_params.is_empty() {
3814            path.push_str("?");
3815            path.push_str(&query_params.join("&"));
3816        }
3817        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3818    }
3819
3820    /// GET GetOnhold V2
3821    /// Retrieves a list of packages on hold for a specified Facility.
3822    /// 
3823    ///   Permissions Required:
3824    ///   - View Packages
3825    ///
3826    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>> {
3827        let mut path = format!("/packages/v2/onhold");
3828        let mut query_params = Vec::new();
3829        if let Some(p) = last_modified_end {
3830            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3831        }
3832        if let Some(p) = last_modified_start {
3833            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3834        }
3835        if let Some(p) = license_number {
3836            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3837        }
3838        if let Some(p) = page_number {
3839            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3840        }
3841        if let Some(p) = page_size {
3842            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3843        }
3844        if !query_params.is_empty() {
3845            path.push_str("?");
3846            path.push_str(&query_params.join("&"));
3847        }
3848        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3849    }
3850
3851    /// GET GetSourceHarvest V2
3852    /// Retrieves the source harvests for a Package by its Id.
3853    /// 
3854    ///   Permissions Required:
3855    ///   - View Package Source Harvests
3856    ///
3857    pub async fn packages_get_source_harvest_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3858        let mut path = format!("/packages/v2/{}/source/harvests", urlencoding::encode(id).as_ref());
3859        let mut query_params = Vec::new();
3860        if let Some(p) = license_number {
3861            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3862        }
3863        if !query_params.is_empty() {
3864            path.push_str("?");
3865            path.push_str(&query_params.join("&"));
3866        }
3867        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3868    }
3869
3870    /// GET GetTransferred V2
3871    /// Retrieves a list of transferred packages for a specific Facility.
3872    /// 
3873    ///   Permissions Required:
3874    ///   - View Packages
3875    ///
3876    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>> {
3877        let mut path = format!("/packages/v2/transferred");
3878        let mut query_params = Vec::new();
3879        if let Some(p) = last_modified_end {
3880            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
3881        }
3882        if let Some(p) = last_modified_start {
3883            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
3884        }
3885        if let Some(p) = license_number {
3886            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3887        }
3888        if let Some(p) = page_number {
3889            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
3890        }
3891        if let Some(p) = page_size {
3892            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
3893        }
3894        if !query_params.is_empty() {
3895            path.push_str("?");
3896            path.push_str(&query_params.join("&"));
3897        }
3898        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3899    }
3900
3901    /// GET GetTypes V1
3902    /// Permissions Required:
3903    ///   - None
3904    ///
3905    pub async fn packages_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3906        let mut path = format!("/packages/v1/types");
3907        let mut query_params = Vec::new();
3908        if let Some(p) = no {
3909            query_params.push(format!("No={}", urlencoding::encode(&p)));
3910        }
3911        if !query_params.is_empty() {
3912            path.push_str("?");
3913            path.push_str(&query_params.join("&"));
3914        }
3915        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3916    }
3917
3918    /// GET GetTypes V2
3919    /// Retrieves a list of available Package types.
3920    /// 
3921    ///   Permissions Required:
3922    ///   - None
3923    ///
3924    pub async fn packages_get_types_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3925        let mut path = format!("/packages/v2/types");
3926        let mut query_params = Vec::new();
3927        if let Some(p) = no {
3928            query_params.push(format!("No={}", urlencoding::encode(&p)));
3929        }
3930        if !query_params.is_empty() {
3931            path.push_str("?");
3932            path.push_str(&query_params.join("&"));
3933        }
3934        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3935    }
3936
3937    /// PUT UpdateAdjust V2
3938    /// Set the final quantity for a Package.
3939    /// 
3940    ///   Permissions Required:
3941    ///   - View Packages
3942    ///   - Manage Packages Inventory
3943    ///
3944    pub async fn packages_update_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3945        let mut path = format!("/packages/v2/adjust");
3946        let mut query_params = Vec::new();
3947        if let Some(p) = license_number {
3948            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3949        }
3950        if !query_params.is_empty() {
3951            path.push_str("?");
3952            path.push_str(&query_params.join("&"));
3953        }
3954        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3955    }
3956
3957    /// PUT UpdateChangeNote V1
3958    /// Permissions Required:
3959    ///   - View Packages
3960    ///   - Manage Packages Inventory
3961    ///   - Manage Package Notes
3962    ///
3963    pub async fn packages_update_change_note_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3964        let mut path = format!("/packages/v1/change/note");
3965        let mut query_params = Vec::new();
3966        if let Some(p) = license_number {
3967            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3968        }
3969        if !query_params.is_empty() {
3970            path.push_str("?");
3971            path.push_str(&query_params.join("&"));
3972        }
3973        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3974    }
3975
3976    /// PUT UpdateDecontaminate V2
3977    /// Updates the Product decontaminate information for a list of packages at a specific Facility.
3978    /// 
3979    ///   Permissions Required:
3980    ///   - View Packages
3981    ///   - Manage Packages Inventory
3982    ///
3983    pub async fn packages_update_decontaminate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
3984        let mut path = format!("/packages/v2/decontaminate");
3985        let mut query_params = Vec::new();
3986        if let Some(p) = license_number {
3987            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
3988        }
3989        if !query_params.is_empty() {
3990            path.push_str("?");
3991            path.push_str(&query_params.join("&"));
3992        }
3993        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
3994    }
3995
3996    /// PUT UpdateDonationFlag V2
3997    /// Flags one or more packages for donation at the specified Facility.
3998    /// 
3999    ///   Permissions Required:
4000    ///   - View Packages
4001    ///   - Manage Packages Inventory
4002    ///
4003    pub async fn packages_update_donation_flag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4004        let mut path = format!("/packages/v2/donation/flag");
4005        let mut query_params = Vec::new();
4006        if let Some(p) = license_number {
4007            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4008        }
4009        if !query_params.is_empty() {
4010            path.push_str("?");
4011            path.push_str(&query_params.join("&"));
4012        }
4013        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4014    }
4015
4016    /// PUT UpdateDonationUnflag V2
4017    /// Removes the donation flag from one or more packages at the specified Facility.
4018    /// 
4019    ///   Permissions Required:
4020    ///   - View Packages
4021    ///   - Manage Packages Inventory
4022    ///
4023    pub async fn packages_update_donation_unflag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4024        let mut path = format!("/packages/v2/donation/unflag");
4025        let mut query_params = Vec::new();
4026        if let Some(p) = license_number {
4027            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4028        }
4029        if !query_params.is_empty() {
4030            path.push_str("?");
4031            path.push_str(&query_params.join("&"));
4032        }
4033        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4034    }
4035
4036    /// PUT UpdateExternalid V2
4037    /// Updates the external identifiers for one or more packages at the specified Facility.
4038    /// 
4039    ///   Permissions Required:
4040    ///   - View Packages
4041    ///   - Manage Package Inventory
4042    ///   - External Id Enabled
4043    ///
4044    pub async fn packages_update_externalid_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4045        let mut path = format!("/packages/v2/externalid");
4046        let mut query_params = Vec::new();
4047        if let Some(p) = license_number {
4048            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4049        }
4050        if !query_params.is_empty() {
4051            path.push_str("?");
4052            path.push_str(&query_params.join("&"));
4053        }
4054        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4055    }
4056
4057    /// PUT UpdateFinish V2
4058    /// Updates a list of packages as finished for a specific Facility.
4059    /// 
4060    ///   Permissions Required:
4061    ///   - View Packages
4062    ///   - Manage Packages Inventory
4063    ///
4064    pub async fn packages_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4065        let mut path = format!("/packages/v2/finish");
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::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4075    }
4076
4077    /// PUT UpdateItem V2
4078    /// Updates the associated Item for one or more packages at the specified Facility.
4079    /// 
4080    ///   Permissions Required:
4081    ///   - View Packages
4082    ///   - Create/Submit/Discontinue Packages
4083    ///
4084    pub async fn packages_update_item_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4085        let mut path = format!("/packages/v2/item");
4086        let mut query_params = Vec::new();
4087        if let Some(p) = license_number {
4088            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4089        }
4090        if !query_params.is_empty() {
4091            path.push_str("?");
4092            path.push_str(&query_params.join("&"));
4093        }
4094        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4095    }
4096
4097    /// PUT UpdateLabTestRequired V2
4098    /// Updates the list of required lab test batches for one or more packages at the specified Facility.
4099    /// 
4100    ///   Permissions Required:
4101    ///   - View Packages
4102    ///   - Create/Submit/Discontinue Packages
4103    ///
4104    pub async fn packages_update_lab_test_required_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4105        let mut path = format!("/packages/v2/labtests/required");
4106        let mut query_params = Vec::new();
4107        if let Some(p) = license_number {
4108            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4109        }
4110        if !query_params.is_empty() {
4111            path.push_str("?");
4112            path.push_str(&query_params.join("&"));
4113        }
4114        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4115    }
4116
4117    /// PUT UpdateLocation V2
4118    /// Updates the Location and Sublocation for one or more packages at the specified Facility.
4119    /// 
4120    ///   Permissions Required:
4121    ///   - View Packages
4122    ///   - Create/Submit/Discontinue Packages
4123    ///
4124    pub async fn packages_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4125        let mut path = format!("/packages/v2/location");
4126        let mut query_params = Vec::new();
4127        if let Some(p) = license_number {
4128            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4129        }
4130        if !query_params.is_empty() {
4131            path.push_str("?");
4132            path.push_str(&query_params.join("&"));
4133        }
4134        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4135    }
4136
4137    /// PUT UpdateNote V2
4138    /// Updates notes associated with one or more packages for the specified Facility.
4139    /// 
4140    ///   Permissions Required:
4141    ///   - View Packages
4142    ///   - Manage Packages Inventory
4143    ///   - Manage Package Notes
4144    ///
4145    pub async fn packages_update_note_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4146        let mut path = format!("/packages/v2/note");
4147        let mut query_params = Vec::new();
4148        if let Some(p) = license_number {
4149            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4150        }
4151        if !query_params.is_empty() {
4152            path.push_str("?");
4153            path.push_str(&query_params.join("&"));
4154        }
4155        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4156    }
4157
4158    /// PUT UpdateRemediate V2
4159    /// Updates a list of Product remediations for packages at a specific Facility.
4160    /// 
4161    ///   Permissions Required:
4162    ///   - View Packages
4163    ///   - Manage Packages Inventory
4164    ///
4165    pub async fn packages_update_remediate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4166        let mut path = format!("/packages/v2/remediate");
4167        let mut query_params = Vec::new();
4168        if let Some(p) = license_number {
4169            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4170        }
4171        if !query_params.is_empty() {
4172            path.push_str("?");
4173            path.push_str(&query_params.join("&"));
4174        }
4175        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4176    }
4177
4178    /// PUT UpdateTradesampleFlag V2
4179    /// Flags or unflags one or more packages at the specified Facility as trade samples.
4180    /// 
4181    ///   Permissions Required:
4182    ///   - View Packages
4183    ///   - Manage Packages Inventory
4184    ///
4185    pub async fn packages_update_tradesample_flag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4186        let mut path = format!("/packages/v2/tradesample/flag");
4187        let mut query_params = Vec::new();
4188        if let Some(p) = license_number {
4189            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4190        }
4191        if !query_params.is_empty() {
4192            path.push_str("?");
4193            path.push_str(&query_params.join("&"));
4194        }
4195        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4196    }
4197
4198    /// PUT UpdateTradesampleUnflag V2
4199    /// Removes the trade sample flag from one or more packages at the specified Facility.
4200    /// 
4201    ///   Permissions Required:
4202    ///   - View Packages
4203    ///   - Manage Packages Inventory
4204    ///
4205    pub async fn packages_update_tradesample_unflag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4206        let mut path = format!("/packages/v2/tradesample/unflag");
4207        let mut query_params = Vec::new();
4208        if let Some(p) = license_number {
4209            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4210        }
4211        if !query_params.is_empty() {
4212            path.push_str("?");
4213            path.push_str(&query_params.join("&"));
4214        }
4215        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4216    }
4217
4218    /// PUT UpdateUnfinish V2
4219    /// Updates a list of packages as unfinished for a specific Facility.
4220    /// 
4221    ///   Permissions Required:
4222    ///   - View Packages
4223    ///   - Manage Packages Inventory
4224    ///
4225    pub async fn packages_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4226        let mut path = format!("/packages/v2/unfinish");
4227        let mut query_params = Vec::new();
4228        if let Some(p) = license_number {
4229            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4230        }
4231        if !query_params.is_empty() {
4232            path.push_str("?");
4233            path.push_str(&query_params.join("&"));
4234        }
4235        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4236    }
4237
4238    /// PUT UpdateUsebydate V2
4239    /// Updates the use-by date for one or more packages at the specified Facility.
4240    /// 
4241    ///   Permissions Required:
4242    ///   - View Packages
4243    ///   - Create/Submit/Discontinue Packages
4244    ///
4245    pub async fn packages_update_usebydate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4246        let mut path = format!("/packages/v2/usebydate");
4247        let mut query_params = Vec::new();
4248        if let Some(p) = license_number {
4249            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4250        }
4251        if !query_params.is_empty() {
4252            path.push_str("?");
4253            path.push_str(&query_params.join("&"));
4254        }
4255        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4256    }
4257
4258    /// GET GetStatusesByPatientLicenseNumber V1
4259    /// Data returned by this endpoint is cached for up to one minute.
4260    /// 
4261    ///   Permissions Required:
4262    ///   - Lookup Patients
4263    ///
4264    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>> {
4265        let mut path = format!("/patients/v1/statuses/{}", urlencoding::encode(patient_license_number).as_ref());
4266        let mut query_params = Vec::new();
4267        if let Some(p) = license_number {
4268            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4269        }
4270        if !query_params.is_empty() {
4271            path.push_str("?");
4272            path.push_str(&query_params.join("&"));
4273        }
4274        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4275    }
4276
4277    /// GET GetStatusesByPatientLicenseNumber V2
4278    /// 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.
4279    /// 
4280    ///   Permissions Required:
4281    ///   - Lookup Patients
4282    ///
4283    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>> {
4284        let mut path = format!("/patients/v2/statuses/{}", urlencoding::encode(patient_license_number).as_ref());
4285        let mut query_params = Vec::new();
4286        if let Some(p) = license_number {
4287            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4288        }
4289        if !query_params.is_empty() {
4290            path.push_str("?");
4291            path.push_str(&query_params.join("&"));
4292        }
4293        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4294    }
4295
4296    /// POST CreateAdditives V1
4297    /// Permissions Required:
4298    ///   - Manage Plants Additives
4299    ///
4300    pub async fn plant_batches_create_additives_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4301        let mut path = format!("/plantbatches/v1/additives");
4302        let mut query_params = Vec::new();
4303        if let Some(p) = license_number {
4304            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4305        }
4306        if !query_params.is_empty() {
4307            path.push_str("?");
4308            path.push_str(&query_params.join("&"));
4309        }
4310        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4311    }
4312
4313    /// POST CreateAdditives V2
4314    /// Records Additive usage details for plant batches at a specific Facility.
4315    /// 
4316    ///   Permissions Required:
4317    ///   - Manage Plants Additives
4318    ///
4319    pub async fn plant_batches_create_additives_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4320        let mut path = format!("/plantbatches/v2/additives");
4321        let mut query_params = Vec::new();
4322        if let Some(p) = license_number {
4323            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4324        }
4325        if !query_params.is_empty() {
4326            path.push_str("?");
4327            path.push_str(&query_params.join("&"));
4328        }
4329        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4330    }
4331
4332    /// POST CreateAdditivesUsingtemplate V2
4333    /// Records Additive usage for plant batches at a Facility using predefined additive templates.
4334    /// 
4335    ///   Permissions Required:
4336    ///   - Manage Plants Additives
4337    ///
4338    pub async fn plant_batches_create_additives_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4339        let mut path = format!("/plantbatches/v2/additives/usingtemplate");
4340        let mut query_params = Vec::new();
4341        if let Some(p) = license_number {
4342            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4349    }
4350
4351    /// POST CreateAdjust V1
4352    /// Permissions Required:
4353    ///   - View Immature Plants
4354    ///   - Manage Immature Plants Inventory
4355    ///
4356    pub async fn plant_batches_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4357        let mut path = format!("/plantbatches/v1/adjust");
4358        let mut query_params = Vec::new();
4359        if let Some(p) = license_number {
4360            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4361        }
4362        if !query_params.is_empty() {
4363            path.push_str("?");
4364            path.push_str(&query_params.join("&"));
4365        }
4366        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4367    }
4368
4369    /// POST CreateAdjust V2
4370    /// Applies Facility specific adjustments to plant batches based on submitted reasons and input data.
4371    /// 
4372    ///   Permissions Required:
4373    ///   - View Immature Plants
4374    ///   - Manage Immature Plants Inventory
4375    ///
4376    pub async fn plant_batches_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4377        let mut path = format!("/plantbatches/v2/adjust");
4378        let mut query_params = Vec::new();
4379        if let Some(p) = license_number {
4380            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4381        }
4382        if !query_params.is_empty() {
4383            path.push_str("?");
4384            path.push_str(&query_params.join("&"));
4385        }
4386        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4387    }
4388
4389    /// POST CreateChangegrowthphase V1
4390    /// Permissions Required:
4391    ///   - View Immature Plants
4392    ///   - Manage Immature Plants Inventory
4393    ///   - View Veg/Flower Plants
4394    ///   - Manage Veg/Flower Plants Inventory
4395    ///
4396    pub async fn plant_batches_create_changegrowthphase_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4397        let mut path = format!("/plantbatches/v1/changegrowthphase");
4398        let mut query_params = Vec::new();
4399        if let Some(p) = license_number {
4400            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4401        }
4402        if !query_params.is_empty() {
4403            path.push_str("?");
4404            path.push_str(&query_params.join("&"));
4405        }
4406        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4407    }
4408
4409    /// POST CreateGrowthphase V2
4410    /// Updates the growth phase of plants at a specified Facility based on tracking information.
4411    /// 
4412    ///   Permissions Required:
4413    ///   - View Immature Plants
4414    ///   - Manage Immature Plants Inventory
4415    ///   - View Veg/Flower Plants
4416    ///   - Manage Veg/Flower Plants Inventory
4417    ///
4418    pub async fn plant_batches_create_growthphase_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4419        let mut path = format!("/plantbatches/v2/growthphase");
4420        let mut query_params = Vec::new();
4421        if let Some(p) = license_number {
4422            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4423        }
4424        if !query_params.is_empty() {
4425            path.push_str("?");
4426            path.push_str(&query_params.join("&"));
4427        }
4428        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4429    }
4430
4431    /// POST CreatePackage V2
4432    /// Creates packages from plant batches at a Facility, with optional support for packaging from mother plants.
4433    /// 
4434    ///   Permissions Required:
4435    ///   - View Immature Plants
4436    ///   - Manage Immature Plants Inventory
4437    ///   - View Packages
4438    ///   - Create/Submit/Discontinue Packages
4439    ///
4440    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>> {
4441        let mut path = format!("/plantbatches/v2/packages");
4442        let mut query_params = Vec::new();
4443        if let Some(p) = is_from_mother_plant {
4444            query_params.push(format!("isFromMotherPlant={}", urlencoding::encode(&p)));
4445        }
4446        if let Some(p) = license_number {
4447            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4448        }
4449        if !query_params.is_empty() {
4450            path.push_str("?");
4451            path.push_str(&query_params.join("&"));
4452        }
4453        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4454    }
4455
4456    /// POST CreatePackageFrommotherplant V1
4457    /// Permissions Required:
4458    ///   - View Immature Plants
4459    ///   - Manage Immature Plants Inventory
4460    ///   - View Packages
4461    ///   - Create/Submit/Discontinue Packages
4462    ///
4463    pub async fn plant_batches_create_package_frommotherplant_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4464        let mut path = format!("/plantbatches/v1/create/packages/frommotherplant");
4465        let mut query_params = Vec::new();
4466        if let Some(p) = license_number {
4467            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4468        }
4469        if !query_params.is_empty() {
4470            path.push_str("?");
4471            path.push_str(&query_params.join("&"));
4472        }
4473        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4474    }
4475
4476    /// POST CreatePackageFrommotherplant V2
4477    /// Creates packages from mother plants at the specified Facility.
4478    /// 
4479    ///   Permissions Required:
4480    ///   - View Immature Plants
4481    ///   - Manage Immature Plants Inventory
4482    ///   - View Packages
4483    ///   - Create/Submit/Discontinue Packages
4484    ///
4485    pub async fn plant_batches_create_package_frommotherplant_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4486        let mut path = format!("/plantbatches/v2/packages/frommotherplant");
4487        let mut query_params = Vec::new();
4488        if let Some(p) = license_number {
4489            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4490        }
4491        if !query_params.is_empty() {
4492            path.push_str("?");
4493            path.push_str(&query_params.join("&"));
4494        }
4495        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4496    }
4497
4498    /// POST CreatePlantings V2
4499    /// Creates new plantings for a Facility by generating plant batches based on provided planting details.
4500    /// 
4501    ///   Permissions Required:
4502    ///   - View Immature Plants
4503    ///   - Manage Immature Plants Inventory
4504    ///
4505    pub async fn plant_batches_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4506        let mut path = format!("/plantbatches/v2/plantings");
4507        let mut query_params = Vec::new();
4508        if let Some(p) = license_number {
4509            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4510        }
4511        if !query_params.is_empty() {
4512            path.push_str("?");
4513            path.push_str(&query_params.join("&"));
4514        }
4515        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4516    }
4517
4518    /// POST CreateSplit V1
4519    /// Permissions Required:
4520    ///   - View Immature Plants
4521    ///   - Manage Immature Plants Inventory
4522    ///
4523    pub async fn plant_batches_create_split_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4524        let mut path = format!("/plantbatches/v1/split");
4525        let mut query_params = Vec::new();
4526        if let Some(p) = license_number {
4527            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4528        }
4529        if !query_params.is_empty() {
4530            path.push_str("?");
4531            path.push_str(&query_params.join("&"));
4532        }
4533        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4534    }
4535
4536    /// POST CreateSplit V2
4537    /// Splits an existing Plant Batch into multiple groups at the specified Facility.
4538    /// 
4539    ///   Permissions Required:
4540    ///   - View Immature Plants
4541    ///   - Manage Immature Plants Inventory
4542    ///
4543    pub async fn plant_batches_create_split_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4544        let mut path = format!("/plantbatches/v2/split");
4545        let mut query_params = Vec::new();
4546        if let Some(p) = license_number {
4547            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4548        }
4549        if !query_params.is_empty() {
4550            path.push_str("?");
4551            path.push_str(&query_params.join("&"));
4552        }
4553        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4554    }
4555
4556    /// POST CreateWaste V1
4557    /// Permissions Required:
4558    ///   - Manage Plants Waste
4559    ///
4560    pub async fn plant_batches_create_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4561        let mut path = format!("/plantbatches/v1/waste");
4562        let mut query_params = Vec::new();
4563        if let Some(p) = license_number {
4564            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4565        }
4566        if !query_params.is_empty() {
4567            path.push_str("?");
4568            path.push_str(&query_params.join("&"));
4569        }
4570        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4571    }
4572
4573    /// POST CreateWaste V2
4574    /// Records waste information for plant batches based on the submitted data for the specified Facility.
4575    /// 
4576    ///   Permissions Required:
4577    ///   - Manage Plants Waste
4578    ///
4579    pub async fn plant_batches_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4580        let mut path = format!("/plantbatches/v2/waste");
4581        let mut query_params = Vec::new();
4582        if let Some(p) = license_number {
4583            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4584        }
4585        if !query_params.is_empty() {
4586            path.push_str("?");
4587            path.push_str(&query_params.join("&"));
4588        }
4589        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4590    }
4591
4592    /// POST Createpackages V1
4593    /// Permissions Required:
4594    ///   - View Immature Plants
4595    ///   - Manage Immature Plants Inventory
4596    ///   - View Packages
4597    ///   - Create/Submit/Discontinue Packages
4598    ///
4599    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>> {
4600        let mut path = format!("/plantbatches/v1/createpackages");
4601        let mut query_params = Vec::new();
4602        if let Some(p) = is_from_mother_plant {
4603            query_params.push(format!("isFromMotherPlant={}", urlencoding::encode(&p)));
4604        }
4605        if let Some(p) = license_number {
4606            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4607        }
4608        if !query_params.is_empty() {
4609            path.push_str("?");
4610            path.push_str(&query_params.join("&"));
4611        }
4612        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4613    }
4614
4615    /// POST Createplantings V1
4616    /// Permissions Required:
4617    ///   - View Immature Plants
4618    ///   - Manage Immature Plants Inventory
4619    ///
4620    pub async fn plant_batches_createplantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4621        let mut path = format!("/plantbatches/v1/createplantings");
4622        let mut query_params = Vec::new();
4623        if let Some(p) = license_number {
4624            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4625        }
4626        if !query_params.is_empty() {
4627            path.push_str("?");
4628            path.push_str(&query_params.join("&"));
4629        }
4630        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4631    }
4632
4633    /// DELETE Delete V1
4634    /// Permissions Required:
4635    ///   - View Immature Plants
4636    ///   - Destroy Immature Plants
4637    ///
4638    pub async fn plant_batches_delete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4639        let mut path = format!("/plantbatches/v1");
4640        let mut query_params = Vec::new();
4641        if let Some(p) = license_number {
4642            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4643        }
4644        if !query_params.is_empty() {
4645            path.push_str("?");
4646            path.push_str(&query_params.join("&"));
4647        }
4648        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4649    }
4650
4651    /// DELETE Delete V2
4652    /// Completes the destruction of plant batches based on the provided input data.
4653    /// 
4654    ///   Permissions Required:
4655    ///   - View Immature Plants
4656    ///   - Destroy Immature Plants
4657    ///
4658    pub async fn plant_batches_delete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4659        let mut path = format!("/plantbatches/v2");
4660        let mut query_params = Vec::new();
4661        if let Some(p) = license_number {
4662            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4663        }
4664        if !query_params.is_empty() {
4665            path.push_str("?");
4666            path.push_str(&query_params.join("&"));
4667        }
4668        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4669    }
4670
4671    /// GET Get V1
4672    /// Permissions Required:
4673    ///   - View Immature Plants
4674    ///
4675    pub async fn plant_batches_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4676        let mut path = format!("/plantbatches/v1/{}", urlencoding::encode(id).as_ref());
4677        let mut query_params = Vec::new();
4678        if let Some(p) = license_number {
4679            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4680        }
4681        if !query_params.is_empty() {
4682            path.push_str("?");
4683            path.push_str(&query_params.join("&"));
4684        }
4685        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4686    }
4687
4688    /// GET Get V2
4689    /// Retrieves a Plant Batch by Id.
4690    /// 
4691    ///   Permissions Required:
4692    ///   - View Immature Plants
4693    ///
4694    pub async fn plant_batches_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4695        let mut path = format!("/plantbatches/v2/{}", urlencoding::encode(id).as_ref());
4696        let mut query_params = Vec::new();
4697        if let Some(p) = license_number {
4698            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4699        }
4700        if !query_params.is_empty() {
4701            path.push_str("?");
4702            path.push_str(&query_params.join("&"));
4703        }
4704        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4705    }
4706
4707    /// GET GetActive V1
4708    /// Permissions Required:
4709    ///   - View Immature Plants
4710    ///
4711    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>> {
4712        let mut path = format!("/plantbatches/v1/active");
4713        let mut query_params = Vec::new();
4714        if let Some(p) = last_modified_end {
4715            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4716        }
4717        if let Some(p) = last_modified_start {
4718            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4719        }
4720        if let Some(p) = license_number {
4721            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4722        }
4723        if !query_params.is_empty() {
4724            path.push_str("?");
4725            path.push_str(&query_params.join("&"));
4726        }
4727        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4728    }
4729
4730    /// GET GetActive V2
4731    /// Retrieves a list of active plant batches for the specified Facility, optionally filtered by last modified date.
4732    /// 
4733    ///   Permissions Required:
4734    ///   - View Immature Plants
4735    ///
4736    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>> {
4737        let mut path = format!("/plantbatches/v2/active");
4738        let mut query_params = Vec::new();
4739        if let Some(p) = last_modified_end {
4740            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4741        }
4742        if let Some(p) = last_modified_start {
4743            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4744        }
4745        if let Some(p) = license_number {
4746            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4747        }
4748        if let Some(p) = page_number {
4749            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4750        }
4751        if let Some(p) = page_size {
4752            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4753        }
4754        if !query_params.is_empty() {
4755            path.push_str("?");
4756            path.push_str(&query_params.join("&"));
4757        }
4758        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4759    }
4760
4761    /// GET GetInactive V1
4762    /// Permissions Required:
4763    ///   - View Immature Plants
4764    ///
4765    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>> {
4766        let mut path = format!("/plantbatches/v1/inactive");
4767        let mut query_params = Vec::new();
4768        if let Some(p) = last_modified_end {
4769            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4770        }
4771        if let Some(p) = last_modified_start {
4772            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4773        }
4774        if let Some(p) = license_number {
4775            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4776        }
4777        if !query_params.is_empty() {
4778            path.push_str("?");
4779            path.push_str(&query_params.join("&"));
4780        }
4781        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4782    }
4783
4784    /// GET GetInactive V2
4785    /// Retrieves a list of inactive plant batches for the specified Facility, optionally filtered by last modified date.
4786    /// 
4787    ///   Permissions Required:
4788    ///   - View Immature Plants
4789    ///
4790    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>> {
4791        let mut path = format!("/plantbatches/v2/inactive");
4792        let mut query_params = Vec::new();
4793        if let Some(p) = last_modified_end {
4794            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
4795        }
4796        if let Some(p) = last_modified_start {
4797            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
4798        }
4799        if let Some(p) = license_number {
4800            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4801        }
4802        if let Some(p) = page_number {
4803            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4804        }
4805        if let Some(p) = page_size {
4806            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4807        }
4808        if !query_params.is_empty() {
4809            path.push_str("?");
4810            path.push_str(&query_params.join("&"));
4811        }
4812        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4813    }
4814
4815    /// GET GetTypes V1
4816    /// Permissions Required:
4817    ///   - None
4818    ///
4819    pub async fn plant_batches_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4820        let mut path = format!("/plantbatches/v1/types");
4821        let mut query_params = Vec::new();
4822        if let Some(p) = no {
4823            query_params.push(format!("No={}", urlencoding::encode(&p)));
4824        }
4825        if !query_params.is_empty() {
4826            path.push_str("?");
4827            path.push_str(&query_params.join("&"));
4828        }
4829        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4830    }
4831
4832    /// GET GetTypes V2
4833    /// Retrieves a list of plant batch types.
4834    /// 
4835    ///   Permissions Required:
4836    ///   - None
4837    ///
4838    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>> {
4839        let mut path = format!("/plantbatches/v2/types");
4840        let mut query_params = Vec::new();
4841        if let Some(p) = page_number {
4842            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4843        }
4844        if let Some(p) = page_size {
4845            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4846        }
4847        if !query_params.is_empty() {
4848            path.push_str("?");
4849            path.push_str(&query_params.join("&"));
4850        }
4851        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4852    }
4853
4854    /// GET GetWaste V2
4855    /// Retrieves waste details associated with plant batches at a specified Facility.
4856    /// 
4857    ///   Permissions Required:
4858    ///   - View Plants Waste
4859    ///
4860    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>> {
4861        let mut path = format!("/plantbatches/v2/waste");
4862        let mut query_params = Vec::new();
4863        if let Some(p) = license_number {
4864            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4865        }
4866        if let Some(p) = page_number {
4867            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
4868        }
4869        if let Some(p) = page_size {
4870            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
4871        }
4872        if !query_params.is_empty() {
4873            path.push_str("?");
4874            path.push_str(&query_params.join("&"));
4875        }
4876        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4877    }
4878
4879    /// GET GetWasteReasons V1
4880    /// Permissions Required:
4881    ///   - None
4882    ///
4883    pub async fn plant_batches_get_waste_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4884        let mut path = format!("/plantbatches/v1/waste/reasons");
4885        let mut query_params = Vec::new();
4886        if let Some(p) = license_number {
4887            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4888        }
4889        if !query_params.is_empty() {
4890            path.push_str("?");
4891            path.push_str(&query_params.join("&"));
4892        }
4893        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4894    }
4895
4896    /// GET GetWasteReasons V2
4897    /// Retrieves a list of valid waste reasons associated with immature plant batches for the specified Facility.
4898    /// 
4899    ///   Permissions Required:
4900    ///   - None
4901    ///
4902    pub async fn plant_batches_get_waste_reasons_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4903        let mut path = format!("/plantbatches/v2/waste/reasons");
4904        let mut query_params = Vec::new();
4905        if let Some(p) = license_number {
4906            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4907        }
4908        if !query_params.is_empty() {
4909            path.push_str("?");
4910            path.push_str(&query_params.join("&"));
4911        }
4912        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4913    }
4914
4915    /// PUT UpdateLocation V2
4916    /// Moves one or more plant batches to new locations with in a specified Facility.
4917    /// 
4918    ///   Permissions Required:
4919    ///   - View Immature Plants
4920    ///   - Manage Immature Plants
4921    ///
4922    pub async fn plant_batches_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4923        let mut path = format!("/plantbatches/v2/location");
4924        let mut query_params = Vec::new();
4925        if let Some(p) = license_number {
4926            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4927        }
4928        if !query_params.is_empty() {
4929            path.push_str("?");
4930            path.push_str(&query_params.join("&"));
4931        }
4932        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4933    }
4934
4935    /// PUT UpdateMoveplantbatches V1
4936    /// Permissions Required:
4937    ///   - View Immature Plants
4938    ///
4939    pub async fn plant_batches_update_moveplantbatches_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4940        let mut path = format!("/plantbatches/v1/moveplantbatches");
4941        let mut query_params = Vec::new();
4942        if let Some(p) = license_number {
4943            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4944        }
4945        if !query_params.is_empty() {
4946            path.push_str("?");
4947            path.push_str(&query_params.join("&"));
4948        }
4949        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4950    }
4951
4952    /// PUT UpdateName V2
4953    /// Renames plant batches at a specified Facility.
4954    /// 
4955    ///   Permissions Required:
4956    ///   - View Veg/Flower Plants
4957    ///   - Manage Veg/Flower Plants Inventory
4958    ///
4959    pub async fn plant_batches_update_name_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4960        let mut path = format!("/plantbatches/v2/name");
4961        let mut query_params = Vec::new();
4962        if let Some(p) = license_number {
4963            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4964        }
4965        if !query_params.is_empty() {
4966            path.push_str("?");
4967            path.push_str(&query_params.join("&"));
4968        }
4969        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4970    }
4971
4972    /// PUT UpdateStrain V2
4973    /// Changes the strain of plant batches at a specified Facility.
4974    /// 
4975    ///   Permissions Required:
4976    ///   - View Veg/Flower Plants
4977    ///   - Manage Veg/Flower Plants Inventory
4978    ///
4979    pub async fn plant_batches_update_strain_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
4980        let mut path = format!("/plantbatches/v2/strain");
4981        let mut query_params = Vec::new();
4982        if let Some(p) = license_number {
4983            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
4984        }
4985        if !query_params.is_empty() {
4986            path.push_str("?");
4987            path.push_str(&query_params.join("&"));
4988        }
4989        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
4990    }
4991
4992    /// PUT UpdateTag V2
4993    /// Replaces tags for plant batches at a specified Facility.
4994    /// 
4995    ///   Permissions Required:
4996    ///   - View Veg/Flower Plants
4997    ///   - Manage Veg/Flower Plants Inventory
4998    ///
4999    pub async fn plant_batches_update_tag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5000        let mut path = format!("/plantbatches/v2/tag");
5001        let mut query_params = Vec::new();
5002        if let Some(p) = license_number {
5003            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5004        }
5005        if !query_params.is_empty() {
5006            path.push_str("?");
5007            path.push_str(&query_params.join("&"));
5008        }
5009        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5010    }
5011
5012    /// POST CreateAdditives V1
5013    /// Permissions Required:
5014    ///   - Manage Plants Additives
5015    ///
5016    pub async fn plants_create_additives_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5017        let mut path = format!("/plants/v1/additives");
5018        let mut query_params = Vec::new();
5019        if let Some(p) = license_number {
5020            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5021        }
5022        if !query_params.is_empty() {
5023            path.push_str("?");
5024            path.push_str(&query_params.join("&"));
5025        }
5026        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5027    }
5028
5029    /// POST CreateAdditives V2
5030    /// Records additive usage details applied to specific plants at a Facility.
5031    /// 
5032    ///   Permissions Required:
5033    ///   - Manage Plants Additives
5034    ///
5035    pub async fn plants_create_additives_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5036        let mut path = format!("/plants/v2/additives");
5037        let mut query_params = Vec::new();
5038        if let Some(p) = license_number {
5039            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5040        }
5041        if !query_params.is_empty() {
5042            path.push_str("?");
5043            path.push_str(&query_params.join("&"));
5044        }
5045        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5046    }
5047
5048    /// POST CreateAdditivesBylocation V1
5049    /// Permissions Required:
5050    ///   - Manage Plants
5051    ///   - Manage Plants Additives
5052    ///
5053    pub async fn plants_create_additives_bylocation_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5054        let mut path = format!("/plants/v1/additives/bylocation");
5055        let mut query_params = Vec::new();
5056        if let Some(p) = license_number {
5057            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5058        }
5059        if !query_params.is_empty() {
5060            path.push_str("?");
5061            path.push_str(&query_params.join("&"));
5062        }
5063        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5064    }
5065
5066    /// POST CreateAdditivesBylocation V2
5067    /// Records additive usage for plants based on their location within a specified Facility.
5068    /// 
5069    ///   Permissions Required:
5070    ///   - Manage Plants
5071    ///   - Manage Plants Additives
5072    ///
5073    pub async fn plants_create_additives_bylocation_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5074        let mut path = format!("/plants/v2/additives/bylocation");
5075        let mut query_params = Vec::new();
5076        if let Some(p) = license_number {
5077            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5078        }
5079        if !query_params.is_empty() {
5080            path.push_str("?");
5081            path.push_str(&query_params.join("&"));
5082        }
5083        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5084    }
5085
5086    /// POST CreateAdditivesBylocationUsingtemplate V2
5087    /// Records additive usage for plants by location using a predefined additive template at a specified Facility.
5088    /// 
5089    ///   Permissions Required:
5090    ///   - Manage Plants Additives
5091    ///
5092    pub async fn plants_create_additives_bylocation_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5093        let mut path = format!("/plants/v2/additives/bylocation/usingtemplate");
5094        let mut query_params = Vec::new();
5095        if let Some(p) = license_number {
5096            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5097        }
5098        if !query_params.is_empty() {
5099            path.push_str("?");
5100            path.push_str(&query_params.join("&"));
5101        }
5102        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5103    }
5104
5105    /// POST CreateAdditivesUsingtemplate V2
5106    /// Records additive usage for plants using predefined additive templates at a specified Facility.
5107    /// 
5108    ///   Permissions Required:
5109    ///   - Manage Plants Additives
5110    ///
5111    pub async fn plants_create_additives_usingtemplate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5112        let mut path = format!("/plants/v2/additives/usingtemplate");
5113        let mut query_params = Vec::new();
5114        if let Some(p) = license_number {
5115            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5116        }
5117        if !query_params.is_empty() {
5118            path.push_str("?");
5119            path.push_str(&query_params.join("&"));
5120        }
5121        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5122    }
5123
5124    /// POST CreateChangegrowthphases V1
5125    /// Permissions Required:
5126    ///   - View Veg/Flower Plants
5127    ///   - Manage Veg/Flower Plants Inventory
5128    ///
5129    pub async fn plants_create_changegrowthphases_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5130        let mut path = format!("/plants/v1/changegrowthphases");
5131        let mut query_params = Vec::new();
5132        if let Some(p) = license_number {
5133            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5134        }
5135        if !query_params.is_empty() {
5136            path.push_str("?");
5137            path.push_str(&query_params.join("&"));
5138        }
5139        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5140    }
5141
5142    /// POST CreateHarvestplants V1
5143    /// NOTE: If HarvestName is excluded from the request body, or if it is passed in as null, the harvest name is auto-generated.
5144    /// 
5145    ///   Permissions Required:
5146    ///   - View Veg/Flower Plants
5147    ///   - Manicure/Harvest Veg/Flower Plants
5148    ///
5149    pub async fn plants_create_harvestplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5150        let mut path = format!("/plants/v1/harvestplants");
5151        let mut query_params = Vec::new();
5152        if let Some(p) = license_number {
5153            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5154        }
5155        if !query_params.is_empty() {
5156            path.push_str("?");
5157            path.push_str(&query_params.join("&"));
5158        }
5159        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5160    }
5161
5162    /// POST CreateManicure V2
5163    /// Creates harvest product records from plant batches at a specified Facility.
5164    /// 
5165    ///   Permissions Required:
5166    ///   - View Veg/Flower Plants
5167    ///   - Manicure/Harvest Veg/Flower Plants
5168    ///
5169    pub async fn plants_create_manicure_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5170        let mut path = format!("/plants/v2/manicure");
5171        let mut query_params = Vec::new();
5172        if let Some(p) = license_number {
5173            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5174        }
5175        if !query_params.is_empty() {
5176            path.push_str("?");
5177            path.push_str(&query_params.join("&"));
5178        }
5179        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5180    }
5181
5182    /// POST CreateManicureplants V1
5183    /// Permissions Required:
5184    ///   - View Veg/Flower Plants
5185    ///   - Manicure/Harvest Veg/Flower Plants
5186    ///
5187    pub async fn plants_create_manicureplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5188        let mut path = format!("/plants/v1/manicureplants");
5189        let mut query_params = Vec::new();
5190        if let Some(p) = license_number {
5191            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5192        }
5193        if !query_params.is_empty() {
5194            path.push_str("?");
5195            path.push_str(&query_params.join("&"));
5196        }
5197        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5198    }
5199
5200    /// POST CreateMoveplants V1
5201    /// Permissions Required:
5202    ///   - View Veg/Flower Plants
5203    ///   - Manage Veg/Flower Plants Inventory
5204    ///
5205    pub async fn plants_create_moveplants_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5206        let mut path = format!("/plants/v1/moveplants");
5207        let mut query_params = Vec::new();
5208        if let Some(p) = license_number {
5209            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5210        }
5211        if !query_params.is_empty() {
5212            path.push_str("?");
5213            path.push_str(&query_params.join("&"));
5214        }
5215        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5216    }
5217
5218    /// POST CreatePlantbatchPackage V1
5219    /// Permissions Required:
5220    ///   - View Immature Plants
5221    ///   - Manage Immature Plants Inventory
5222    ///   - View Veg/Flower Plants
5223    ///   - Manage Veg/Flower Plants Inventory
5224    ///   - View Packages
5225    ///   - Create/Submit/Discontinue Packages
5226    ///
5227    pub async fn plants_create_plantbatch_package_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5228        let mut path = format!("/plants/v1/create/plantbatch/packages");
5229        let mut query_params = Vec::new();
5230        if let Some(p) = license_number {
5231            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5232        }
5233        if !query_params.is_empty() {
5234            path.push_str("?");
5235            path.push_str(&query_params.join("&"));
5236        }
5237        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5238    }
5239
5240    /// POST CreatePlantbatchPackage V2
5241    /// Creates packages from plant batches at a specified Facility.
5242    /// 
5243    ///   Permissions Required:
5244    ///   - View Immature Plants
5245    ///   - Manage Immature Plants Inventory
5246    ///   - View Veg/Flower Plants
5247    ///   - Manage Veg/Flower Plants Inventory
5248    ///   - View Packages
5249    ///   - Create/Submit/Discontinue Packages
5250    ///
5251    pub async fn plants_create_plantbatch_package_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5252        let mut path = format!("/plants/v2/plantbatch/packages");
5253        let mut query_params = Vec::new();
5254        if let Some(p) = license_number {
5255            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5256        }
5257        if !query_params.is_empty() {
5258            path.push_str("?");
5259            path.push_str(&query_params.join("&"));
5260        }
5261        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5262    }
5263
5264    /// POST CreatePlantings V1
5265    /// Permissions Required:
5266    ///   - View Immature Plants
5267    ///   - Manage Immature Plants Inventory
5268    ///   - View Veg/Flower Plants
5269    ///   - Manage Veg/Flower Plants Inventory
5270    ///
5271    pub async fn plants_create_plantings_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5272        let mut path = format!("/plants/v1/create/plantings");
5273        let mut query_params = Vec::new();
5274        if let Some(p) = license_number {
5275            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5276        }
5277        if !query_params.is_empty() {
5278            path.push_str("?");
5279            path.push_str(&query_params.join("&"));
5280        }
5281        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5282    }
5283
5284    /// POST CreatePlantings V2
5285    /// Creates new plant batches at a specified Facility from existing plant data.
5286    /// 
5287    ///   Permissions Required:
5288    ///   - View Immature Plants
5289    ///   - Manage Immature Plants Inventory
5290    ///   - View Veg/Flower Plants
5291    ///   - Manage Veg/Flower Plants Inventory
5292    ///
5293    pub async fn plants_create_plantings_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5294        let mut path = format!("/plants/v2/plantings");
5295        let mut query_params = Vec::new();
5296        if let Some(p) = license_number {
5297            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5304    }
5305
5306    /// POST CreateWaste V1
5307    /// Permissions Required:
5308    ///   - Manage Plants Waste
5309    ///
5310    pub async fn plants_create_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5311        let mut path = format!("/plants/v1/waste");
5312        let mut query_params = Vec::new();
5313        if let Some(p) = license_number {
5314            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5315        }
5316        if !query_params.is_empty() {
5317            path.push_str("?");
5318            path.push_str(&query_params.join("&"));
5319        }
5320        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5321    }
5322
5323    /// POST CreateWaste V2
5324    /// Records waste events for plants at a Facility, including method, reason, and location details.
5325    /// 
5326    ///   Permissions Required:
5327    ///   - Manage Plants Waste
5328    ///
5329    pub async fn plants_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5330        let mut path = format!("/plants/v2/waste");
5331        let mut query_params = Vec::new();
5332        if let Some(p) = license_number {
5333            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5334        }
5335        if !query_params.is_empty() {
5336            path.push_str("?");
5337            path.push_str(&query_params.join("&"));
5338        }
5339        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5340    }
5341
5342    /// DELETE Delete V1
5343    /// Permissions Required:
5344    ///   - View Veg/Flower Plants
5345    ///   - Destroy Veg/Flower Plants
5346    ///
5347    pub async fn plants_delete_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5348        let mut path = format!("/plants/v1");
5349        let mut query_params = Vec::new();
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::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5358    }
5359
5360    /// DELETE Delete V2
5361    /// Removes plants from a Facility’s inventory while recording the reason for their disposal.
5362    /// 
5363    ///   Permissions Required:
5364    ///   - View Veg/Flower Plants
5365    ///   - Destroy Veg/Flower Plants
5366    ///
5367    pub async fn plants_delete_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5368        let mut path = format!("/plants/v2");
5369        let mut query_params = Vec::new();
5370        if let Some(p) = license_number {
5371            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5372        }
5373        if !query_params.is_empty() {
5374            path.push_str("?");
5375            path.push_str(&query_params.join("&"));
5376        }
5377        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5378    }
5379
5380    /// GET Get V1
5381    /// Permissions Required:
5382    ///   - View Veg/Flower Plants
5383    ///
5384    pub async fn plants_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5385        let mut path = format!("/plants/v1/{}", urlencoding::encode(id).as_ref());
5386        let mut query_params = Vec::new();
5387        if let Some(p) = license_number {
5388            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5389        }
5390        if !query_params.is_empty() {
5391            path.push_str("?");
5392            path.push_str(&query_params.join("&"));
5393        }
5394        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5395    }
5396
5397    /// GET Get V2
5398    /// Retrieves a Plant by Id.
5399    /// 
5400    ///   Permissions Required:
5401    ///   - View Veg/Flower Plants
5402    ///
5403    pub async fn plants_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5404        let mut path = format!("/plants/v2/{}", urlencoding::encode(id).as_ref());
5405        let mut query_params = Vec::new();
5406        if let Some(p) = license_number {
5407            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5408        }
5409        if !query_params.is_empty() {
5410            path.push_str("?");
5411            path.push_str(&query_params.join("&"));
5412        }
5413        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5414    }
5415
5416    /// GET GetAdditives V1
5417    /// Permissions Required:
5418    ///   - View/Manage Plants Additives
5419    ///
5420    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>> {
5421        let mut path = format!("/plants/v1/additives");
5422        let mut query_params = Vec::new();
5423        if let Some(p) = last_modified_end {
5424            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5425        }
5426        if let Some(p) = last_modified_start {
5427            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5428        }
5429        if let Some(p) = license_number {
5430            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5431        }
5432        if !query_params.is_empty() {
5433            path.push_str("?");
5434            path.push_str(&query_params.join("&"));
5435        }
5436        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5437    }
5438
5439    /// GET GetAdditives V2
5440    /// Retrieves additive records applied to plants at a specified Facility.
5441    /// 
5442    ///   Permissions Required:
5443    ///   - View/Manage Plants Additives
5444    ///
5445    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>> {
5446        let mut path = format!("/plants/v2/additives");
5447        let mut query_params = Vec::new();
5448        if let Some(p) = last_modified_end {
5449            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5450        }
5451        if let Some(p) = last_modified_start {
5452            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5453        }
5454        if let Some(p) = license_number {
5455            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5456        }
5457        if let Some(p) = page_number {
5458            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5459        }
5460        if let Some(p) = page_size {
5461            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5462        }
5463        if !query_params.is_empty() {
5464            path.push_str("?");
5465            path.push_str(&query_params.join("&"));
5466        }
5467        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5468    }
5469
5470    /// GET GetAdditivesTypes V1
5471    /// Permissions Required:
5472    ///   -
5473    ///
5474    pub async fn plants_get_additives_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5475        let mut path = format!("/plants/v1/additives/types");
5476        let mut query_params = Vec::new();
5477        if let Some(p) = no {
5478            query_params.push(format!("No={}", urlencoding::encode(&p)));
5479        }
5480        if !query_params.is_empty() {
5481            path.push_str("?");
5482            path.push_str(&query_params.join("&"));
5483        }
5484        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5485    }
5486
5487    /// GET GetAdditivesTypes V2
5488    /// Retrieves a list of all plant additive types defined within a Facility.
5489    /// 
5490    ///   Permissions Required:
5491    ///   - None
5492    ///
5493    pub async fn plants_get_additives_types_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5494        let mut path = format!("/plants/v2/additives/types");
5495        let mut query_params = Vec::new();
5496        if let Some(p) = no {
5497            query_params.push(format!("No={}", urlencoding::encode(&p)));
5498        }
5499        if !query_params.is_empty() {
5500            path.push_str("?");
5501            path.push_str(&query_params.join("&"));
5502        }
5503        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5504    }
5505
5506    /// GET GetByLabel V1
5507    /// Permissions Required:
5508    ///   - View Veg/Flower Plants
5509    ///
5510    pub async fn plants_get_by_label_v1(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5511        let mut path = format!("/plants/v1/{}", urlencoding::encode(label).as_ref());
5512        let mut query_params = Vec::new();
5513        if let Some(p) = license_number {
5514            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5515        }
5516        if !query_params.is_empty() {
5517            path.push_str("?");
5518            path.push_str(&query_params.join("&"));
5519        }
5520        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5521    }
5522
5523    /// GET GetByLabel V2
5524    /// Retrieves a Plant by label.
5525    /// 
5526    ///   Permissions Required:
5527    ///   - View Veg/Flower Plants
5528    ///
5529    pub async fn plants_get_by_label_v2(&self, label: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5530        let mut path = format!("/plants/v2/{}", urlencoding::encode(label).as_ref());
5531        let mut query_params = Vec::new();
5532        if let Some(p) = license_number {
5533            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5534        }
5535        if !query_params.is_empty() {
5536            path.push_str("?");
5537            path.push_str(&query_params.join("&"));
5538        }
5539        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5540    }
5541
5542    /// GET GetFlowering V1
5543    /// Permissions Required:
5544    ///   - View Veg/Flower Plants
5545    ///
5546    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>> {
5547        let mut path = format!("/plants/v1/flowering");
5548        let mut query_params = Vec::new();
5549        if let Some(p) = last_modified_end {
5550            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5551        }
5552        if let Some(p) = last_modified_start {
5553            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5554        }
5555        if let Some(p) = license_number {
5556            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5557        }
5558        if !query_params.is_empty() {
5559            path.push_str("?");
5560            path.push_str(&query_params.join("&"));
5561        }
5562        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5563    }
5564
5565    /// GET GetFlowering V2
5566    /// Retrieves flowering-phase plants at a specified Facility, optionally filtered by last modified date.
5567    /// 
5568    ///   Permissions Required:
5569    ///   - View Veg/Flower Plants
5570    ///
5571    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>> {
5572        let mut path = format!("/plants/v2/flowering");
5573        let mut query_params = Vec::new();
5574        if let Some(p) = last_modified_end {
5575            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5576        }
5577        if let Some(p) = last_modified_start {
5578            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5579        }
5580        if let Some(p) = license_number {
5581            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5582        }
5583        if let Some(p) = page_number {
5584            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5585        }
5586        if let Some(p) = page_size {
5587            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5588        }
5589        if !query_params.is_empty() {
5590            path.push_str("?");
5591            path.push_str(&query_params.join("&"));
5592        }
5593        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5594    }
5595
5596    /// GET GetGrowthPhases V1
5597    /// Permissions Required:
5598    ///   - None
5599    ///
5600    pub async fn plants_get_growth_phases_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5601        let mut path = format!("/plants/v1/growthphases");
5602        let mut query_params = Vec::new();
5603        if let Some(p) = license_number {
5604            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5605        }
5606        if !query_params.is_empty() {
5607            path.push_str("?");
5608            path.push_str(&query_params.join("&"));
5609        }
5610        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5611    }
5612
5613    /// GET GetGrowthPhases V2
5614    /// Retrieves the list of growth phases supported by a specified Facility.
5615    /// 
5616    ///   Permissions Required:
5617    ///   - None
5618    ///
5619    pub async fn plants_get_growth_phases_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5620        let mut path = format!("/plants/v2/growthphases");
5621        let mut query_params = Vec::new();
5622        if let Some(p) = license_number {
5623            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5624        }
5625        if !query_params.is_empty() {
5626            path.push_str("?");
5627            path.push_str(&query_params.join("&"));
5628        }
5629        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5630    }
5631
5632    /// GET GetInactive V1
5633    /// Permissions Required:
5634    ///   - View Veg/Flower Plants
5635    ///
5636    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>> {
5637        let mut path = format!("/plants/v1/inactive");
5638        let mut query_params = Vec::new();
5639        if let Some(p) = last_modified_end {
5640            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5641        }
5642        if let Some(p) = last_modified_start {
5643            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5644        }
5645        if let Some(p) = license_number {
5646            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5647        }
5648        if !query_params.is_empty() {
5649            path.push_str("?");
5650            path.push_str(&query_params.join("&"));
5651        }
5652        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5653    }
5654
5655    /// GET GetInactive V2
5656    /// Retrieves inactive plants at a specified Facility.
5657    /// 
5658    ///   Permissions Required:
5659    ///   - View Veg/Flower Plants
5660    ///
5661    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>> {
5662        let mut path = format!("/plants/v2/inactive");
5663        let mut query_params = Vec::new();
5664        if let Some(p) = last_modified_end {
5665            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5666        }
5667        if let Some(p) = last_modified_start {
5668            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5669        }
5670        if let Some(p) = license_number {
5671            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5672        }
5673        if let Some(p) = page_number {
5674            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5675        }
5676        if let Some(p) = page_size {
5677            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5678        }
5679        if !query_params.is_empty() {
5680            path.push_str("?");
5681            path.push_str(&query_params.join("&"));
5682        }
5683        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5684    }
5685
5686    /// GET GetMother V2
5687    /// Retrieves mother-phase plants at a specified Facility.
5688    /// 
5689    ///   Permissions Required:
5690    ///   - View Mother Plants
5691    ///
5692    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>> {
5693        let mut path = format!("/plants/v2/mother");
5694        let mut query_params = Vec::new();
5695        if let Some(p) = last_modified_end {
5696            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5697        }
5698        if let Some(p) = last_modified_start {
5699            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5700        }
5701        if let Some(p) = license_number {
5702            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5703        }
5704        if let Some(p) = page_number {
5705            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5706        }
5707        if let Some(p) = page_size {
5708            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5709        }
5710        if !query_params.is_empty() {
5711            path.push_str("?");
5712            path.push_str(&query_params.join("&"));
5713        }
5714        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5715    }
5716
5717    /// GET GetMotherInactive V2
5718    /// Retrieves inactive mother-phase plants at a specified Facility.
5719    /// 
5720    ///   Permissions Required:
5721    ///   - View Mother Plants
5722    ///
5723    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>> {
5724        let mut path = format!("/plants/v2/mother/inactive");
5725        let mut query_params = Vec::new();
5726        if let Some(p) = last_modified_end {
5727            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5728        }
5729        if let Some(p) = last_modified_start {
5730            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5731        }
5732        if let Some(p) = license_number {
5733            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5734        }
5735        if let Some(p) = page_number {
5736            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5737        }
5738        if let Some(p) = page_size {
5739            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5740        }
5741        if !query_params.is_empty() {
5742            path.push_str("?");
5743            path.push_str(&query_params.join("&"));
5744        }
5745        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5746    }
5747
5748    /// GET GetMotherOnhold V2
5749    /// Retrieves mother-phase plants currently marked as on hold at a specified Facility.
5750    /// 
5751    ///   Permissions Required:
5752    ///   - View Mother Plants
5753    ///
5754    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>> {
5755        let mut path = format!("/plants/v2/mother/onhold");
5756        let mut query_params = Vec::new();
5757        if let Some(p) = last_modified_end {
5758            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5759        }
5760        if let Some(p) = last_modified_start {
5761            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5762        }
5763        if let Some(p) = license_number {
5764            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5765        }
5766        if let Some(p) = page_number {
5767            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5768        }
5769        if let Some(p) = page_size {
5770            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5771        }
5772        if !query_params.is_empty() {
5773            path.push_str("?");
5774            path.push_str(&query_params.join("&"));
5775        }
5776        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5777    }
5778
5779    /// GET GetOnhold V1
5780    /// Permissions Required:
5781    ///   - View Veg/Flower Plants
5782    ///
5783    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>> {
5784        let mut path = format!("/plants/v1/onhold");
5785        let mut query_params = Vec::new();
5786        if let Some(p) = last_modified_end {
5787            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5788        }
5789        if let Some(p) = last_modified_start {
5790            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5791        }
5792        if let Some(p) = license_number {
5793            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5794        }
5795        if !query_params.is_empty() {
5796            path.push_str("?");
5797            path.push_str(&query_params.join("&"));
5798        }
5799        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5800    }
5801
5802    /// GET GetOnhold V2
5803    /// Retrieves plants that are currently on hold at a specified Facility.
5804    /// 
5805    ///   Permissions Required:
5806    ///   - View Veg/Flower Plants
5807    ///
5808    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>> {
5809        let mut path = format!("/plants/v2/onhold");
5810        let mut query_params = Vec::new();
5811        if let Some(p) = last_modified_end {
5812            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5813        }
5814        if let Some(p) = last_modified_start {
5815            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5816        }
5817        if let Some(p) = license_number {
5818            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5819        }
5820        if let Some(p) = page_number {
5821            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5822        }
5823        if let Some(p) = page_size {
5824            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5825        }
5826        if !query_params.is_empty() {
5827            path.push_str("?");
5828            path.push_str(&query_params.join("&"));
5829        }
5830        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5831    }
5832
5833    /// GET GetVegetative V1
5834    /// Permissions Required:
5835    ///   - View Veg/Flower Plants
5836    ///
5837    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>> {
5838        let mut path = format!("/plants/v1/vegetative");
5839        let mut query_params = Vec::new();
5840        if let Some(p) = last_modified_end {
5841            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5842        }
5843        if let Some(p) = last_modified_start {
5844            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5845        }
5846        if let Some(p) = license_number {
5847            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5848        }
5849        if !query_params.is_empty() {
5850            path.push_str("?");
5851            path.push_str(&query_params.join("&"));
5852        }
5853        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5854    }
5855
5856    /// GET GetVegetative V2
5857    /// Retrieves vegetative-phase plants at a specified Facility, optionally filtered by last modified date.
5858    /// 
5859    ///   Permissions Required:
5860    ///   - View Veg/Flower Plants
5861    ///
5862    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>> {
5863        let mut path = format!("/plants/v2/vegetative");
5864        let mut query_params = Vec::new();
5865        if let Some(p) = last_modified_end {
5866            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
5867        }
5868        if let Some(p) = last_modified_start {
5869            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
5870        }
5871        if let Some(p) = license_number {
5872            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5873        }
5874        if let Some(p) = page_number {
5875            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5876        }
5877        if let Some(p) = page_size {
5878            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5879        }
5880        if !query_params.is_empty() {
5881            path.push_str("?");
5882            path.push_str(&query_params.join("&"));
5883        }
5884        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5885    }
5886
5887    /// GET GetWaste V2
5888    /// Retrieves a list of recorded plant waste events for a specific Facility.
5889    /// 
5890    ///   Permissions Required:
5891    ///   - View Plants Waste
5892    ///
5893    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>> {
5894        let mut path = format!("/plants/v2/waste");
5895        let mut query_params = Vec::new();
5896        if let Some(p) = license_number {
5897            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5898        }
5899        if let Some(p) = page_number {
5900            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5901        }
5902        if let Some(p) = page_size {
5903            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5904        }
5905        if !query_params.is_empty() {
5906            path.push_str("?");
5907            path.push_str(&query_params.join("&"));
5908        }
5909        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5910    }
5911
5912    /// GET GetWasteMethodsAll V1
5913    /// Permissions Required:
5914    ///   - None
5915    ///
5916    pub async fn plants_get_waste_methods_all_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
5917        let mut path = format!("/plants/v1/waste/methods/all");
5918        let mut query_params = Vec::new();
5919        if let Some(p) = no {
5920            query_params.push(format!("No={}", urlencoding::encode(&p)));
5921        }
5922        if !query_params.is_empty() {
5923            path.push_str("?");
5924            path.push_str(&query_params.join("&"));
5925        }
5926        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5927    }
5928
5929    /// GET GetWasteMethodsAll V2
5930    /// Retrieves a list of all available plant waste methods for use within a Facility.
5931    /// 
5932    ///   Permissions Required:
5933    ///   - None
5934    ///
5935    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>> {
5936        let mut path = format!("/plants/v2/waste/methods/all");
5937        let mut query_params = Vec::new();
5938        if let Some(p) = page_number {
5939            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5940        }
5941        if let Some(p) = page_size {
5942            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5943        }
5944        if !query_params.is_empty() {
5945            path.push_str("?");
5946            path.push_str(&query_params.join("&"));
5947        }
5948        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5949    }
5950
5951    /// GET GetWastePackage V2
5952    /// Retrieves a list of package records linked to the specified plantWasteId for a given facility.
5953    /// 
5954    ///   Permissions Required:
5955    ///   - View Plants Waste
5956    ///
5957    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>> {
5958        let mut path = format!("/plants/v2/waste/{}/package", urlencoding::encode(id).as_ref());
5959        let mut query_params = Vec::new();
5960        if let Some(p) = license_number {
5961            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5962        }
5963        if let Some(p) = page_number {
5964            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5965        }
5966        if let Some(p) = page_size {
5967            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5968        }
5969        if !query_params.is_empty() {
5970            path.push_str("?");
5971            path.push_str(&query_params.join("&"));
5972        }
5973        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5974    }
5975
5976    /// GET GetWastePlant V2
5977    /// Retrieves a list of plants records linked to the specified plantWasteId for a given facility.
5978    /// 
5979    ///   Permissions Required:
5980    ///   - View Plants Waste
5981    ///
5982    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>> {
5983        let mut path = format!("/plants/v2/waste/{}/plant", urlencoding::encode(id).as_ref());
5984        let mut query_params = Vec::new();
5985        if let Some(p) = license_number {
5986            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
5987        }
5988        if let Some(p) = page_number {
5989            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
5990        }
5991        if let Some(p) = page_size {
5992            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
5993        }
5994        if !query_params.is_empty() {
5995            path.push_str("?");
5996            path.push_str(&query_params.join("&"));
5997        }
5998        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
5999    }
6000
6001    /// GET GetWasteReasons V1
6002    /// Permissions Required:
6003    ///   - None
6004    ///
6005    pub async fn plants_get_waste_reasons_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6006        let mut path = format!("/plants/v1/waste/reasons");
6007        let mut query_params = Vec::new();
6008        if let Some(p) = license_number {
6009            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6010        }
6011        if !query_params.is_empty() {
6012            path.push_str("?");
6013            path.push_str(&query_params.join("&"));
6014        }
6015        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6016    }
6017
6018    /// GET GetWasteReasons V2
6019    /// Retriveves available reasons for recording mature plant waste at a specified Facility.
6020    /// 
6021    ///   Permissions Required:
6022    ///   - None
6023    ///
6024    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>> {
6025        let mut path = format!("/plants/v2/waste/reasons");
6026        let mut query_params = Vec::new();
6027        if let Some(p) = license_number {
6028            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6029        }
6030        if let Some(p) = page_number {
6031            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6032        }
6033        if let Some(p) = page_size {
6034            query_params.push(format!("pageSize={}", 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::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6041    }
6042
6043    /// PUT UpdateAdjust V2
6044    /// Adjusts the recorded count of plants at a specified Facility.
6045    /// 
6046    ///   Permissions Required:
6047    ///   - View Veg/Flower Plants
6048    ///   - Manage Veg/Flower Plants Inventory
6049    ///
6050    pub async fn plants_update_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6051        let mut path = format!("/plants/v2/adjust");
6052        let mut query_params = Vec::new();
6053        if let Some(p) = license_number {
6054            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6055        }
6056        if !query_params.is_empty() {
6057            path.push_str("?");
6058            path.push_str(&query_params.join("&"));
6059        }
6060        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6061    }
6062
6063    /// PUT UpdateGrowthphase V2
6064    /// Changes the growth phases of plants within a specified Facility.
6065    /// 
6066    ///   Permissions Required:
6067    ///   - View Veg/Flower Plants
6068    ///   - Manage Veg/Flower Plants Inventory
6069    ///
6070    pub async fn plants_update_growthphase_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6071        let mut path = format!("/plants/v2/growthphase");
6072        let mut query_params = Vec::new();
6073        if let Some(p) = license_number {
6074            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6075        }
6076        if !query_params.is_empty() {
6077            path.push_str("?");
6078            path.push_str(&query_params.join("&"));
6079        }
6080        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6081    }
6082
6083    /// PUT UpdateHarvest V2
6084    /// 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.
6085    /// 
6086    ///   Permissions Required:
6087    ///   - View Veg/Flower Plants
6088    ///   - Manicure/Harvest Veg/Flower Plants
6089    ///
6090    pub async fn plants_update_harvest_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6091        let mut path = format!("/plants/v2/harvest");
6092        let mut query_params = Vec::new();
6093        if let Some(p) = license_number {
6094            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6095        }
6096        if !query_params.is_empty() {
6097            path.push_str("?");
6098            path.push_str(&query_params.join("&"));
6099        }
6100        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6101    }
6102
6103    /// PUT UpdateLocation V2
6104    /// Moves plant batches to new locations within a specified Facility.
6105    /// 
6106    ///   Permissions Required:
6107    ///   - View Veg/Flower Plants
6108    ///   - Manage Veg/Flower Plants Inventory
6109    ///
6110    pub async fn plants_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6111        let mut path = format!("/plants/v2/location");
6112        let mut query_params = Vec::new();
6113        if let Some(p) = license_number {
6114            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6115        }
6116        if !query_params.is_empty() {
6117            path.push_str("?");
6118            path.push_str(&query_params.join("&"));
6119        }
6120        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6121    }
6122
6123    /// PUT UpdateMerge V2
6124    /// Merges multiple plant groups into a single group within a Facility.
6125    /// 
6126    ///   Permissions Required:
6127    ///   - View Veg/Flower Plants
6128    ///   - Manicure/Harvest Veg/Flower Plants
6129    ///
6130    pub async fn plants_update_merge_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6131        let mut path = format!("/plants/v2/merge");
6132        let mut query_params = Vec::new();
6133        if let Some(p) = license_number {
6134            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6135        }
6136        if !query_params.is_empty() {
6137            path.push_str("?");
6138            path.push_str(&query_params.join("&"));
6139        }
6140        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6141    }
6142
6143    /// PUT UpdateSplit V2
6144    /// Splits an existing plant group into multiple groups within a Facility.
6145    /// 
6146    ///   Permissions Required:
6147    ///   - View Plant
6148    ///
6149    pub async fn plants_update_split_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6150        let mut path = format!("/plants/v2/split");
6151        let mut query_params = Vec::new();
6152        if let Some(p) = license_number {
6153            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6154        }
6155        if !query_params.is_empty() {
6156            path.push_str("?");
6157            path.push_str(&query_params.join("&"));
6158        }
6159        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6160    }
6161
6162    /// PUT UpdateStrain V2
6163    /// Updates the strain information for plants within a Facility.
6164    /// 
6165    ///   Permissions Required:
6166    ///   - View Veg/Flower Plants
6167    ///   - Manage Veg/Flower Plants Inventory
6168    ///
6169    pub async fn plants_update_strain_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6170        let mut path = format!("/plants/v2/strain");
6171        let mut query_params = Vec::new();
6172        if let Some(p) = license_number {
6173            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6174        }
6175        if !query_params.is_empty() {
6176            path.push_str("?");
6177            path.push_str(&query_params.join("&"));
6178        }
6179        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6180    }
6181
6182    /// PUT UpdateTag V2
6183    /// Replaces existing plant tags with new tags for plants within a Facility.
6184    /// 
6185    ///   Permissions Required:
6186    ///   - View Veg/Flower Plants
6187    ///   - Manage Veg/Flower Plants Inventory
6188    ///
6189    pub async fn plants_update_tag_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6190        let mut path = format!("/plants/v2/tag");
6191        let mut query_params = Vec::new();
6192        if let Some(p) = license_number {
6193            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6194        }
6195        if !query_params.is_empty() {
6196            path.push_str("?");
6197            path.push_str(&query_params.join("&"));
6198        }
6199        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6200    }
6201
6202    /// POST CreateAdjust V1
6203    /// Permissions Required:
6204    ///   - ManageProcessingJobs
6205    ///
6206    pub async fn processing_jobs_create_adjust_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6207        let mut path = format!("/processing/v1/adjust");
6208        let mut query_params = Vec::new();
6209        if let Some(p) = license_number {
6210            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6211        }
6212        if !query_params.is_empty() {
6213            path.push_str("?");
6214            path.push_str(&query_params.join("&"));
6215        }
6216        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6217    }
6218
6219    /// POST CreateAdjust V2
6220    /// Adjusts the details of existing processing jobs at a Facility, including units of measure and associated packages.
6221    /// 
6222    ///   Permissions Required:
6223    ///   - Manage Processing Job
6224    ///
6225    pub async fn processing_jobs_create_adjust_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6226        let mut path = format!("/processing/v2/adjust");
6227        let mut query_params = Vec::new();
6228        if let Some(p) = license_number {
6229            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6230        }
6231        if !query_params.is_empty() {
6232            path.push_str("?");
6233            path.push_str(&query_params.join("&"));
6234        }
6235        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6236    }
6237
6238    /// POST CreateJobtypes V1
6239    /// Permissions Required:
6240    ///   - Manage Processing Job
6241    ///
6242    pub async fn processing_jobs_create_jobtypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6243        let mut path = format!("/processing/v1/jobtypes");
6244        let mut query_params = Vec::new();
6245        if let Some(p) = license_number {
6246            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6247        }
6248        if !query_params.is_empty() {
6249            path.push_str("?");
6250            path.push_str(&query_params.join("&"));
6251        }
6252        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6253    }
6254
6255    /// POST CreateJobtypes V2
6256    /// Creates new processing job types for a Facility, including name, category, description, steps, and attributes.
6257    /// 
6258    ///   Permissions Required:
6259    ///   - Manage Processing Job
6260    ///
6261    pub async fn processing_jobs_create_jobtypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6262        let mut path = format!("/processing/v2/jobtypes");
6263        let mut query_params = Vec::new();
6264        if let Some(p) = license_number {
6265            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6266        }
6267        if !query_params.is_empty() {
6268            path.push_str("?");
6269            path.push_str(&query_params.join("&"));
6270        }
6271        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6272    }
6273
6274    /// POST CreateStart V1
6275    /// Permissions Required:
6276    ///   - ManageProcessingJobs
6277    ///
6278    pub async fn processing_jobs_create_start_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6279        let mut path = format!("/processing/v1/start");
6280        let mut query_params = Vec::new();
6281        if let Some(p) = license_number {
6282            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6283        }
6284        if !query_params.is_empty() {
6285            path.push_str("?");
6286            path.push_str(&query_params.join("&"));
6287        }
6288        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6289    }
6290
6291    /// POST CreateStart V2
6292    /// Initiates new processing jobs at a Facility, including job details and associated packages.
6293    /// 
6294    ///   Permissions Required:
6295    ///   - Manage Processing Job
6296    ///
6297    pub async fn processing_jobs_create_start_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6298        let mut path = format!("/processing/v2/start");
6299        let mut query_params = Vec::new();
6300        if let Some(p) = license_number {
6301            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6302        }
6303        if !query_params.is_empty() {
6304            path.push_str("?");
6305            path.push_str(&query_params.join("&"));
6306        }
6307        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6308    }
6309
6310    /// POST Createpackages V1
6311    /// Permissions Required:
6312    ///   - ManageProcessingJobs
6313    ///
6314    pub async fn processing_jobs_createpackages_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6315        let mut path = format!("/processing/v1/createpackages");
6316        let mut query_params = Vec::new();
6317        if let Some(p) = license_number {
6318            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6319        }
6320        if !query_params.is_empty() {
6321            path.push_str("?");
6322            path.push_str(&query_params.join("&"));
6323        }
6324        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6325    }
6326
6327    /// POST Createpackages V2
6328    /// Creates packages from processing jobs at a Facility, including optional location and note assignments.
6329    /// 
6330    ///   Permissions Required:
6331    ///   - Manage Processing Job
6332    ///
6333    pub async fn processing_jobs_createpackages_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6334        let mut path = format!("/processing/v2/createpackages");
6335        let mut query_params = Vec::new();
6336        if let Some(p) = license_number {
6337            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6338        }
6339        if !query_params.is_empty() {
6340            path.push_str("?");
6341            path.push_str(&query_params.join("&"));
6342        }
6343        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6344    }
6345
6346    /// DELETE Delete V1
6347    /// Permissions Required:
6348    ///   - Manage Processing Job
6349    ///
6350    pub async fn processing_jobs_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6351        let mut path = format!("/processing/v1/{}", urlencoding::encode(id).as_ref());
6352        let mut query_params = Vec::new();
6353        if let Some(p) = license_number {
6354            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6355        }
6356        if !query_params.is_empty() {
6357            path.push_str("?");
6358            path.push_str(&query_params.join("&"));
6359        }
6360        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6361    }
6362
6363    /// DELETE Delete V2
6364    /// Archives a Processing Job at a Facility by marking it as inactive and removing it from active use.
6365    /// 
6366    ///   Permissions Required:
6367    ///   - Manage Processing Job
6368    ///
6369    pub async fn processing_jobs_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6370        let mut path = format!("/processing/v2/{}", urlencoding::encode(id).as_ref());
6371        let mut query_params = Vec::new();
6372        if let Some(p) = license_number {
6373            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6374        }
6375        if !query_params.is_empty() {
6376            path.push_str("?");
6377            path.push_str(&query_params.join("&"));
6378        }
6379        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6380    }
6381
6382    /// DELETE DeleteJobtypes V1
6383    /// Permissions Required:
6384    ///   - Manage Processing Job
6385    ///
6386    pub async fn processing_jobs_delete_jobtypes_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6387        let mut path = format!("/processing/v1/jobtypes/{}", urlencoding::encode(id).as_ref());
6388        let mut query_params = Vec::new();
6389        if let Some(p) = license_number {
6390            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6391        }
6392        if !query_params.is_empty() {
6393            path.push_str("?");
6394            path.push_str(&query_params.join("&"));
6395        }
6396        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6397    }
6398
6399    /// DELETE DeleteJobtypes V2
6400    /// Archives a Processing Job Type at a Facility, making it inactive for future use.
6401    /// 
6402    ///   Permissions Required:
6403    ///   - Manage Processing Job
6404    ///
6405    pub async fn processing_jobs_delete_jobtypes_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6406        let mut path = format!("/processing/v2/jobtypes/{}", urlencoding::encode(id).as_ref());
6407        let mut query_params = Vec::new();
6408        if let Some(p) = license_number {
6409            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6410        }
6411        if !query_params.is_empty() {
6412            path.push_str("?");
6413            path.push_str(&query_params.join("&"));
6414        }
6415        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6416    }
6417
6418    /// GET Get V1
6419    /// Permissions Required:
6420    ///   - Manage Processing Job
6421    ///
6422    pub async fn processing_jobs_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6423        let mut path = format!("/processing/v1/{}", urlencoding::encode(id).as_ref());
6424        let mut query_params = Vec::new();
6425        if let Some(p) = license_number {
6426            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6427        }
6428        if !query_params.is_empty() {
6429            path.push_str("?");
6430            path.push_str(&query_params.join("&"));
6431        }
6432        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6433    }
6434
6435    /// GET Get V2
6436    /// Retrieves a ProcessingJob by Id.
6437    /// 
6438    ///   Permissions Required:
6439    ///   - Manage Processing Job
6440    ///
6441    pub async fn processing_jobs_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6442        let mut path = format!("/processing/v2/{}", urlencoding::encode(id).as_ref());
6443        let mut query_params = Vec::new();
6444        if let Some(p) = license_number {
6445            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6446        }
6447        if !query_params.is_empty() {
6448            path.push_str("?");
6449            path.push_str(&query_params.join("&"));
6450        }
6451        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6452    }
6453
6454    /// GET GetActive V1
6455    /// Permissions Required:
6456    ///   - Manage Processing Job
6457    ///
6458    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>> {
6459        let mut path = format!("/processing/v1/active");
6460        let mut query_params = Vec::new();
6461        if let Some(p) = last_modified_end {
6462            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6463        }
6464        if let Some(p) = last_modified_start {
6465            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6466        }
6467        if let Some(p) = license_number {
6468            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6469        }
6470        if !query_params.is_empty() {
6471            path.push_str("?");
6472            path.push_str(&query_params.join("&"));
6473        }
6474        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6475    }
6476
6477    /// GET GetActive V2
6478    /// Retrieves active processing jobs at a specified Facility.
6479    /// 
6480    ///   Permissions Required:
6481    ///   - Manage Processing Job
6482    ///
6483    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>> {
6484        let mut path = format!("/processing/v2/active");
6485        let mut query_params = Vec::new();
6486        if let Some(p) = last_modified_end {
6487            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6488        }
6489        if let Some(p) = last_modified_start {
6490            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6491        }
6492        if let Some(p) = license_number {
6493            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6494        }
6495        if let Some(p) = page_number {
6496            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6497        }
6498        if let Some(p) = page_size {
6499            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6500        }
6501        if !query_params.is_empty() {
6502            path.push_str("?");
6503            path.push_str(&query_params.join("&"));
6504        }
6505        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6506    }
6507
6508    /// GET GetInactive V1
6509    /// Permissions Required:
6510    ///   - Manage Processing Job
6511    ///
6512    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>> {
6513        let mut path = format!("/processing/v1/inactive");
6514        let mut query_params = Vec::new();
6515        if let Some(p) = last_modified_end {
6516            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6517        }
6518        if let Some(p) = last_modified_start {
6519            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6520        }
6521        if let Some(p) = license_number {
6522            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6523        }
6524        if !query_params.is_empty() {
6525            path.push_str("?");
6526            path.push_str(&query_params.join("&"));
6527        }
6528        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6529    }
6530
6531    /// GET GetInactive V2
6532    /// Retrieves inactive processing jobs at a specified Facility.
6533    /// 
6534    ///   Permissions Required:
6535    ///   - Manage Processing Job
6536    ///
6537    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>> {
6538        let mut path = format!("/processing/v2/inactive");
6539        let mut query_params = Vec::new();
6540        if let Some(p) = last_modified_end {
6541            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6542        }
6543        if let Some(p) = last_modified_start {
6544            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6545        }
6546        if let Some(p) = license_number {
6547            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6548        }
6549        if let Some(p) = page_number {
6550            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6551        }
6552        if let Some(p) = page_size {
6553            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6554        }
6555        if !query_params.is_empty() {
6556            path.push_str("?");
6557            path.push_str(&query_params.join("&"));
6558        }
6559        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6560    }
6561
6562    /// GET GetJobtypesActive V1
6563    /// Permissions Required:
6564    ///   - Manage Processing Job
6565    ///
6566    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>> {
6567        let mut path = format!("/processing/v1/jobtypes/active");
6568        let mut query_params = Vec::new();
6569        if let Some(p) = last_modified_end {
6570            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6571        }
6572        if let Some(p) = last_modified_start {
6573            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6574        }
6575        if let Some(p) = license_number {
6576            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6577        }
6578        if !query_params.is_empty() {
6579            path.push_str("?");
6580            path.push_str(&query_params.join("&"));
6581        }
6582        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6583    }
6584
6585    /// GET GetJobtypesActive V2
6586    /// Retrieves a list of all active processing job types defined within a Facility.
6587    /// 
6588    ///   Permissions Required:
6589    ///   - Manage Processing Job
6590    ///
6591    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>> {
6592        let mut path = format!("/processing/v2/jobtypes/active");
6593        let mut query_params = Vec::new();
6594        if let Some(p) = last_modified_end {
6595            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6596        }
6597        if let Some(p) = last_modified_start {
6598            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6599        }
6600        if let Some(p) = license_number {
6601            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6602        }
6603        if let Some(p) = page_number {
6604            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6605        }
6606        if let Some(p) = page_size {
6607            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6608        }
6609        if !query_params.is_empty() {
6610            path.push_str("?");
6611            path.push_str(&query_params.join("&"));
6612        }
6613        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6614    }
6615
6616    /// GET GetJobtypesAttributes V1
6617    /// Permissions Required:
6618    ///   - Manage Processing Job
6619    ///
6620    pub async fn processing_jobs_get_jobtypes_attributes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6621        let mut path = format!("/processing/v1/jobtypes/attributes");
6622        let mut query_params = Vec::new();
6623        if let Some(p) = license_number {
6624            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6625        }
6626        if !query_params.is_empty() {
6627            path.push_str("?");
6628            path.push_str(&query_params.join("&"));
6629        }
6630        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6631    }
6632
6633    /// GET GetJobtypesAttributes V2
6634    /// Retrieves all processing job attributes available for a Facility.
6635    /// 
6636    ///   Permissions Required:
6637    ///   - Manage Processing Job
6638    ///
6639    pub async fn processing_jobs_get_jobtypes_attributes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6640        let mut path = format!("/processing/v2/jobtypes/attributes");
6641        let mut query_params = Vec::new();
6642        if let Some(p) = license_number {
6643            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6644        }
6645        if !query_params.is_empty() {
6646            path.push_str("?");
6647            path.push_str(&query_params.join("&"));
6648        }
6649        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6650    }
6651
6652    /// GET GetJobtypesCategories V1
6653    /// Permissions Required:
6654    ///   - Manage Processing Job
6655    ///
6656    pub async fn processing_jobs_get_jobtypes_categories_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6657        let mut path = format!("/processing/v1/jobtypes/categories");
6658        let mut query_params = Vec::new();
6659        if let Some(p) = license_number {
6660            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6661        }
6662        if !query_params.is_empty() {
6663            path.push_str("?");
6664            path.push_str(&query_params.join("&"));
6665        }
6666        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6667    }
6668
6669    /// GET GetJobtypesCategories V2
6670    /// Retrieves all processing job categories available for a specified Facility.
6671    /// 
6672    ///   Permissions Required:
6673    ///   - Manage Processing Job
6674    ///
6675    pub async fn processing_jobs_get_jobtypes_categories_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6676        let mut path = format!("/processing/v2/jobtypes/categories");
6677        let mut query_params = Vec::new();
6678        if let Some(p) = license_number {
6679            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6680        }
6681        if !query_params.is_empty() {
6682            path.push_str("?");
6683            path.push_str(&query_params.join("&"));
6684        }
6685        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6686    }
6687
6688    /// GET GetJobtypesInactive V1
6689    /// Permissions Required:
6690    ///   - Manage Processing Job
6691    ///
6692    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>> {
6693        let mut path = format!("/processing/v1/jobtypes/inactive");
6694        let mut query_params = Vec::new();
6695        if let Some(p) = last_modified_end {
6696            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6697        }
6698        if let Some(p) = last_modified_start {
6699            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6700        }
6701        if let Some(p) = license_number {
6702            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6703        }
6704        if !query_params.is_empty() {
6705            path.push_str("?");
6706            path.push_str(&query_params.join("&"));
6707        }
6708        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6709    }
6710
6711    /// GET GetJobtypesInactive V2
6712    /// Retrieves a list of all inactive processing job types defined within a Facility.
6713    /// 
6714    ///   Permissions Required:
6715    ///   - Manage Processing Job
6716    ///
6717    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>> {
6718        let mut path = format!("/processing/v2/jobtypes/inactive");
6719        let mut query_params = Vec::new();
6720        if let Some(p) = last_modified_end {
6721            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
6722        }
6723        if let Some(p) = last_modified_start {
6724            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
6725        }
6726        if let Some(p) = license_number {
6727            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6728        }
6729        if let Some(p) = page_number {
6730            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
6731        }
6732        if let Some(p) = page_size {
6733            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
6734        }
6735        if !query_params.is_empty() {
6736            path.push_str("?");
6737            path.push_str(&query_params.join("&"));
6738        }
6739        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6740    }
6741
6742    /// PUT UpdateFinish V1
6743    /// Permissions Required:
6744    ///   - Manage Processing Job
6745    ///
6746    pub async fn processing_jobs_update_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6747        let mut path = format!("/processing/v1/finish");
6748        let mut query_params = Vec::new();
6749        if let Some(p) = license_number {
6750            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6751        }
6752        if !query_params.is_empty() {
6753            path.push_str("?");
6754            path.push_str(&query_params.join("&"));
6755        }
6756        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6757    }
6758
6759    /// PUT UpdateFinish V2
6760    /// Completes processing jobs at a Facility by recording final notes and waste measurements.
6761    /// 
6762    ///   Permissions Required:
6763    ///   - Manage Processing Job
6764    ///
6765    pub async fn processing_jobs_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6766        let mut path = format!("/processing/v2/finish");
6767        let mut query_params = Vec::new();
6768        if let Some(p) = license_number {
6769            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6770        }
6771        if !query_params.is_empty() {
6772            path.push_str("?");
6773            path.push_str(&query_params.join("&"));
6774        }
6775        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6776    }
6777
6778    /// PUT UpdateJobtypes V1
6779    /// Permissions Required:
6780    ///   - Manage Processing Job
6781    ///
6782    pub async fn processing_jobs_update_jobtypes_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6783        let mut path = format!("/processing/v1/jobtypes");
6784        let mut query_params = Vec::new();
6785        if let Some(p) = license_number {
6786            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6787        }
6788        if !query_params.is_empty() {
6789            path.push_str("?");
6790            path.push_str(&query_params.join("&"));
6791        }
6792        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6793    }
6794
6795    /// PUT UpdateJobtypes V2
6796    /// Updates existing processing job types at a Facility, including their name, category, description, steps, and attributes.
6797    /// 
6798    ///   Permissions Required:
6799    ///   - Manage Processing Job
6800    ///
6801    pub async fn processing_jobs_update_jobtypes_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6802        let mut path = format!("/processing/v2/jobtypes");
6803        let mut query_params = Vec::new();
6804        if let Some(p) = license_number {
6805            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6806        }
6807        if !query_params.is_empty() {
6808            path.push_str("?");
6809            path.push_str(&query_params.join("&"));
6810        }
6811        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6812    }
6813
6814    /// PUT UpdateUnfinish V1
6815    /// Permissions Required:
6816    ///   - Manage Processing Job
6817    ///
6818    pub async fn processing_jobs_update_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6819        let mut path = format!("/processing/v1/unfinish");
6820        let mut query_params = Vec::new();
6821        if let Some(p) = license_number {
6822            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6823        }
6824        if !query_params.is_empty() {
6825            path.push_str("?");
6826            path.push_str(&query_params.join("&"));
6827        }
6828        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6829    }
6830
6831    /// PUT UpdateUnfinish V2
6832    /// Reopens previously completed processing jobs at a Facility to allow further updates or corrections.
6833    /// 
6834    ///   Permissions Required:
6835    ///   - Manage Processing Job
6836    ///
6837    pub async fn processing_jobs_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6838        let mut path = format!("/processing/v2/unfinish");
6839        let mut query_params = Vec::new();
6840        if let Some(p) = license_number {
6841            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6842        }
6843        if !query_params.is_empty() {
6844            path.push_str("?");
6845            path.push_str(&query_params.join("&"));
6846        }
6847        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6848    }
6849
6850    /// POST CreateAssociate V2
6851    /// Facilitate association of QR codes and Package labels. This will return the count of packages and QR codes associated that were added or replaced.
6852    /// 
6853    ///   Permissions Required:
6854    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
6855    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
6856    ///   - Industry/View Packages
6857    ///   - 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)
6858    ///
6859    pub async fn retail_id_create_associate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6860        let mut path = format!("/retailid/v2/associate");
6861        let mut query_params = Vec::new();
6862        if let Some(p) = license_number {
6863            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6864        }
6865        if !query_params.is_empty() {
6866            path.push_str("?");
6867            path.push_str(&query_params.join("&"));
6868        }
6869        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6870    }
6871
6872    /// POST CreateGenerate V2
6873    /// Allows you to generate a specific quantity of QR codes. Id value returned (issuance ID) could be used for printing.
6874    /// 
6875    ///   Permissions Required:
6876    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
6877    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
6878    ///   - Industry/View Packages
6879    ///   - One of the following: Industry/Facility Type/Can Download Product Label, Licensee/Download Product Label or Admin/Employees/Packages Page/Product Labels(Manage)
6880    ///
6881    pub async fn retail_id_create_generate_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6882        let mut path = format!("/retailid/v2/generate");
6883        let mut query_params = Vec::new();
6884        if let Some(p) = license_number {
6885            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6886        }
6887        if !query_params.is_empty() {
6888            path.push_str("?");
6889            path.push_str(&query_params.join("&"));
6890        }
6891        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6892    }
6893
6894    /// POST CreateMerge V2
6895    /// 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.
6896    /// 
6897    ///   Permissions Required:
6898    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
6899    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
6900    ///   - Key Value Settings/Retail ID Merge Packages Enabled
6901    ///
6902    pub async fn retail_id_create_merge_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6903        let mut path = format!("/retailid/v2/merge");
6904        let mut query_params = Vec::new();
6905        if let Some(p) = license_number {
6906            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6907        }
6908        if !query_params.is_empty() {
6909            path.push_str("?");
6910            path.push_str(&query_params.join("&"));
6911        }
6912        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6913    }
6914
6915    /// POST CreatePackageInfo V2
6916    /// Retrieves Package information for given list of Package labels.
6917    /// 
6918    ///   Permissions Required:
6919    ///   - External Sources(ThirdPartyVendorV2)/Retail ID(Write)
6920    ///   - WebApi Retail ID Read Write State (All or WriteOnly)
6921    ///   - Industry/View Packages
6922    ///   - Admin/Employees/Packages Page/Product Labels(Manage)
6923    ///
6924    pub async fn retail_id_create_package_info_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6925        let mut path = format!("/retailid/v2/packages/info");
6926        let mut query_params = Vec::new();
6927        if let Some(p) = license_number {
6928            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6935    }
6936
6937    /// GET GetReceiveByLabel V2
6938    /// Get a list of eaches (Retail ID QR code URL) and sibling tags based on given Package label.
6939    /// 
6940    ///   Permissions Required:
6941    ///   - External Sources(ThirdPartyVendorV2)/Manage RetailId
6942    ///   - WebApi Retail ID Read Write State (All or ReadOnly)
6943    ///   - Industry/View Packages
6944    ///   - 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)
6945    ///
6946    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>> {
6947        let mut path = format!("/retailid/v2/receive/{}", urlencoding::encode(label).as_ref());
6948        let mut query_params = Vec::new();
6949        if let Some(p) = license_number {
6950            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6951        }
6952        if !query_params.is_empty() {
6953            path.push_str("?");
6954            path.push_str(&query_params.join("&"));
6955        }
6956        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6957    }
6958
6959    /// GET GetReceiveQrByShortCode V2
6960    /// 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).
6961    /// 
6962    ///   Permissions Required:
6963    ///   - External Sources(ThirdPartyVendorV2)/Manage RetailId
6964    ///   - WebApi Retail ID Read Write State (All or ReadOnly)
6965    ///   - Industry/View Packages
6966    ///   - 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)
6967    ///
6968    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>> {
6969        let mut path = format!("/retailid/v2/receive/qr/{}", urlencoding::encode(short_code).as_ref());
6970        let mut query_params = Vec::new();
6971        if let Some(p) = license_number {
6972            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
6973        }
6974        if !query_params.is_empty() {
6975            path.push_str("?");
6976            path.push_str(&query_params.join("&"));
6977        }
6978        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6979    }
6980
6981    /// POST CreateIntegratorSetup V2
6982    /// 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.
6983    /// 
6984    ///   Permissions Required:
6985    ///   - None
6986    ///
6987    pub async fn sandbox_create_integrator_setup_v2(&self, user_key: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
6988        let mut path = format!("/sandbox/v2/integrator/setup");
6989        let mut query_params = Vec::new();
6990        if let Some(p) = user_key {
6991            query_params.push(format!("userKey={}", urlencoding::encode(&p)));
6992        }
6993        if !query_params.is_empty() {
6994            path.push_str("?");
6995            path.push_str(&query_params.join("&"));
6996        }
6997        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
6998    }
6999
7000    /// GET GetByCaregiverLicenseNumber V1
7001    /// Data returned by this endpoint is cached for up to one minute.
7002    /// 
7003    ///   Permissions Required:
7004    ///   - Lookup Caregivers
7005    ///
7006    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>> {
7007        let mut path = format!("/caregivers/v1/status/{}", urlencoding::encode(caregiver_license_number).as_ref());
7008        let mut query_params = Vec::new();
7009        if let Some(p) = license_number {
7010            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7011        }
7012        if !query_params.is_empty() {
7013            path.push_str("?");
7014            path.push_str(&query_params.join("&"));
7015        }
7016        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7017    }
7018
7019    /// GET GetByCaregiverLicenseNumber V2
7020    /// 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.
7021    /// 
7022    ///   Permissions Required:
7023    ///   - Lookup Caregivers
7024    ///
7025    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>> {
7026        let mut path = format!("/caregivers/v2/status/{}", urlencoding::encode(caregiver_license_number).as_ref());
7027        let mut query_params = Vec::new();
7028        if let Some(p) = license_number {
7029            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7030        }
7031        if !query_params.is_empty() {
7032            path.push_str("?");
7033            path.push_str(&query_params.join("&"));
7034        }
7035        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7036    }
7037
7038    /// GET GetAll V1
7039    /// Permissions Required:
7040    ///   - Manage Employees
7041    ///
7042    pub async fn employees_get_all_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7043        let mut path = format!("/employees/v1");
7044        let mut query_params = Vec::new();
7045        if let Some(p) = license_number {
7046            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7047        }
7048        if !query_params.is_empty() {
7049            path.push_str("?");
7050            path.push_str(&query_params.join("&"));
7051        }
7052        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7053    }
7054
7055    /// GET GetAll V2
7056    /// Retrieves a list of employees for a specified Facility.
7057    /// 
7058    ///   Permissions Required:
7059    ///   - Manage Employees
7060    ///   - View Employees
7061    ///
7062    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>> {
7063        let mut path = format!("/employees/v2");
7064        let mut query_params = Vec::new();
7065        if let Some(p) = license_number {
7066            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7067        }
7068        if let Some(p) = page_number {
7069            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7070        }
7071        if let Some(p) = page_size {
7072            query_params.push(format!("pageSize={}", 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 GetPermissions V2
7082    /// Retrieves the permissions of a specified Employee, identified by their Employee License Number, for a given Facility.
7083    /// 
7084    ///   Permissions Required:
7085    ///   - Manage Employees
7086    ///
7087    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>> {
7088        let mut path = format!("/employees/v2/permissions");
7089        let mut query_params = Vec::new();
7090        if let Some(p) = employee_license_number {
7091            query_params.push(format!("employeeLicenseNumber={}", urlencoding::encode(&p)));
7092        }
7093        if let Some(p) = license_number {
7094            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7095        }
7096        if !query_params.is_empty() {
7097            path.push_str("?");
7098            path.push_str(&query_params.join("&"));
7099        }
7100        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7101    }
7102
7103    /// POST CreateRecord V1
7104    /// Permissions Required:
7105    ///   - View Packages
7106    ///   - Manage Packages Inventory
7107    ///
7108    pub async fn lab_tests_create_record_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7109        let mut path = format!("/labtests/v1/record");
7110        let mut query_params = Vec::new();
7111        if let Some(p) = license_number {
7112            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7113        }
7114        if !query_params.is_empty() {
7115            path.push_str("?");
7116            path.push_str(&query_params.join("&"));
7117        }
7118        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7119    }
7120
7121    /// POST CreateRecord V2
7122    /// 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.
7123    /// 
7124    ///   Permissions Required:
7125    ///   - View Packages
7126    ///   - Manage Packages Inventory
7127    ///
7128    pub async fn lab_tests_create_record_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7129        let mut path = format!("/labtests/v2/record");
7130        let mut query_params = Vec::new();
7131        if let Some(p) = license_number {
7132            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7133        }
7134        if !query_params.is_empty() {
7135            path.push_str("?");
7136            path.push_str(&query_params.join("&"));
7137        }
7138        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7139    }
7140
7141    /// GET GetBatches V2
7142    /// Retrieves a list of Lab Test batches.
7143    /// 
7144    ///   Permissions Required:
7145    ///   - None
7146    ///
7147    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>> {
7148        let mut path = format!("/labtests/v2/batches");
7149        let mut query_params = Vec::new();
7150        if let Some(p) = page_number {
7151            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7152        }
7153        if let Some(p) = page_size {
7154            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7155        }
7156        if !query_params.is_empty() {
7157            path.push_str("?");
7158            path.push_str(&query_params.join("&"));
7159        }
7160        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7161    }
7162
7163    /// GET GetLabtestdocument V1
7164    /// Permissions Required:
7165    ///   - View Packages
7166    ///   - Manage Packages Inventory
7167    ///
7168    pub async fn lab_tests_get_labtestdocument_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7169        let mut path = format!("/labtests/v1/labtestdocument/{}", urlencoding::encode(id).as_ref());
7170        let mut query_params = Vec::new();
7171        if let Some(p) = license_number {
7172            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7173        }
7174        if !query_params.is_empty() {
7175            path.push_str("?");
7176            path.push_str(&query_params.join("&"));
7177        }
7178        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7179    }
7180
7181    /// GET GetLabtestdocument V2
7182    /// Retrieves a specific Lab Test result document by its Id for a given Facility.
7183    /// 
7184    ///   Permissions Required:
7185    ///   - View Packages
7186    ///   - Manage Packages Inventory
7187    ///
7188    pub async fn lab_tests_get_labtestdocument_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7189        let mut path = format!("/labtests/v2/labtestdocument/{}", urlencoding::encode(id).as_ref());
7190        let mut query_params = Vec::new();
7191        if let Some(p) = license_number {
7192            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7193        }
7194        if !query_params.is_empty() {
7195            path.push_str("?");
7196            path.push_str(&query_params.join("&"));
7197        }
7198        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7199    }
7200
7201    /// GET GetResults V1
7202    /// Permissions Required:
7203    ///   - View Packages
7204    ///
7205    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>> {
7206        let mut path = format!("/labtests/v1/results");
7207        let mut query_params = Vec::new();
7208        if let Some(p) = license_number {
7209            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7210        }
7211        if let Some(p) = package_id {
7212            query_params.push(format!("packageId={}", urlencoding::encode(&p)));
7213        }
7214        if !query_params.is_empty() {
7215            path.push_str("?");
7216            path.push_str(&query_params.join("&"));
7217        }
7218        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7219    }
7220
7221    /// GET GetResults V2
7222    /// Retrieves Lab Test results for a specified Package.
7223    /// 
7224    ///   Permissions Required:
7225    ///   - View Packages
7226    ///   - Manage Packages Inventory
7227    ///
7228    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>> {
7229        let mut path = format!("/labtests/v2/results");
7230        let mut query_params = Vec::new();
7231        if let Some(p) = license_number {
7232            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7233        }
7234        if let Some(p) = package_id {
7235            query_params.push(format!("packageId={}", urlencoding::encode(&p)));
7236        }
7237        if let Some(p) = page_number {
7238            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7239        }
7240        if let Some(p) = page_size {
7241            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7242        }
7243        if !query_params.is_empty() {
7244            path.push_str("?");
7245            path.push_str(&query_params.join("&"));
7246        }
7247        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7248    }
7249
7250    /// GET GetStates V1
7251    /// Permissions Required:
7252    ///   - None
7253    ///
7254    pub async fn lab_tests_get_states_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7255        let mut path = format!("/labtests/v1/states");
7256        let mut query_params = Vec::new();
7257        if let Some(p) = no {
7258            query_params.push(format!("No={}", urlencoding::encode(&p)));
7259        }
7260        if !query_params.is_empty() {
7261            path.push_str("?");
7262            path.push_str(&query_params.join("&"));
7263        }
7264        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7265    }
7266
7267    /// GET GetStates V2
7268    /// Returns a list of all lab testing states.
7269    /// 
7270    ///   Permissions Required:
7271    ///   - None
7272    ///
7273    pub async fn lab_tests_get_states_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7274        let mut path = format!("/labtests/v2/states");
7275        let mut query_params = Vec::new();
7276        if let Some(p) = no {
7277            query_params.push(format!("No={}", urlencoding::encode(&p)));
7278        }
7279        if !query_params.is_empty() {
7280            path.push_str("?");
7281            path.push_str(&query_params.join("&"));
7282        }
7283        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7284    }
7285
7286    /// GET GetTypes V1
7287    /// Permissions Required:
7288    ///   - None
7289    ///
7290    pub async fn lab_tests_get_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7291        let mut path = format!("/labtests/v1/types");
7292        let mut query_params = Vec::new();
7293        if let Some(p) = no {
7294            query_params.push(format!("No={}", urlencoding::encode(&p)));
7295        }
7296        if !query_params.is_empty() {
7297            path.push_str("?");
7298            path.push_str(&query_params.join("&"));
7299        }
7300        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7301    }
7302
7303    /// GET GetTypes V2
7304    /// Returns a list of Lab Test types.
7305    /// 
7306    ///   Permissions Required:
7307    ///   - None
7308    ///
7309    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>> {
7310        let mut path = format!("/labtests/v2/types");
7311        let mut query_params = Vec::new();
7312        if let Some(p) = page_number {
7313            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7314        }
7315        if let Some(p) = page_size {
7316            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7317        }
7318        if !query_params.is_empty() {
7319            path.push_str("?");
7320            path.push_str(&query_params.join("&"));
7321        }
7322        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7323    }
7324
7325    /// PUT UpdateLabtestdocument V1
7326    /// Permissions Required:
7327    ///   - View Packages
7328    ///   - Manage Packages Inventory
7329    ///
7330    pub async fn lab_tests_update_labtestdocument_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7331        let mut path = format!("/labtests/v1/labtestdocument");
7332        let mut query_params = Vec::new();
7333        if let Some(p) = license_number {
7334            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7335        }
7336        if !query_params.is_empty() {
7337            path.push_str("?");
7338            path.push_str(&query_params.join("&"));
7339        }
7340        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7341    }
7342
7343    /// PUT UpdateLabtestdocument V2
7344    /// Updates one or more documents for previously submitted lab tests.
7345    /// 
7346    ///   Permissions Required:
7347    ///   - View Packages
7348    ///   - Manage Packages Inventory
7349    ///
7350    pub async fn lab_tests_update_labtestdocument_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7351        let mut path = format!("/labtests/v2/labtestdocument");
7352        let mut query_params = Vec::new();
7353        if let Some(p) = license_number {
7354            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7355        }
7356        if !query_params.is_empty() {
7357            path.push_str("?");
7358            path.push_str(&query_params.join("&"));
7359        }
7360        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7361    }
7362
7363    /// PUT UpdateResultRelease V1
7364    /// Permissions Required:
7365    ///   - View Packages
7366    ///   - Manage Packages Inventory
7367    ///
7368    pub async fn lab_tests_update_result_release_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7369        let mut path = format!("/labtests/v1/results/release");
7370        let mut query_params = Vec::new();
7371        if let Some(p) = license_number {
7372            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7373        }
7374        if !query_params.is_empty() {
7375            path.push_str("?");
7376            path.push_str(&query_params.join("&"));
7377        }
7378        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7379    }
7380
7381    /// PUT UpdateResultRelease V2
7382    /// Releases Lab Test results for one or more packages.
7383    /// 
7384    ///   Permissions Required:
7385    ///   - View Packages
7386    ///   - Manage Packages Inventory
7387    ///
7388    pub async fn lab_tests_update_result_release_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7389        let mut path = format!("/labtests/v2/results/release");
7390        let mut query_params = Vec::new();
7391        if let Some(p) = license_number {
7392            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7393        }
7394        if !query_params.is_empty() {
7395            path.push_str("?");
7396            path.push_str(&query_params.join("&"));
7397        }
7398        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7399    }
7400
7401    /// POST Create V2
7402    /// Creates new sublocation records for a Facility.
7403    /// 
7404    ///   Permissions Required:
7405    ///   - Manage Locations
7406    ///
7407    pub async fn sublocations_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7408        let mut path = format!("/sublocations/v2");
7409        let mut query_params = Vec::new();
7410        if let Some(p) = license_number {
7411            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7412        }
7413        if !query_params.is_empty() {
7414            path.push_str("?");
7415            path.push_str(&query_params.join("&"));
7416        }
7417        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7418    }
7419
7420    /// DELETE Delete V2
7421    /// Archives an existing Sublocation record for a Facility.
7422    /// 
7423    ///   Permissions Required:
7424    ///   - Manage Locations
7425    ///
7426    pub async fn sublocations_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7427        let mut path = format!("/sublocations/v2/{}", urlencoding::encode(id).as_ref());
7428        let mut query_params = Vec::new();
7429        if let Some(p) = license_number {
7430            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7431        }
7432        if !query_params.is_empty() {
7433            path.push_str("?");
7434            path.push_str(&query_params.join("&"));
7435        }
7436        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7437    }
7438
7439    /// GET Get V2
7440    /// Retrieves a Sublocation by its Id, with an optional license number.
7441    /// 
7442    ///   Permissions Required:
7443    ///   - Manage Locations
7444    ///
7445    pub async fn sublocations_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7446        let mut path = format!("/sublocations/v2/{}", urlencoding::encode(id).as_ref());
7447        let mut query_params = Vec::new();
7448        if let Some(p) = license_number {
7449            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7450        }
7451        if !query_params.is_empty() {
7452            path.push_str("?");
7453            path.push_str(&query_params.join("&"));
7454        }
7455        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7456    }
7457
7458    /// GET GetActive V2
7459    /// Retrieves a list of active sublocations for the current Facility, optionally filtered by last modified date range.
7460    /// 
7461    ///   Permissions Required:
7462    ///   - Manage Locations
7463    ///
7464    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>> {
7465        let mut path = format!("/sublocations/v2/active");
7466        let mut query_params = Vec::new();
7467        if let Some(p) = last_modified_end {
7468            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7469        }
7470        if let Some(p) = last_modified_start {
7471            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7472        }
7473        if let Some(p) = license_number {
7474            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7475        }
7476        if let Some(p) = page_number {
7477            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7478        }
7479        if let Some(p) = page_size {
7480            query_params.push(format!("pageSize={}", 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::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7487    }
7488
7489    /// GET GetInactive V2
7490    /// Retrieves a list of inactive sublocations for the specified Facility.
7491    /// 
7492    ///   Permissions Required:
7493    ///   - Manage Locations
7494    ///
7495    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>> {
7496        let mut path = format!("/sublocations/v2/inactive");
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 let Some(p) = page_number {
7502            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7503        }
7504        if let Some(p) = page_size {
7505            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7506        }
7507        if !query_params.is_empty() {
7508            path.push_str("?");
7509            path.push_str(&query_params.join("&"));
7510        }
7511        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7512    }
7513
7514    /// PUT Update V2
7515    /// Updates existing sublocation records for a specified Facility.
7516    /// 
7517    ///   Permissions Required:
7518    ///   - Manage Locations
7519    ///
7520    pub async fn sublocations_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7521        let mut path = format!("/sublocations/v2");
7522        let mut query_params = Vec::new();
7523        if let Some(p) = license_number {
7524            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7525        }
7526        if !query_params.is_empty() {
7527            path.push_str("?");
7528            path.push_str(&query_params.join("&"));
7529        }
7530        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7531    }
7532
7533    /// GET GetActive V1
7534    /// Permissions Required:
7535    ///   - None
7536    ///
7537    pub async fn units_of_measure_get_active_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7538        let mut path = format!("/unitsofmeasure/v1/active");
7539        let mut query_params = Vec::new();
7540        if let Some(p) = no {
7541            query_params.push(format!("No={}", urlencoding::encode(&p)));
7542        }
7543        if !query_params.is_empty() {
7544            path.push_str("?");
7545            path.push_str(&query_params.join("&"));
7546        }
7547        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7548    }
7549
7550    /// GET GetActive V2
7551    /// Retrieves all active units of measure.
7552    /// 
7553    ///   Permissions Required:
7554    ///   - None
7555    ///
7556    pub async fn units_of_measure_get_active_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7557        let mut path = format!("/unitsofmeasure/v2/active");
7558        let mut query_params = Vec::new();
7559        if let Some(p) = no {
7560            query_params.push(format!("No={}", urlencoding::encode(&p)));
7561        }
7562        if !query_params.is_empty() {
7563            path.push_str("?");
7564            path.push_str(&query_params.join("&"));
7565        }
7566        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7567    }
7568
7569    /// GET GetInactive V2
7570    /// Retrieves all inactive units of measure.
7571    /// 
7572    ///   Permissions Required:
7573    ///   - None
7574    ///
7575    pub async fn units_of_measure_get_inactive_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7576        let mut path = format!("/unitsofmeasure/v2/inactive");
7577        let mut query_params = Vec::new();
7578        if let Some(p) = no {
7579            query_params.push(format!("No={}", urlencoding::encode(&p)));
7580        }
7581        if !query_params.is_empty() {
7582            path.push_str("?");
7583            path.push_str(&query_params.join("&"));
7584        }
7585        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7586    }
7587
7588    /// GET GetAll V2
7589    /// Retrieves all available waste methods.
7590    /// 
7591    ///   Permissions Required:
7592    ///   - None
7593    ///
7594    pub async fn waste_methods_get_all_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7595        let mut path = format!("/wastemethods/v2");
7596        let mut query_params = Vec::new();
7597        if let Some(p) = no {
7598            query_params.push(format!("No={}", urlencoding::encode(&p)));
7599        }
7600        if !query_params.is_empty() {
7601            path.push_str("?");
7602            path.push_str(&query_params.join("&"));
7603        }
7604        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7605    }
7606
7607    /// GET GetAll V1
7608    /// This endpoint provides a list of facilities for which the authenticated user has access.
7609    /// 
7610    ///   Permissions Required:
7611    ///   - None
7612    ///
7613    pub async fn facilities_get_all_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7614        let mut path = format!("/facilities/v1");
7615        let mut query_params = Vec::new();
7616        if let Some(p) = no {
7617            query_params.push(format!("No={}", urlencoding::encode(&p)));
7618        }
7619        if !query_params.is_empty() {
7620            path.push_str("?");
7621            path.push_str(&query_params.join("&"));
7622        }
7623        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7624    }
7625
7626    /// GET GetAll V2
7627    /// This endpoint provides a list of facilities for which the authenticated user has access.
7628    /// 
7629    ///   Permissions Required:
7630    ///   - None
7631    ///
7632    pub async fn facilities_get_all_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7633        let mut path = format!("/facilities/v2");
7634        let mut query_params = Vec::new();
7635        if let Some(p) = no {
7636            query_params.push(format!("No={}", 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::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7643    }
7644
7645    /// POST Create V1
7646    /// 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.
7647    /// 
7648    ///   Permissions Required:
7649    ///   - Manage Items
7650    ///
7651    pub async fn items_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7652        let mut path = format!("/items/v1/create");
7653        let mut query_params = Vec::new();
7654        if let Some(p) = license_number {
7655            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7656        }
7657        if !query_params.is_empty() {
7658            path.push_str("?");
7659            path.push_str(&query_params.join("&"));
7660        }
7661        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7662    }
7663
7664    /// POST Create V2
7665    /// 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.
7666    /// 
7667    ///   Permissions Required:
7668    ///   - Manage Items
7669    ///
7670    pub async fn items_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7671        let mut path = format!("/items/v2");
7672        let mut query_params = Vec::new();
7673        if let Some(p) = license_number {
7674            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7675        }
7676        if !query_params.is_empty() {
7677            path.push_str("?");
7678            path.push_str(&query_params.join("&"));
7679        }
7680        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7681    }
7682
7683    /// POST CreateBrand V2
7684    /// Creates one or more new item brands for the specified Facility identified by the License Number.
7685    /// 
7686    ///   Permissions Required:
7687    ///   - Manage Items
7688    ///
7689    pub async fn items_create_brand_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7690        let mut path = format!("/items/v2/brand");
7691        let mut query_params = Vec::new();
7692        if let Some(p) = license_number {
7693            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7694        }
7695        if !query_params.is_empty() {
7696            path.push_str("?");
7697            path.push_str(&query_params.join("&"));
7698        }
7699        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7700    }
7701
7702    /// POST CreateFile V2
7703    /// Uploads one or more image or PDF files for products, labels, packaging, or documents at the specified Facility.
7704    /// 
7705    ///   Permissions Required:
7706    ///   - Manage Items
7707    ///
7708    pub async fn items_create_file_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7709        let mut path = format!("/items/v2/file");
7710        let mut query_params = Vec::new();
7711        if let Some(p) = license_number {
7712            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7719    }
7720
7721    /// POST CreatePhoto V1
7722    /// This endpoint allows only BMP, GIF, JPG, and PNG files and uploaded files can be no more than 5 MB in size.
7723    /// 
7724    ///   Permissions Required:
7725    ///   - Manage Items
7726    ///
7727    pub async fn items_create_photo_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7728        let mut path = format!("/items/v1/photo");
7729        let mut query_params = Vec::new();
7730        if let Some(p) = license_number {
7731            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7738    }
7739
7740    /// POST CreatePhoto V2
7741    /// This endpoint allows only BMP, GIF, JPG, and PNG files and uploaded files can be no more than 5 MB in size.
7742    /// 
7743    ///   Permissions Required:
7744    ///   - Manage Items
7745    ///
7746    pub async fn items_create_photo_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7747        let mut path = format!("/items/v2/photo");
7748        let mut query_params = Vec::new();
7749        if let Some(p) = license_number {
7750            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7751        }
7752        if !query_params.is_empty() {
7753            path.push_str("?");
7754            path.push_str(&query_params.join("&"));
7755        }
7756        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7757    }
7758
7759    /// POST CreateUpdate V1
7760    /// Permissions Required:
7761    ///   - Manage Items
7762    ///
7763    pub async fn items_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7764        let mut path = format!("/items/v1/update");
7765        let mut query_params = Vec::new();
7766        if let Some(p) = license_number {
7767            query_params.push(format!("licenseNumber={}", 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::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7774    }
7775
7776    /// DELETE Delete V1
7777    /// Permissions Required:
7778    ///   - Manage Items
7779    ///
7780    pub async fn items_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7781        let mut path = format!("/items/v1/{}", urlencoding::encode(id).as_ref());
7782        let mut query_params = Vec::new();
7783        if let Some(p) = license_number {
7784            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7785        }
7786        if !query_params.is_empty() {
7787            path.push_str("?");
7788            path.push_str(&query_params.join("&"));
7789        }
7790        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7791    }
7792
7793    /// DELETE Delete V2
7794    /// Archives the specified Product by Id for the given Facility License Number.
7795    /// 
7796    ///   Permissions Required:
7797    ///   - Manage Items
7798    ///
7799    pub async fn items_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7800        let mut path = format!("/items/v2/{}", urlencoding::encode(id).as_ref());
7801        let mut query_params = Vec::new();
7802        if let Some(p) = license_number {
7803            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7804        }
7805        if !query_params.is_empty() {
7806            path.push_str("?");
7807            path.push_str(&query_params.join("&"));
7808        }
7809        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7810    }
7811
7812    /// DELETE DeleteBrand V2
7813    /// Archives the specified Item Brand by Id for the given Facility License Number.
7814    /// 
7815    ///   Permissions Required:
7816    ///   - Manage Items
7817    ///
7818    pub async fn items_delete_brand_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7819        let mut path = format!("/items/v2/brand/{}", urlencoding::encode(id).as_ref());
7820        let mut query_params = Vec::new();
7821        if let Some(p) = license_number {
7822            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7823        }
7824        if !query_params.is_empty() {
7825            path.push_str("?");
7826            path.push_str(&query_params.join("&"));
7827        }
7828        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7829    }
7830
7831    /// GET Get V1
7832    /// Permissions Required:
7833    ///   - Manage Items
7834    ///
7835    pub async fn items_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7836        let mut path = format!("/items/v1/{}", urlencoding::encode(id).as_ref());
7837        let mut query_params = Vec::new();
7838        if let Some(p) = license_number {
7839            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7840        }
7841        if !query_params.is_empty() {
7842            path.push_str("?");
7843            path.push_str(&query_params.join("&"));
7844        }
7845        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7846    }
7847
7848    /// GET Get V2
7849    /// Retrieves detailed information about a specific Item by Id.
7850    /// 
7851    ///   Permissions Required:
7852    ///   - Manage Items
7853    ///
7854    pub async fn items_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7855        let mut path = format!("/items/v2/{}", urlencoding::encode(id).as_ref());
7856        let mut query_params = Vec::new();
7857        if let Some(p) = license_number {
7858            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7859        }
7860        if !query_params.is_empty() {
7861            path.push_str("?");
7862            path.push_str(&query_params.join("&"));
7863        }
7864        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7865    }
7866
7867    /// GET GetActive V1
7868    /// Permissions Required:
7869    ///   - Manage Items
7870    ///
7871    pub async fn items_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7872        let mut path = format!("/items/v1/active");
7873        let mut query_params = Vec::new();
7874        if let Some(p) = license_number {
7875            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7876        }
7877        if !query_params.is_empty() {
7878            path.push_str("?");
7879            path.push_str(&query_params.join("&"));
7880        }
7881        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7882    }
7883
7884    /// GET GetActive V2
7885    /// Returns a list of active items for the specified Facility.
7886    /// 
7887    ///   Permissions Required:
7888    ///   - Manage Items
7889    ///
7890    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>> {
7891        let mut path = format!("/items/v2/active");
7892        let mut query_params = Vec::new();
7893        if let Some(p) = last_modified_end {
7894            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
7895        }
7896        if let Some(p) = last_modified_start {
7897            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
7898        }
7899        if let Some(p) = license_number {
7900            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7901        }
7902        if let Some(p) = page_number {
7903            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7904        }
7905        if let Some(p) = page_size {
7906            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7907        }
7908        if !query_params.is_empty() {
7909            path.push_str("?");
7910            path.push_str(&query_params.join("&"));
7911        }
7912        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7913    }
7914
7915    /// GET GetBrands V1
7916    /// Permissions Required:
7917    ///   - Manage Items
7918    ///
7919    pub async fn items_get_brands_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7920        let mut path = format!("/items/v1/brands");
7921        let mut query_params = Vec::new();
7922        if let Some(p) = license_number {
7923            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7924        }
7925        if !query_params.is_empty() {
7926            path.push_str("?");
7927            path.push_str(&query_params.join("&"));
7928        }
7929        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7930    }
7931
7932    /// GET GetBrands V2
7933    /// Retrieves a list of active item brands for the specified Facility.
7934    /// 
7935    ///   Permissions Required:
7936    ///   - Manage Items
7937    ///
7938    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>> {
7939        let mut path = format!("/items/v2/brands");
7940        let mut query_params = Vec::new();
7941        if let Some(p) = license_number {
7942            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7943        }
7944        if let Some(p) = page_number {
7945            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7946        }
7947        if let Some(p) = page_size {
7948            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7949        }
7950        if !query_params.is_empty() {
7951            path.push_str("?");
7952            path.push_str(&query_params.join("&"));
7953        }
7954        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7955    }
7956
7957    /// GET GetCategories V1
7958    /// Permissions Required:
7959    ///   - None
7960    ///
7961    pub async fn items_get_categories_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
7962        let mut path = format!("/items/v1/categories");
7963        let mut query_params = Vec::new();
7964        if let Some(p) = license_number {
7965            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7966        }
7967        if !query_params.is_empty() {
7968            path.push_str("?");
7969            path.push_str(&query_params.join("&"));
7970        }
7971        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7972    }
7973
7974    /// GET GetCategories V2
7975    /// Retrieves a list of item categories.
7976    /// 
7977    ///   Permissions Required:
7978    ///   - None
7979    ///
7980    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>> {
7981        let mut path = format!("/items/v2/categories");
7982        let mut query_params = Vec::new();
7983        if let Some(p) = license_number {
7984            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
7985        }
7986        if let Some(p) = page_number {
7987            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
7988        }
7989        if let Some(p) = page_size {
7990            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
7991        }
7992        if !query_params.is_empty() {
7993            path.push_str("?");
7994            path.push_str(&query_params.join("&"));
7995        }
7996        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
7997    }
7998
7999    /// GET GetFile V2
8000    /// Retrieves a file by its Id for the specified Facility.
8001    /// 
8002    ///   Permissions Required:
8003    ///   - Manage Items
8004    ///
8005    pub async fn items_get_file_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8006        let mut path = format!("/items/v2/file/{}", urlencoding::encode(id).as_ref());
8007        let mut query_params = Vec::new();
8008        if let Some(p) = license_number {
8009            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8010        }
8011        if !query_params.is_empty() {
8012            path.push_str("?");
8013            path.push_str(&query_params.join("&"));
8014        }
8015        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8016    }
8017
8018    /// GET GetInactive V1
8019    /// Permissions Required:
8020    ///   - Manage Items
8021    ///
8022    pub async fn items_get_inactive_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8023        let mut path = format!("/items/v1/inactive");
8024        let mut query_params = Vec::new();
8025        if let Some(p) = license_number {
8026            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8027        }
8028        if !query_params.is_empty() {
8029            path.push_str("?");
8030            path.push_str(&query_params.join("&"));
8031        }
8032        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8033    }
8034
8035    /// GET GetInactive V2
8036    /// Retrieves a list of inactive items for the specified Facility.
8037    /// 
8038    ///   Permissions Required:
8039    ///   - Manage Items
8040    ///
8041    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>> {
8042        let mut path = format!("/items/v2/inactive");
8043        let mut query_params = Vec::new();
8044        if let Some(p) = license_number {
8045            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8046        }
8047        if let Some(p) = page_number {
8048            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8049        }
8050        if let Some(p) = page_size {
8051            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8052        }
8053        if !query_params.is_empty() {
8054            path.push_str("?");
8055            path.push_str(&query_params.join("&"));
8056        }
8057        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8058    }
8059
8060    /// GET GetPhoto V1
8061    /// Permissions Required:
8062    ///   - Manage Items
8063    ///
8064    pub async fn items_get_photo_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8065        let mut path = format!("/items/v1/photo/{}", urlencoding::encode(id).as_ref());
8066        let mut query_params = Vec::new();
8067        if let Some(p) = license_number {
8068            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8069        }
8070        if !query_params.is_empty() {
8071            path.push_str("?");
8072            path.push_str(&query_params.join("&"));
8073        }
8074        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8075    }
8076
8077    /// GET GetPhoto V2
8078    /// Retrieves an image by its Id for the specified Facility.
8079    /// 
8080    ///   Permissions Required:
8081    ///   - Manage Items
8082    ///
8083    pub async fn items_get_photo_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8084        let mut path = format!("/items/v2/photo/{}", urlencoding::encode(id).as_ref());
8085        let mut query_params = Vec::new();
8086        if let Some(p) = license_number {
8087            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8088        }
8089        if !query_params.is_empty() {
8090            path.push_str("?");
8091            path.push_str(&query_params.join("&"));
8092        }
8093        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8094    }
8095
8096    /// PUT Update V2
8097    /// Updates one or more existing products for the specified Facility.
8098    /// 
8099    ///   Permissions Required:
8100    ///   - Manage Items
8101    ///
8102    pub async fn items_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8103        let mut path = format!("/items/v2");
8104        let mut query_params = Vec::new();
8105        if let Some(p) = license_number {
8106            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8107        }
8108        if !query_params.is_empty() {
8109            path.push_str("?");
8110            path.push_str(&query_params.join("&"));
8111        }
8112        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8113    }
8114
8115    /// PUT UpdateBrand V2
8116    /// Updates one or more existing item brands for the specified Facility.
8117    /// 
8118    ///   Permissions Required:
8119    ///   - Manage Items
8120    ///
8121    pub async fn items_update_brand_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8122        let mut path = format!("/items/v2/brand");
8123        let mut query_params = Vec::new();
8124        if let Some(p) = license_number {
8125            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8126        }
8127        if !query_params.is_empty() {
8128            path.push_str("?");
8129            path.push_str(&query_params.join("&"));
8130        }
8131        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8132    }
8133
8134    /// POST Create V1
8135    /// Permissions Required:
8136    ///   - ManagePatientsCheckIns
8137    ///
8138    pub async fn patient_check_ins_create_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8139        let mut path = format!("/patient-checkins/v1");
8140        let mut query_params = Vec::new();
8141        if let Some(p) = license_number {
8142            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8143        }
8144        if !query_params.is_empty() {
8145            path.push_str("?");
8146            path.push_str(&query_params.join("&"));
8147        }
8148        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8149    }
8150
8151    /// POST Create V2
8152    /// Records patient check-ins for a specified Facility.
8153    /// 
8154    ///   Permissions Required:
8155    ///   - ManagePatientsCheckIns
8156    ///
8157    pub async fn patient_check_ins_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8158        let mut path = format!("/patient-checkins/v2");
8159        let mut query_params = Vec::new();
8160        if let Some(p) = license_number {
8161            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8162        }
8163        if !query_params.is_empty() {
8164            path.push_str("?");
8165            path.push_str(&query_params.join("&"));
8166        }
8167        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8168    }
8169
8170    /// DELETE Delete V1
8171    /// Permissions Required:
8172    ///   - ManagePatientsCheckIns
8173    ///
8174    pub async fn patient_check_ins_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8175        let mut path = format!("/patient-checkins/v1/{}", urlencoding::encode(id).as_ref());
8176        let mut query_params = Vec::new();
8177        if let Some(p) = license_number {
8178            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8179        }
8180        if !query_params.is_empty() {
8181            path.push_str("?");
8182            path.push_str(&query_params.join("&"));
8183        }
8184        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8185    }
8186
8187    /// DELETE Delete V2
8188    /// Archives a Patient Check-In, identified by its Id, for a specified Facility.
8189    /// 
8190    ///   Permissions Required:
8191    ///   - ManagePatientsCheckIns
8192    ///
8193    pub async fn patient_check_ins_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8194        let mut path = format!("/patient-checkins/v2/{}", urlencoding::encode(id).as_ref());
8195        let mut query_params = Vec::new();
8196        if let Some(p) = license_number {
8197            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8198        }
8199        if !query_params.is_empty() {
8200            path.push_str("?");
8201            path.push_str(&query_params.join("&"));
8202        }
8203        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8204    }
8205
8206    /// GET GetAll V1
8207    /// Permissions Required:
8208    ///   - ManagePatientsCheckIns
8209    ///
8210    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>> {
8211        let mut path = format!("/patient-checkins/v1");
8212        let mut query_params = Vec::new();
8213        if let Some(p) = checkin_date_end {
8214            query_params.push(format!("checkinDateEnd={}", urlencoding::encode(&p)));
8215        }
8216        if let Some(p) = checkin_date_start {
8217            query_params.push(format!("checkinDateStart={}", urlencoding::encode(&p)));
8218        }
8219        if let Some(p) = license_number {
8220            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8221        }
8222        if !query_params.is_empty() {
8223            path.push_str("?");
8224            path.push_str(&query_params.join("&"));
8225        }
8226        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8227    }
8228
8229    /// GET GetAll V2
8230    /// Retrieves a list of patient check-ins for a specified Facility.
8231    /// 
8232    ///   Permissions Required:
8233    ///   - ManagePatientsCheckIns
8234    ///
8235    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>> {
8236        let mut path = format!("/patient-checkins/v2");
8237        let mut query_params = Vec::new();
8238        if let Some(p) = checkin_date_end {
8239            query_params.push(format!("checkinDateEnd={}", urlencoding::encode(&p)));
8240        }
8241        if let Some(p) = checkin_date_start {
8242            query_params.push(format!("checkinDateStart={}", urlencoding::encode(&p)));
8243        }
8244        if let Some(p) = license_number {
8245            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8246        }
8247        if !query_params.is_empty() {
8248            path.push_str("?");
8249            path.push_str(&query_params.join("&"));
8250        }
8251        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8252    }
8253
8254    /// GET GetLocations V1
8255    /// Permissions Required:
8256    ///   - None
8257    ///
8258    pub async fn patient_check_ins_get_locations_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8259        let mut path = format!("/patient-checkins/v1/locations");
8260        let mut query_params = Vec::new();
8261        if let Some(p) = no {
8262            query_params.push(format!("No={}", urlencoding::encode(&p)));
8263        }
8264        if !query_params.is_empty() {
8265            path.push_str("?");
8266            path.push_str(&query_params.join("&"));
8267        }
8268        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8269    }
8270
8271    /// GET GetLocations V2
8272    /// Retrieves a list of Patient Check-In locations.
8273    /// 
8274    ///   Permissions Required:
8275    ///   - None
8276    ///
8277    pub async fn patient_check_ins_get_locations_v2(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8278        let mut path = format!("/patient-checkins/v2/locations");
8279        let mut query_params = Vec::new();
8280        if let Some(p) = no {
8281            query_params.push(format!("No={}", urlencoding::encode(&p)));
8282        }
8283        if !query_params.is_empty() {
8284            path.push_str("?");
8285            path.push_str(&query_params.join("&"));
8286        }
8287        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8288    }
8289
8290    /// PUT Update V1
8291    /// Permissions Required:
8292    ///   - ManagePatientsCheckIns
8293    ///
8294    pub async fn patient_check_ins_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8295        let mut path = format!("/patient-checkins/v1");
8296        let mut query_params = Vec::new();
8297        if let Some(p) = license_number {
8298            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8299        }
8300        if !query_params.is_empty() {
8301            path.push_str("?");
8302            path.push_str(&query_params.join("&"));
8303        }
8304        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8305    }
8306
8307    /// PUT Update V2
8308    /// Updates patient check-ins for a specified Facility.
8309    /// 
8310    ///   Permissions Required:
8311    ///   - ManagePatientsCheckIns
8312    ///
8313    pub async fn patient_check_ins_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8314        let mut path = format!("/patient-checkins/v2");
8315        let mut query_params = Vec::new();
8316        if let Some(p) = license_number {
8317            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8318        }
8319        if !query_params.is_empty() {
8320            path.push_str("?");
8321            path.push_str(&query_params.join("&"));
8322        }
8323        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8324    }
8325
8326    /// POST Create V2
8327    /// Creates new additive templates for a specified Facility.
8328    /// 
8329    ///   Permissions Required:
8330    ///   - Manage Additives
8331    ///
8332    pub async fn additives_templates_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8333        let mut path = format!("/additivestemplates/v2");
8334        let mut query_params = Vec::new();
8335        if let Some(p) = license_number {
8336            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8337        }
8338        if !query_params.is_empty() {
8339            path.push_str("?");
8340            path.push_str(&query_params.join("&"));
8341        }
8342        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8343    }
8344
8345    /// GET Get V2
8346    /// Retrieves an Additive Template by its Id.
8347    /// 
8348    ///   Permissions Required:
8349    ///   - Manage Additives
8350    ///
8351    pub async fn additives_templates_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8352        let mut path = format!("/additivestemplates/v2/{}", urlencoding::encode(id).as_ref());
8353        let mut query_params = Vec::new();
8354        if let Some(p) = license_number {
8355            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8356        }
8357        if !query_params.is_empty() {
8358            path.push_str("?");
8359            path.push_str(&query_params.join("&"));
8360        }
8361        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8362    }
8363
8364    /// GET GetActive V2
8365    /// Retrieves a list of active additive templates for a specified Facility.
8366    /// 
8367    ///   Permissions Required:
8368    ///   - Manage Additives
8369    ///
8370    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>> {
8371        let mut path = format!("/additivestemplates/v2/active");
8372        let mut query_params = Vec::new();
8373        if let Some(p) = last_modified_end {
8374            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8375        }
8376        if let Some(p) = last_modified_start {
8377            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8378        }
8379        if let Some(p) = license_number {
8380            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8381        }
8382        if let Some(p) = page_number {
8383            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8384        }
8385        if let Some(p) = page_size {
8386            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8387        }
8388        if !query_params.is_empty() {
8389            path.push_str("?");
8390            path.push_str(&query_params.join("&"));
8391        }
8392        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8393    }
8394
8395    /// GET GetInactive V2
8396    /// Retrieves a list of inactive additive templates for a specified Facility.
8397    /// 
8398    ///   Permissions Required:
8399    ///   - Manage Additives
8400    ///
8401    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>> {
8402        let mut path = format!("/additivestemplates/v2/inactive");
8403        let mut query_params = Vec::new();
8404        if let Some(p) = last_modified_end {
8405            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8406        }
8407        if let Some(p) = last_modified_start {
8408            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8409        }
8410        if let Some(p) = license_number {
8411            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8412        }
8413        if let Some(p) = page_number {
8414            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8415        }
8416        if let Some(p) = page_size {
8417            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8418        }
8419        if !query_params.is_empty() {
8420            path.push_str("?");
8421            path.push_str(&query_params.join("&"));
8422        }
8423        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8424    }
8425
8426    /// PUT Update V2
8427    /// Updates existing additive templates for a specified Facility.
8428    /// 
8429    ///   Permissions Required:
8430    ///   - Manage Additives
8431    ///
8432    pub async fn additives_templates_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8433        let mut path = format!("/additivestemplates/v2");
8434        let mut query_params = Vec::new();
8435        if let Some(p) = license_number {
8436            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8437        }
8438        if !query_params.is_empty() {
8439            path.push_str("?");
8440            path.push_str(&query_params.join("&"));
8441        }
8442        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8443    }
8444
8445    /// POST CreateFinish V1
8446    /// Permissions Required:
8447    ///   - View Harvests
8448    ///   - Finish/Discontinue Harvests
8449    ///
8450    pub async fn harvests_create_finish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8451        let mut path = format!("/harvests/v1/finish");
8452        let mut query_params = Vec::new();
8453        if let Some(p) = license_number {
8454            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8455        }
8456        if !query_params.is_empty() {
8457            path.push_str("?");
8458            path.push_str(&query_params.join("&"));
8459        }
8460        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8461    }
8462
8463    /// POST CreatePackage V1
8464    /// Permissions Required:
8465    ///   - View Harvests
8466    ///   - Manage Harvests
8467    ///   - View Packages
8468    ///   - Create/Submit/Discontinue Packages
8469    ///
8470    pub async fn harvests_create_package_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8471        let mut path = format!("/harvests/v1/create/packages");
8472        let mut query_params = Vec::new();
8473        if let Some(p) = license_number {
8474            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8475        }
8476        if !query_params.is_empty() {
8477            path.push_str("?");
8478            path.push_str(&query_params.join("&"));
8479        }
8480        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8481    }
8482
8483    /// POST CreatePackage V2
8484    /// Creates packages from harvested products for a specified Facility.
8485    /// 
8486    ///   Permissions Required:
8487    ///   - View Harvests
8488    ///   - Manage Harvests
8489    ///   - View Packages
8490    ///   - Create/Submit/Discontinue Packages
8491    ///
8492    pub async fn harvests_create_package_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8493        let mut path = format!("/harvests/v2/packages");
8494        let mut query_params = Vec::new();
8495        if let Some(p) = license_number {
8496            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8497        }
8498        if !query_params.is_empty() {
8499            path.push_str("?");
8500            path.push_str(&query_params.join("&"));
8501        }
8502        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8503    }
8504
8505    /// POST CreatePackageTesting V1
8506    /// Permissions Required:
8507    ///   - View Harvests
8508    ///   - Manage Harvests
8509    ///   - View Packages
8510    ///   - Create/Submit/Discontinue Packages
8511    ///
8512    pub async fn harvests_create_package_testing_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8513        let mut path = format!("/harvests/v1/create/packages/testing");
8514        let mut query_params = Vec::new();
8515        if let Some(p) = license_number {
8516            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8517        }
8518        if !query_params.is_empty() {
8519            path.push_str("?");
8520            path.push_str(&query_params.join("&"));
8521        }
8522        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8523    }
8524
8525    /// POST CreatePackageTesting V2
8526    /// Creates packages for testing from harvested products for a specified Facility.
8527    /// 
8528    ///   Permissions Required:
8529    ///   - View Harvests
8530    ///   - Manage Harvests
8531    ///   - View Packages
8532    ///   - Create/Submit/Discontinue Packages
8533    ///
8534    pub async fn harvests_create_package_testing_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8535        let mut path = format!("/harvests/v2/packages/testing");
8536        let mut query_params = Vec::new();
8537        if let Some(p) = license_number {
8538            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8539        }
8540        if !query_params.is_empty() {
8541            path.push_str("?");
8542            path.push_str(&query_params.join("&"));
8543        }
8544        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8545    }
8546
8547    /// POST CreateRemoveWaste V1
8548    /// Permissions Required:
8549    ///   - View Harvests
8550    ///   - Manage Harvests
8551    ///
8552    pub async fn harvests_create_remove_waste_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8553        let mut path = format!("/harvests/v1/removewaste");
8554        let mut query_params = Vec::new();
8555        if let Some(p) = license_number {
8556            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8557        }
8558        if !query_params.is_empty() {
8559            path.push_str("?");
8560            path.push_str(&query_params.join("&"));
8561        }
8562        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8563    }
8564
8565    /// POST CreateUnfinish V1
8566    /// Permissions Required:
8567    ///   - View Harvests
8568    ///   - Finish/Discontinue Harvests
8569    ///
8570    pub async fn harvests_create_unfinish_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8571        let mut path = format!("/harvests/v1/unfinish");
8572        let mut query_params = Vec::new();
8573        if let Some(p) = license_number {
8574            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8575        }
8576        if !query_params.is_empty() {
8577            path.push_str("?");
8578            path.push_str(&query_params.join("&"));
8579        }
8580        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8581    }
8582
8583    /// POST CreateWaste V2
8584    /// 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.
8585    /// 
8586    ///   Permissions Required:
8587    ///   - View Harvests
8588    ///   - Manage Harvests
8589    ///
8590    pub async fn harvests_create_waste_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8591        let mut path = format!("/harvests/v2/waste");
8592        let mut query_params = Vec::new();
8593        if let Some(p) = license_number {
8594            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8595        }
8596        if !query_params.is_empty() {
8597            path.push_str("?");
8598            path.push_str(&query_params.join("&"));
8599        }
8600        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8601    }
8602
8603    /// DELETE DeleteWaste V2
8604    /// Discontinues a specific harvest waste record by Id for the specified Facility.
8605    /// 
8606    ///   Permissions Required:
8607    ///   - View Harvests
8608    ///   - Discontinue Harvest Waste
8609    ///
8610    pub async fn harvests_delete_waste_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8611        let mut path = format!("/harvests/v2/waste/{}", urlencoding::encode(id).as_ref());
8612        let mut query_params = Vec::new();
8613        if let Some(p) = license_number {
8614            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8615        }
8616        if !query_params.is_empty() {
8617            path.push_str("?");
8618            path.push_str(&query_params.join("&"));
8619        }
8620        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8621    }
8622
8623    /// GET Get V1
8624    /// Permissions Required:
8625    ///   - View Harvests
8626    ///
8627    pub async fn harvests_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8628        let mut path = format!("/harvests/v1/{}", urlencoding::encode(id).as_ref());
8629        let mut query_params = Vec::new();
8630        if let Some(p) = license_number {
8631            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8632        }
8633        if !query_params.is_empty() {
8634            path.push_str("?");
8635            path.push_str(&query_params.join("&"));
8636        }
8637        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8638    }
8639
8640    /// GET Get V2
8641    /// Retrieves a Harvest by its Id, optionally validated against a specified Facility License Number.
8642    /// 
8643    ///   Permissions Required:
8644    ///   - View Harvests
8645    ///
8646    pub async fn harvests_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8647        let mut path = format!("/harvests/v2/{}", urlencoding::encode(id).as_ref());
8648        let mut query_params = Vec::new();
8649        if let Some(p) = license_number {
8650            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8651        }
8652        if !query_params.is_empty() {
8653            path.push_str("?");
8654            path.push_str(&query_params.join("&"));
8655        }
8656        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8657    }
8658
8659    /// GET GetActive V1
8660    /// Permissions Required:
8661    ///   - View Harvests
8662    ///
8663    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>> {
8664        let mut path = format!("/harvests/v1/active");
8665        let mut query_params = Vec::new();
8666        if let Some(p) = last_modified_end {
8667            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8668        }
8669        if let Some(p) = last_modified_start {
8670            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8671        }
8672        if let Some(p) = license_number {
8673            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8674        }
8675        if !query_params.is_empty() {
8676            path.push_str("?");
8677            path.push_str(&query_params.join("&"));
8678        }
8679        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8680    }
8681
8682    /// GET GetActive V2
8683    /// Retrieves a list of active harvests for a specified Facility.
8684    /// 
8685    ///   Permissions Required:
8686    ///   - View Harvests
8687    ///
8688    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>> {
8689        let mut path = format!("/harvests/v2/active");
8690        let mut query_params = Vec::new();
8691        if let Some(p) = last_modified_end {
8692            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8693        }
8694        if let Some(p) = last_modified_start {
8695            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8696        }
8697        if let Some(p) = license_number {
8698            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8699        }
8700        if let Some(p) = page_number {
8701            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8702        }
8703        if let Some(p) = page_size {
8704            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8705        }
8706        if !query_params.is_empty() {
8707            path.push_str("?");
8708            path.push_str(&query_params.join("&"));
8709        }
8710        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8711    }
8712
8713    /// GET GetInactive V1
8714    /// Permissions Required:
8715    ///   - View Harvests
8716    ///
8717    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>> {
8718        let mut path = format!("/harvests/v1/inactive");
8719        let mut query_params = Vec::new();
8720        if let Some(p) = last_modified_end {
8721            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8722        }
8723        if let Some(p) = last_modified_start {
8724            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8725        }
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::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8734    }
8735
8736    /// GET GetInactive V2
8737    /// Retrieves a list of inactive harvests for a specified Facility.
8738    /// 
8739    ///   Permissions Required:
8740    ///   - View Harvests
8741    ///
8742    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>> {
8743        let mut path = format!("/harvests/v2/inactive");
8744        let mut query_params = Vec::new();
8745        if let Some(p) = last_modified_end {
8746            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8747        }
8748        if let Some(p) = last_modified_start {
8749            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8750        }
8751        if let Some(p) = license_number {
8752            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8753        }
8754        if let Some(p) = page_number {
8755            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8756        }
8757        if let Some(p) = page_size {
8758            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8759        }
8760        if !query_params.is_empty() {
8761            path.push_str("?");
8762            path.push_str(&query_params.join("&"));
8763        }
8764        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8765    }
8766
8767    /// GET GetOnhold V1
8768    /// Permissions Required:
8769    ///   - View Harvests
8770    ///
8771    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>> {
8772        let mut path = format!("/harvests/v1/onhold");
8773        let mut query_params = Vec::new();
8774        if let Some(p) = last_modified_end {
8775            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8776        }
8777        if let Some(p) = last_modified_start {
8778            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8779        }
8780        if let Some(p) = license_number {
8781            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8782        }
8783        if !query_params.is_empty() {
8784            path.push_str("?");
8785            path.push_str(&query_params.join("&"));
8786        }
8787        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8788    }
8789
8790    /// GET GetOnhold V2
8791    /// Retrieves a list of harvests on hold for a specified Facility.
8792    /// 
8793    ///   Permissions Required:
8794    ///   - View Harvests
8795    ///
8796    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>> {
8797        let mut path = format!("/harvests/v2/onhold");
8798        let mut query_params = Vec::new();
8799        if let Some(p) = last_modified_end {
8800            query_params.push(format!("lastModifiedEnd={}", urlencoding::encode(&p)));
8801        }
8802        if let Some(p) = last_modified_start {
8803            query_params.push(format!("lastModifiedStart={}", urlencoding::encode(&p)));
8804        }
8805        if let Some(p) = license_number {
8806            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8807        }
8808        if let Some(p) = page_number {
8809            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8810        }
8811        if let Some(p) = page_size {
8812            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8813        }
8814        if !query_params.is_empty() {
8815            path.push_str("?");
8816            path.push_str(&query_params.join("&"));
8817        }
8818        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8819    }
8820
8821    /// GET GetWaste V2
8822    /// Retrieves a list of Waste records for a specified Harvest, identified by its Harvest Id, within a Facility identified by its License Number.
8823    /// 
8824    ///   Permissions Required:
8825    ///   - View Harvests
8826    ///
8827    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>> {
8828        let mut path = format!("/harvests/v2/waste");
8829        let mut query_params = Vec::new();
8830        if let Some(p) = harvest_id {
8831            query_params.push(format!("harvestId={}", urlencoding::encode(&p)));
8832        }
8833        if let Some(p) = license_number {
8834            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8835        }
8836        if let Some(p) = page_number {
8837            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8838        }
8839        if let Some(p) = page_size {
8840            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8841        }
8842        if !query_params.is_empty() {
8843            path.push_str("?");
8844            path.push_str(&query_params.join("&"));
8845        }
8846        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8847    }
8848
8849    /// GET GetWasteTypes V1
8850    /// Permissions Required:
8851    ///   - None
8852    ///
8853    pub async fn harvests_get_waste_types_v1(&self, no: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8854        let mut path = format!("/harvests/v1/waste/types");
8855        let mut query_params = Vec::new();
8856        if let Some(p) = no {
8857            query_params.push(format!("No={}", urlencoding::encode(&p)));
8858        }
8859        if !query_params.is_empty() {
8860            path.push_str("?");
8861            path.push_str(&query_params.join("&"));
8862        }
8863        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8864    }
8865
8866    /// GET GetWasteTypes V2
8867    /// Retrieves a list of Waste types for harvests.
8868    /// 
8869    ///   Permissions Required:
8870    ///   - None
8871    ///
8872    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>> {
8873        let mut path = format!("/harvests/v2/waste/types");
8874        let mut query_params = Vec::new();
8875        if let Some(p) = page_number {
8876            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
8877        }
8878        if let Some(p) = page_size {
8879            query_params.push(format!("pageSize={}", urlencoding::encode(&p)));
8880        }
8881        if !query_params.is_empty() {
8882            path.push_str("?");
8883            path.push_str(&query_params.join("&"));
8884        }
8885        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8886    }
8887
8888    /// PUT UpdateFinish V2
8889    /// Marks one or more harvests as finished for the specified Facility.
8890    /// 
8891    ///   Permissions Required:
8892    ///   - View Harvests
8893    ///   - Finish/Discontinue Harvests
8894    ///
8895    pub async fn harvests_update_finish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8896        let mut path = format!("/harvests/v2/finish");
8897        let mut query_params = Vec::new();
8898        if let Some(p) = license_number {
8899            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8900        }
8901        if !query_params.is_empty() {
8902            path.push_str("?");
8903            path.push_str(&query_params.join("&"));
8904        }
8905        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8906    }
8907
8908    /// PUT UpdateLocation V2
8909    /// Updates the Location of Harvest for a specified Facility.
8910    /// 
8911    ///   Permissions Required:
8912    ///   - View Harvests
8913    ///   - Manage Harvests
8914    ///
8915    pub async fn harvests_update_location_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8916        let mut path = format!("/harvests/v2/location");
8917        let mut query_params = Vec::new();
8918        if let Some(p) = license_number {
8919            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8920        }
8921        if !query_params.is_empty() {
8922            path.push_str("?");
8923            path.push_str(&query_params.join("&"));
8924        }
8925        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8926    }
8927
8928    /// PUT UpdateMove V1
8929    /// Permissions Required:
8930    ///   - View Harvests
8931    ///   - Manage Harvests
8932    ///
8933    pub async fn harvests_update_move_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8934        let mut path = format!("/harvests/v1/move");
8935        let mut query_params = Vec::new();
8936        if let Some(p) = license_number {
8937            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8938        }
8939        if !query_params.is_empty() {
8940            path.push_str("?");
8941            path.push_str(&query_params.join("&"));
8942        }
8943        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8944    }
8945
8946    /// PUT UpdateRename V1
8947    /// Permissions Required:
8948    ///   - View Harvests
8949    ///   - Manage Harvests
8950    ///
8951    pub async fn harvests_update_rename_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8952        let mut path = format!("/harvests/v1/rename");
8953        let mut query_params = Vec::new();
8954        if let Some(p) = license_number {
8955            query_params.push(format!("licenseNumber={}", 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::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8962    }
8963
8964    /// PUT UpdateRename V2
8965    /// Renames one or more harvests for the specified Facility.
8966    /// 
8967    ///   Permissions Required:
8968    ///   - View Harvests
8969    ///   - Manage Harvests
8970    ///
8971    pub async fn harvests_update_rename_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8972        let mut path = format!("/harvests/v2/rename");
8973        let mut query_params = Vec::new();
8974        if let Some(p) = license_number {
8975            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8976        }
8977        if !query_params.is_empty() {
8978            path.push_str("?");
8979            path.push_str(&query_params.join("&"));
8980        }
8981        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
8982    }
8983
8984    /// PUT UpdateRestoreHarvestedPlants V2
8985    /// Restores previously harvested plants to their original state for the specified Facility.
8986    /// 
8987    ///   Permissions Required:
8988    ///   - View Harvests
8989    ///   - Finish/Discontinue Harvests
8990    ///
8991    pub async fn harvests_update_restore_harvested_plants_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
8992        let mut path = format!("/harvests/v2/restore/harvestedplants");
8993        let mut query_params = Vec::new();
8994        if let Some(p) = license_number {
8995            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
8996        }
8997        if !query_params.is_empty() {
8998            path.push_str("?");
8999            path.push_str(&query_params.join("&"));
9000        }
9001        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9002    }
9003
9004    /// PUT UpdateUnfinish V2
9005    /// Reopens one or more previously finished harvests for the specified Facility.
9006    /// 
9007    ///   Permissions Required:
9008    ///   - View Harvests
9009    ///   - Finish/Discontinue Harvests
9010    ///
9011    pub async fn harvests_update_unfinish_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9012        let mut path = format!("/harvests/v2/unfinish");
9013        let mut query_params = Vec::new();
9014        if let Some(p) = license_number {
9015            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9016        }
9017        if !query_params.is_empty() {
9018            path.push_str("?");
9019            path.push_str(&query_params.join("&"));
9020        }
9021        self.send(reqwest::Method::PUT, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9022    }
9023
9024    /// POST Create V2
9025    /// Adds new patients to a specified Facility.
9026    /// 
9027    ///   Permissions Required:
9028    ///   - Manage Patients
9029    ///
9030    pub async fn patients_create_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9031        let mut path = format!("/patients/v2");
9032        let mut query_params = Vec::new();
9033        if let Some(p) = license_number {
9034            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9035        }
9036        if !query_params.is_empty() {
9037            path.push_str("?");
9038            path.push_str(&query_params.join("&"));
9039        }
9040        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9041    }
9042
9043    /// POST CreateAdd V1
9044    /// Permissions Required:
9045    ///   - Manage Patients
9046    ///
9047    pub async fn patients_create_add_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9048        let mut path = format!("/patients/v1/add");
9049        let mut query_params = Vec::new();
9050        if let Some(p) = license_number {
9051            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9052        }
9053        if !query_params.is_empty() {
9054            path.push_str("?");
9055            path.push_str(&query_params.join("&"));
9056        }
9057        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9058    }
9059
9060    /// POST CreateUpdate V1
9061    /// Permissions Required:
9062    ///   - Manage Patients
9063    ///
9064    pub async fn patients_create_update_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9065        let mut path = format!("/patients/v1/update");
9066        let mut query_params = Vec::new();
9067        if let Some(p) = license_number {
9068            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9069        }
9070        if !query_params.is_empty() {
9071            path.push_str("?");
9072            path.push_str(&query_params.join("&"));
9073        }
9074        self.send(reqwest::Method::POST, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9075    }
9076
9077    /// DELETE Delete V1
9078    /// Permissions Required:
9079    ///   - Manage Patients
9080    ///
9081    pub async fn patients_delete_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9082        let mut path = format!("/patients/v1/{}", urlencoding::encode(id).as_ref());
9083        let mut query_params = Vec::new();
9084        if let Some(p) = license_number {
9085            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9086        }
9087        if !query_params.is_empty() {
9088            path.push_str("?");
9089            path.push_str(&query_params.join("&"));
9090        }
9091        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9092    }
9093
9094    /// DELETE Delete V2
9095    /// Removes a Patient, identified by an Id, from a specified Facility.
9096    /// 
9097    ///   Permissions Required:
9098    ///   - Manage Patients
9099    ///
9100    pub async fn patients_delete_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9101        let mut path = format!("/patients/v2/{}", urlencoding::encode(id).as_ref());
9102        let mut query_params = Vec::new();
9103        if let Some(p) = license_number {
9104            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9105        }
9106        if !query_params.is_empty() {
9107            path.push_str("?");
9108            path.push_str(&query_params.join("&"));
9109        }
9110        self.send(reqwest::Method::DELETE, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9111    }
9112
9113    /// GET Get V1
9114    /// Permissions Required:
9115    ///   - Manage Patients
9116    ///
9117    pub async fn patients_get_v1(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9118        let mut path = format!("/patients/v1/{}", urlencoding::encode(id).as_ref());
9119        let mut query_params = Vec::new();
9120        if let Some(p) = license_number {
9121            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9122        }
9123        if !query_params.is_empty() {
9124            path.push_str("?");
9125            path.push_str(&query_params.join("&"));
9126        }
9127        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9128    }
9129
9130    /// GET Get V2
9131    /// Retrieves a Patient by Id.
9132    /// 
9133    ///   Permissions Required:
9134    ///   - Manage Patients
9135    ///
9136    pub async fn patients_get_v2(&self, id: &str, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9137        let mut path = format!("/patients/v2/{}", urlencoding::encode(id).as_ref());
9138        let mut query_params = Vec::new();
9139        if let Some(p) = license_number {
9140            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9141        }
9142        if !query_params.is_empty() {
9143            path.push_str("?");
9144            path.push_str(&query_params.join("&"));
9145        }
9146        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9147    }
9148
9149    /// GET GetActive V1
9150    /// Permissions Required:
9151    ///   - Manage Patients
9152    ///
9153    pub async fn patients_get_active_v1(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9154        let mut path = format!("/patients/v1/active");
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 !query_params.is_empty() {
9160            path.push_str("?");
9161            path.push_str(&query_params.join("&"));
9162        }
9163        self.send(reqwest::Method::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9164    }
9165
9166    /// GET GetActive V2
9167    /// Retrieves a list of active patients for a specified Facility.
9168    /// 
9169    ///   Permissions Required:
9170    ///   - Manage Patients
9171    ///
9172    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>> {
9173        let mut path = format!("/patients/v2/active");
9174        let mut query_params = Vec::new();
9175        if let Some(p) = license_number {
9176            query_params.push(format!("licenseNumber={}", urlencoding::encode(&p)));
9177        }
9178        if let Some(p) = page_number {
9179            query_params.push(format!("pageNumber={}", urlencoding::encode(&p)));
9180        }
9181        if let Some(p) = page_size {
9182            query_params.push(format!("pageSize={}", 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::GET, &path, body.map(|b| serde_json::to_value(b).unwrap()).as_ref()).await
9189    }
9190
9191    /// PUT Update V2
9192    /// Updates Patient information for a specified Facility.
9193    /// 
9194    ///   Permissions Required:
9195    ///   - Manage Patients
9196    ///
9197    pub async fn patients_update_v2(&self, license_number: Option<String>, body: Option<&Value>) -> Result<Option<Value>, Box<dyn Error>> {
9198        let mut path = format!("/patients/v2");
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}