Skip to main content

hanzo_client/apis/
commerce_api.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`delete_commerce_collection_by_collectionid`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteCommerceCollectionByCollectionidError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`delete_commerce_disclosure_by_disclosureid`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteCommerceDisclosureByDisclosureidError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_commerce_discount_by_discountid`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteCommerceDiscountByDiscountidError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_commerce_movie_by_movieid`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteCommerceMovieByMovieidError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`delete_commerce_note_by_noteid`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteCommerceNoteByNoteidError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`delete_commerce_plans_entries_by_slug`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum DeleteCommercePlansEntriesBySlugError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`delete_commerce_product_by_productid`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum DeleteCommerceProductByProductidError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`delete_commerce_rates_entries_by_product_by_meter`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum DeleteCommerceRatesEntriesByProductByMeterError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`delete_commerce_return_by_returnid`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum DeleteCommerceReturnByReturnidError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_commerce_saleschannel_by_saleschannelid`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteCommerceSaleschannelBySaleschannelidError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`delete_commerce_stocklocation_by_stocklocationid`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteCommerceStocklocationByStocklocationidError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`delete_commerce_store_by_storeid`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum DeleteCommerceStoreByStoreidError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`delete_commerce_store_by_storeid_listing_by_key`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum DeleteCommerceStoreByStoreidListingByKeyError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`delete_commerce_submission_by_submissionid`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum DeleteCommerceSubmissionBySubmissionidError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`delete_commerce_subscriber_by_subscriberid`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum DeleteCommerceSubscriberBySubscriberidError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`delete_commerce_tokentransaction_by_tokentransactionid`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum DeleteCommerceTokentransactionByTokentransactionidError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`delete_commerce_transfer_by_transferid`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum DeleteCommerceTransferByTransferidError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`delete_commerce_variant_by_variantid`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum DeleteCommerceVariantByVariantidError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`delete_commerce_wallet_by_walletid`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum DeleteCommerceWalletByWalletidError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`delete_commerce_watchlist_by_watchlistid`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum DeleteCommerceWatchlistByWatchlistidError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`delete_commerce_webhook_by_webhookid`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum DeleteCommerceWebhookByWebhookidError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`discard_cart`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum DiscardCartError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_cart`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetCartError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_commerce_admin_catalog`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetCommerceAdminCatalogError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_commerce_catalog`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetCommerceCatalogError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_commerce_catalog_entries`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetCommerceCatalogEntriesError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_commerce_collection`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetCommerceCollectionError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_commerce_collection_by_collectionid`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetCommerceCollectionByCollectionidError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_commerce_currencies`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetCommerceCurrenciesError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_commerce_deposits`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetCommerceDepositsError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_commerce_disclosure`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetCommerceDisclosureError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`get_commerce_disclosure_by_disclosureid`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetCommerceDisclosureByDisclosureidError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`get_commerce_discount`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetCommerceDiscountError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_commerce_discount_by_discountid`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetCommerceDiscountByDiscountidError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`get_commerce_health`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetCommerceHealthError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`get_commerce_movie`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetCommerceMovieError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`get_commerce_movie_by_movieid`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetCommerceMovieByMovieidError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`get_commerce_note`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetCommerceNoteError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`get_commerce_note_by_noteid`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum GetCommerceNoteByNoteidError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`get_commerce_org`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum GetCommerceOrgError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`get_commerce_plans_entries`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum GetCommercePlansEntriesError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`get_commerce_product`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum GetCommerceProductError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`get_commerce_product_by_productid`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum GetCommerceProductByProductidError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`get_commerce_rates_entries`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum GetCommerceRatesEntriesError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`get_commerce_return`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum GetCommerceReturnError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`get_commerce_return_by_returnid`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum GetCommerceReturnByReturnidError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`get_commerce_saleschannel`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum GetCommerceSaleschannelError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`get_commerce_saleschannel_by_saleschannelid`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum GetCommerceSaleschannelBySaleschannelidError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`get_commerce_stocklocation`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum GetCommerceStocklocationError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`get_commerce_stocklocation_by_stocklocationid`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum GetCommerceStocklocationByStocklocationidError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`get_commerce_store`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum GetCommerceStoreError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`get_commerce_store_access`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum GetCommerceStoreAccessError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`get_commerce_store_by_storeid`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum GetCommerceStoreByStoreidError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`get_commerce_store_by_storeid_bundle_by_key`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum GetCommerceStoreByStoreidBundleByKeyError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`get_commerce_store_by_storeid_listing`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum GetCommerceStoreByStoreidListingError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`get_commerce_store_by_storeid_listing_by_key`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum GetCommerceStoreByStoreidListingByKeyError {
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`get_commerce_store_by_storeid_product_by_key`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum GetCommerceStoreByStoreidProductByKeyError {
414    UnknownValue(serde_json::Value),
415}
416
417/// struct for typed errors of method [`get_commerce_store_by_storeid_variant_by_key`]
418#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum GetCommerceStoreByStoreidVariantByKeyError {
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`get_commerce_store_current`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum GetCommerceStoreCurrentError {
428    UnknownValue(serde_json::Value),
429}
430
431/// struct for typed errors of method [`get_commerce_submission`]
432#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum GetCommerceSubmissionError {
435    UnknownValue(serde_json::Value),
436}
437
438/// struct for typed errors of method [`get_commerce_submission_by_submissionid`]
439#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum GetCommerceSubmissionBySubmissionidError {
442    UnknownValue(serde_json::Value),
443}
444
445/// struct for typed errors of method [`get_commerce_subscriber`]
446#[derive(Debug, Clone, Serialize, Deserialize)]
447#[serde(untagged)]
448pub enum GetCommerceSubscriberError {
449    UnknownValue(serde_json::Value),
450}
451
452/// struct for typed errors of method [`get_commerce_subscriber_by_subscriberid`]
453#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum GetCommerceSubscriberBySubscriberidError {
456    UnknownValue(serde_json::Value),
457}
458
459/// struct for typed errors of method [`get_commerce_tokentransaction`]
460#[derive(Debug, Clone, Serialize, Deserialize)]
461#[serde(untagged)]
462pub enum GetCommerceTokentransactionError {
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`get_commerce_tokentransaction_by_tokentransactionid`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum GetCommerceTokentransactionByTokentransactionidError {
470    UnknownValue(serde_json::Value),
471}
472
473/// struct for typed errors of method [`get_commerce_transfer`]
474#[derive(Debug, Clone, Serialize, Deserialize)]
475#[serde(untagged)]
476pub enum GetCommerceTransferError {
477    UnknownValue(serde_json::Value),
478}
479
480/// struct for typed errors of method [`get_commerce_transfer_by_transferid`]
481#[derive(Debug, Clone, Serialize, Deserialize)]
482#[serde(untagged)]
483pub enum GetCommerceTransferByTransferidError {
484    UnknownValue(serde_json::Value),
485}
486
487/// struct for typed errors of method [`get_commerce_variant`]
488#[derive(Debug, Clone, Serialize, Deserialize)]
489#[serde(untagged)]
490pub enum GetCommerceVariantError {
491    UnknownValue(serde_json::Value),
492}
493
494/// struct for typed errors of method [`get_commerce_variant_by_variantid`]
495#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum GetCommerceVariantByVariantidError {
498    UnknownValue(serde_json::Value),
499}
500
501/// struct for typed errors of method [`get_commerce_wallet`]
502#[derive(Debug, Clone, Serialize, Deserialize)]
503#[serde(untagged)]
504pub enum GetCommerceWalletError {
505    UnknownValue(serde_json::Value),
506}
507
508/// struct for typed errors of method [`get_commerce_wallet_by_walletid`]
509#[derive(Debug, Clone, Serialize, Deserialize)]
510#[serde(untagged)]
511pub enum GetCommerceWalletByWalletidError {
512    UnknownValue(serde_json::Value),
513}
514
515/// struct for typed errors of method [`get_commerce_watchlist`]
516#[derive(Debug, Clone, Serialize, Deserialize)]
517#[serde(untagged)]
518pub enum GetCommerceWatchlistError {
519    UnknownValue(serde_json::Value),
520}
521
522/// struct for typed errors of method [`get_commerce_watchlist_by_watchlistid`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum GetCommerceWatchlistByWatchlistidError {
526    UnknownValue(serde_json::Value),
527}
528
529/// struct for typed errors of method [`get_commerce_webhook`]
530#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum GetCommerceWebhookError {
533    UnknownValue(serde_json::Value),
534}
535
536/// struct for typed errors of method [`get_commerce_webhook_by_webhookid`]
537#[derive(Debug, Clone, Serialize, Deserialize)]
538#[serde(untagged)]
539pub enum GetCommerceWebhookByWebhookidError {
540    UnknownValue(serde_json::Value),
541}
542
543/// struct for typed errors of method [`get_payment`]
544#[derive(Debug, Clone, Serialize, Deserialize)]
545#[serde(untagged)]
546pub enum GetPaymentError {
547    UnknownValue(serde_json::Value),
548}
549
550/// struct for typed errors of method [`open_cart`]
551#[derive(Debug, Clone, Serialize, Deserialize)]
552#[serde(untagged)]
553pub enum OpenCartError {
554    UnknownValue(serde_json::Value),
555}
556
557/// struct for typed errors of method [`patch_commerce_collection_by_collectionid`]
558#[derive(Debug, Clone, Serialize, Deserialize)]
559#[serde(untagged)]
560pub enum PatchCommerceCollectionByCollectionidError {
561    UnknownValue(serde_json::Value),
562}
563
564/// struct for typed errors of method [`patch_commerce_disclosure_by_disclosureid`]
565#[derive(Debug, Clone, Serialize, Deserialize)]
566#[serde(untagged)]
567pub enum PatchCommerceDisclosureByDisclosureidError {
568    UnknownValue(serde_json::Value),
569}
570
571/// struct for typed errors of method [`patch_commerce_discount_by_discountid`]
572#[derive(Debug, Clone, Serialize, Deserialize)]
573#[serde(untagged)]
574pub enum PatchCommerceDiscountByDiscountidError {
575    UnknownValue(serde_json::Value),
576}
577
578/// struct for typed errors of method [`patch_commerce_movie_by_movieid`]
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum PatchCommerceMovieByMovieidError {
582    UnknownValue(serde_json::Value),
583}
584
585/// struct for typed errors of method [`patch_commerce_note_by_noteid`]
586#[derive(Debug, Clone, Serialize, Deserialize)]
587#[serde(untagged)]
588pub enum PatchCommerceNoteByNoteidError {
589    UnknownValue(serde_json::Value),
590}
591
592/// struct for typed errors of method [`patch_commerce_product_by_productid`]
593#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum PatchCommerceProductByProductidError {
596    UnknownValue(serde_json::Value),
597}
598
599/// struct for typed errors of method [`patch_commerce_return_by_returnid`]
600#[derive(Debug, Clone, Serialize, Deserialize)]
601#[serde(untagged)]
602pub enum PatchCommerceReturnByReturnidError {
603    UnknownValue(serde_json::Value),
604}
605
606/// struct for typed errors of method [`patch_commerce_saleschannel_by_saleschannelid`]
607#[derive(Debug, Clone, Serialize, Deserialize)]
608#[serde(untagged)]
609pub enum PatchCommerceSaleschannelBySaleschannelidError {
610    UnknownValue(serde_json::Value),
611}
612
613/// struct for typed errors of method [`patch_commerce_stocklocation_by_stocklocationid`]
614#[derive(Debug, Clone, Serialize, Deserialize)]
615#[serde(untagged)]
616pub enum PatchCommerceStocklocationByStocklocationidError {
617    UnknownValue(serde_json::Value),
618}
619
620/// struct for typed errors of method [`patch_commerce_store_by_storeid`]
621#[derive(Debug, Clone, Serialize, Deserialize)]
622#[serde(untagged)]
623pub enum PatchCommerceStoreByStoreidError {
624    UnknownValue(serde_json::Value),
625}
626
627/// struct for typed errors of method [`patch_commerce_store_by_storeid_listing_by_key`]
628#[derive(Debug, Clone, Serialize, Deserialize)]
629#[serde(untagged)]
630pub enum PatchCommerceStoreByStoreidListingByKeyError {
631    UnknownValue(serde_json::Value),
632}
633
634/// struct for typed errors of method [`patch_commerce_submission_by_submissionid`]
635#[derive(Debug, Clone, Serialize, Deserialize)]
636#[serde(untagged)]
637pub enum PatchCommerceSubmissionBySubmissionidError {
638    UnknownValue(serde_json::Value),
639}
640
641/// struct for typed errors of method [`patch_commerce_subscriber_by_subscriberid`]
642#[derive(Debug, Clone, Serialize, Deserialize)]
643#[serde(untagged)]
644pub enum PatchCommerceSubscriberBySubscriberidError {
645    UnknownValue(serde_json::Value),
646}
647
648/// struct for typed errors of method [`patch_commerce_tokentransaction_by_tokentransactionid`]
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[serde(untagged)]
651pub enum PatchCommerceTokentransactionByTokentransactionidError {
652    UnknownValue(serde_json::Value),
653}
654
655/// struct for typed errors of method [`patch_commerce_transfer_by_transferid`]
656#[derive(Debug, Clone, Serialize, Deserialize)]
657#[serde(untagged)]
658pub enum PatchCommerceTransferByTransferidError {
659    UnknownValue(serde_json::Value),
660}
661
662/// struct for typed errors of method [`patch_commerce_variant_by_variantid`]
663#[derive(Debug, Clone, Serialize, Deserialize)]
664#[serde(untagged)]
665pub enum PatchCommerceVariantByVariantidError {
666    UnknownValue(serde_json::Value),
667}
668
669/// struct for typed errors of method [`patch_commerce_wallet_by_walletid`]
670#[derive(Debug, Clone, Serialize, Deserialize)]
671#[serde(untagged)]
672pub enum PatchCommerceWalletByWalletidError {
673    UnknownValue(serde_json::Value),
674}
675
676/// struct for typed errors of method [`patch_commerce_watchlist_by_watchlistid`]
677#[derive(Debug, Clone, Serialize, Deserialize)]
678#[serde(untagged)]
679pub enum PatchCommerceWatchlistByWatchlistidError {
680    UnknownValue(serde_json::Value),
681}
682
683/// struct for typed errors of method [`patch_commerce_webhook_by_webhookid`]
684#[derive(Debug, Clone, Serialize, Deserialize)]
685#[serde(untagged)]
686pub enum PatchCommerceWebhookByWebhookidError {
687    UnknownValue(serde_json::Value),
688}
689
690/// struct for typed errors of method [`post_commerce_catalog_entries`]
691#[derive(Debug, Clone, Serialize, Deserialize)]
692#[serde(untagged)]
693pub enum PostCommerceCatalogEntriesError {
694    UnknownValue(serde_json::Value),
695}
696
697/// struct for typed errors of method [`post_commerce_catalog_models`]
698#[derive(Debug, Clone, Serialize, Deserialize)]
699#[serde(untagged)]
700pub enum PostCommerceCatalogModelsError {
701    UnknownValue(serde_json::Value),
702}
703
704/// struct for typed errors of method [`post_commerce_catalog_models_refresh`]
705#[derive(Debug, Clone, Serialize, Deserialize)]
706#[serde(untagged)]
707pub enum PostCommerceCatalogModelsRefreshError {
708    UnknownValue(serde_json::Value),
709}
710
711/// struct for typed errors of method [`post_commerce_catalog_seed`]
712#[derive(Debug, Clone, Serialize, Deserialize)]
713#[serde(untagged)]
714pub enum PostCommerceCatalogSeedError {
715    UnknownValue(serde_json::Value),
716}
717
718/// struct for typed errors of method [`post_commerce_collection`]
719#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum PostCommerceCollectionError {
722    UnknownValue(serde_json::Value),
723}
724
725/// struct for typed errors of method [`post_commerce_collection_by_collectionid`]
726#[derive(Debug, Clone, Serialize, Deserialize)]
727#[serde(untagged)]
728pub enum PostCommerceCollectionByCollectionidError {
729    UnknownValue(serde_json::Value),
730}
731
732/// struct for typed errors of method [`post_commerce_disclosure`]
733#[derive(Debug, Clone, Serialize, Deserialize)]
734#[serde(untagged)]
735pub enum PostCommerceDisclosureError {
736    UnknownValue(serde_json::Value),
737}
738
739/// struct for typed errors of method [`post_commerce_disclosure_by_disclosureid`]
740#[derive(Debug, Clone, Serialize, Deserialize)]
741#[serde(untagged)]
742pub enum PostCommerceDisclosureByDisclosureidError {
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`post_commerce_discount`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum PostCommerceDiscountError {
750    UnknownValue(serde_json::Value),
751}
752
753/// struct for typed errors of method [`post_commerce_discount_by_discountid`]
754#[derive(Debug, Clone, Serialize, Deserialize)]
755#[serde(untagged)]
756pub enum PostCommerceDiscountByDiscountidError {
757    UnknownValue(serde_json::Value),
758}
759
760/// struct for typed errors of method [`post_commerce_movie`]
761#[derive(Debug, Clone, Serialize, Deserialize)]
762#[serde(untagged)]
763pub enum PostCommerceMovieError {
764    UnknownValue(serde_json::Value),
765}
766
767/// struct for typed errors of method [`post_commerce_movie_by_movieid`]
768#[derive(Debug, Clone, Serialize, Deserialize)]
769#[serde(untagged)]
770pub enum PostCommerceMovieByMovieidError {
771    UnknownValue(serde_json::Value),
772}
773
774/// struct for typed errors of method [`post_commerce_note`]
775#[derive(Debug, Clone, Serialize, Deserialize)]
776#[serde(untagged)]
777pub enum PostCommerceNoteError {
778    UnknownValue(serde_json::Value),
779}
780
781/// struct for typed errors of method [`post_commerce_note_by_noteid`]
782#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum PostCommerceNoteByNoteidError {
785    UnknownValue(serde_json::Value),
786}
787
788/// struct for typed errors of method [`post_commerce_plans_entries`]
789#[derive(Debug, Clone, Serialize, Deserialize)]
790#[serde(untagged)]
791pub enum PostCommercePlansEntriesError {
792    UnknownValue(serde_json::Value),
793}
794
795/// struct for typed errors of method [`post_commerce_plans_seed`]
796#[derive(Debug, Clone, Serialize, Deserialize)]
797#[serde(untagged)]
798pub enum PostCommercePlansSeedError {
799    UnknownValue(serde_json::Value),
800}
801
802/// struct for typed errors of method [`post_commerce_product`]
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(untagged)]
805pub enum PostCommerceProductError {
806    UnknownValue(serde_json::Value),
807}
808
809/// struct for typed errors of method [`post_commerce_product_by_productid`]
810#[derive(Debug, Clone, Serialize, Deserialize)]
811#[serde(untagged)]
812pub enum PostCommerceProductByProductidError {
813    UnknownValue(serde_json::Value),
814}
815
816/// struct for typed errors of method [`post_commerce_rates_entries`]
817#[derive(Debug, Clone, Serialize, Deserialize)]
818#[serde(untagged)]
819pub enum PostCommerceRatesEntriesError {
820    UnknownValue(serde_json::Value),
821}
822
823/// struct for typed errors of method [`post_commerce_rates_import`]
824#[derive(Debug, Clone, Serialize, Deserialize)]
825#[serde(untagged)]
826pub enum PostCommerceRatesImportError {
827    UnknownValue(serde_json::Value),
828}
829
830/// struct for typed errors of method [`post_commerce_return`]
831#[derive(Debug, Clone, Serialize, Deserialize)]
832#[serde(untagged)]
833pub enum PostCommerceReturnError {
834    UnknownValue(serde_json::Value),
835}
836
837/// struct for typed errors of method [`post_commerce_return_by_returnid`]
838#[derive(Debug, Clone, Serialize, Deserialize)]
839#[serde(untagged)]
840pub enum PostCommerceReturnByReturnidError {
841    UnknownValue(serde_json::Value),
842}
843
844/// struct for typed errors of method [`post_commerce_saleschannel`]
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum PostCommerceSaleschannelError {
848    UnknownValue(serde_json::Value),
849}
850
851/// struct for typed errors of method [`post_commerce_saleschannel_by_saleschannelid`]
852#[derive(Debug, Clone, Serialize, Deserialize)]
853#[serde(untagged)]
854pub enum PostCommerceSaleschannelBySaleschannelidError {
855    UnknownValue(serde_json::Value),
856}
857
858/// struct for typed errors of method [`post_commerce_stocklocation`]
859#[derive(Debug, Clone, Serialize, Deserialize)]
860#[serde(untagged)]
861pub enum PostCommerceStocklocationError {
862    UnknownValue(serde_json::Value),
863}
864
865/// struct for typed errors of method [`post_commerce_stocklocation_by_stocklocationid`]
866#[derive(Debug, Clone, Serialize, Deserialize)]
867#[serde(untagged)]
868pub enum PostCommerceStocklocationByStocklocationidError {
869    UnknownValue(serde_json::Value),
870}
871
872/// struct for typed errors of method [`post_commerce_store`]
873#[derive(Debug, Clone, Serialize, Deserialize)]
874#[serde(untagged)]
875pub enum PostCommerceStoreError {
876    UnknownValue(serde_json::Value),
877}
878
879/// struct for typed errors of method [`post_commerce_store_by_storeid`]
880#[derive(Debug, Clone, Serialize, Deserialize)]
881#[serde(untagged)]
882pub enum PostCommerceStoreByStoreidError {
883    UnknownValue(serde_json::Value),
884}
885
886/// struct for typed errors of method [`post_commerce_store_by_storeid_authorize`]
887#[derive(Debug, Clone, Serialize, Deserialize)]
888#[serde(untagged)]
889pub enum PostCommerceStoreByStoreidAuthorizeError {
890    UnknownValue(serde_json::Value),
891}
892
893/// struct for typed errors of method [`post_commerce_store_by_storeid_authorize_by_orderid`]
894#[derive(Debug, Clone, Serialize, Deserialize)]
895#[serde(untagged)]
896pub enum PostCommerceStoreByStoreidAuthorizeByOrderidError {
897    UnknownValue(serde_json::Value),
898}
899
900/// struct for typed errors of method [`post_commerce_store_by_storeid_capture_by_orderid`]
901#[derive(Debug, Clone, Serialize, Deserialize)]
902#[serde(untagged)]
903pub enum PostCommerceStoreByStoreidCaptureByOrderidError {
904    UnknownValue(serde_json::Value),
905}
906
907/// struct for typed errors of method [`post_commerce_store_by_storeid_charge`]
908#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum PostCommerceStoreByStoreidChargeError {
911    UnknownValue(serde_json::Value),
912}
913
914/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_authorize`]
915#[derive(Debug, Clone, Serialize, Deserialize)]
916#[serde(untagged)]
917pub enum PostCommerceStoreByStoreidCheckoutAuthorizeError {
918    UnknownValue(serde_json::Value),
919}
920
921/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_authorize_by_orderid`]
922#[derive(Debug, Clone, Serialize, Deserialize)]
923#[serde(untagged)]
924pub enum PostCommerceStoreByStoreidCheckoutAuthorizeByOrderidError {
925    UnknownValue(serde_json::Value),
926}
927
928/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_capture_by_orderid`]
929#[derive(Debug, Clone, Serialize, Deserialize)]
930#[serde(untagged)]
931pub enum PostCommerceStoreByStoreidCheckoutCaptureByOrderidError {
932    UnknownValue(serde_json::Value),
933}
934
935/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_charge`]
936#[derive(Debug, Clone, Serialize, Deserialize)]
937#[serde(untagged)]
938pub enum PostCommerceStoreByStoreidCheckoutChargeError {
939    UnknownValue(serde_json::Value),
940}
941
942/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_paypal_cancel_by_paykey`]
943#[derive(Debug, Clone, Serialize, Deserialize)]
944#[serde(untagged)]
945pub enum PostCommerceStoreByStoreidCheckoutPaypalCancelByPaykeyError {
946    UnknownValue(serde_json::Value),
947}
948
949/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_paypal_confirm_by_paykey`]
950#[derive(Debug, Clone, Serialize, Deserialize)]
951#[serde(untagged)]
952pub enum PostCommerceStoreByStoreidCheckoutPaypalConfirmByPaykeyError {
953    UnknownValue(serde_json::Value),
954}
955
956/// struct for typed errors of method [`post_commerce_store_by_storeid_checkout_paypal_pay`]
957#[derive(Debug, Clone, Serialize, Deserialize)]
958#[serde(untagged)]
959pub enum PostCommerceStoreByStoreidCheckoutPaypalPayError {
960    UnknownValue(serde_json::Value),
961}
962
963/// struct for typed errors of method [`post_commerce_store_by_storeid_listing_by_key`]
964#[derive(Debug, Clone, Serialize, Deserialize)]
965#[serde(untagged)]
966pub enum PostCommerceStoreByStoreidListingByKeyError {
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`post_commerce_store_by_storeid_paypal_cancel_by_paykey`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum PostCommerceStoreByStoreidPaypalCancelByPaykeyError {
974    UnknownValue(serde_json::Value),
975}
976
977/// struct for typed errors of method [`post_commerce_store_by_storeid_paypal_confirm_by_paykey`]
978#[derive(Debug, Clone, Serialize, Deserialize)]
979#[serde(untagged)]
980pub enum PostCommerceStoreByStoreidPaypalConfirmByPaykeyError {
981    UnknownValue(serde_json::Value),
982}
983
984/// struct for typed errors of method [`post_commerce_store_by_storeid_paypal_pay`]
985#[derive(Debug, Clone, Serialize, Deserialize)]
986#[serde(untagged)]
987pub enum PostCommerceStoreByStoreidPaypalPayError {
988    UnknownValue(serde_json::Value),
989}
990
991/// struct for typed errors of method [`post_commerce_store_by_storeid_trial`]
992#[derive(Debug, Clone, Serialize, Deserialize)]
993#[serde(untagged)]
994pub enum PostCommerceStoreByStoreidTrialError {
995    UnknownValue(serde_json::Value),
996}
997
998/// struct for typed errors of method [`post_commerce_store_token`]
999#[derive(Debug, Clone, Serialize, Deserialize)]
1000#[serde(untagged)]
1001pub enum PostCommerceStoreTokenError {
1002    UnknownValue(serde_json::Value),
1003}
1004
1005/// struct for typed errors of method [`post_commerce_submission`]
1006#[derive(Debug, Clone, Serialize, Deserialize)]
1007#[serde(untagged)]
1008pub enum PostCommerceSubmissionError {
1009    UnknownValue(serde_json::Value),
1010}
1011
1012/// struct for typed errors of method [`post_commerce_submission_by_submissionid`]
1013#[derive(Debug, Clone, Serialize, Deserialize)]
1014#[serde(untagged)]
1015pub enum PostCommerceSubmissionBySubmissionidError {
1016    UnknownValue(serde_json::Value),
1017}
1018
1019/// struct for typed errors of method [`post_commerce_subscriber`]
1020#[derive(Debug, Clone, Serialize, Deserialize)]
1021#[serde(untagged)]
1022pub enum PostCommerceSubscriberError {
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`post_commerce_subscriber_by_subscriberid`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum PostCommerceSubscriberBySubscriberidError {
1030    UnknownValue(serde_json::Value),
1031}
1032
1033/// struct for typed errors of method [`post_commerce_tokentransaction`]
1034#[derive(Debug, Clone, Serialize, Deserialize)]
1035#[serde(untagged)]
1036pub enum PostCommerceTokentransactionError {
1037    UnknownValue(serde_json::Value),
1038}
1039
1040/// struct for typed errors of method [`post_commerce_tokentransaction_by_tokentransactionid`]
1041#[derive(Debug, Clone, Serialize, Deserialize)]
1042#[serde(untagged)]
1043pub enum PostCommerceTokentransactionByTokentransactionidError {
1044    UnknownValue(serde_json::Value),
1045}
1046
1047/// struct for typed errors of method [`post_commerce_transfer`]
1048#[derive(Debug, Clone, Serialize, Deserialize)]
1049#[serde(untagged)]
1050pub enum PostCommerceTransferError {
1051    UnknownValue(serde_json::Value),
1052}
1053
1054/// struct for typed errors of method [`post_commerce_transfer_by_transferid`]
1055#[derive(Debug, Clone, Serialize, Deserialize)]
1056#[serde(untagged)]
1057pub enum PostCommerceTransferByTransferidError {
1058    UnknownValue(serde_json::Value),
1059}
1060
1061/// struct for typed errors of method [`post_commerce_variant`]
1062#[derive(Debug, Clone, Serialize, Deserialize)]
1063#[serde(untagged)]
1064pub enum PostCommerceVariantError {
1065    UnknownValue(serde_json::Value),
1066}
1067
1068/// struct for typed errors of method [`post_commerce_variant_by_variantid`]
1069#[derive(Debug, Clone, Serialize, Deserialize)]
1070#[serde(untagged)]
1071pub enum PostCommerceVariantByVariantidError {
1072    UnknownValue(serde_json::Value),
1073}
1074
1075/// struct for typed errors of method [`post_commerce_wallet`]
1076#[derive(Debug, Clone, Serialize, Deserialize)]
1077#[serde(untagged)]
1078pub enum PostCommerceWalletError {
1079    UnknownValue(serde_json::Value),
1080}
1081
1082/// struct for typed errors of method [`post_commerce_wallet_by_walletid`]
1083#[derive(Debug, Clone, Serialize, Deserialize)]
1084#[serde(untagged)]
1085pub enum PostCommerceWalletByWalletidError {
1086    UnknownValue(serde_json::Value),
1087}
1088
1089/// struct for typed errors of method [`post_commerce_watchlist`]
1090#[derive(Debug, Clone, Serialize, Deserialize)]
1091#[serde(untagged)]
1092pub enum PostCommerceWatchlistError {
1093    UnknownValue(serde_json::Value),
1094}
1095
1096/// struct for typed errors of method [`post_commerce_watchlist_by_watchlistid`]
1097#[derive(Debug, Clone, Serialize, Deserialize)]
1098#[serde(untagged)]
1099pub enum PostCommerceWatchlistByWatchlistidError {
1100    UnknownValue(serde_json::Value),
1101}
1102
1103/// struct for typed errors of method [`post_commerce_webhook`]
1104#[derive(Debug, Clone, Serialize, Deserialize)]
1105#[serde(untagged)]
1106pub enum PostCommerceWebhookError {
1107    UnknownValue(serde_json::Value),
1108}
1109
1110/// struct for typed errors of method [`post_commerce_webhook_by_webhookid`]
1111#[derive(Debug, Clone, Serialize, Deserialize)]
1112#[serde(untagged)]
1113pub enum PostCommerceWebhookByWebhookidError {
1114    UnknownValue(serde_json::Value),
1115}
1116
1117/// struct for typed errors of method [`post_commerce_webhooks_by_provider`]
1118#[derive(Debug, Clone, Serialize, Deserialize)]
1119#[serde(untagged)]
1120pub enum PostCommerceWebhooksByProviderError {
1121    UnknownValue(serde_json::Value),
1122}
1123
1124/// struct for typed errors of method [`put_commerce_collection_by_collectionid`]
1125#[derive(Debug, Clone, Serialize, Deserialize)]
1126#[serde(untagged)]
1127pub enum PutCommerceCollectionByCollectionidError {
1128    UnknownValue(serde_json::Value),
1129}
1130
1131/// struct for typed errors of method [`put_commerce_disclosure_by_disclosureid`]
1132#[derive(Debug, Clone, Serialize, Deserialize)]
1133#[serde(untagged)]
1134pub enum PutCommerceDisclosureByDisclosureidError {
1135    UnknownValue(serde_json::Value),
1136}
1137
1138/// struct for typed errors of method [`put_commerce_discount_by_discountid`]
1139#[derive(Debug, Clone, Serialize, Deserialize)]
1140#[serde(untagged)]
1141pub enum PutCommerceDiscountByDiscountidError {
1142    UnknownValue(serde_json::Value),
1143}
1144
1145/// struct for typed errors of method [`put_commerce_movie_by_movieid`]
1146#[derive(Debug, Clone, Serialize, Deserialize)]
1147#[serde(untagged)]
1148pub enum PutCommerceMovieByMovieidError {
1149    UnknownValue(serde_json::Value),
1150}
1151
1152/// struct for typed errors of method [`put_commerce_note_by_noteid`]
1153#[derive(Debug, Clone, Serialize, Deserialize)]
1154#[serde(untagged)]
1155pub enum PutCommerceNoteByNoteidError {
1156    UnknownValue(serde_json::Value),
1157}
1158
1159/// struct for typed errors of method [`put_commerce_plans_entries_by_slug`]
1160#[derive(Debug, Clone, Serialize, Deserialize)]
1161#[serde(untagged)]
1162pub enum PutCommercePlansEntriesBySlugError {
1163    UnknownValue(serde_json::Value),
1164}
1165
1166/// struct for typed errors of method [`put_commerce_product_by_productid`]
1167#[derive(Debug, Clone, Serialize, Deserialize)]
1168#[serde(untagged)]
1169pub enum PutCommerceProductByProductidError {
1170    UnknownValue(serde_json::Value),
1171}
1172
1173/// struct for typed errors of method [`put_commerce_rates_entries_by_product_by_meter`]
1174#[derive(Debug, Clone, Serialize, Deserialize)]
1175#[serde(untagged)]
1176pub enum PutCommerceRatesEntriesByProductByMeterError {
1177    UnknownValue(serde_json::Value),
1178}
1179
1180/// struct for typed errors of method [`put_commerce_return_by_returnid`]
1181#[derive(Debug, Clone, Serialize, Deserialize)]
1182#[serde(untagged)]
1183pub enum PutCommerceReturnByReturnidError {
1184    UnknownValue(serde_json::Value),
1185}
1186
1187/// struct for typed errors of method [`put_commerce_saleschannel_by_saleschannelid`]
1188#[derive(Debug, Clone, Serialize, Deserialize)]
1189#[serde(untagged)]
1190pub enum PutCommerceSaleschannelBySaleschannelidError {
1191    UnknownValue(serde_json::Value),
1192}
1193
1194/// struct for typed errors of method [`put_commerce_stocklocation_by_stocklocationid`]
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1196#[serde(untagged)]
1197pub enum PutCommerceStocklocationByStocklocationidError {
1198    UnknownValue(serde_json::Value),
1199}
1200
1201/// struct for typed errors of method [`put_commerce_store_by_storeid`]
1202#[derive(Debug, Clone, Serialize, Deserialize)]
1203#[serde(untagged)]
1204pub enum PutCommerceStoreByStoreidError {
1205    UnknownValue(serde_json::Value),
1206}
1207
1208/// struct for typed errors of method [`put_commerce_store_by_storeid_listing_by_key`]
1209#[derive(Debug, Clone, Serialize, Deserialize)]
1210#[serde(untagged)]
1211pub enum PutCommerceStoreByStoreidListingByKeyError {
1212    UnknownValue(serde_json::Value),
1213}
1214
1215/// struct for typed errors of method [`put_commerce_submission_by_submissionid`]
1216#[derive(Debug, Clone, Serialize, Deserialize)]
1217#[serde(untagged)]
1218pub enum PutCommerceSubmissionBySubmissionidError {
1219    UnknownValue(serde_json::Value),
1220}
1221
1222/// struct for typed errors of method [`put_commerce_subscriber_by_subscriberid`]
1223#[derive(Debug, Clone, Serialize, Deserialize)]
1224#[serde(untagged)]
1225pub enum PutCommerceSubscriberBySubscriberidError {
1226    UnknownValue(serde_json::Value),
1227}
1228
1229/// struct for typed errors of method [`put_commerce_tokentransaction_by_tokentransactionid`]
1230#[derive(Debug, Clone, Serialize, Deserialize)]
1231#[serde(untagged)]
1232pub enum PutCommerceTokentransactionByTokentransactionidError {
1233    UnknownValue(serde_json::Value),
1234}
1235
1236/// struct for typed errors of method [`put_commerce_transfer_by_transferid`]
1237#[derive(Debug, Clone, Serialize, Deserialize)]
1238#[serde(untagged)]
1239pub enum PutCommerceTransferByTransferidError {
1240    UnknownValue(serde_json::Value),
1241}
1242
1243/// struct for typed errors of method [`put_commerce_variant_by_variantid`]
1244#[derive(Debug, Clone, Serialize, Deserialize)]
1245#[serde(untagged)]
1246pub enum PutCommerceVariantByVariantidError {
1247    UnknownValue(serde_json::Value),
1248}
1249
1250/// struct for typed errors of method [`put_commerce_wallet_by_walletid`]
1251#[derive(Debug, Clone, Serialize, Deserialize)]
1252#[serde(untagged)]
1253pub enum PutCommerceWalletByWalletidError {
1254    UnknownValue(serde_json::Value),
1255}
1256
1257/// struct for typed errors of method [`put_commerce_watchlist_by_watchlistid`]
1258#[derive(Debug, Clone, Serialize, Deserialize)]
1259#[serde(untagged)]
1260pub enum PutCommerceWatchlistByWatchlistidError {
1261    UnknownValue(serde_json::Value),
1262}
1263
1264/// struct for typed errors of method [`put_commerce_webhook_by_webhookid`]
1265#[derive(Debug, Clone, Serialize, Deserialize)]
1266#[serde(untagged)]
1267pub enum PutCommerceWebhookByWebhookidError {
1268    UnknownValue(serde_json::Value),
1269}
1270
1271/// struct for typed errors of method [`set_cart_item`]
1272#[derive(Debug, Clone, Serialize, Deserialize)]
1273#[serde(untagged)]
1274pub enum SetCartItemError {
1275    UnknownValue(serde_json::Value),
1276}
1277
1278/// struct for typed errors of method [`take_payment`]
1279#[derive(Debug, Clone, Serialize, Deserialize)]
1280#[serde(untagged)]
1281pub enum TakePaymentError {
1282    UnknownValue(serde_json::Value),
1283}
1284
1285
1286/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteCollection.
1287pub async fn delete_commerce_collection_by_collectionid(configuration: &configuration::Configuration, collectionid: &str) -> Result<(), Error<DeleteCommerceCollectionByCollectionidError>> {
1288    // add a prefix to parameters to efficiently prevent name collisions
1289    let p_collectionid = collectionid;
1290
1291    let uri_str = format!("{}/v1/commerce/collection/{collectionid}", configuration.base_path, collectionid=crate::apis::urlencode(p_collectionid));
1292    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1293
1294    if let Some(ref user_agent) = configuration.user_agent {
1295        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1296    }
1297    if let Some(ref token) = configuration.bearer_access_token {
1298        req_builder = req_builder.bearer_auth(token.to_owned());
1299    };
1300
1301    let req = req_builder.build()?;
1302    let resp = configuration.client.execute(req).await?;
1303
1304    let status = resp.status();
1305
1306    if !status.is_client_error() && !status.is_server_error() {
1307        Ok(())
1308    } else {
1309        let content = resp.text().await?;
1310        let entity: Option<DeleteCommerceCollectionByCollectionidError> = serde_json::from_str(&content).ok();
1311        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1312    }
1313}
1314
1315/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1316pub async fn delete_commerce_disclosure_by_disclosureid(configuration: &configuration::Configuration, disclosureid: &str) -> Result<(), Error<DeleteCommerceDisclosureByDisclosureidError>> {
1317    // add a prefix to parameters to efficiently prevent name collisions
1318    let p_disclosureid = disclosureid;
1319
1320    let uri_str = format!("{}/v1/commerce/disclosure/{disclosureid}", configuration.base_path, disclosureid=crate::apis::urlencode(p_disclosureid));
1321    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1322
1323    if let Some(ref user_agent) = configuration.user_agent {
1324        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1325    }
1326    if let Some(ref token) = configuration.bearer_access_token {
1327        req_builder = req_builder.bearer_auth(token.to_owned());
1328    };
1329
1330    let req = req_builder.build()?;
1331    let resp = configuration.client.execute(req).await?;
1332
1333    let status = resp.status();
1334
1335    if !status.is_client_error() && !status.is_server_error() {
1336        Ok(())
1337    } else {
1338        let content = resp.text().await?;
1339        let entity: Option<DeleteCommerceDisclosureByDisclosureidError> = serde_json::from_str(&content).ok();
1340        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1341    }
1342}
1343
1344/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1345pub async fn delete_commerce_discount_by_discountid(configuration: &configuration::Configuration, discountid: &str) -> Result<(), Error<DeleteCommerceDiscountByDiscountidError>> {
1346    // add a prefix to parameters to efficiently prevent name collisions
1347    let p_discountid = discountid;
1348
1349    let uri_str = format!("{}/v1/commerce/discount/{discountid}", configuration.base_path, discountid=crate::apis::urlencode(p_discountid));
1350    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1351
1352    if let Some(ref user_agent) = configuration.user_agent {
1353        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1354    }
1355    if let Some(ref token) = configuration.bearer_access_token {
1356        req_builder = req_builder.bearer_auth(token.to_owned());
1357    };
1358
1359    let req = req_builder.build()?;
1360    let resp = configuration.client.execute(req).await?;
1361
1362    let status = resp.status();
1363
1364    if !status.is_client_error() && !status.is_server_error() {
1365        Ok(())
1366    } else {
1367        let content = resp.text().await?;
1368        let entity: Option<DeleteCommerceDiscountByDiscountidError> = serde_json::from_str(&content).ok();
1369        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1370    }
1371}
1372
1373/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1374pub async fn delete_commerce_movie_by_movieid(configuration: &configuration::Configuration, movieid: &str) -> Result<(), Error<DeleteCommerceMovieByMovieidError>> {
1375    // add a prefix to parameters to efficiently prevent name collisions
1376    let p_movieid = movieid;
1377
1378    let uri_str = format!("{}/v1/commerce/movie/{movieid}", configuration.base_path, movieid=crate::apis::urlencode(p_movieid));
1379    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1380
1381    if let Some(ref user_agent) = configuration.user_agent {
1382        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1383    }
1384    if let Some(ref token) = configuration.bearer_access_token {
1385        req_builder = req_builder.bearer_auth(token.to_owned());
1386    };
1387
1388    let req = req_builder.build()?;
1389    let resp = configuration.client.execute(req).await?;
1390
1391    let status = resp.status();
1392
1393    if !status.is_client_error() && !status.is_server_error() {
1394        Ok(())
1395    } else {
1396        let content = resp.text().await?;
1397        let entity: Option<DeleteCommerceMovieByMovieidError> = serde_json::from_str(&content).ok();
1398        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1399    }
1400}
1401
1402/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1403pub async fn delete_commerce_note_by_noteid(configuration: &configuration::Configuration, noteid: &str) -> Result<(), Error<DeleteCommerceNoteByNoteidError>> {
1404    // add a prefix to parameters to efficiently prevent name collisions
1405    let p_noteid = noteid;
1406
1407    let uri_str = format!("{}/v1/commerce/note/{noteid}", configuration.base_path, noteid=crate::apis::urlencode(p_noteid));
1408    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1409
1410    if let Some(ref user_agent) = configuration.user_agent {
1411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1412    }
1413    if let Some(ref token) = configuration.bearer_access_token {
1414        req_builder = req_builder.bearer_auth(token.to_owned());
1415    };
1416
1417    let req = req_builder.build()?;
1418    let resp = configuration.client.execute(req).await?;
1419
1420    let status = resp.status();
1421
1422    if !status.is_client_error() && !status.is_server_error() {
1423        Ok(())
1424    } else {
1425        let content = resp.text().await?;
1426        let entity: Option<DeleteCommerceNoteByNoteidError> = serde_json::from_str(&content).ok();
1427        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1428    }
1429}
1430
1431/// Deletes the addressed plan and answers 204. It removes the plan from the catalog buyers choose from; it does not touch subscriptions already sold against it, which keep their stored plan id. PLATFORM admin only — an org-level admin is refused 403 — and an unknown slug is 404.
1432pub async fn delete_commerce_plans_entries_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<DeleteCommercePlansEntriesBySlugError>> {
1433    // add a prefix to parameters to efficiently prevent name collisions
1434    let p_slug = slug;
1435
1436    let uri_str = format!("{}/v1/commerce/plans/entries/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1437    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1438
1439    if let Some(ref user_agent) = configuration.user_agent {
1440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1441    }
1442    if let Some(ref token) = configuration.bearer_access_token {
1443        req_builder = req_builder.bearer_auth(token.to_owned());
1444    };
1445
1446    let req = req_builder.build()?;
1447    let resp = configuration.client.execute(req).await?;
1448
1449    let status = resp.status();
1450
1451    if !status.is_client_error() && !status.is_server_error() {
1452        Ok(())
1453    } else {
1454        let content = resp.text().await?;
1455        let entity: Option<DeleteCommercePlansEntriesBySlugError> = serde_json::from_str(&content).ok();
1456        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1457    }
1458}
1459
1460/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteProduct.
1461pub async fn delete_commerce_product_by_productid(configuration: &configuration::Configuration, productid: &str) -> Result<(), Error<DeleteCommerceProductByProductidError>> {
1462    // add a prefix to parameters to efficiently prevent name collisions
1463    let p_productid = productid;
1464
1465    let uri_str = format!("{}/v1/commerce/product/{productid}", configuration.base_path, productid=crate::apis::urlencode(p_productid));
1466    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1467
1468    if let Some(ref user_agent) = configuration.user_agent {
1469        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1470    }
1471    if let Some(ref token) = configuration.bearer_access_token {
1472        req_builder = req_builder.bearer_auth(token.to_owned());
1473    };
1474
1475    let req = req_builder.build()?;
1476    let resp = configuration.client.execute(req).await?;
1477
1478    let status = resp.status();
1479
1480    if !status.is_client_error() && !status.is_server_error() {
1481        Ok(())
1482    } else {
1483        let content = resp.text().await?;
1484        let entity: Option<DeleteCommerceProductByProductidError> = serde_json::from_str(&content).ok();
1485        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1486    }
1487}
1488
1489/// Deletes the row. ARCHIVING is usually what is wanted instead — a deleted rate cannot price a historical charge, so a past invoice that has to re-resolve its rate finds nothing to read. Reach for status=archived unless the rate never priced anything. SuperAdmin only.
1490pub async fn delete_commerce_rates_entries_by_product_by_meter(configuration: &configuration::Configuration, product: &str, meter: &str) -> Result<(), Error<DeleteCommerceRatesEntriesByProductByMeterError>> {
1491    // add a prefix to parameters to efficiently prevent name collisions
1492    let p_product = product;
1493    let p_meter = meter;
1494
1495    let uri_str = format!("{}/v1/commerce/rates/entries/{product}/{meter}", configuration.base_path, product=crate::apis::urlencode(p_product), meter=crate::apis::urlencode(p_meter));
1496    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1497
1498    if let Some(ref user_agent) = configuration.user_agent {
1499        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1500    }
1501    if let Some(ref token) = configuration.bearer_access_token {
1502        req_builder = req_builder.bearer_auth(token.to_owned());
1503    };
1504
1505    let req = req_builder.build()?;
1506    let resp = configuration.client.execute(req).await?;
1507
1508    let status = resp.status();
1509
1510    if !status.is_client_error() && !status.is_server_error() {
1511        Ok(())
1512    } else {
1513        let content = resp.text().await?;
1514        let entity: Option<DeleteCommerceRatesEntriesByProductByMeterError> = serde_json::from_str(&content).ok();
1515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1516    }
1517}
1518
1519/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The token must also carry Admin or WriteReturn.
1520pub async fn delete_commerce_return_by_returnid(configuration: &configuration::Configuration, returnid: &str) -> Result<(), Error<DeleteCommerceReturnByReturnidError>> {
1521    // add a prefix to parameters to efficiently prevent name collisions
1522    let p_returnid = returnid;
1523
1524    let uri_str = format!("{}/v1/commerce/return/{returnid}", configuration.base_path, returnid=crate::apis::urlencode(p_returnid));
1525    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1526
1527    if let Some(ref user_agent) = configuration.user_agent {
1528        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1529    }
1530    if let Some(ref token) = configuration.bearer_access_token {
1531        req_builder = req_builder.bearer_auth(token.to_owned());
1532    };
1533
1534    let req = req_builder.build()?;
1535    let resp = configuration.client.execute(req).await?;
1536
1537    let status = resp.status();
1538
1539    if !status.is_client_error() && !status.is_server_error() {
1540        Ok(())
1541    } else {
1542        let content = resp.text().await?;
1543        let entity: Option<DeleteCommerceReturnByReturnidError> = serde_json::from_str(&content).ok();
1544        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1545    }
1546}
1547
1548/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1549pub async fn delete_commerce_saleschannel_by_saleschannelid(configuration: &configuration::Configuration, saleschannelid: &str) -> Result<(), Error<DeleteCommerceSaleschannelBySaleschannelidError>> {
1550    // add a prefix to parameters to efficiently prevent name collisions
1551    let p_saleschannelid = saleschannelid;
1552
1553    let uri_str = format!("{}/v1/commerce/saleschannel/{saleschannelid}", configuration.base_path, saleschannelid=crate::apis::urlencode(p_saleschannelid));
1554    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1555
1556    if let Some(ref user_agent) = configuration.user_agent {
1557        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1558    }
1559    if let Some(ref token) = configuration.bearer_access_token {
1560        req_builder = req_builder.bearer_auth(token.to_owned());
1561    };
1562
1563    let req = req_builder.build()?;
1564    let resp = configuration.client.execute(req).await?;
1565
1566    let status = resp.status();
1567
1568    if !status.is_client_error() && !status.is_server_error() {
1569        Ok(())
1570    } else {
1571        let content = resp.text().await?;
1572        let entity: Option<DeleteCommerceSaleschannelBySaleschannelidError> = serde_json::from_str(&content).ok();
1573        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1574    }
1575}
1576
1577/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1578pub async fn delete_commerce_stocklocation_by_stocklocationid(configuration: &configuration::Configuration, stocklocationid: &str) -> Result<(), Error<DeleteCommerceStocklocationByStocklocationidError>> {
1579    // add a prefix to parameters to efficiently prevent name collisions
1580    let p_stocklocationid = stocklocationid;
1581
1582    let uri_str = format!("{}/v1/commerce/stocklocation/{stocklocationid}", configuration.base_path, stocklocationid=crate::apis::urlencode(p_stocklocationid));
1583    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1584
1585    if let Some(ref user_agent) = configuration.user_agent {
1586        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1587    }
1588    if let Some(ref token) = configuration.bearer_access_token {
1589        req_builder = req_builder.bearer_auth(token.to_owned());
1590    };
1591
1592    let req = req_builder.build()?;
1593    let resp = configuration.client.execute(req).await?;
1594
1595    let status = resp.status();
1596
1597    if !status.is_client_error() && !status.is_server_error() {
1598        Ok(())
1599    } else {
1600        let content = resp.text().await?;
1601        let entity: Option<DeleteCommerceStocklocationByStocklocationidError> = serde_json::from_str(&content).ok();
1602        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1603    }
1604}
1605
1606/// Removes the addressed store and answers 204 with no body. Before the live row goes, the entity is written once more under a tombstone kind, so the deletion leaves a recoverable copy rather than destroying the record outright; the store's listing overrides live inside that row and go with it. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is 404. Requires an admin or store-write token.
1607pub async fn delete_commerce_store_by_storeid(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<DeleteCommerceStoreByStoreidError>> {
1608    // add a prefix to parameters to efficiently prevent name collisions
1609    let p_storeid = storeid;
1610
1611    let uri_str = format!("{}/v1/commerce/store/{storeid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
1612    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1613
1614    if let Some(ref user_agent) = configuration.user_agent {
1615        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1616    }
1617    if let Some(ref token) = configuration.bearer_access_token {
1618        req_builder = req_builder.bearer_auth(token.to_owned());
1619    };
1620
1621    let req = req_builder.build()?;
1622    let resp = configuration.client.execute(req).await?;
1623
1624    let status = resp.status();
1625
1626    if !status.is_client_error() && !status.is_server_error() {
1627        Ok(())
1628    } else {
1629        let content = resp.text().await?;
1630        let entity: Option<DeleteCommerceStoreByStoreidError> = serde_json::from_str(&content).ok();
1631        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1632    }
1633}
1634
1635/// Drops the key from the store's listing map and re-saves the store, answering 204 with no body. It UN-OVERRIDES rather than deletes: the product, variant or bundle itself is untouched and simply reverts to its catalog values on this storefront. A key that is not present is 404, and so is a store id outside the caller org's namespace. Admin-gated.
1636pub async fn delete_commerce_store_by_storeid_listing_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<DeleteCommerceStoreByStoreidListingByKeyError>> {
1637    // add a prefix to parameters to efficiently prevent name collisions
1638    let p_storeid = storeid;
1639    let p_key = key;
1640
1641    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
1642    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1643
1644    if let Some(ref user_agent) = configuration.user_agent {
1645        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1646    }
1647    if let Some(ref token) = configuration.bearer_access_token {
1648        req_builder = req_builder.bearer_auth(token.to_owned());
1649    };
1650
1651    let req = req_builder.build()?;
1652    let resp = configuration.client.execute(req).await?;
1653
1654    let status = resp.status();
1655
1656    if !status.is_client_error() && !status.is_server_error() {
1657        Ok(())
1658    } else {
1659        let content = resp.text().await?;
1660        let entity: Option<DeleteCommerceStoreByStoreidListingByKeyError> = serde_json::from_str(&content).ok();
1661        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1662    }
1663}
1664
1665/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1666pub async fn delete_commerce_submission_by_submissionid(configuration: &configuration::Configuration, submissionid: &str) -> Result<(), Error<DeleteCommerceSubmissionBySubmissionidError>> {
1667    // add a prefix to parameters to efficiently prevent name collisions
1668    let p_submissionid = submissionid;
1669
1670    let uri_str = format!("{}/v1/commerce/submission/{submissionid}", configuration.base_path, submissionid=crate::apis::urlencode(p_submissionid));
1671    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1672
1673    if let Some(ref user_agent) = configuration.user_agent {
1674        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1675    }
1676    if let Some(ref token) = configuration.bearer_access_token {
1677        req_builder = req_builder.bearer_auth(token.to_owned());
1678    };
1679
1680    let req = req_builder.build()?;
1681    let resp = configuration.client.execute(req).await?;
1682
1683    let status = resp.status();
1684
1685    if !status.is_client_error() && !status.is_server_error() {
1686        Ok(())
1687    } else {
1688        let content = resp.text().await?;
1689        let entity: Option<DeleteCommerceSubmissionBySubmissionidError> = serde_json::from_str(&content).ok();
1690        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1691    }
1692}
1693
1694/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The token must also carry Admin or WriteSubscriber.
1695pub async fn delete_commerce_subscriber_by_subscriberid(configuration: &configuration::Configuration, subscriberid: &str) -> Result<(), Error<DeleteCommerceSubscriberBySubscriberidError>> {
1696    // add a prefix to parameters to efficiently prevent name collisions
1697    let p_subscriberid = subscriberid;
1698
1699    let uri_str = format!("{}/v1/commerce/subscriber/{subscriberid}", configuration.base_path, subscriberid=crate::apis::urlencode(p_subscriberid));
1700    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1701
1702    if let Some(ref user_agent) = configuration.user_agent {
1703        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1704    }
1705    if let Some(ref token) = configuration.bearer_access_token {
1706        req_builder = req_builder.bearer_auth(token.to_owned());
1707    };
1708
1709    let req = req_builder.build()?;
1710    let resp = configuration.client.execute(req).await?;
1711
1712    let status = resp.status();
1713
1714    if !status.is_client_error() && !status.is_server_error() {
1715        Ok(())
1716    } else {
1717        let content = resp.text().await?;
1718        let entity: Option<DeleteCommerceSubscriberBySubscriberidError> = serde_json::from_str(&content).ok();
1719        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1720    }
1721}
1722
1723/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1724pub async fn delete_commerce_tokentransaction_by_tokentransactionid(configuration: &configuration::Configuration, tokentransactionid: &str) -> Result<(), Error<DeleteCommerceTokentransactionByTokentransactionidError>> {
1725    // add a prefix to parameters to efficiently prevent name collisions
1726    let p_tokentransactionid = tokentransactionid;
1727
1728    let uri_str = format!("{}/v1/commerce/tokentransaction/{tokentransactionid}", configuration.base_path, tokentransactionid=crate::apis::urlencode(p_tokentransactionid));
1729    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1730
1731    if let Some(ref user_agent) = configuration.user_agent {
1732        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1733    }
1734    if let Some(ref token) = configuration.bearer_access_token {
1735        req_builder = req_builder.bearer_auth(token.to_owned());
1736    };
1737
1738    let req = req_builder.build()?;
1739    let resp = configuration.client.execute(req).await?;
1740
1741    let status = resp.status();
1742
1743    if !status.is_client_error() && !status.is_server_error() {
1744        Ok(())
1745    } else {
1746        let content = resp.text().await?;
1747        let entity: Option<DeleteCommerceTokentransactionByTokentransactionidError> = serde_json::from_str(&content).ok();
1748        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1749    }
1750}
1751
1752/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1753pub async fn delete_commerce_transfer_by_transferid(configuration: &configuration::Configuration, transferid: &str) -> Result<(), Error<DeleteCommerceTransferByTransferidError>> {
1754    // add a prefix to parameters to efficiently prevent name collisions
1755    let p_transferid = transferid;
1756
1757    let uri_str = format!("{}/v1/commerce/transfer/{transferid}", configuration.base_path, transferid=crate::apis::urlencode(p_transferid));
1758    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1759
1760    if let Some(ref user_agent) = configuration.user_agent {
1761        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1762    }
1763    if let Some(ref token) = configuration.bearer_access_token {
1764        req_builder = req_builder.bearer_auth(token.to_owned());
1765    };
1766
1767    let req = req_builder.build()?;
1768    let resp = configuration.client.execute(req).await?;
1769
1770    let status = resp.status();
1771
1772    if !status.is_client_error() && !status.is_server_error() {
1773        Ok(())
1774    } else {
1775        let content = resp.text().await?;
1776        let entity: Option<DeleteCommerceTransferByTransferidError> = serde_json::from_str(&content).ok();
1777        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1778    }
1779}
1780
1781/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteVariant.
1782pub async fn delete_commerce_variant_by_variantid(configuration: &configuration::Configuration, variantid: &str) -> Result<(), Error<DeleteCommerceVariantByVariantidError>> {
1783    // add a prefix to parameters to efficiently prevent name collisions
1784    let p_variantid = variantid;
1785
1786    let uri_str = format!("{}/v1/commerce/variant/{variantid}", configuration.base_path, variantid=crate::apis::urlencode(p_variantid));
1787    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1788
1789    if let Some(ref user_agent) = configuration.user_agent {
1790        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1791    }
1792    if let Some(ref token) = configuration.bearer_access_token {
1793        req_builder = req_builder.bearer_auth(token.to_owned());
1794    };
1795
1796    let req = req_builder.build()?;
1797    let resp = configuration.client.execute(req).await?;
1798
1799    let status = resp.status();
1800
1801    if !status.is_client_error() && !status.is_server_error() {
1802        Ok(())
1803    } else {
1804        let content = resp.text().await?;
1805        let entity: Option<DeleteCommerceVariantByVariantidError> = serde_json::from_str(&content).ok();
1806        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1807    }
1808}
1809
1810/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1811pub async fn delete_commerce_wallet_by_walletid(configuration: &configuration::Configuration, walletid: &str) -> Result<(), Error<DeleteCommerceWalletByWalletidError>> {
1812    // add a prefix to parameters to efficiently prevent name collisions
1813    let p_walletid = walletid;
1814
1815    let uri_str = format!("{}/v1/commerce/wallet/{walletid}", configuration.base_path, walletid=crate::apis::urlencode(p_walletid));
1816    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1817
1818    if let Some(ref user_agent) = configuration.user_agent {
1819        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1820    }
1821    if let Some(ref token) = configuration.bearer_access_token {
1822        req_builder = req_builder.bearer_auth(token.to_owned());
1823    };
1824
1825    let req = req_builder.build()?;
1826    let resp = configuration.client.execute(req).await?;
1827
1828    let status = resp.status();
1829
1830    if !status.is_client_error() && !status.is_server_error() {
1831        Ok(())
1832    } else {
1833        let content = resp.text().await?;
1834        let entity: Option<DeleteCommerceWalletByWalletidError> = serde_json::from_str(&content).ok();
1835        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1836    }
1837}
1838
1839/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1840pub async fn delete_commerce_watchlist_by_watchlistid(configuration: &configuration::Configuration, watchlistid: &str) -> Result<(), Error<DeleteCommerceWatchlistByWatchlistidError>> {
1841    // add a prefix to parameters to efficiently prevent name collisions
1842    let p_watchlistid = watchlistid;
1843
1844    let uri_str = format!("{}/v1/commerce/watchlist/{watchlistid}", configuration.base_path, watchlistid=crate::apis::urlencode(p_watchlistid));
1845    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1846
1847    if let Some(ref user_agent) = configuration.user_agent {
1848        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1849    }
1850    if let Some(ref token) = configuration.bearer_access_token {
1851        req_builder = req_builder.bearer_auth(token.to_owned());
1852    };
1853
1854    let req = req_builder.build()?;
1855    let resp = configuration.client.execute(req).await?;
1856
1857    let status = resp.status();
1858
1859    if !status.is_client_error() && !status.is_server_error() {
1860        Ok(())
1861    } else {
1862        let content = resp.text().await?;
1863        let entity: Option<DeleteCommerceWatchlistByWatchlistidError> = serde_json::from_str(&content).ok();
1864        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1865    }
1866}
1867
1868/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
1869pub async fn delete_commerce_webhook_by_webhookid(configuration: &configuration::Configuration, webhookid: &str) -> Result<(), Error<DeleteCommerceWebhookByWebhookidError>> {
1870    // add a prefix to parameters to efficiently prevent name collisions
1871    let p_webhookid = webhookid;
1872
1873    let uri_str = format!("{}/v1/commerce/webhook/{webhookid}", configuration.base_path, webhookid=crate::apis::urlencode(p_webhookid));
1874    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1875
1876    if let Some(ref user_agent) = configuration.user_agent {
1877        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1878    }
1879    if let Some(ref token) = configuration.bearer_access_token {
1880        req_builder = req_builder.bearer_auth(token.to_owned());
1881    };
1882
1883    let req = req_builder.build()?;
1884    let resp = configuration.client.execute(req).await?;
1885
1886    let status = resp.status();
1887
1888    if !status.is_client_error() && !status.is_server_error() {
1889        Ok(())
1890    } else {
1891        let content = resp.text().await?;
1892        let entity: Option<DeleteCommerceWebhookByWebhookidError> = serde_json::from_str(&content).ok();
1893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1894    }
1895}
1896
1897/// Discards a cart the shopper abandoned, and answers it in its final state.  A discarded cart is CLOSED, not deleted: the row stays, so abandoned-basket reporting and any follow-up that keys on it still have something to read. It stops being a cart anything will check out, which is the point — it is how a storefront says \"this basket is over\" without destroying the evidence that it existed.  Discarding is idempotent: a cart already discarded answers its stored state rather than failing, so a retry is safe.  The cart is resolved inside the caller's own org namespace, so another tenant's id answers 404.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
1898pub async fn discard_cart(configuration: &configuration::Configuration, id: &str) -> Result<models::Cart, Error<DiscardCartError>> {
1899    // add a prefix to parameters to efficiently prevent name collisions
1900    let p_id = id;
1901
1902    let uri_str = format!("{}/v1/commerce/cart/{id}/discard", configuration.base_path, id=crate::apis::urlencode(p_id));
1903    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1904
1905    if let Some(ref user_agent) = configuration.user_agent {
1906        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1907    }
1908    if let Some(ref token) = configuration.bearer_access_token {
1909        req_builder = req_builder.bearer_auth(token.to_owned());
1910    };
1911
1912    let req = req_builder.build()?;
1913    let resp = configuration.client.execute(req).await?;
1914
1915    let status = resp.status();
1916    let content_type = resp
1917        .headers()
1918        .get("content-type")
1919        .and_then(|v| v.to_str().ok())
1920        .unwrap_or("application/octet-stream");
1921    let content_type = super::ContentType::from(content_type);
1922
1923    if !status.is_client_error() && !status.is_server_error() {
1924        let content = resp.text().await?;
1925        match content_type {
1926            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1927            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Cart`"))),
1928            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Cart`")))),
1929        }
1930    } else {
1931        let content = resp.text().await?;
1932        let entity: Option<DiscardCartError> = serde_json::from_str(&content).ok();
1933        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1934    }
1935}
1936
1937/// Reads one cart: its lines, its status and what it comes to.  This is what a storefront calls to render the basket, and what a support agent calls to see what a shopper is looking at. The totals are the cart's STORED tally — shipping and tax stay zero until checkout resolves a shipping option and a tax region, so a cart total before checkout is the merchandise total and is meant to be.  The org scopes the read by construction: the store is namespaced to it, so a cart id belonging to another tenant is simply not found rather than found and then filtered, and answers 404 rather than 403 so the id space cannot be probed.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
1938pub async fn get_cart(configuration: &configuration::Configuration, id: &str) -> Result<models::Cart, Error<GetCartError>> {
1939    // add a prefix to parameters to efficiently prevent name collisions
1940    let p_id = id;
1941
1942    let uri_str = format!("{}/v1/commerce/cart/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
1943    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1944
1945    if let Some(ref user_agent) = configuration.user_agent {
1946        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1947    }
1948    if let Some(ref token) = configuration.bearer_access_token {
1949        req_builder = req_builder.bearer_auth(token.to_owned());
1950    };
1951
1952    let req = req_builder.build()?;
1953    let resp = configuration.client.execute(req).await?;
1954
1955    let status = resp.status();
1956    let content_type = resp
1957        .headers()
1958        .get("content-type")
1959        .and_then(|v| v.to_str().ok())
1960        .unwrap_or("application/octet-stream");
1961    let content_type = super::ContentType::from(content_type);
1962
1963    if !status.is_client_error() && !status.is_server_error() {
1964        let content = resp.text().await?;
1965        match content_type {
1966            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1967            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Cart`"))),
1968            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Cart`")))),
1969        }
1970    } else {
1971        let content = resp.text().await?;
1972        let entity: Option<GetCartError> = serde_json::from_str(&content).ok();
1973        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1974    }
1975}
1976
1977/// Returns the brand-scoped catalog carrying the administrative economics the public projection withholds — upstream cost and margin percentage — for the margin surface the platform console administrates. The brand comes from the query and defaults to hanzo. PLATFORM admin only, enforced by the handler on top of the route's IAM gate: an ORG-level admin is refused 403 precisely so upstream cost and margin never reach a tenant.
1978pub async fn get_commerce_admin_catalog(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceAdminCatalogError>> {
1979
1980    let uri_str = format!("{}/v1/commerce/admin/catalog", configuration.base_path);
1981    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1982
1983    if let Some(ref user_agent) = configuration.user_agent {
1984        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1985    }
1986    if let Some(ref token) = configuration.bearer_access_token {
1987        req_builder = req_builder.bearer_auth(token.to_owned());
1988    };
1989
1990    let req = req_builder.build()?;
1991    let resp = configuration.client.execute(req).await?;
1992
1993    let status = resp.status();
1994
1995    if !status.is_client_error() && !status.is_server_error() {
1996        Ok(())
1997    } else {
1998        let content = resp.text().await?;
1999        let entity: Option<GetCommerceAdminCatalogError> = serde_json::from_str(&content).ok();
2000        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2001    }
2002}
2003
2004/// Returns the brand's published catalog — the shared source docs, the console sidebar and the pricing pages all read — with the brand taken from the query and defaulting to hanzo. It is public and cacheable, and it is the projection that deliberately omits cost and margin; those live only on the platform-admin projection.
2005pub async fn get_commerce_catalog(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceCatalogError>> {
2006
2007    let uri_str = format!("{}/v1/commerce/catalog", configuration.base_path);
2008    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2009
2010    if let Some(ref user_agent) = configuration.user_agent {
2011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2012    }
2013    if let Some(ref token) = configuration.bearer_access_token {
2014        req_builder = req_builder.bearer_auth(token.to_owned());
2015    };
2016
2017    let req = req_builder.build()?;
2018    let resp = configuration.client.execute(req).await?;
2019
2020    let status = resp.status();
2021
2022    if !status.is_client_error() && !status.is_server_error() {
2023        Ok(())
2024    } else {
2025        let content = resp.text().await?;
2026        let entity: Option<GetCommerceCatalogError> = serde_json::from_str(&content).ok();
2027        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2028    }
2029}
2030
2031/// Returns every catalog row as stored — the admin view, which unlike the public projection includes entries that are not published. It is cross-tenant platform data, so the gate is a PLATFORM admin: an org-level admin is refused 403 no matter how privileged they are inside their own org, enforced by the handler itself and not only by the route's token middleware.
2032pub async fn get_commerce_catalog_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceCatalogEntriesError>> {
2033
2034    let uri_str = format!("{}/v1/commerce/catalog/entries", configuration.base_path);
2035    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2036
2037    if let Some(ref user_agent) = configuration.user_agent {
2038        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2039    }
2040    if let Some(ref token) = configuration.bearer_access_token {
2041        req_builder = req_builder.bearer_auth(token.to_owned());
2042    };
2043
2044    let req = req_builder.build()?;
2045    let resp = configuration.client.execute(req).await?;
2046
2047    let status = resp.status();
2048
2049    if !status.is_client_error() && !status.is_server_error() {
2050        Ok(())
2051    } else {
2052        let content = resp.text().await?;
2053        let entity: Option<GetCommerceCatalogEntriesError> = serde_json::from_str(&content).ok();
2054        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2055    }
2056}
2057
2058/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Collection list scope.
2059pub async fn get_commerce_collection(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceCollectionError>> {
2060
2061    let uri_str = format!("{}/v1/commerce/collection/", configuration.base_path);
2062    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2063
2064    if let Some(ref user_agent) = configuration.user_agent {
2065        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2066    }
2067    if let Some(ref token) = configuration.bearer_access_token {
2068        req_builder = req_builder.bearer_auth(token.to_owned());
2069    };
2070
2071    let req = req_builder.build()?;
2072    let resp = configuration.client.execute(req).await?;
2073
2074    let status = resp.status();
2075
2076    if !status.is_client_error() && !status.is_server_error() {
2077        Ok(())
2078    } else {
2079        let content = resp.text().await?;
2080        let entity: Option<GetCommerceCollectionError> = serde_json::from_str(&content).ok();
2081        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2082    }
2083}
2084
2085/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadCollection.
2086pub async fn get_commerce_collection_by_collectionid(configuration: &configuration::Configuration, collectionid: &str) -> Result<(), Error<GetCommerceCollectionByCollectionidError>> {
2087    // add a prefix to parameters to efficiently prevent name collisions
2088    let p_collectionid = collectionid;
2089
2090    let uri_str = format!("{}/v1/commerce/collection/{collectionid}", configuration.base_path, collectionid=crate::apis::urlencode(p_collectionid));
2091    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2092
2093    if let Some(ref user_agent) = configuration.user_agent {
2094        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2095    }
2096    if let Some(ref token) = configuration.bearer_access_token {
2097        req_builder = req_builder.bearer_auth(token.to_owned());
2098    };
2099
2100    let req = req_builder.build()?;
2101    let resp = configuration.client.execute(req).await?;
2102
2103    let status = resp.status();
2104
2105    if !status.is_client_error() && !status.is_server_error() {
2106        Ok(())
2107    } else {
2108        let content = resp.text().await?;
2109        let entity: Option<GetCommerceCollectionByCollectionidError> = serde_json::from_str(&content).ok();
2110        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2111    }
2112}
2113
2114/// Returns every reference currency as one global list, so a store settings form or a product price picker binds real rows instead of a hardcoded array. It is a default-namespace read shared by every tenant rather than per-org data, and it is public and cacheable.
2115pub async fn get_commerce_currencies(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceCurrenciesError>> {
2116
2117    let uri_str = format!("{}/v1/commerce/currencies", configuration.base_path);
2118    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2119
2120    if let Some(ref user_agent) = configuration.user_agent {
2121        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2122    }
2123    if let Some(ref token) = configuration.bearer_access_token {
2124        req_builder = req_builder.bearer_auth(token.to_owned());
2125    };
2126
2127    let req = req_builder.build()?;
2128    let resp = configuration.client.execute(req).await?;
2129
2130    let status = resp.status();
2131
2132    if !status.is_client_error() && !status.is_server_error() {
2133        Ok(())
2134    } else {
2135        let content = resp.text().await?;
2136        let entity: Option<GetCommerceCurrenciesError> = serde_json::from_str(&content).ok();
2137        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2138    }
2139}
2140
2141/// Reports whether the deposit watcher is running, its poll interval, and one row per armed asset: chain, token, contract, pooled address and the last block that asset's cursor reached. That last block is the only way to see a watcher that is up but no longer advancing, which is what a stalled deposit rail looks like from outside. SuperAdmin only — the reserved admin org's owner claim; an authenticated caller without it is refused 403 and an anonymous one 401. It is READ-ONLY by design: arming an asset stays a CRYPTO_DEPOSIT_* deployment act and is deliberately not a button here, so there is nothing on this surface that can start crediting a customer's balance. The asset's RPC endpoint is reduced to scheme://host before it is returned, because a managed node URL carries its API key in the path or query and echoing it verbatim would publish that credential to every reader of this status.
2142pub async fn get_commerce_deposits(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceDepositsError>> {
2143
2144    let uri_str = format!("{}/v1/commerce/deposits", configuration.base_path);
2145    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2146
2147    if let Some(ref user_agent) = configuration.user_agent {
2148        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2149    }
2150    if let Some(ref token) = configuration.bearer_access_token {
2151        req_builder = req_builder.bearer_auth(token.to_owned());
2152    };
2153
2154    let req = req_builder.build()?;
2155    let resp = configuration.client.execute(req).await?;
2156
2157    let status = resp.status();
2158
2159    if !status.is_client_error() && !status.is_server_error() {
2160        Ok(())
2161    } else {
2162        let content = resp.text().await?;
2163        let entity: Option<GetCommerceDepositsError> = serde_json::from_str(&content).ok();
2164        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2165    }
2166}
2167
2168/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2169pub async fn get_commerce_disclosure(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceDisclosureError>> {
2170
2171    let uri_str = format!("{}/v1/commerce/disclosure/", configuration.base_path);
2172    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2173
2174    if let Some(ref user_agent) = configuration.user_agent {
2175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2176    }
2177    if let Some(ref token) = configuration.bearer_access_token {
2178        req_builder = req_builder.bearer_auth(token.to_owned());
2179    };
2180
2181    let req = req_builder.build()?;
2182    let resp = configuration.client.execute(req).await?;
2183
2184    let status = resp.status();
2185
2186    if !status.is_client_error() && !status.is_server_error() {
2187        Ok(())
2188    } else {
2189        let content = resp.text().await?;
2190        let entity: Option<GetCommerceDisclosureError> = serde_json::from_str(&content).ok();
2191        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2192    }
2193}
2194
2195/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2196pub async fn get_commerce_disclosure_by_disclosureid(configuration: &configuration::Configuration, disclosureid: &str) -> Result<(), Error<GetCommerceDisclosureByDisclosureidError>> {
2197    // add a prefix to parameters to efficiently prevent name collisions
2198    let p_disclosureid = disclosureid;
2199
2200    let uri_str = format!("{}/v1/commerce/disclosure/{disclosureid}", configuration.base_path, disclosureid=crate::apis::urlencode(p_disclosureid));
2201    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2202
2203    if let Some(ref user_agent) = configuration.user_agent {
2204        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2205    }
2206    if let Some(ref token) = configuration.bearer_access_token {
2207        req_builder = req_builder.bearer_auth(token.to_owned());
2208    };
2209
2210    let req = req_builder.build()?;
2211    let resp = configuration.client.execute(req).await?;
2212
2213    let status = resp.status();
2214
2215    if !status.is_client_error() && !status.is_server_error() {
2216        Ok(())
2217    } else {
2218        let content = resp.text().await?;
2219        let entity: Option<GetCommerceDisclosureByDisclosureidError> = serde_json::from_str(&content).ok();
2220        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2221    }
2222}
2223
2224/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2225pub async fn get_commerce_discount(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceDiscountError>> {
2226
2227    let uri_str = format!("{}/v1/commerce/discount/", configuration.base_path);
2228    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2229
2230    if let Some(ref user_agent) = configuration.user_agent {
2231        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2232    }
2233    if let Some(ref token) = configuration.bearer_access_token {
2234        req_builder = req_builder.bearer_auth(token.to_owned());
2235    };
2236
2237    let req = req_builder.build()?;
2238    let resp = configuration.client.execute(req).await?;
2239
2240    let status = resp.status();
2241
2242    if !status.is_client_error() && !status.is_server_error() {
2243        Ok(())
2244    } else {
2245        let content = resp.text().await?;
2246        let entity: Option<GetCommerceDiscountError> = serde_json::from_str(&content).ok();
2247        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2248    }
2249}
2250
2251/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2252pub async fn get_commerce_discount_by_discountid(configuration: &configuration::Configuration, discountid: &str) -> Result<(), Error<GetCommerceDiscountByDiscountidError>> {
2253    // add a prefix to parameters to efficiently prevent name collisions
2254    let p_discountid = discountid;
2255
2256    let uri_str = format!("{}/v1/commerce/discount/{discountid}", configuration.base_path, discountid=crate::apis::urlencode(p_discountid));
2257    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2258
2259    if let Some(ref user_agent) = configuration.user_agent {
2260        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2261    }
2262    if let Some(ref token) = configuration.bearer_access_token {
2263        req_builder = req_builder.bearer_auth(token.to_owned());
2264    };
2265
2266    let req = req_builder.build()?;
2267    let resp = configuration.client.execute(req).await?;
2268
2269    let status = resp.status();
2270
2271    if !status.is_client_error() && !status.is_server_error() {
2272        Ok(())
2273    } else {
2274        let content = resp.text().await?;
2275        let entity: Option<GetCommerceDiscountByDiscountidError> = serde_json::from_str(&content).ok();
2276        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2277    }
2278}
2279
2280/// Answers ok whenever the commerce subsystem is mounted. It is registered before the module embed boots, so it keeps answering even when the embed failed and every business route serves the fail-closed 503 — which is the point: it reports that the process is reachable, never that the money plane is healthy. Unauthenticated: a probe that needs a credential is a probe that reports the credential.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
2281pub async fn get_commerce_health(configuration: &configuration::Configuration, ) -> Result<models::Liveness, Error<GetCommerceHealthError>> {
2282
2283    let uri_str = format!("{}/v1/commerce/health", configuration.base_path);
2284    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2285
2286    if let Some(ref user_agent) = configuration.user_agent {
2287        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2288    }
2289    if let Some(ref token) = configuration.bearer_access_token {
2290        req_builder = req_builder.bearer_auth(token.to_owned());
2291    };
2292
2293    let req = req_builder.build()?;
2294    let resp = configuration.client.execute(req).await?;
2295
2296    let status = resp.status();
2297    let content_type = resp
2298        .headers()
2299        .get("content-type")
2300        .and_then(|v| v.to_str().ok())
2301        .unwrap_or("application/octet-stream");
2302    let content_type = super::ContentType::from(content_type);
2303
2304    if !status.is_client_error() && !status.is_server_error() {
2305        let content = resp.text().await?;
2306        match content_type {
2307            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2308            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Liveness`"))),
2309            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Liveness`")))),
2310        }
2311    } else {
2312        let content = resp.text().await?;
2313        let entity: Option<GetCommerceHealthError> = serde_json::from_str(&content).ok();
2314        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2315    }
2316}
2317
2318/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2319pub async fn get_commerce_movie(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceMovieError>> {
2320
2321    let uri_str = format!("{}/v1/commerce/movie/", configuration.base_path);
2322    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2323
2324    if let Some(ref user_agent) = configuration.user_agent {
2325        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2326    }
2327    if let Some(ref token) = configuration.bearer_access_token {
2328        req_builder = req_builder.bearer_auth(token.to_owned());
2329    };
2330
2331    let req = req_builder.build()?;
2332    let resp = configuration.client.execute(req).await?;
2333
2334    let status = resp.status();
2335
2336    if !status.is_client_error() && !status.is_server_error() {
2337        Ok(())
2338    } else {
2339        let content = resp.text().await?;
2340        let entity: Option<GetCommerceMovieError> = serde_json::from_str(&content).ok();
2341        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2342    }
2343}
2344
2345/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2346pub async fn get_commerce_movie_by_movieid(configuration: &configuration::Configuration, movieid: &str) -> Result<(), Error<GetCommerceMovieByMovieidError>> {
2347    // add a prefix to parameters to efficiently prevent name collisions
2348    let p_movieid = movieid;
2349
2350    let uri_str = format!("{}/v1/commerce/movie/{movieid}", configuration.base_path, movieid=crate::apis::urlencode(p_movieid));
2351    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2352
2353    if let Some(ref user_agent) = configuration.user_agent {
2354        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2355    }
2356    if let Some(ref token) = configuration.bearer_access_token {
2357        req_builder = req_builder.bearer_auth(token.to_owned());
2358    };
2359
2360    let req = req_builder.build()?;
2361    let resp = configuration.client.execute(req).await?;
2362
2363    let status = resp.status();
2364
2365    if !status.is_client_error() && !status.is_server_error() {
2366        Ok(())
2367    } else {
2368        let content = resp.text().await?;
2369        let entity: Option<GetCommerceMovieByMovieidError> = serde_json::from_str(&content).ok();
2370        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2371    }
2372}
2373
2374/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2375pub async fn get_commerce_note(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceNoteError>> {
2376
2377    let uri_str = format!("{}/v1/commerce/note/", configuration.base_path);
2378    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2379
2380    if let Some(ref user_agent) = configuration.user_agent {
2381        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2382    }
2383    if let Some(ref token) = configuration.bearer_access_token {
2384        req_builder = req_builder.bearer_auth(token.to_owned());
2385    };
2386
2387    let req = req_builder.build()?;
2388    let resp = configuration.client.execute(req).await?;
2389
2390    let status = resp.status();
2391
2392    if !status.is_client_error() && !status.is_server_error() {
2393        Ok(())
2394    } else {
2395        let content = resp.text().await?;
2396        let entity: Option<GetCommerceNoteError> = serde_json::from_str(&content).ok();
2397        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2398    }
2399}
2400
2401/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2402pub async fn get_commerce_note_by_noteid(configuration: &configuration::Configuration, noteid: &str) -> Result<(), Error<GetCommerceNoteByNoteidError>> {
2403    // add a prefix to parameters to efficiently prevent name collisions
2404    let p_noteid = noteid;
2405
2406    let uri_str = format!("{}/v1/commerce/note/{noteid}", configuration.base_path, noteid=crate::apis::urlencode(p_noteid));
2407    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2408
2409    if let Some(ref user_agent) = configuration.user_agent {
2410        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2411    }
2412    if let Some(ref token) = configuration.bearer_access_token {
2413        req_builder = req_builder.bearer_auth(token.to_owned());
2414    };
2415
2416    let req = req_builder.build()?;
2417    let resp = configuration.client.execute(req).await?;
2418
2419    let status = resp.status();
2420
2421    if !status.is_client_error() && !status.is_server_error() {
2422        Ok(())
2423    } else {
2424        let content = resp.text().await?;
2425        let entity: Option<GetCommerceNoteByNoteidError> = serde_json::from_str(&content).ok();
2426        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2427    }
2428}
2429
2430/// Answers the branding, identity issuer and client id, identity-verification config, enabled payment providers, return-URL allowlist and public payment application config for the org the request HOST resolves to. It is genuinely public and unauthenticated — a checkout page calls it before anyone has signed in — and it carries the same public payment config the authenticated config read does, so the card iframe can never initialize against a different application than the one that will be charged. Only ENABLED providers are listed and no credential path is ever projected. An unresolvable host answers a constant 404 that does not echo the host, so the endpoint cannot be used to enumerate orgs; a successful answer is cacheable for a minute.
2431pub async fn get_commerce_org(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceOrgError>> {
2432
2433    let uri_str = format!("{}/v1/commerce/org", configuration.base_path);
2434    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2435
2436    if let Some(ref user_agent) = configuration.user_agent {
2437        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2438    }
2439    if let Some(ref token) = configuration.bearer_access_token {
2440        req_builder = req_builder.bearer_auth(token.to_owned());
2441    };
2442
2443    let req = req_builder.build()?;
2444    let resp = configuration.client.execute(req).await?;
2445
2446    let status = resp.status();
2447
2448    if !status.is_client_error() && !status.is_server_error() {
2449        Ok(())
2450    } else {
2451        let content = resp.text().await?;
2452        let entity: Option<GetCommerceOrgError> = serde_json::from_str(&content).ok();
2453        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2454    }
2455}
2456
2457/// Returns every plan row as stored — the administrative view behind the public plan catalog. The plan authority is cross-tenant pricing data, so the gate is a PLATFORM admin enforced by the handler itself: an org-level admin is refused 403 no matter what they may do inside their own org.
2458pub async fn get_commerce_plans_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommercePlansEntriesError>> {
2459
2460    let uri_str = format!("{}/v1/commerce/plans/entries", configuration.base_path);
2461    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2462
2463    if let Some(ref user_agent) = configuration.user_agent {
2464        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2465    }
2466    if let Some(ref token) = configuration.bearer_access_token {
2467        req_builder = req_builder.bearer_auth(token.to_owned());
2468    };
2469
2470    let req = req_builder.build()?;
2471    let resp = configuration.client.execute(req).await?;
2472
2473    let status = resp.status();
2474
2475    if !status.is_client_error() && !status.is_server_error() {
2476        Ok(())
2477    } else {
2478        let content = resp.text().await?;
2479        let entity: Option<GetCommercePlansEntriesError> = serde_json::from_str(&content).ok();
2480        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2481    }
2482}
2483
2484/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Product list scope.
2485pub async fn get_commerce_product(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceProductError>> {
2486
2487    let uri_str = format!("{}/v1/commerce/product/", configuration.base_path);
2488    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2489
2490    if let Some(ref user_agent) = configuration.user_agent {
2491        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2492    }
2493    if let Some(ref token) = configuration.bearer_access_token {
2494        req_builder = req_builder.bearer_auth(token.to_owned());
2495    };
2496
2497    let req = req_builder.build()?;
2498    let resp = configuration.client.execute(req).await?;
2499
2500    let status = resp.status();
2501
2502    if !status.is_client_error() && !status.is_server_error() {
2503        Ok(())
2504    } else {
2505        let content = resp.text().await?;
2506        let entity: Option<GetCommerceProductError> = serde_json::from_str(&content).ok();
2507        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2508    }
2509}
2510
2511/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadProduct.
2512pub async fn get_commerce_product_by_productid(configuration: &configuration::Configuration, productid: &str) -> Result<(), Error<GetCommerceProductByProductidError>> {
2513    // add a prefix to parameters to efficiently prevent name collisions
2514    let p_productid = productid;
2515
2516    let uri_str = format!("{}/v1/commerce/product/{productid}", configuration.base_path, productid=crate::apis::urlencode(p_productid));
2517    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2518
2519    if let Some(ref user_agent) = configuration.user_agent {
2520        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2521    }
2522    if let Some(ref token) = configuration.bearer_access_token {
2523        req_builder = req_builder.bearer_auth(token.to_owned());
2524    };
2525
2526    let req = req_builder.build()?;
2527    let resp = configuration.client.execute(req).await?;
2528
2529    let status = resp.status();
2530
2531    if !status.is_client_error() && !status.is_server_error() {
2532        Ok(())
2533    } else {
2534        let content = resp.text().await?;
2535        let entity: Option<GetCommerceProductByProductidError> = serde_json::from_str(&content).ok();
2536        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2537    }
2538}
2539
2540/// Returns the rate authority's rows — the prices every metered charge resolves against. Narrow with ?product= to show one surface at a time rather than every rate at once. SuperAdmin only: a rate is cross-tenant money, so the handler asks for the reserved admin org's owner claim itself rather than trusting the bundle's token gate.
2541pub async fn get_commerce_rates_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceRatesEntriesError>> {
2542
2543    let uri_str = format!("{}/v1/commerce/rates/entries", configuration.base_path);
2544    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2545
2546    if let Some(ref user_agent) = configuration.user_agent {
2547        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2548    }
2549    if let Some(ref token) = configuration.bearer_access_token {
2550        req_builder = req_builder.bearer_auth(token.to_owned());
2551    };
2552
2553    let req = req_builder.build()?;
2554    let resp = configuration.client.execute(req).await?;
2555
2556    let status = resp.status();
2557
2558    if !status.is_client_error() && !status.is_server_error() {
2559        Ok(())
2560    } else {
2561        let content = resp.text().await?;
2562        let entity: Option<GetCommerceRatesEntriesError> = serde_json::from_str(&content).ok();
2563        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2564    }
2565}
2566
2567/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The token must also carry Admin or the Return list scope.
2568pub async fn get_commerce_return(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceReturnError>> {
2569
2570    let uri_str = format!("{}/v1/commerce/return/", configuration.base_path);
2571    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2572
2573    if let Some(ref user_agent) = configuration.user_agent {
2574        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2575    }
2576    if let Some(ref token) = configuration.bearer_access_token {
2577        req_builder = req_builder.bearer_auth(token.to_owned());
2578    };
2579
2580    let req = req_builder.build()?;
2581    let resp = configuration.client.execute(req).await?;
2582
2583    let status = resp.status();
2584
2585    if !status.is_client_error() && !status.is_server_error() {
2586        Ok(())
2587    } else {
2588        let content = resp.text().await?;
2589        let entity: Option<GetCommerceReturnError> = serde_json::from_str(&content).ok();
2590        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2591    }
2592}
2593
2594/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The token must also carry Admin or ReadReturn.
2595pub async fn get_commerce_return_by_returnid(configuration: &configuration::Configuration, returnid: &str) -> Result<(), Error<GetCommerceReturnByReturnidError>> {
2596    // add a prefix to parameters to efficiently prevent name collisions
2597    let p_returnid = returnid;
2598
2599    let uri_str = format!("{}/v1/commerce/return/{returnid}", configuration.base_path, returnid=crate::apis::urlencode(p_returnid));
2600    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2601
2602    if let Some(ref user_agent) = configuration.user_agent {
2603        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2604    }
2605    if let Some(ref token) = configuration.bearer_access_token {
2606        req_builder = req_builder.bearer_auth(token.to_owned());
2607    };
2608
2609    let req = req_builder.build()?;
2610    let resp = configuration.client.execute(req).await?;
2611
2612    let status = resp.status();
2613
2614    if !status.is_client_error() && !status.is_server_error() {
2615        Ok(())
2616    } else {
2617        let content = resp.text().await?;
2618        let entity: Option<GetCommerceReturnByReturnidError> = serde_json::from_str(&content).ok();
2619        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2620    }
2621}
2622
2623/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2624pub async fn get_commerce_saleschannel(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceSaleschannelError>> {
2625
2626    let uri_str = format!("{}/v1/commerce/saleschannel/", configuration.base_path);
2627    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2628
2629    if let Some(ref user_agent) = configuration.user_agent {
2630        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2631    }
2632    if let Some(ref token) = configuration.bearer_access_token {
2633        req_builder = req_builder.bearer_auth(token.to_owned());
2634    };
2635
2636    let req = req_builder.build()?;
2637    let resp = configuration.client.execute(req).await?;
2638
2639    let status = resp.status();
2640
2641    if !status.is_client_error() && !status.is_server_error() {
2642        Ok(())
2643    } else {
2644        let content = resp.text().await?;
2645        let entity: Option<GetCommerceSaleschannelError> = serde_json::from_str(&content).ok();
2646        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2647    }
2648}
2649
2650/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2651pub async fn get_commerce_saleschannel_by_saleschannelid(configuration: &configuration::Configuration, saleschannelid: &str) -> Result<(), Error<GetCommerceSaleschannelBySaleschannelidError>> {
2652    // add a prefix to parameters to efficiently prevent name collisions
2653    let p_saleschannelid = saleschannelid;
2654
2655    let uri_str = format!("{}/v1/commerce/saleschannel/{saleschannelid}", configuration.base_path, saleschannelid=crate::apis::urlencode(p_saleschannelid));
2656    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2657
2658    if let Some(ref user_agent) = configuration.user_agent {
2659        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2660    }
2661    if let Some(ref token) = configuration.bearer_access_token {
2662        req_builder = req_builder.bearer_auth(token.to_owned());
2663    };
2664
2665    let req = req_builder.build()?;
2666    let resp = configuration.client.execute(req).await?;
2667
2668    let status = resp.status();
2669
2670    if !status.is_client_error() && !status.is_server_error() {
2671        Ok(())
2672    } else {
2673        let content = resp.text().await?;
2674        let entity: Option<GetCommerceSaleschannelBySaleschannelidError> = serde_json::from_str(&content).ok();
2675        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2676    }
2677}
2678
2679/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2680pub async fn get_commerce_stocklocation(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceStocklocationError>> {
2681
2682    let uri_str = format!("{}/v1/commerce/stocklocation/", configuration.base_path);
2683    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2684
2685    if let Some(ref user_agent) = configuration.user_agent {
2686        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2687    }
2688    if let Some(ref token) = configuration.bearer_access_token {
2689        req_builder = req_builder.bearer_auth(token.to_owned());
2690    };
2691
2692    let req = req_builder.build()?;
2693    let resp = configuration.client.execute(req).await?;
2694
2695    let status = resp.status();
2696
2697    if !status.is_client_error() && !status.is_server_error() {
2698        Ok(())
2699    } else {
2700        let content = resp.text().await?;
2701        let entity: Option<GetCommerceStocklocationError> = serde_json::from_str(&content).ok();
2702        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2703    }
2704}
2705
2706/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2707pub async fn get_commerce_stocklocation_by_stocklocationid(configuration: &configuration::Configuration, stocklocationid: &str) -> Result<(), Error<GetCommerceStocklocationByStocklocationidError>> {
2708    // add a prefix to parameters to efficiently prevent name collisions
2709    let p_stocklocationid = stocklocationid;
2710
2711    let uri_str = format!("{}/v1/commerce/stocklocation/{stocklocationid}", configuration.base_path, stocklocationid=crate::apis::urlencode(p_stocklocationid));
2712    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2713
2714    if let Some(ref user_agent) = configuration.user_agent {
2715        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2716    }
2717    if let Some(ref token) = configuration.bearer_access_token {
2718        req_builder = req_builder.bearer_auth(token.to_owned());
2719    };
2720
2721    let req = req_builder.build()?;
2722    let resp = configuration.client.execute(req).await?;
2723
2724    let status = resp.status();
2725
2726    if !status.is_client_error() && !status.is_server_error() {
2727        Ok(())
2728    } else {
2729        let content = resp.text().await?;
2730        let entity: Option<GetCommerceStocklocationByStocklocationidError> = serde_json::from_str(&content).ok();
2731        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2732    }
2733}
2734
2735/// Answers a pagination envelope — page, display, the rows, and a total count — read from the caller org's OWN namespaced database, so one tenant can never list another's stores. Sorting defaults to the store slug and is overridable with sort; display is the page size and page applies only alongside it, and either one that is not a positive integer is refused rather than silently ignored. The limit query overrides the reported COUNT only and never the rows returned. A request that resolves no org namespace is served an empty page, never an unscoped scan. Readable with an admin token, a store-scoped token, or the anonymous published storefront key.
2736pub async fn get_commerce_store(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceStoreError>> {
2737
2738    let uri_str = format!("{}/v1/commerce/store/", configuration.base_path);
2739    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2740
2741    if let Some(ref user_agent) = configuration.user_agent {
2742        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2743    }
2744    if let Some(ref token) = configuration.bearer_access_token {
2745        req_builder = req_builder.bearer_auth(token.to_owned());
2746    };
2747
2748    let req = req_builder.build()?;
2749    let resp = configuration.client.execute(req).await?;
2750
2751    let status = resp.status();
2752
2753    if !status.is_client_error() && !status.is_server_error() {
2754        Ok(())
2755    } else {
2756        let content = resp.text().await?;
2757        let entity: Option<GetCommerceStoreError> = serde_json::from_str(&content).ok();
2758        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2759    }
2760}
2761
2762/// Answers allowed, the store id, and a status of trial, active, payment_required, store_required or unavailable — the entitlement check a merchant surface gates on. The rule that surprises people is that entitlement is PER STORE, not per org: the store needs its own current subscription on the entry plan, either trialing with a trial end still ahead or active with a period end still ahead, so an org-wide balance or a sibling store's plan unlocks nothing here. The store comes from the X-Store-Id header and otherwise falls back to the org's first store; neither resolving is store_required with allowed false, and a backing-store failure is 503 with status unavailable — a retry signal, not a denial.
2763pub async fn get_commerce_store_access(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceStoreAccessError>> {
2764
2765    let uri_str = format!("{}/v1/commerce/store/access", configuration.base_path);
2766    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2767
2768    if let Some(ref user_agent) = configuration.user_agent {
2769        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2770    }
2771    if let Some(ref token) = configuration.bearer_access_token {
2772        req_builder = req_builder.bearer_auth(token.to_owned());
2773    };
2774
2775    let req = req_builder.build()?;
2776    let resp = configuration.client.execute(req).await?;
2777
2778    let status = resp.status();
2779
2780    if !status.is_client_error() && !status.is_server_error() {
2781        Ok(())
2782    } else {
2783        let content = resp.text().await?;
2784        let entity: Option<GetCommerceStoreAccessError> = serde_json::from_str(&content).ok();
2785        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2786    }
2787}
2788
2789/// Reads the addressed store from the caller org's own namespaced database, so an id belonging to another tenant is simply absent there and answers 404 rather than leaking its existence. The body is the stored entity including its embedded listing override map. Readable with an admin or store-read token and also with the anonymous published storefront key, which is what lets a logged-out storefront resolve the store it is rendering.
2790pub async fn get_commerce_store_by_storeid(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<GetCommerceStoreByStoreidError>> {
2791    // add a prefix to parameters to efficiently prevent name collisions
2792    let p_storeid = storeid;
2793
2794    let uri_str = format!("{}/v1/commerce/store/{storeid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
2795    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2796
2797    if let Some(ref user_agent) = configuration.user_agent {
2798        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2799    }
2800    if let Some(ref token) = configuration.bearer_access_token {
2801        req_builder = req_builder.bearer_auth(token.to_owned());
2802    };
2803
2804    let req = req_builder.build()?;
2805    let resp = configuration.client.execute(req).await?;
2806
2807    let status = resp.status();
2808
2809    if !status.is_client_error() && !status.is_server_error() {
2810        Ok(())
2811    } else {
2812        let content = resp.text().await?;
2813        let entity: Option<GetCommerceStoreByStoreidError> = serde_json::from_str(&content).ok();
2814        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2815    }
2816}
2817
2818/// Returns the stored bundle with the store's listing for it laid over the top — every non-empty listing field wins, and the currency is forced to the store's own — so the caller reads what this storefront actually sells rather than the catalog-wide record. The overlay is keyed by the item's ID: a listing filed only under a slug or SKU does not reach it, unlike the listing reads, which do fall back to those. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
2819pub async fn get_commerce_store_by_storeid_bundle_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<GetCommerceStoreByStoreidBundleByKeyError>> {
2820    // add a prefix to parameters to efficiently prevent name collisions
2821    let p_storeid = storeid;
2822    let p_key = key;
2823
2824    let uri_str = format!("{}/v1/commerce/store/{storeid}/bundle/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
2825    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2826
2827    if let Some(ref user_agent) = configuration.user_agent {
2828        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2829    }
2830    if let Some(ref token) = configuration.bearer_access_token {
2831        req_builder = req_builder.bearer_auth(token.to_owned());
2832    };
2833
2834    let req = req_builder.build()?;
2835    let resp = configuration.client.execute(req).await?;
2836
2837    let status = resp.status();
2838
2839    if !status.is_client_error() && !status.is_server_error() {
2840        Ok(())
2841    } else {
2842        let content = resp.text().await?;
2843        let entity: Option<GetCommerceStoreByStoreidBundleByKeyError> = serde_json::from_str(&content).ok();
2844        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2845    }
2846}
2847
2848/// Returns every override this store applies to catalog items — name, price, list price, media, availability and the hidden flag — keyed by product or variant id, in one read. A listing is an OVERRIDE, not a product: the catalog item exists independently and this map only says how this storefront presents it. Read from the caller org's own namespaced database, so a store id belonging to another tenant is 404. Readable with an admin token or the anonymous published storefront key.
2849pub async fn get_commerce_store_by_storeid_listing(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<GetCommerceStoreByStoreidListingError>> {
2850    // add a prefix to parameters to efficiently prevent name collisions
2851    let p_storeid = storeid;
2852
2853    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
2854    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2855
2856    if let Some(ref user_agent) = configuration.user_agent {
2857        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2858    }
2859    if let Some(ref token) = configuration.bearer_access_token {
2860        req_builder = req_builder.bearer_auth(token.to_owned());
2861    };
2862
2863    let req = req_builder.build()?;
2864    let resp = configuration.client.execute(req).await?;
2865
2866    let status = resp.status();
2867
2868    if !status.is_client_error() && !status.is_server_error() {
2869        Ok(())
2870    } else {
2871        let content = resp.text().await?;
2872        let entity: Option<GetCommerceStoreByStoreidListingError> = serde_json::from_str(&content).ok();
2873        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2874    }
2875}
2876
2877/// Looks the key up in the store's listing map first and, failing that, matches it against each listing's slug and then its SKU — so a storefront holding only a product's URL slug can still resolve the override. That fallback is unique to the listing reads; the item overlay routes match by id alone. A key matching none of the three is 404, as is a store id outside the caller org's namespace. Readable with an admin token or the anonymous published storefront key.
2878pub async fn get_commerce_store_by_storeid_listing_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<GetCommerceStoreByStoreidListingByKeyError>> {
2879    // add a prefix to parameters to efficiently prevent name collisions
2880    let p_storeid = storeid;
2881    let p_key = key;
2882
2883    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
2884    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2885
2886    if let Some(ref user_agent) = configuration.user_agent {
2887        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2888    }
2889    if let Some(ref token) = configuration.bearer_access_token {
2890        req_builder = req_builder.bearer_auth(token.to_owned());
2891    };
2892
2893    let req = req_builder.build()?;
2894    let resp = configuration.client.execute(req).await?;
2895
2896    let status = resp.status();
2897
2898    if !status.is_client_error() && !status.is_server_error() {
2899        Ok(())
2900    } else {
2901        let content = resp.text().await?;
2902        let entity: Option<GetCommerceStoreByStoreidListingByKeyError> = serde_json::from_str(&content).ok();
2903        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2904    }
2905}
2906
2907/// Returns the stored product with the store's listing for it laid over the top — non-empty listing fields replace the catalog values and the currency is forced to the store's own — which is what lets two storefronts sell the same catalog product at their own price, name and media. The overlay is keyed by the product's ID, so a listing filed only under a slug or SKU does not apply here. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
2908pub async fn get_commerce_store_by_storeid_product_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<GetCommerceStoreByStoreidProductByKeyError>> {
2909    // add a prefix to parameters to efficiently prevent name collisions
2910    let p_storeid = storeid;
2911    let p_key = key;
2912
2913    let uri_str = format!("{}/v1/commerce/store/{storeid}/product/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
2914    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2915
2916    if let Some(ref user_agent) = configuration.user_agent {
2917        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2918    }
2919    if let Some(ref token) = configuration.bearer_access_token {
2920        req_builder = req_builder.bearer_auth(token.to_owned());
2921    };
2922
2923    let req = req_builder.build()?;
2924    let resp = configuration.client.execute(req).await?;
2925
2926    let status = resp.status();
2927
2928    if !status.is_client_error() && !status.is_server_error() {
2929        Ok(())
2930    } else {
2931        let content = resp.text().await?;
2932        let entity: Option<GetCommerceStoreByStoreidProductByKeyError> = serde_json::from_str(&content).ok();
2933        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2934    }
2935}
2936
2937/// Returns the stored variant with the store's listing for it overlaid — non-empty listing fields replace the catalog values and the currency is forced to the store's own — which is what makes per-storefront pricing of a shared variant possible. The overlay is keyed by the variant's ID, never by its slug or SKU. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
2938pub async fn get_commerce_store_by_storeid_variant_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<GetCommerceStoreByStoreidVariantByKeyError>> {
2939    // add a prefix to parameters to efficiently prevent name collisions
2940    let p_storeid = storeid;
2941    let p_key = key;
2942
2943    let uri_str = format!("{}/v1/commerce/store/{storeid}/variant/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
2944    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2945
2946    if let Some(ref user_agent) = configuration.user_agent {
2947        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2948    }
2949    if let Some(ref token) = configuration.bearer_access_token {
2950        req_builder = req_builder.bearer_auth(token.to_owned());
2951    };
2952
2953    let req = req_builder.build()?;
2954    let resp = configuration.client.execute(req).await?;
2955
2956    let status = resp.status();
2957
2958    if !status.is_client_error() && !status.is_server_error() {
2959        Ok(())
2960    } else {
2961        let content = resp.text().await?;
2962        let entity: Option<GetCommerceStoreByStoreidVariantByKeyError> = serde_json::from_str(&content).ok();
2963        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2964    }
2965}
2966
2967/// Returns the caller org's store resolved FROM THE AUTHENTICATED ORG rather than from a path id — which is how an admin dashboard or a storefront edge learns the store id it should then read and write against. An X-Store-Id header selects a specific store, resolved only inside the caller's own namespace, so a foreign id cannot cross the tenant boundary and answers 404 instead. With no header the org's first store is returned, and an org that has none yet has its canonical default provisioned lazily and idempotently, carrying no payment credentials. Only when there is no org in context, or provisioning fails, does it fall back to a placeholder store literally named default, which a storefront edge should treat as unconfigured.
2968pub async fn get_commerce_store_current(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceStoreCurrentError>> {
2969
2970    let uri_str = format!("{}/v1/commerce/store/current", configuration.base_path);
2971    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2972
2973    if let Some(ref user_agent) = configuration.user_agent {
2974        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2975    }
2976    if let Some(ref token) = configuration.bearer_access_token {
2977        req_builder = req_builder.bearer_auth(token.to_owned());
2978    };
2979
2980    let req = req_builder.build()?;
2981    let resp = configuration.client.execute(req).await?;
2982
2983    let status = resp.status();
2984
2985    if !status.is_client_error() && !status.is_server_error() {
2986        Ok(())
2987    } else {
2988        let content = resp.text().await?;
2989        let entity: Option<GetCommerceStoreCurrentError> = serde_json::from_str(&content).ok();
2990        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2991    }
2992}
2993
2994/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
2995pub async fn get_commerce_submission(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceSubmissionError>> {
2996
2997    let uri_str = format!("{}/v1/commerce/submission/", configuration.base_path);
2998    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2999
3000    if let Some(ref user_agent) = configuration.user_agent {
3001        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3002    }
3003    if let Some(ref token) = configuration.bearer_access_token {
3004        req_builder = req_builder.bearer_auth(token.to_owned());
3005    };
3006
3007    let req = req_builder.build()?;
3008    let resp = configuration.client.execute(req).await?;
3009
3010    let status = resp.status();
3011
3012    if !status.is_client_error() && !status.is_server_error() {
3013        Ok(())
3014    } else {
3015        let content = resp.text().await?;
3016        let entity: Option<GetCommerceSubmissionError> = serde_json::from_str(&content).ok();
3017        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3018    }
3019}
3020
3021/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3022pub async fn get_commerce_submission_by_submissionid(configuration: &configuration::Configuration, submissionid: &str) -> Result<(), Error<GetCommerceSubmissionBySubmissionidError>> {
3023    // add a prefix to parameters to efficiently prevent name collisions
3024    let p_submissionid = submissionid;
3025
3026    let uri_str = format!("{}/v1/commerce/submission/{submissionid}", configuration.base_path, submissionid=crate::apis::urlencode(p_submissionid));
3027    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3028
3029    if let Some(ref user_agent) = configuration.user_agent {
3030        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3031    }
3032    if let Some(ref token) = configuration.bearer_access_token {
3033        req_builder = req_builder.bearer_auth(token.to_owned());
3034    };
3035
3036    let req = req_builder.build()?;
3037    let resp = configuration.client.execute(req).await?;
3038
3039    let status = resp.status();
3040
3041    if !status.is_client_error() && !status.is_server_error() {
3042        Ok(())
3043    } else {
3044        let content = resp.text().await?;
3045        let entity: Option<GetCommerceSubmissionBySubmissionidError> = serde_json::from_str(&content).ok();
3046        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3047    }
3048}
3049
3050/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The token must also carry Admin or the Subscriber list scope.
3051pub async fn get_commerce_subscriber(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceSubscriberError>> {
3052
3053    let uri_str = format!("{}/v1/commerce/subscriber/", configuration.base_path);
3054    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3055
3056    if let Some(ref user_agent) = configuration.user_agent {
3057        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3058    }
3059    if let Some(ref token) = configuration.bearer_access_token {
3060        req_builder = req_builder.bearer_auth(token.to_owned());
3061    };
3062
3063    let req = req_builder.build()?;
3064    let resp = configuration.client.execute(req).await?;
3065
3066    let status = resp.status();
3067
3068    if !status.is_client_error() && !status.is_server_error() {
3069        Ok(())
3070    } else {
3071        let content = resp.text().await?;
3072        let entity: Option<GetCommerceSubscriberError> = serde_json::from_str(&content).ok();
3073        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3074    }
3075}
3076
3077/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The token must also carry Admin or ReadSubscriber.
3078pub async fn get_commerce_subscriber_by_subscriberid(configuration: &configuration::Configuration, subscriberid: &str) -> Result<(), Error<GetCommerceSubscriberBySubscriberidError>> {
3079    // add a prefix to parameters to efficiently prevent name collisions
3080    let p_subscriberid = subscriberid;
3081
3082    let uri_str = format!("{}/v1/commerce/subscriber/{subscriberid}", configuration.base_path, subscriberid=crate::apis::urlencode(p_subscriberid));
3083    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3084
3085    if let Some(ref user_agent) = configuration.user_agent {
3086        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3087    }
3088    if let Some(ref token) = configuration.bearer_access_token {
3089        req_builder = req_builder.bearer_auth(token.to_owned());
3090    };
3091
3092    let req = req_builder.build()?;
3093    let resp = configuration.client.execute(req).await?;
3094
3095    let status = resp.status();
3096
3097    if !status.is_client_error() && !status.is_server_error() {
3098        Ok(())
3099    } else {
3100        let content = resp.text().await?;
3101        let entity: Option<GetCommerceSubscriberBySubscriberidError> = serde_json::from_str(&content).ok();
3102        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3103    }
3104}
3105
3106/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3107pub async fn get_commerce_tokentransaction(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceTokentransactionError>> {
3108
3109    let uri_str = format!("{}/v1/commerce/tokentransaction/", configuration.base_path);
3110    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3111
3112    if let Some(ref user_agent) = configuration.user_agent {
3113        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3114    }
3115    if let Some(ref token) = configuration.bearer_access_token {
3116        req_builder = req_builder.bearer_auth(token.to_owned());
3117    };
3118
3119    let req = req_builder.build()?;
3120    let resp = configuration.client.execute(req).await?;
3121
3122    let status = resp.status();
3123
3124    if !status.is_client_error() && !status.is_server_error() {
3125        Ok(())
3126    } else {
3127        let content = resp.text().await?;
3128        let entity: Option<GetCommerceTokentransactionError> = serde_json::from_str(&content).ok();
3129        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3130    }
3131}
3132
3133/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3134pub async fn get_commerce_tokentransaction_by_tokentransactionid(configuration: &configuration::Configuration, tokentransactionid: &str) -> Result<(), Error<GetCommerceTokentransactionByTokentransactionidError>> {
3135    // add a prefix to parameters to efficiently prevent name collisions
3136    let p_tokentransactionid = tokentransactionid;
3137
3138    let uri_str = format!("{}/v1/commerce/tokentransaction/{tokentransactionid}", configuration.base_path, tokentransactionid=crate::apis::urlencode(p_tokentransactionid));
3139    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3140
3141    if let Some(ref user_agent) = configuration.user_agent {
3142        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3143    }
3144    if let Some(ref token) = configuration.bearer_access_token {
3145        req_builder = req_builder.bearer_auth(token.to_owned());
3146    };
3147
3148    let req = req_builder.build()?;
3149    let resp = configuration.client.execute(req).await?;
3150
3151    let status = resp.status();
3152
3153    if !status.is_client_error() && !status.is_server_error() {
3154        Ok(())
3155    } else {
3156        let content = resp.text().await?;
3157        let entity: Option<GetCommerceTokentransactionByTokentransactionidError> = serde_json::from_str(&content).ok();
3158        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3159    }
3160}
3161
3162/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3163pub async fn get_commerce_transfer(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceTransferError>> {
3164
3165    let uri_str = format!("{}/v1/commerce/transfer/", configuration.base_path);
3166    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3167
3168    if let Some(ref user_agent) = configuration.user_agent {
3169        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3170    }
3171    if let Some(ref token) = configuration.bearer_access_token {
3172        req_builder = req_builder.bearer_auth(token.to_owned());
3173    };
3174
3175    let req = req_builder.build()?;
3176    let resp = configuration.client.execute(req).await?;
3177
3178    let status = resp.status();
3179
3180    if !status.is_client_error() && !status.is_server_error() {
3181        Ok(())
3182    } else {
3183        let content = resp.text().await?;
3184        let entity: Option<GetCommerceTransferError> = serde_json::from_str(&content).ok();
3185        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3186    }
3187}
3188
3189/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3190pub async fn get_commerce_transfer_by_transferid(configuration: &configuration::Configuration, transferid: &str) -> Result<(), Error<GetCommerceTransferByTransferidError>> {
3191    // add a prefix to parameters to efficiently prevent name collisions
3192    let p_transferid = transferid;
3193
3194    let uri_str = format!("{}/v1/commerce/transfer/{transferid}", configuration.base_path, transferid=crate::apis::urlencode(p_transferid));
3195    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3196
3197    if let Some(ref user_agent) = configuration.user_agent {
3198        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3199    }
3200    if let Some(ref token) = configuration.bearer_access_token {
3201        req_builder = req_builder.bearer_auth(token.to_owned());
3202    };
3203
3204    let req = req_builder.build()?;
3205    let resp = configuration.client.execute(req).await?;
3206
3207    let status = resp.status();
3208
3209    if !status.is_client_error() && !status.is_server_error() {
3210        Ok(())
3211    } else {
3212        let content = resp.text().await?;
3213        let entity: Option<GetCommerceTransferByTransferidError> = serde_json::from_str(&content).ok();
3214        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3215    }
3216}
3217
3218/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the SKU and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Variant list scope.
3219pub async fn get_commerce_variant(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceVariantError>> {
3220
3221    let uri_str = format!("{}/v1/commerce/variant/", configuration.base_path);
3222    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3223
3224    if let Some(ref user_agent) = configuration.user_agent {
3225        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3226    }
3227    if let Some(ref token) = configuration.bearer_access_token {
3228        req_builder = req_builder.bearer_auth(token.to_owned());
3229    };
3230
3231    let req = req_builder.build()?;
3232    let resp = configuration.client.execute(req).await?;
3233
3234    let status = resp.status();
3235
3236    if !status.is_client_error() && !status.is_server_error() {
3237        Ok(())
3238    } else {
3239        let content = resp.text().await?;
3240        let entity: Option<GetCommerceVariantError> = serde_json::from_str(&content).ok();
3241        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3242    }
3243}
3244
3245/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadVariant.
3246pub async fn get_commerce_variant_by_variantid(configuration: &configuration::Configuration, variantid: &str) -> Result<(), Error<GetCommerceVariantByVariantidError>> {
3247    // add a prefix to parameters to efficiently prevent name collisions
3248    let p_variantid = variantid;
3249
3250    let uri_str = format!("{}/v1/commerce/variant/{variantid}", configuration.base_path, variantid=crate::apis::urlencode(p_variantid));
3251    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3252
3253    if let Some(ref user_agent) = configuration.user_agent {
3254        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3255    }
3256    if let Some(ref token) = configuration.bearer_access_token {
3257        req_builder = req_builder.bearer_auth(token.to_owned());
3258    };
3259
3260    let req = req_builder.build()?;
3261    let resp = configuration.client.execute(req).await?;
3262
3263    let status = resp.status();
3264
3265    if !status.is_client_error() && !status.is_server_error() {
3266        Ok(())
3267    } else {
3268        let content = resp.text().await?;
3269        let entity: Option<GetCommerceVariantByVariantidError> = serde_json::from_str(&content).ok();
3270        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3271    }
3272}
3273
3274/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3275pub async fn get_commerce_wallet(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceWalletError>> {
3276
3277    let uri_str = format!("{}/v1/commerce/wallet/", configuration.base_path);
3278    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3279
3280    if let Some(ref user_agent) = configuration.user_agent {
3281        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3282    }
3283    if let Some(ref token) = configuration.bearer_access_token {
3284        req_builder = req_builder.bearer_auth(token.to_owned());
3285    };
3286
3287    let req = req_builder.build()?;
3288    let resp = configuration.client.execute(req).await?;
3289
3290    let status = resp.status();
3291
3292    if !status.is_client_error() && !status.is_server_error() {
3293        Ok(())
3294    } else {
3295        let content = resp.text().await?;
3296        let entity: Option<GetCommerceWalletError> = serde_json::from_str(&content).ok();
3297        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3298    }
3299}
3300
3301/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3302pub async fn get_commerce_wallet_by_walletid(configuration: &configuration::Configuration, walletid: &str) -> Result<(), Error<GetCommerceWalletByWalletidError>> {
3303    // add a prefix to parameters to efficiently prevent name collisions
3304    let p_walletid = walletid;
3305
3306    let uri_str = format!("{}/v1/commerce/wallet/{walletid}", configuration.base_path, walletid=crate::apis::urlencode(p_walletid));
3307    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3308
3309    if let Some(ref user_agent) = configuration.user_agent {
3310        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3311    }
3312    if let Some(ref token) = configuration.bearer_access_token {
3313        req_builder = req_builder.bearer_auth(token.to_owned());
3314    };
3315
3316    let req = req_builder.build()?;
3317    let resp = configuration.client.execute(req).await?;
3318
3319    let status = resp.status();
3320
3321    if !status.is_client_error() && !status.is_server_error() {
3322        Ok(())
3323    } else {
3324        let content = resp.text().await?;
3325        let entity: Option<GetCommerceWalletByWalletidError> = serde_json::from_str(&content).ok();
3326        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3327    }
3328}
3329
3330/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3331pub async fn get_commerce_watchlist(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceWatchlistError>> {
3332
3333    let uri_str = format!("{}/v1/commerce/watchlist/", configuration.base_path);
3334    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3335
3336    if let Some(ref user_agent) = configuration.user_agent {
3337        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3338    }
3339    if let Some(ref token) = configuration.bearer_access_token {
3340        req_builder = req_builder.bearer_auth(token.to_owned());
3341    };
3342
3343    let req = req_builder.build()?;
3344    let resp = configuration.client.execute(req).await?;
3345
3346    let status = resp.status();
3347
3348    if !status.is_client_error() && !status.is_server_error() {
3349        Ok(())
3350    } else {
3351        let content = resp.text().await?;
3352        let entity: Option<GetCommerceWatchlistError> = serde_json::from_str(&content).ok();
3353        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3354    }
3355}
3356
3357/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3358pub async fn get_commerce_watchlist_by_watchlistid(configuration: &configuration::Configuration, watchlistid: &str) -> Result<(), Error<GetCommerceWatchlistByWatchlistidError>> {
3359    // add a prefix to parameters to efficiently prevent name collisions
3360    let p_watchlistid = watchlistid;
3361
3362    let uri_str = format!("{}/v1/commerce/watchlist/{watchlistid}", configuration.base_path, watchlistid=crate::apis::urlencode(p_watchlistid));
3363    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3364
3365    if let Some(ref user_agent) = configuration.user_agent {
3366        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3367    }
3368    if let Some(ref token) = configuration.bearer_access_token {
3369        req_builder = req_builder.bearer_auth(token.to_owned());
3370    };
3371
3372    let req = req_builder.build()?;
3373    let resp = configuration.client.execute(req).await?;
3374
3375    let status = resp.status();
3376
3377    if !status.is_client_error() && !status.is_server_error() {
3378        Ok(())
3379    } else {
3380        let content = resp.text().await?;
3381        let entity: Option<GetCommerceWatchlistByWatchlistidError> = serde_json::from_str(&content).ok();
3382        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3383    }
3384}
3385
3386/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3387pub async fn get_commerce_webhook(configuration: &configuration::Configuration, ) -> Result<(), Error<GetCommerceWebhookError>> {
3388
3389    let uri_str = format!("{}/v1/commerce/webhook/", configuration.base_path);
3390    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3391
3392    if let Some(ref user_agent) = configuration.user_agent {
3393        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3394    }
3395    if let Some(ref token) = configuration.bearer_access_token {
3396        req_builder = req_builder.bearer_auth(token.to_owned());
3397    };
3398
3399    let req = req_builder.build()?;
3400    let resp = configuration.client.execute(req).await?;
3401
3402    let status = resp.status();
3403
3404    if !status.is_client_error() && !status.is_server_error() {
3405        Ok(())
3406    } else {
3407        let content = resp.text().await?;
3408        let entity: Option<GetCommerceWebhookError> = serde_json::from_str(&content).ok();
3409        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3410    }
3411}
3412
3413/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3414pub async fn get_commerce_webhook_by_webhookid(configuration: &configuration::Configuration, webhookid: &str) -> Result<(), Error<GetCommerceWebhookByWebhookidError>> {
3415    // add a prefix to parameters to efficiently prevent name collisions
3416    let p_webhookid = webhookid;
3417
3418    let uri_str = format!("{}/v1/commerce/webhook/{webhookid}", configuration.base_path, webhookid=crate::apis::urlencode(p_webhookid));
3419    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3420
3421    if let Some(ref user_agent) = configuration.user_agent {
3422        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3423    }
3424    if let Some(ref token) = configuration.bearer_access_token {
3425        req_builder = req_builder.bearer_auth(token.to_owned());
3426    };
3427
3428    let req = req_builder.build()?;
3429    let resp = configuration.client.execute(req).await?;
3430
3431    let status = resp.status();
3432
3433    if !status.is_client_error() && !status.is_server_error() {
3434        Ok(())
3435    } else {
3436        let content = resp.text().await?;
3437        let entity: Option<GetCommerceWebhookByWebhookidError> = serde_json::from_str(&content).ok();
3438        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3439    }
3440}
3441
3442/// Reads one settled payment out of the caller's org ledger.  The org scopes the read by construction — the ledger is namespaced to it — so an id belonging to another tenant is simply not found rather than found and then filtered. A ledger row that is not a payment is likewise not found, so this cannot be used to walk the org's usage debits.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
3443pub async fn get_payment(configuration: &configuration::Configuration, id: &str) -> Result<models::PaymentRecord, Error<GetPaymentError>> {
3444    // add a prefix to parameters to efficiently prevent name collisions
3445    let p_id = id;
3446
3447    let uri_str = format!("{}/v1/commerce/payments/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
3448    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3449
3450    if let Some(ref user_agent) = configuration.user_agent {
3451        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3452    }
3453    if let Some(ref token) = configuration.bearer_access_token {
3454        req_builder = req_builder.bearer_auth(token.to_owned());
3455    };
3456
3457    let req = req_builder.build()?;
3458    let resp = configuration.client.execute(req).await?;
3459
3460    let status = resp.status();
3461    let content_type = resp
3462        .headers()
3463        .get("content-type")
3464        .and_then(|v| v.to_str().ok())
3465        .unwrap_or("application/octet-stream");
3466    let content_type = super::ContentType::from(content_type);
3467
3468    if !status.is_client_error() && !status.is_server_error() {
3469        let content = resp.text().await?;
3470        match content_type {
3471            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3472            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentRecord`"))),
3473            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaymentRecord`")))),
3474        }
3475    } else {
3476        let content = resp.text().await?;
3477        let entity: Option<GetPaymentError> = serde_json::from_str(&content).ok();
3478        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3479    }
3480}
3481
3482/// Opens an empty cart for a shopper to fill, and answers it with its new id.  This is the first step of a sale: hold the id, add items to it with setCartItem, then hand it to checkout. Every field of the request is optional — an empty body opens a perfectly good anonymous cart — and the fields exist only to pre-fill what is already known about the shopper.  The STORE defaults to the org's own default storefront, so a merchant selling through one storefront never has to name it. The CURRENCY defaults to usd; note that checkout overrides it with the store's own currency when the sale is authorized, so a currency set here is a hint rather than a commitment.  The cart is created in the CALLER'S OWN org namespace, taken from the validated principal and never from the body, so a cart can never be opened on another tenant's books.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
3483pub async fn open_cart(configuration: &configuration::Configuration, cart_open: models::CartOpen) -> Result<models::Cart, Error<OpenCartError>> {
3484    // add a prefix to parameters to efficiently prevent name collisions
3485    let p_cart_open = cart_open;
3486
3487    let uri_str = format!("{}/v1/commerce/cart", configuration.base_path);
3488    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3489
3490    if let Some(ref user_agent) = configuration.user_agent {
3491        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3492    }
3493    if let Some(ref token) = configuration.bearer_access_token {
3494        req_builder = req_builder.bearer_auth(token.to_owned());
3495    };
3496    req_builder = req_builder.json(&p_cart_open);
3497
3498    let req = req_builder.build()?;
3499    let resp = configuration.client.execute(req).await?;
3500
3501    let status = resp.status();
3502    let content_type = resp
3503        .headers()
3504        .get("content-type")
3505        .and_then(|v| v.to_str().ok())
3506        .unwrap_or("application/octet-stream");
3507    let content_type = super::ContentType::from(content_type);
3508
3509    if !status.is_client_error() && !status.is_server_error() {
3510        let content = resp.text().await?;
3511        match content_type {
3512            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3513            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Cart`"))),
3514            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Cart`")))),
3515        }
3516    } else {
3517        let content = resp.text().await?;
3518        let entity: Option<OpenCartError> = serde_json::from_str(&content).ok();
3519        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3520    }
3521}
3522
3523/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadCollection and WriteCollection together.
3524pub async fn patch_commerce_collection_by_collectionid(configuration: &configuration::Configuration, collectionid: &str) -> Result<(), Error<PatchCommerceCollectionByCollectionidError>> {
3525    // add a prefix to parameters to efficiently prevent name collisions
3526    let p_collectionid = collectionid;
3527
3528    let uri_str = format!("{}/v1/commerce/collection/{collectionid}", configuration.base_path, collectionid=crate::apis::urlencode(p_collectionid));
3529    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3530
3531    if let Some(ref user_agent) = configuration.user_agent {
3532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3533    }
3534    if let Some(ref token) = configuration.bearer_access_token {
3535        req_builder = req_builder.bearer_auth(token.to_owned());
3536    };
3537
3538    let req = req_builder.build()?;
3539    let resp = configuration.client.execute(req).await?;
3540
3541    let status = resp.status();
3542
3543    if !status.is_client_error() && !status.is_server_error() {
3544        Ok(())
3545    } else {
3546        let content = resp.text().await?;
3547        let entity: Option<PatchCommerceCollectionByCollectionidError> = serde_json::from_str(&content).ok();
3548        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3549    }
3550}
3551
3552/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3553pub async fn patch_commerce_disclosure_by_disclosureid(configuration: &configuration::Configuration, disclosureid: &str) -> Result<(), Error<PatchCommerceDisclosureByDisclosureidError>> {
3554    // add a prefix to parameters to efficiently prevent name collisions
3555    let p_disclosureid = disclosureid;
3556
3557    let uri_str = format!("{}/v1/commerce/disclosure/{disclosureid}", configuration.base_path, disclosureid=crate::apis::urlencode(p_disclosureid));
3558    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3559
3560    if let Some(ref user_agent) = configuration.user_agent {
3561        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3562    }
3563    if let Some(ref token) = configuration.bearer_access_token {
3564        req_builder = req_builder.bearer_auth(token.to_owned());
3565    };
3566
3567    let req = req_builder.build()?;
3568    let resp = configuration.client.execute(req).await?;
3569
3570    let status = resp.status();
3571
3572    if !status.is_client_error() && !status.is_server_error() {
3573        Ok(())
3574    } else {
3575        let content = resp.text().await?;
3576        let entity: Option<PatchCommerceDisclosureByDisclosureidError> = serde_json::from_str(&content).ok();
3577        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3578    }
3579}
3580
3581/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3582pub async fn patch_commerce_discount_by_discountid(configuration: &configuration::Configuration, discountid: &str) -> Result<(), Error<PatchCommerceDiscountByDiscountidError>> {
3583    // add a prefix to parameters to efficiently prevent name collisions
3584    let p_discountid = discountid;
3585
3586    let uri_str = format!("{}/v1/commerce/discount/{discountid}", configuration.base_path, discountid=crate::apis::urlencode(p_discountid));
3587    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3588
3589    if let Some(ref user_agent) = configuration.user_agent {
3590        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3591    }
3592    if let Some(ref token) = configuration.bearer_access_token {
3593        req_builder = req_builder.bearer_auth(token.to_owned());
3594    };
3595
3596    let req = req_builder.build()?;
3597    let resp = configuration.client.execute(req).await?;
3598
3599    let status = resp.status();
3600
3601    if !status.is_client_error() && !status.is_server_error() {
3602        Ok(())
3603    } else {
3604        let content = resp.text().await?;
3605        let entity: Option<PatchCommerceDiscountByDiscountidError> = serde_json::from_str(&content).ok();
3606        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3607    }
3608}
3609
3610/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3611pub async fn patch_commerce_movie_by_movieid(configuration: &configuration::Configuration, movieid: &str) -> Result<(), Error<PatchCommerceMovieByMovieidError>> {
3612    // add a prefix to parameters to efficiently prevent name collisions
3613    let p_movieid = movieid;
3614
3615    let uri_str = format!("{}/v1/commerce/movie/{movieid}", configuration.base_path, movieid=crate::apis::urlencode(p_movieid));
3616    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3617
3618    if let Some(ref user_agent) = configuration.user_agent {
3619        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3620    }
3621    if let Some(ref token) = configuration.bearer_access_token {
3622        req_builder = req_builder.bearer_auth(token.to_owned());
3623    };
3624
3625    let req = req_builder.build()?;
3626    let resp = configuration.client.execute(req).await?;
3627
3628    let status = resp.status();
3629
3630    if !status.is_client_error() && !status.is_server_error() {
3631        Ok(())
3632    } else {
3633        let content = resp.text().await?;
3634        let entity: Option<PatchCommerceMovieByMovieidError> = serde_json::from_str(&content).ok();
3635        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3636    }
3637}
3638
3639/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3640pub async fn patch_commerce_note_by_noteid(configuration: &configuration::Configuration, noteid: &str) -> Result<(), Error<PatchCommerceNoteByNoteidError>> {
3641    // add a prefix to parameters to efficiently prevent name collisions
3642    let p_noteid = noteid;
3643
3644    let uri_str = format!("{}/v1/commerce/note/{noteid}", configuration.base_path, noteid=crate::apis::urlencode(p_noteid));
3645    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3646
3647    if let Some(ref user_agent) = configuration.user_agent {
3648        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3649    }
3650    if let Some(ref token) = configuration.bearer_access_token {
3651        req_builder = req_builder.bearer_auth(token.to_owned());
3652    };
3653
3654    let req = req_builder.build()?;
3655    let resp = configuration.client.execute(req).await?;
3656
3657    let status = resp.status();
3658
3659    if !status.is_client_error() && !status.is_server_error() {
3660        Ok(())
3661    } else {
3662        let content = resp.text().await?;
3663        let entity: Option<PatchCommerceNoteByNoteidError> = serde_json::from_str(&content).ok();
3664        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3665    }
3666}
3667
3668/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadProduct and WriteProduct together.
3669pub async fn patch_commerce_product_by_productid(configuration: &configuration::Configuration, productid: &str) -> Result<(), Error<PatchCommerceProductByProductidError>> {
3670    // add a prefix to parameters to efficiently prevent name collisions
3671    let p_productid = productid;
3672
3673    let uri_str = format!("{}/v1/commerce/product/{productid}", configuration.base_path, productid=crate::apis::urlencode(p_productid));
3674    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3675
3676    if let Some(ref user_agent) = configuration.user_agent {
3677        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3678    }
3679    if let Some(ref token) = configuration.bearer_access_token {
3680        req_builder = req_builder.bearer_auth(token.to_owned());
3681    };
3682
3683    let req = req_builder.build()?;
3684    let resp = configuration.client.execute(req).await?;
3685
3686    let status = resp.status();
3687
3688    if !status.is_client_error() && !status.is_server_error() {
3689        Ok(())
3690    } else {
3691        let content = resp.text().await?;
3692        let entity: Option<PatchCommerceProductByProductidError> = serde_json::from_str(&content).ok();
3693        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3694    }
3695}
3696
3697/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The token must also carry Admin, or ReadReturn and WriteReturn together.
3698pub async fn patch_commerce_return_by_returnid(configuration: &configuration::Configuration, returnid: &str) -> Result<(), Error<PatchCommerceReturnByReturnidError>> {
3699    // add a prefix to parameters to efficiently prevent name collisions
3700    let p_returnid = returnid;
3701
3702    let uri_str = format!("{}/v1/commerce/return/{returnid}", configuration.base_path, returnid=crate::apis::urlencode(p_returnid));
3703    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3704
3705    if let Some(ref user_agent) = configuration.user_agent {
3706        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3707    }
3708    if let Some(ref token) = configuration.bearer_access_token {
3709        req_builder = req_builder.bearer_auth(token.to_owned());
3710    };
3711
3712    let req = req_builder.build()?;
3713    let resp = configuration.client.execute(req).await?;
3714
3715    let status = resp.status();
3716
3717    if !status.is_client_error() && !status.is_server_error() {
3718        Ok(())
3719    } else {
3720        let content = resp.text().await?;
3721        let entity: Option<PatchCommerceReturnByReturnidError> = serde_json::from_str(&content).ok();
3722        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3723    }
3724}
3725
3726/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3727pub async fn patch_commerce_saleschannel_by_saleschannelid(configuration: &configuration::Configuration, saleschannelid: &str) -> Result<(), Error<PatchCommerceSaleschannelBySaleschannelidError>> {
3728    // add a prefix to parameters to efficiently prevent name collisions
3729    let p_saleschannelid = saleschannelid;
3730
3731    let uri_str = format!("{}/v1/commerce/saleschannel/{saleschannelid}", configuration.base_path, saleschannelid=crate::apis::urlencode(p_saleschannelid));
3732    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3733
3734    if let Some(ref user_agent) = configuration.user_agent {
3735        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3736    }
3737    if let Some(ref token) = configuration.bearer_access_token {
3738        req_builder = req_builder.bearer_auth(token.to_owned());
3739    };
3740
3741    let req = req_builder.build()?;
3742    let resp = configuration.client.execute(req).await?;
3743
3744    let status = resp.status();
3745
3746    if !status.is_client_error() && !status.is_server_error() {
3747        Ok(())
3748    } else {
3749        let content = resp.text().await?;
3750        let entity: Option<PatchCommerceSaleschannelBySaleschannelidError> = serde_json::from_str(&content).ok();
3751        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3752    }
3753}
3754
3755/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3756pub async fn patch_commerce_stocklocation_by_stocklocationid(configuration: &configuration::Configuration, stocklocationid: &str) -> Result<(), Error<PatchCommerceStocklocationByStocklocationidError>> {
3757    // add a prefix to parameters to efficiently prevent name collisions
3758    let p_stocklocationid = stocklocationid;
3759
3760    let uri_str = format!("{}/v1/commerce/stocklocation/{stocklocationid}", configuration.base_path, stocklocationid=crate::apis::urlencode(p_stocklocationid));
3761    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3762
3763    if let Some(ref user_agent) = configuration.user_agent {
3764        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3765    }
3766    if let Some(ref token) = configuration.bearer_access_token {
3767        req_builder = req_builder.bearer_auth(token.to_owned());
3768    };
3769
3770    let req = req_builder.build()?;
3771    let resp = configuration.client.execute(req).await?;
3772
3773    let status = resp.status();
3774
3775    if !status.is_client_error() && !status.is_server_error() {
3776        Ok(())
3777    } else {
3778        let content = resp.text().await?;
3779        let entity: Option<PatchCommerceStocklocationByStocklocationidError> = serde_json::from_str(&content).ok();
3780        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3781    }
3782}
3783
3784/// Loads the stored store and decodes the body over it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged entity. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is 404. Requires an admin token, or one holding both store read and store write.
3785pub async fn patch_commerce_store_by_storeid(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PatchCommerceStoreByStoreidError>> {
3786    // add a prefix to parameters to efficiently prevent name collisions
3787    let p_storeid = storeid;
3788
3789    let uri_str = format!("{}/v1/commerce/store/{storeid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
3790    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3791
3792    if let Some(ref user_agent) = configuration.user_agent {
3793        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3794    }
3795    if let Some(ref token) = configuration.bearer_access_token {
3796        req_builder = req_builder.bearer_auth(token.to_owned());
3797    };
3798
3799    let req = req_builder.build()?;
3800    let resp = configuration.client.execute(req).await?;
3801
3802    let status = resp.status();
3803
3804    if !status.is_client_error() && !status.is_server_error() {
3805        Ok(())
3806    } else {
3807        let content = resp.text().await?;
3808        let entity: Option<PatchCommerceStoreByStoreidError> = serde_json::from_str(&content).ok();
3809        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3810    }
3811}
3812
3813/// Requires the key to already be present — an absent one is 404 — and answers the store's listing map at 200. Read the behaviour before relying on it: the decoded body is applied to a COPY taken out of the map and is never assigned back, so the stored listing is unchanged and the map returned is exactly the map that was already there. An actual edit to an existing listing has to go through the upsert, which does write its result back into the store. A body that fails to decode is still 400. Admin-gated and namespaced to the caller's org.
3814pub async fn patch_commerce_store_by_storeid_listing_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<PatchCommerceStoreByStoreidListingByKeyError>> {
3815    // add a prefix to parameters to efficiently prevent name collisions
3816    let p_storeid = storeid;
3817    let p_key = key;
3818
3819    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
3820    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3821
3822    if let Some(ref user_agent) = configuration.user_agent {
3823        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3824    }
3825    if let Some(ref token) = configuration.bearer_access_token {
3826        req_builder = req_builder.bearer_auth(token.to_owned());
3827    };
3828
3829    let req = req_builder.build()?;
3830    let resp = configuration.client.execute(req).await?;
3831
3832    let status = resp.status();
3833
3834    if !status.is_client_error() && !status.is_server_error() {
3835        Ok(())
3836    } else {
3837        let content = resp.text().await?;
3838        let entity: Option<PatchCommerceStoreByStoreidListingByKeyError> = serde_json::from_str(&content).ok();
3839        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3840    }
3841}
3842
3843/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3844pub async fn patch_commerce_submission_by_submissionid(configuration: &configuration::Configuration, submissionid: &str) -> Result<(), Error<PatchCommerceSubmissionBySubmissionidError>> {
3845    // add a prefix to parameters to efficiently prevent name collisions
3846    let p_submissionid = submissionid;
3847
3848    let uri_str = format!("{}/v1/commerce/submission/{submissionid}", configuration.base_path, submissionid=crate::apis::urlencode(p_submissionid));
3849    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3850
3851    if let Some(ref user_agent) = configuration.user_agent {
3852        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3853    }
3854    if let Some(ref token) = configuration.bearer_access_token {
3855        req_builder = req_builder.bearer_auth(token.to_owned());
3856    };
3857
3858    let req = req_builder.build()?;
3859    let resp = configuration.client.execute(req).await?;
3860
3861    let status = resp.status();
3862
3863    if !status.is_client_error() && !status.is_server_error() {
3864        Ok(())
3865    } else {
3866        let content = resp.text().await?;
3867        let entity: Option<PatchCommerceSubmissionBySubmissionidError> = serde_json::from_str(&content).ok();
3868        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3869    }
3870}
3871
3872/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The token must also carry Admin, or ReadSubscriber and WriteSubscriber together.
3873pub async fn patch_commerce_subscriber_by_subscriberid(configuration: &configuration::Configuration, subscriberid: &str) -> Result<(), Error<PatchCommerceSubscriberBySubscriberidError>> {
3874    // add a prefix to parameters to efficiently prevent name collisions
3875    let p_subscriberid = subscriberid;
3876
3877    let uri_str = format!("{}/v1/commerce/subscriber/{subscriberid}", configuration.base_path, subscriberid=crate::apis::urlencode(p_subscriberid));
3878    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3879
3880    if let Some(ref user_agent) = configuration.user_agent {
3881        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3882    }
3883    if let Some(ref token) = configuration.bearer_access_token {
3884        req_builder = req_builder.bearer_auth(token.to_owned());
3885    };
3886
3887    let req = req_builder.build()?;
3888    let resp = configuration.client.execute(req).await?;
3889
3890    let status = resp.status();
3891
3892    if !status.is_client_error() && !status.is_server_error() {
3893        Ok(())
3894    } else {
3895        let content = resp.text().await?;
3896        let entity: Option<PatchCommerceSubscriberBySubscriberidError> = serde_json::from_str(&content).ok();
3897        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3898    }
3899}
3900
3901/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3902pub async fn patch_commerce_tokentransaction_by_tokentransactionid(configuration: &configuration::Configuration, tokentransactionid: &str) -> Result<(), Error<PatchCommerceTokentransactionByTokentransactionidError>> {
3903    // add a prefix to parameters to efficiently prevent name collisions
3904    let p_tokentransactionid = tokentransactionid;
3905
3906    let uri_str = format!("{}/v1/commerce/tokentransaction/{tokentransactionid}", configuration.base_path, tokentransactionid=crate::apis::urlencode(p_tokentransactionid));
3907    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3908
3909    if let Some(ref user_agent) = configuration.user_agent {
3910        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3911    }
3912    if let Some(ref token) = configuration.bearer_access_token {
3913        req_builder = req_builder.bearer_auth(token.to_owned());
3914    };
3915
3916    let req = req_builder.build()?;
3917    let resp = configuration.client.execute(req).await?;
3918
3919    let status = resp.status();
3920
3921    if !status.is_client_error() && !status.is_server_error() {
3922        Ok(())
3923    } else {
3924        let content = resp.text().await?;
3925        let entity: Option<PatchCommerceTokentransactionByTokentransactionidError> = serde_json::from_str(&content).ok();
3926        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3927    }
3928}
3929
3930/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3931pub async fn patch_commerce_transfer_by_transferid(configuration: &configuration::Configuration, transferid: &str) -> Result<(), Error<PatchCommerceTransferByTransferidError>> {
3932    // add a prefix to parameters to efficiently prevent name collisions
3933    let p_transferid = transferid;
3934
3935    let uri_str = format!("{}/v1/commerce/transfer/{transferid}", configuration.base_path, transferid=crate::apis::urlencode(p_transferid));
3936    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3937
3938    if let Some(ref user_agent) = configuration.user_agent {
3939        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3940    }
3941    if let Some(ref token) = configuration.bearer_access_token {
3942        req_builder = req_builder.bearer_auth(token.to_owned());
3943    };
3944
3945    let req = req_builder.build()?;
3946    let resp = configuration.client.execute(req).await?;
3947
3948    let status = resp.status();
3949
3950    if !status.is_client_error() && !status.is_server_error() {
3951        Ok(())
3952    } else {
3953        let content = resp.text().await?;
3954        let entity: Option<PatchCommerceTransferByTransferidError> = serde_json::from_str(&content).ok();
3955        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3956    }
3957}
3958
3959/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadVariant and WriteVariant together.
3960pub async fn patch_commerce_variant_by_variantid(configuration: &configuration::Configuration, variantid: &str) -> Result<(), Error<PatchCommerceVariantByVariantidError>> {
3961    // add a prefix to parameters to efficiently prevent name collisions
3962    let p_variantid = variantid;
3963
3964    let uri_str = format!("{}/v1/commerce/variant/{variantid}", configuration.base_path, variantid=crate::apis::urlencode(p_variantid));
3965    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3966
3967    if let Some(ref user_agent) = configuration.user_agent {
3968        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3969    }
3970    if let Some(ref token) = configuration.bearer_access_token {
3971        req_builder = req_builder.bearer_auth(token.to_owned());
3972    };
3973
3974    let req = req_builder.build()?;
3975    let resp = configuration.client.execute(req).await?;
3976
3977    let status = resp.status();
3978
3979    if !status.is_client_error() && !status.is_server_error() {
3980        Ok(())
3981    } else {
3982        let content = resp.text().await?;
3983        let entity: Option<PatchCommerceVariantByVariantidError> = serde_json::from_str(&content).ok();
3984        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3985    }
3986}
3987
3988/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
3989pub async fn patch_commerce_wallet_by_walletid(configuration: &configuration::Configuration, walletid: &str) -> Result<(), Error<PatchCommerceWalletByWalletidError>> {
3990    // add a prefix to parameters to efficiently prevent name collisions
3991    let p_walletid = walletid;
3992
3993    let uri_str = format!("{}/v1/commerce/wallet/{walletid}", configuration.base_path, walletid=crate::apis::urlencode(p_walletid));
3994    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3995
3996    if let Some(ref user_agent) = configuration.user_agent {
3997        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3998    }
3999    if let Some(ref token) = configuration.bearer_access_token {
4000        req_builder = req_builder.bearer_auth(token.to_owned());
4001    };
4002
4003    let req = req_builder.build()?;
4004    let resp = configuration.client.execute(req).await?;
4005
4006    let status = resp.status();
4007
4008    if !status.is_client_error() && !status.is_server_error() {
4009        Ok(())
4010    } else {
4011        let content = resp.text().await?;
4012        let entity: Option<PatchCommerceWalletByWalletidError> = serde_json::from_str(&content).ok();
4013        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4014    }
4015}
4016
4017/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4018pub async fn patch_commerce_watchlist_by_watchlistid(configuration: &configuration::Configuration, watchlistid: &str) -> Result<(), Error<PatchCommerceWatchlistByWatchlistidError>> {
4019    // add a prefix to parameters to efficiently prevent name collisions
4020    let p_watchlistid = watchlistid;
4021
4022    let uri_str = format!("{}/v1/commerce/watchlist/{watchlistid}", configuration.base_path, watchlistid=crate::apis::urlencode(p_watchlistid));
4023    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4024
4025    if let Some(ref user_agent) = configuration.user_agent {
4026        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4027    }
4028    if let Some(ref token) = configuration.bearer_access_token {
4029        req_builder = req_builder.bearer_auth(token.to_owned());
4030    };
4031
4032    let req = req_builder.build()?;
4033    let resp = configuration.client.execute(req).await?;
4034
4035    let status = resp.status();
4036
4037    if !status.is_client_error() && !status.is_server_error() {
4038        Ok(())
4039    } else {
4040        let content = resp.text().await?;
4041        let entity: Option<PatchCommerceWatchlistByWatchlistidError> = serde_json::from_str(&content).ok();
4042        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4043    }
4044}
4045
4046/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4047pub async fn patch_commerce_webhook_by_webhookid(configuration: &configuration::Configuration, webhookid: &str) -> Result<(), Error<PatchCommerceWebhookByWebhookidError>> {
4048    // add a prefix to parameters to efficiently prevent name collisions
4049    let p_webhookid = webhookid;
4050
4051    let uri_str = format!("{}/v1/commerce/webhook/{webhookid}", configuration.base_path, webhookid=crate::apis::urlencode(p_webhookid));
4052    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4053
4054    if let Some(ref user_agent) = configuration.user_agent {
4055        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4056    }
4057    if let Some(ref token) = configuration.bearer_access_token {
4058        req_builder = req_builder.bearer_auth(token.to_owned());
4059    };
4060
4061    let req = req_builder.build()?;
4062    let resp = configuration.client.execute(req).await?;
4063
4064    let status = resp.status();
4065
4066    if !status.is_client_error() && !status.is_server_error() {
4067        Ok(())
4068    } else {
4069        let content = resp.text().await?;
4070        let entity: Option<PatchCommerceWebhookByWebhookidError> = serde_json::from_str(&content).ok();
4071        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4072    }
4073}
4074
4075/// Creates a catalog row from the body and answers it at 201. The slug is required and is the globally-unique catalog key, so a second entry claiming a slug already in use is refused 409 rather than shadowing the first. PLATFORM admin only — this is cross-tenant pricing and packaging data, and an org-level admin is refused 403.
4076pub async fn post_commerce_catalog_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceCatalogEntriesError>> {
4077
4078    let uri_str = format!("{}/v1/commerce/catalog/entries", configuration.base_path);
4079    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4080
4081    if let Some(ref user_agent) = configuration.user_agent {
4082        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4083    }
4084    if let Some(ref token) = configuration.bearer_access_token {
4085        req_builder = req_builder.bearer_auth(token.to_owned());
4086    };
4087
4088    let req = req_builder.build()?;
4089    let resp = configuration.client.execute(req).await?;
4090
4091    let status = resp.status();
4092
4093    if !status.is_client_error() && !status.is_server_error() {
4094        Ok(())
4095    } else {
4096        let content = resp.text().await?;
4097        let entity: Option<PostCommerceCatalogEntriesError> = serde_json::from_str(&content).ok();
4098        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4099    }
4100}
4101
4102/// Takes a batch of model rows and upserts each one's upstream COST and machine-observable facts, answering what was created and changed. It deliberately touches nothing a human owns — not the retail price, not the markup, not the entitlement tier — so a sync can never overwrite an administrator's pricing decision. The gate is a PLATFORM principal rather than a platform ADMIN, because the caller is normally a scheduled job holding the internal service token, which carries platform scope but no admin claim.
4103pub async fn post_commerce_catalog_models(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceCatalogModelsError>> {
4104
4105    let uri_str = format!("{}/v1/commerce/catalog/models", configuration.base_path);
4106    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4107
4108    if let Some(ref user_agent) = configuration.user_agent {
4109        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4110    }
4111    if let Some(ref token) = configuration.bearer_access_token {
4112        req_builder = req_builder.bearer_auth(token.to_owned());
4113    };
4114
4115    let req = req_builder.build()?;
4116    let resp = configuration.client.execute(req).await?;
4117
4118    let status = resp.status();
4119
4120    if !status.is_client_error() && !status.is_server_error() {
4121        Ok(())
4122    } else {
4123        let content = resp.text().await?;
4124        let entity: Option<PostCommerceCatalogModelsError> = serde_json::from_str(&content).ok();
4125        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4126    }
4127}
4128
4129/// Pulls the upstream model list and lands it through the same upsert the push endpoint uses, so the rule that a sync owns cost and an administrator owns price holds no matter which endpoint a row came through. It takes no body — the upstream is READ rather than told. If that upstream cannot be read the call answers 502 and writes NOTHING: a sync that cannot see its source must never conclude the source is empty, because that conclusion would withdraw every model on sale. The gate is a PLATFORM principal so the scheduled job's service token qualifies.
4130pub async fn post_commerce_catalog_models_refresh(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceCatalogModelsRefreshError>> {
4131
4132    let uri_str = format!("{}/v1/commerce/catalog/models/refresh", configuration.base_path);
4133    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4134
4135    if let Some(ref user_agent) = configuration.user_agent {
4136        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4137    }
4138    if let Some(ref token) = configuration.bearer_access_token {
4139        req_builder = req_builder.bearer_auth(token.to_owned());
4140    };
4141
4142    let req = req_builder.build()?;
4143    let resp = configuration.client.execute(req).await?;
4144
4145    let status = resp.status();
4146
4147    if !status.is_client_error() && !status.is_server_error() {
4148        Ok(())
4149    } else {
4150        let content = resp.text().await?;
4151        let entity: Option<PostCommerceCatalogModelsRefreshError> = serde_json::from_str(&content).ok();
4152        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4153    }
4154}
4155
4156/// Upserts the shipped catalog seed and answers how many entries it created. It is idempotent and non-destructive — an entry an administrator has since edited is left alone — so it is safe to run against a live catalog to fill in what is missing. PLATFORM admin only; an org-level admin is refused 403.
4157pub async fn post_commerce_catalog_seed(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceCatalogSeedError>> {
4158
4159    let uri_str = format!("{}/v1/commerce/catalog/seed", configuration.base_path);
4160    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4161
4162    if let Some(ref user_agent) = configuration.user_agent {
4163        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4164    }
4165    if let Some(ref token) = configuration.bearer_access_token {
4166        req_builder = req_builder.bearer_auth(token.to_owned());
4167    };
4168
4169    let req = req_builder.build()?;
4170    let resp = configuration.client.execute(req).await?;
4171
4172    let status = resp.status();
4173
4174    if !status.is_client_error() && !status.is_server_error() {
4175        Ok(())
4176    } else {
4177        let content = resp.text().await?;
4178        let entity: Option<PostCommerceCatalogSeedError> = serde_json::from_str(&content).ok();
4179        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4180    }
4181}
4182
4183/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteCollection.
4184pub async fn post_commerce_collection(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceCollectionError>> {
4185
4186    let uri_str = format!("{}/v1/commerce/collection/", configuration.base_path);
4187    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4188
4189    if let Some(ref user_agent) = configuration.user_agent {
4190        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4191    }
4192    if let Some(ref token) = configuration.bearer_access_token {
4193        req_builder = req_builder.bearer_auth(token.to_owned());
4194    };
4195
4196    let req = req_builder.build()?;
4197    let resp = configuration.client.execute(req).await?;
4198
4199    let status = resp.status();
4200
4201    if !status.is_client_error() && !status.is_server_error() {
4202        Ok(())
4203    } else {
4204        let content = resp.text().await?;
4205        let entity: Option<PostCommerceCollectionError> = serde_json::from_str(&content).ok();
4206        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4207    }
4208}
4209
4210/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
4211pub async fn post_commerce_collection_by_collectionid(configuration: &configuration::Configuration, collectionid: &str) -> Result<(), Error<PostCommerceCollectionByCollectionidError>> {
4212    // add a prefix to parameters to efficiently prevent name collisions
4213    let p_collectionid = collectionid;
4214
4215    let uri_str = format!("{}/v1/commerce/collection/{collectionid}", configuration.base_path, collectionid=crate::apis::urlencode(p_collectionid));
4216    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4217
4218    if let Some(ref user_agent) = configuration.user_agent {
4219        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4220    }
4221    if let Some(ref token) = configuration.bearer_access_token {
4222        req_builder = req_builder.bearer_auth(token.to_owned());
4223    };
4224
4225    let req = req_builder.build()?;
4226    let resp = configuration.client.execute(req).await?;
4227
4228    let status = resp.status();
4229
4230    if !status.is_client_error() && !status.is_server_error() {
4231        Ok(())
4232    } else {
4233        let content = resp.text().await?;
4234        let entity: Option<PostCommerceCollectionByCollectionidError> = serde_json::from_str(&content).ok();
4235        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4236    }
4237}
4238
4239/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4240pub async fn post_commerce_disclosure(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceDisclosureError>> {
4241
4242    let uri_str = format!("{}/v1/commerce/disclosure/", configuration.base_path);
4243    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4244
4245    if let Some(ref user_agent) = configuration.user_agent {
4246        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4247    }
4248    if let Some(ref token) = configuration.bearer_access_token {
4249        req_builder = req_builder.bearer_auth(token.to_owned());
4250    };
4251
4252    let req = req_builder.build()?;
4253    let resp = configuration.client.execute(req).await?;
4254
4255    let status = resp.status();
4256
4257    if !status.is_client_error() && !status.is_server_error() {
4258        Ok(())
4259    } else {
4260        let content = resp.text().await?;
4261        let entity: Option<PostCommerceDisclosureError> = serde_json::from_str(&content).ok();
4262        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4263    }
4264}
4265
4266/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
4267pub async fn post_commerce_disclosure_by_disclosureid(configuration: &configuration::Configuration, disclosureid: &str) -> Result<(), Error<PostCommerceDisclosureByDisclosureidError>> {
4268    // add a prefix to parameters to efficiently prevent name collisions
4269    let p_disclosureid = disclosureid;
4270
4271    let uri_str = format!("{}/v1/commerce/disclosure/{disclosureid}", configuration.base_path, disclosureid=crate::apis::urlencode(p_disclosureid));
4272    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4273
4274    if let Some(ref user_agent) = configuration.user_agent {
4275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4276    }
4277    if let Some(ref token) = configuration.bearer_access_token {
4278        req_builder = req_builder.bearer_auth(token.to_owned());
4279    };
4280
4281    let req = req_builder.build()?;
4282    let resp = configuration.client.execute(req).await?;
4283
4284    let status = resp.status();
4285
4286    if !status.is_client_error() && !status.is_server_error() {
4287        Ok(())
4288    } else {
4289        let content = resp.text().await?;
4290        let entity: Option<PostCommerceDisclosureByDisclosureidError> = serde_json::from_str(&content).ok();
4291        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4292    }
4293}
4294
4295/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4296pub async fn post_commerce_discount(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceDiscountError>> {
4297
4298    let uri_str = format!("{}/v1/commerce/discount/", configuration.base_path);
4299    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4300
4301    if let Some(ref user_agent) = configuration.user_agent {
4302        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4303    }
4304    if let Some(ref token) = configuration.bearer_access_token {
4305        req_builder = req_builder.bearer_auth(token.to_owned());
4306    };
4307
4308    let req = req_builder.build()?;
4309    let resp = configuration.client.execute(req).await?;
4310
4311    let status = resp.status();
4312
4313    if !status.is_client_error() && !status.is_server_error() {
4314        Ok(())
4315    } else {
4316        let content = resp.text().await?;
4317        let entity: Option<PostCommerceDiscountError> = serde_json::from_str(&content).ok();
4318        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4319    }
4320}
4321
4322/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
4323pub async fn post_commerce_discount_by_discountid(configuration: &configuration::Configuration, discountid: &str) -> Result<(), Error<PostCommerceDiscountByDiscountidError>> {
4324    // add a prefix to parameters to efficiently prevent name collisions
4325    let p_discountid = discountid;
4326
4327    let uri_str = format!("{}/v1/commerce/discount/{discountid}", configuration.base_path, discountid=crate::apis::urlencode(p_discountid));
4328    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4329
4330    if let Some(ref user_agent) = configuration.user_agent {
4331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4332    }
4333    if let Some(ref token) = configuration.bearer_access_token {
4334        req_builder = req_builder.bearer_auth(token.to_owned());
4335    };
4336
4337    let req = req_builder.build()?;
4338    let resp = configuration.client.execute(req).await?;
4339
4340    let status = resp.status();
4341
4342    if !status.is_client_error() && !status.is_server_error() {
4343        Ok(())
4344    } else {
4345        let content = resp.text().await?;
4346        let entity: Option<PostCommerceDiscountByDiscountidError> = serde_json::from_str(&content).ok();
4347        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4348    }
4349}
4350
4351/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4352pub async fn post_commerce_movie(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceMovieError>> {
4353
4354    let uri_str = format!("{}/v1/commerce/movie/", configuration.base_path);
4355    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4356
4357    if let Some(ref user_agent) = configuration.user_agent {
4358        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4359    }
4360    if let Some(ref token) = configuration.bearer_access_token {
4361        req_builder = req_builder.bearer_auth(token.to_owned());
4362    };
4363
4364    let req = req_builder.build()?;
4365    let resp = configuration.client.execute(req).await?;
4366
4367    let status = resp.status();
4368
4369    if !status.is_client_error() && !status.is_server_error() {
4370        Ok(())
4371    } else {
4372        let content = resp.text().await?;
4373        let entity: Option<PostCommerceMovieError> = serde_json::from_str(&content).ok();
4374        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4375    }
4376}
4377
4378/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
4379pub async fn post_commerce_movie_by_movieid(configuration: &configuration::Configuration, movieid: &str) -> Result<(), Error<PostCommerceMovieByMovieidError>> {
4380    // add a prefix to parameters to efficiently prevent name collisions
4381    let p_movieid = movieid;
4382
4383    let uri_str = format!("{}/v1/commerce/movie/{movieid}", configuration.base_path, movieid=crate::apis::urlencode(p_movieid));
4384    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4385
4386    if let Some(ref user_agent) = configuration.user_agent {
4387        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4388    }
4389    if let Some(ref token) = configuration.bearer_access_token {
4390        req_builder = req_builder.bearer_auth(token.to_owned());
4391    };
4392
4393    let req = req_builder.build()?;
4394    let resp = configuration.client.execute(req).await?;
4395
4396    let status = resp.status();
4397
4398    if !status.is_client_error() && !status.is_server_error() {
4399        Ok(())
4400    } else {
4401        let content = resp.text().await?;
4402        let entity: Option<PostCommerceMovieByMovieidError> = serde_json::from_str(&content).ok();
4403        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4404    }
4405}
4406
4407/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4408pub async fn post_commerce_note(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceNoteError>> {
4409
4410    let uri_str = format!("{}/v1/commerce/note/", configuration.base_path);
4411    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4412
4413    if let Some(ref user_agent) = configuration.user_agent {
4414        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4415    }
4416    if let Some(ref token) = configuration.bearer_access_token {
4417        req_builder = req_builder.bearer_auth(token.to_owned());
4418    };
4419
4420    let req = req_builder.build()?;
4421    let resp = configuration.client.execute(req).await?;
4422
4423    let status = resp.status();
4424
4425    if !status.is_client_error() && !status.is_server_error() {
4426        Ok(())
4427    } else {
4428        let content = resp.text().await?;
4429        let entity: Option<PostCommerceNoteError> = serde_json::from_str(&content).ok();
4430        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4431    }
4432}
4433
4434/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
4435pub async fn post_commerce_note_by_noteid(configuration: &configuration::Configuration, noteid: &str) -> Result<(), Error<PostCommerceNoteByNoteidError>> {
4436    // add a prefix to parameters to efficiently prevent name collisions
4437    let p_noteid = noteid;
4438
4439    let uri_str = format!("{}/v1/commerce/note/{noteid}", configuration.base_path, noteid=crate::apis::urlencode(p_noteid));
4440    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4441
4442    if let Some(ref user_agent) = configuration.user_agent {
4443        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4444    }
4445    if let Some(ref token) = configuration.bearer_access_token {
4446        req_builder = req_builder.bearer_auth(token.to_owned());
4447    };
4448
4449    let req = req_builder.build()?;
4450    let resp = configuration.client.execute(req).await?;
4451
4452    let status = resp.status();
4453
4454    if !status.is_client_error() && !status.is_server_error() {
4455        Ok(())
4456    } else {
4457        let content = resp.text().await?;
4458        let entity: Option<PostCommerceNoteByNoteidError> = serde_json::from_str(&content).ok();
4459        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4460    }
4461}
4462
4463/// Creates a plan from the body and answers it at 201. The slug is required and globally unique — a duplicate is 409 — and the row is marked authoritative on creation, so the corrective seed will leave it alone. Price, annual price and the contact-sales flag are stored exactly as sent, never coerced, so the difference between a free plan and a quote-only plan survives. PLATFORM admin only.
4464pub async fn post_commerce_plans_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommercePlansEntriesError>> {
4465
4466    let uri_str = format!("{}/v1/commerce/plans/entries", configuration.base_path);
4467    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4468
4469    if let Some(ref user_agent) = configuration.user_agent {
4470        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4471    }
4472    if let Some(ref token) = configuration.bearer_access_token {
4473        req_builder = req_builder.bearer_auth(token.to_owned());
4474    };
4475
4476    let req = req_builder.build()?;
4477    let resp = configuration.client.execute(req).await?;
4478
4479    let status = resp.status();
4480
4481    if !status.is_client_error() && !status.is_server_error() {
4482        Ok(())
4483    } else {
4484        let content = resp.text().await?;
4485        let entity: Option<PostCommercePlansEntriesError> = serde_json::from_str(&content).ok();
4486        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4487    }
4488}
4489
4490/// Upserts the shipped plan rows and answers how many were created and how many corrected. It is idempotent and non-destructive — a row an administrator authored or edited is left as it stands — so it is safe against a live authority and fills only what is missing or has drifted. PLATFORM admin only, and a deployment with no seed source wired answers 500 rather than quietly seeding nothing.
4491pub async fn post_commerce_plans_seed(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommercePlansSeedError>> {
4492
4493    let uri_str = format!("{}/v1/commerce/plans/seed", configuration.base_path);
4494    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4495
4496    if let Some(ref user_agent) = configuration.user_agent {
4497        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4498    }
4499    if let Some(ref token) = configuration.bearer_access_token {
4500        req_builder = req_builder.bearer_auth(token.to_owned());
4501    };
4502
4503    let req = req_builder.build()?;
4504    let resp = configuration.client.execute(req).await?;
4505
4506    let status = resp.status();
4507
4508    if !status.is_client_error() && !status.is_server_error() {
4509        Ok(())
4510    } else {
4511        let content = resp.text().await?;
4512        let entity: Option<PostCommercePlansSeedError> = serde_json::from_str(&content).ok();
4513        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4514    }
4515}
4516
4517/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteProduct.
4518pub async fn post_commerce_product(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceProductError>> {
4519
4520    let uri_str = format!("{}/v1/commerce/product/", configuration.base_path);
4521    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4522
4523    if let Some(ref user_agent) = configuration.user_agent {
4524        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4525    }
4526    if let Some(ref token) = configuration.bearer_access_token {
4527        req_builder = req_builder.bearer_auth(token.to_owned());
4528    };
4529
4530    let req = req_builder.build()?;
4531    let resp = configuration.client.execute(req).await?;
4532
4533    let status = resp.status();
4534
4535    if !status.is_client_error() && !status.is_server_error() {
4536        Ok(())
4537    } else {
4538        let content = resp.text().await?;
4539        let entity: Option<PostCommerceProductError> = serde_json::from_str(&content).ok();
4540        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4541    }
4542}
4543
4544/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
4545pub async fn post_commerce_product_by_productid(configuration: &configuration::Configuration, productid: &str) -> Result<(), Error<PostCommerceProductByProductidError>> {
4546    // add a prefix to parameters to efficiently prevent name collisions
4547    let p_productid = productid;
4548
4549    let uri_str = format!("{}/v1/commerce/product/{productid}", configuration.base_path, productid=crate::apis::urlencode(p_productid));
4550    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4551
4552    if let Some(ref user_agent) = configuration.user_agent {
4553        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4554    }
4555    if let Some(ref token) = configuration.bearer_access_token {
4556        req_builder = req_builder.bearer_auth(token.to_owned());
4557    };
4558
4559    let req = req_builder.build()?;
4560    let resp = configuration.client.execute(req).await?;
4561
4562    let status = resp.status();
4563
4564    if !status.is_client_error() && !status.is_server_error() {
4565        Ok(())
4566    } else {
4567        let content = resp.text().await?;
4568        let entity: Option<PostCommerceProductByProductidError> = serde_json::from_str(&content).ok();
4569        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4570    }
4571}
4572
4573/// Creates one rate. Product AND meter are both required, because together they are the identity: a rate keyed on the metered thing alone would let one product's price overwrite another's under the same name. A slug that already exists is refused rather than silently replaced. SuperAdmin only.
4574pub async fn post_commerce_rates_entries(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceRatesEntriesError>> {
4575
4576    let uri_str = format!("{}/v1/commerce/rates/entries", configuration.base_path);
4577    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4578
4579    if let Some(ref user_agent) = configuration.user_agent {
4580        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4581    }
4582    if let Some(ref token) = configuration.bearer_access_token {
4583        req_builder = req_builder.bearer_auth(token.to_owned());
4584    };
4585
4586    let req = req_builder.build()?;
4587    let resp = configuration.client.execute(req).await?;
4588
4589    let status = resp.status();
4590
4591    if !status.is_client_error() && !status.is_server_error() {
4592        Ok(())
4593    } else {
4594        let content = resp.text().await?;
4595        let entity: Option<PostCommerceRatesEntriesError> = serde_json::from_str(&content).ok();
4596        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4597    }
4598}
4599
4600/// Takes an array of rates and seeds the authority from it — the same reconcile the boot catalog runs, driven from admin instead. It RECONCILES: a row that matches is left alone, a row that has drifted is corrected, and a row an operator edited is skipped — so importing the same document twice is a no-op and importing a corrected one moves exactly the rows that changed. Answers what it received, created, corrected and left unchanged, so an import that changes nothing reads as nothing to do rather than as a failure. An empty array is refused 400. SuperAdmin only.
4601pub async fn post_commerce_rates_import(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceRatesImportError>> {
4602
4603    let uri_str = format!("{}/v1/commerce/rates/import", configuration.base_path);
4604    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4605
4606    if let Some(ref user_agent) = configuration.user_agent {
4607        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4608    }
4609    if let Some(ref token) = configuration.bearer_access_token {
4610        req_builder = req_builder.bearer_auth(token.to_owned());
4611    };
4612
4613    let req = req_builder.build()?;
4614    let resp = configuration.client.execute(req).await?;
4615
4616    let status = resp.status();
4617
4618    if !status.is_client_error() && !status.is_server_error() {
4619        Ok(())
4620    } else {
4621        let content = resp.text().await?;
4622        let entity: Option<PostCommerceRatesImportError> = serde_json::from_str(&content).ok();
4623        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4624    }
4625}
4626
4627/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The token must also carry Admin or WriteReturn.
4628pub async fn post_commerce_return(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceReturnError>> {
4629
4630    let uri_str = format!("{}/v1/commerce/return/", configuration.base_path);
4631    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4632
4633    if let Some(ref user_agent) = configuration.user_agent {
4634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4635    }
4636    if let Some(ref token) = configuration.bearer_access_token {
4637        req_builder = req_builder.bearer_auth(token.to_owned());
4638    };
4639
4640    let req = req_builder.build()?;
4641    let resp = configuration.client.execute(req).await?;
4642
4643    let status = resp.status();
4644
4645    if !status.is_client_error() && !status.is_server_error() {
4646        Ok(())
4647    } else {
4648        let content = resp.text().await?;
4649        let entity: Option<PostCommerceReturnError> = serde_json::from_str(&content).ok();
4650        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4651    }
4652}
4653
4654/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
4655pub async fn post_commerce_return_by_returnid(configuration: &configuration::Configuration, returnid: &str) -> Result<(), Error<PostCommerceReturnByReturnidError>> {
4656    // add a prefix to parameters to efficiently prevent name collisions
4657    let p_returnid = returnid;
4658
4659    let uri_str = format!("{}/v1/commerce/return/{returnid}", configuration.base_path, returnid=crate::apis::urlencode(p_returnid));
4660    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4661
4662    if let Some(ref user_agent) = configuration.user_agent {
4663        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4664    }
4665    if let Some(ref token) = configuration.bearer_access_token {
4666        req_builder = req_builder.bearer_auth(token.to_owned());
4667    };
4668
4669    let req = req_builder.build()?;
4670    let resp = configuration.client.execute(req).await?;
4671
4672    let status = resp.status();
4673
4674    if !status.is_client_error() && !status.is_server_error() {
4675        Ok(())
4676    } else {
4677        let content = resp.text().await?;
4678        let entity: Option<PostCommerceReturnByReturnidError> = serde_json::from_str(&content).ok();
4679        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4680    }
4681}
4682
4683/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4684pub async fn post_commerce_saleschannel(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceSaleschannelError>> {
4685
4686    let uri_str = format!("{}/v1/commerce/saleschannel/", configuration.base_path);
4687    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4688
4689    if let Some(ref user_agent) = configuration.user_agent {
4690        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4691    }
4692    if let Some(ref token) = configuration.bearer_access_token {
4693        req_builder = req_builder.bearer_auth(token.to_owned());
4694    };
4695
4696    let req = req_builder.build()?;
4697    let resp = configuration.client.execute(req).await?;
4698
4699    let status = resp.status();
4700
4701    if !status.is_client_error() && !status.is_server_error() {
4702        Ok(())
4703    } else {
4704        let content = resp.text().await?;
4705        let entity: Option<PostCommerceSaleschannelError> = serde_json::from_str(&content).ok();
4706        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4707    }
4708}
4709
4710/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
4711pub async fn post_commerce_saleschannel_by_saleschannelid(configuration: &configuration::Configuration, saleschannelid: &str) -> Result<(), Error<PostCommerceSaleschannelBySaleschannelidError>> {
4712    // add a prefix to parameters to efficiently prevent name collisions
4713    let p_saleschannelid = saleschannelid;
4714
4715    let uri_str = format!("{}/v1/commerce/saleschannel/{saleschannelid}", configuration.base_path, saleschannelid=crate::apis::urlencode(p_saleschannelid));
4716    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4717
4718    if let Some(ref user_agent) = configuration.user_agent {
4719        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4720    }
4721    if let Some(ref token) = configuration.bearer_access_token {
4722        req_builder = req_builder.bearer_auth(token.to_owned());
4723    };
4724
4725    let req = req_builder.build()?;
4726    let resp = configuration.client.execute(req).await?;
4727
4728    let status = resp.status();
4729
4730    if !status.is_client_error() && !status.is_server_error() {
4731        Ok(())
4732    } else {
4733        let content = resp.text().await?;
4734        let entity: Option<PostCommerceSaleschannelBySaleschannelidError> = serde_json::from_str(&content).ok();
4735        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4736    }
4737}
4738
4739/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
4740pub async fn post_commerce_stocklocation(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceStocklocationError>> {
4741
4742    let uri_str = format!("{}/v1/commerce/stocklocation/", configuration.base_path);
4743    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4744
4745    if let Some(ref user_agent) = configuration.user_agent {
4746        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4747    }
4748    if let Some(ref token) = configuration.bearer_access_token {
4749        req_builder = req_builder.bearer_auth(token.to_owned());
4750    };
4751
4752    let req = req_builder.build()?;
4753    let resp = configuration.client.execute(req).await?;
4754
4755    let status = resp.status();
4756
4757    if !status.is_client_error() && !status.is_server_error() {
4758        Ok(())
4759    } else {
4760        let content = resp.text().await?;
4761        let entity: Option<PostCommerceStocklocationError> = serde_json::from_str(&content).ok();
4762        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4763    }
4764}
4765
4766/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
4767pub async fn post_commerce_stocklocation_by_stocklocationid(configuration: &configuration::Configuration, stocklocationid: &str) -> Result<(), Error<PostCommerceStocklocationByStocklocationidError>> {
4768    // add a prefix to parameters to efficiently prevent name collisions
4769    let p_stocklocationid = stocklocationid;
4770
4771    let uri_str = format!("{}/v1/commerce/stocklocation/{stocklocationid}", configuration.base_path, stocklocationid=crate::apis::urlencode(p_stocklocationid));
4772    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4773
4774    if let Some(ref user_agent) = configuration.user_agent {
4775        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4776    }
4777    if let Some(ref token) = configuration.bearer_access_token {
4778        req_builder = req_builder.bearer_auth(token.to_owned());
4779    };
4780
4781    let req = req_builder.build()?;
4782    let resp = configuration.client.execute(req).await?;
4783
4784    let status = resp.status();
4785
4786    if !status.is_client_error() && !status.is_server_error() {
4787        Ok(())
4788    } else {
4789        let content = resp.text().await?;
4790        let entity: Option<PostCommerceStocklocationByStocklocationidError> = serde_json::from_str(&content).ok();
4791        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4792    }
4793}
4794
4795/// Creates a store from the body inside the caller org's own namespaced database, so the row is physically isolated to that tenant from its first write, and answers it at 201 with a Location header naming its id. Requires an admin or store-write token: the anonymous published storefront key may READ stores but never create one. A body that fails to decode is 400.
4796pub async fn post_commerce_store(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceStoreError>> {
4797
4798    let uri_str = format!("{}/v1/commerce/store/", configuration.base_path);
4799    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4800
4801    if let Some(ref user_agent) = configuration.user_agent {
4802        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4803    }
4804    if let Some(ref token) = configuration.bearer_access_token {
4805        req_builder = req_builder.bearer_auth(token.to_owned());
4806    };
4807
4808    let req = req_builder.build()?;
4809    let resp = configuration.client.execute(req).await?;
4810
4811    let status = resp.status();
4812
4813    if !status.is_client_error() && !status.is_server_error() {
4814        Ok(())
4815    } else {
4816        let content = resp.text().await?;
4817        let entity: Option<PostCommerceStoreError> = serde_json::from_str(&content).ok();
4818        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4819    }
4820}
4821
4822/// Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header, the header winning when both are present. Only PUT, PATCH and DELETE are accepted; anything else resolves to 405. The trap is the default: naming NO override at all is treated as a partial update, never as a create. Authorization is whatever the underlying operation requires, since the real handler runs.
4823pub async fn post_commerce_store_by_storeid(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidError>> {
4824    // add a prefix to parameters to efficiently prevent name collisions
4825    let p_storeid = storeid;
4826
4827    let uri_str = format!("{}/v1/commerce/store/{storeid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
4828    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4829
4830    if let Some(ref user_agent) = configuration.user_agent {
4831        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4832    }
4833    if let Some(ref token) = configuration.bearer_access_token {
4834        req_builder = req_builder.bearer_auth(token.to_owned());
4835    };
4836
4837    let req = req_builder.build()?;
4838    let resp = configuration.client.execute(req).await?;
4839
4840    let status = resp.status();
4841
4842    if !status.is_client_error() && !status.is_server_error() {
4843        Ok(())
4844    } else {
4845        let content = resp.text().await?;
4846        let entity: Option<PostCommerceStoreByStoreidError> = serde_json::from_str(&content).ok();
4847        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4848    }
4849}
4850
4851/// Tallies a new order for the addressed store from the user, payment and order body, reserves its items, runs the processor authorization and answers the saved order with a Location header pointing at it. The gate is a token carrying admin or published scope, so a published storefront key is enough; no token is 401 and a token with neither bit is 403. The store is loaded BEFORE any payment work and its currency OVERRIDES whatever the body asked for, so a store that will not load ends the call with 500 and nothing is charged. On any authorization failure the reservations are released and the order and payment are persisted as cancelled, so a failed attempt still leaves a durable record. Capture is a separate call.
4852pub async fn post_commerce_store_by_storeid_authorize(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidAuthorizeError>> {
4853    // add a prefix to parameters to efficiently prevent name collisions
4854    let p_storeid = storeid;
4855
4856    let uri_str = format!("{}/v1/commerce/store/{storeid}/authorize", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
4857    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4858
4859    if let Some(ref user_agent) = configuration.user_agent {
4860        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4861    }
4862    if let Some(ref token) = configuration.bearer_access_token {
4863        req_builder = req_builder.bearer_auth(token.to_owned());
4864    };
4865
4866    let req = req_builder.build()?;
4867    let resp = configuration.client.execute(req).await?;
4868
4869    let status = resp.status();
4870
4871    if !status.is_client_error() && !status.is_server_error() {
4872        Ok(())
4873    } else {
4874        let content = resp.text().await?;
4875        let entity: Option<PostCommerceStoreByStoreidAuthorizeError> = serde_json::from_str(&content).ok();
4876        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4877    }
4878}
4879
4880/// Continues the order named in the path rather than minting a new one, holding funds for it. The order is loaded from the caller org's own store, so an id belonging to another tenant is a 404. The rule most callers get wrong is that the body's order object is MERGED onto the loaded order before the tally — this is not a read-only reference, and a field sent here overwrites what is stored. The gate, the store resolution and the currency override behave exactly as on the bodiless-id sibling, and settling is still the capture call's job.
4881pub async fn post_commerce_store_by_storeid_authorize_by_orderid(configuration: &configuration::Configuration, storeid: &str, orderid: &str) -> Result<(), Error<PostCommerceStoreByStoreidAuthorizeByOrderidError>> {
4882    // add a prefix to parameters to efficiently prevent name collisions
4883    let p_storeid = storeid;
4884    let p_orderid = orderid;
4885
4886    let uri_str = format!("{}/v1/commerce/store/{storeid}/authorize/{orderid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), orderid=crate::apis::urlencode(p_orderid));
4887    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4888
4889    if let Some(ref user_agent) = configuration.user_agent {
4890        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4891    }
4892    if let Some(ref token) = configuration.bearer_access_token {
4893        req_builder = req_builder.bearer_auth(token.to_owned());
4894    };
4895
4896    let req = req_builder.build()?;
4897    let resp = configuration.client.execute(req).await?;
4898
4899    let status = resp.status();
4900
4901    if !status.is_client_error() && !status.is_server_error() {
4902        Ok(())
4903    } else {
4904        let content = resp.text().await?;
4905        let entity: Option<PostCommerceStoreByStoreidAuthorizeByOrderidError> = serde_json::from_str(&content).ok();
4906        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4907    }
4908}
4909
4910/// Settles the order named in the path — the second half of the two-step flow — and answers the updated order with a Location header. Dispatch follows the order's STORED payment type, and a successful capture is the moment the rest of the system learns about the sale: order and payment rows are updated, coupon redemptions, referral, cart and stats are written, the confirmation email goes out, and the paid and completed events are emitted. A capture failure releases the order's inventory reservations and answers 400, so a failed settlement never leaves items held.
4911pub async fn post_commerce_store_by_storeid_capture_by_orderid(configuration: &configuration::Configuration, storeid: &str, orderid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCaptureByOrderidError>> {
4912    // add a prefix to parameters to efficiently prevent name collisions
4913    let p_storeid = storeid;
4914    let p_orderid = orderid;
4915
4916    let uri_str = format!("{}/v1/commerce/store/{storeid}/capture/{orderid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), orderid=crate::apis::urlencode(p_orderid));
4917    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4918
4919    if let Some(ref user_agent) = configuration.user_agent {
4920        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4921    }
4922    if let Some(ref token) = configuration.bearer_access_token {
4923        req_builder = req_builder.bearer_auth(token.to_owned());
4924    };
4925
4926    let req = req_builder.build()?;
4927    let resp = configuration.client.execute(req).await?;
4928
4929    let status = resp.status();
4930
4931    if !status.is_client_error() && !status.is_server_error() {
4932        Ok(())
4933    } else {
4934        let content = resp.text().await?;
4935        let entity: Option<PostCommerceStoreByStoreidCaptureByOrderidError> = serde_json::from_str(&content).ok();
4936        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4937    }
4938}
4939
4940/// Runs authorization and capture back to back against a freshly created order — the one-step flow for callers with no reason to hold funds. It takes the authorize body and inherits every authorize rule: the store's currency wins over the body, the items are reserved before the processor is called, and the amount bounds the processor enforces still apply. There is no order id on this address, so it can never continue an existing order. Either half failing answers 400, and the capture side effects — confirmation email, redemptions, stats, the paid and completed events — run only when both halves succeed.
4941pub async fn post_commerce_store_by_storeid_charge(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidChargeError>> {
4942    // add a prefix to parameters to efficiently prevent name collisions
4943    let p_storeid = storeid;
4944
4945    let uri_str = format!("{}/v1/commerce/store/{storeid}/charge", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
4946    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4947
4948    if let Some(ref user_agent) = configuration.user_agent {
4949        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4950    }
4951    if let Some(ref token) = configuration.bearer_access_token {
4952        req_builder = req_builder.bearer_auth(token.to_owned());
4953    };
4954
4955    let req = req_builder.build()?;
4956    let resp = configuration.client.execute(req).await?;
4957
4958    let status = resp.status();
4959
4960    if !status.is_client_error() && !status.is_server_error() {
4961        Ok(())
4962    } else {
4963        let content = resp.text().await?;
4964        let entity: Option<PostCommerceStoreByStoreidChargeError> = serde_json::from_str(&content).ok();
4965        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4966    }
4967}
4968
4969/// Authorizes a new order for the addressed store and holds the funds, answering the saved order with a Location header. It binds the identical handler as the shorter authorize address, so the two are ONE operation at two spellings and not two behaviours; the checkout prefix is the newer one. Every rule carries over: admin or published scope on the token, the store loaded first with its currency overriding the body, items reserved before the processor call, and reservations released with the order persisted cancelled on failure. Nothing is settled here.
4970pub async fn post_commerce_store_by_storeid_checkout_authorize(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutAuthorizeError>> {
4971    // add a prefix to parameters to efficiently prevent name collisions
4972    let p_storeid = storeid;
4973
4974    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/authorize", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
4975    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4976
4977    if let Some(ref user_agent) = configuration.user_agent {
4978        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4979    }
4980    if let Some(ref token) = configuration.bearer_access_token {
4981        req_builder = req_builder.bearer_auth(token.to_owned());
4982    };
4983
4984    let req = req_builder.build()?;
4985    let resp = configuration.client.execute(req).await?;
4986
4987    let status = resp.status();
4988
4989    if !status.is_client_error() && !status.is_server_error() {
4990        Ok(())
4991    } else {
4992        let content = resp.text().await?;
4993        let entity: Option<PostCommerceStoreByStoreidCheckoutAuthorizeError> = serde_json::from_str(&content).ok();
4994        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4995    }
4996}
4997
4998/// Continues the order named in the path rather than minting one, and shares its handler byte for byte with the unprefixed authorize-by-id address. The order is loaded from the caller org's own store, so another tenant's id is a 404, and the body's order object is merged onto the loaded row before the tally — a field sent here overwrites what is stored. Store resolution, the token gate and the currency override behave as on every other authorize address; settle with the capture address and the same order id.
4999pub async fn post_commerce_store_by_storeid_checkout_authorize_by_orderid(configuration: &configuration::Configuration, storeid: &str, orderid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutAuthorizeByOrderidError>> {
5000    // add a prefix to parameters to efficiently prevent name collisions
5001    let p_storeid = storeid;
5002    let p_orderid = orderid;
5003
5004    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/authorize/{orderid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), orderid=crate::apis::urlencode(p_orderid));
5005    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5006
5007    if let Some(ref user_agent) = configuration.user_agent {
5008        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5009    }
5010    if let Some(ref token) = configuration.bearer_access_token {
5011        req_builder = req_builder.bearer_auth(token.to_owned());
5012    };
5013
5014    let req = req_builder.build()?;
5015    let resp = configuration.client.execute(req).await?;
5016
5017    let status = resp.status();
5018
5019    if !status.is_client_error() && !status.is_server_error() {
5020        Ok(())
5021    } else {
5022        let content = resp.text().await?;
5023        let entity: Option<PostCommerceStoreByStoreidCheckoutAuthorizeByOrderidError> = serde_json::from_str(&content).ok();
5024        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5025    }
5026}
5027
5028/// Settles the authorized order named in the path and answers the updated order with a Location header, running the same handler as the unprefixed capture address. Dispatch follows the order's stored payment type. Success is what triggers the downstream work — order and payment updates, redemptions, referral, cart and stats, the confirmation email, and the paid and completed events — while a failure releases the order's inventory reservations and answers 400.
5029pub async fn post_commerce_store_by_storeid_checkout_capture_by_orderid(configuration: &configuration::Configuration, storeid: &str, orderid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutCaptureByOrderidError>> {
5030    // add a prefix to parameters to efficiently prevent name collisions
5031    let p_storeid = storeid;
5032    let p_orderid = orderid;
5033
5034    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/capture/{orderid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), orderid=crate::apis::urlencode(p_orderid));
5035    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5036
5037    if let Some(ref user_agent) = configuration.user_agent {
5038        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5039    }
5040    if let Some(ref token) = configuration.bearer_access_token {
5041        req_builder = req_builder.bearer_auth(token.to_owned());
5042    };
5043
5044    let req = req_builder.build()?;
5045    let resp = configuration.client.execute(req).await?;
5046
5047    let status = resp.status();
5048
5049    if !status.is_client_error() && !status.is_server_error() {
5050        Ok(())
5051    } else {
5052        let content = resp.text().await?;
5053        let entity: Option<PostCommerceStoreByStoreidCheckoutCaptureByOrderidError> = serde_json::from_str(&content).ok();
5054        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5055    }
5056}
5057
5058/// Performs authorization and capture back to back against a newly created order for the addressed store, on the same handler as the unprefixed charge address. It takes the authorize body and inherits every authorize rule, including the store's currency winning over the body and the items being reserved before the processor is called. There is no order id on this address, so it can never continue an existing order. Either half failing answers 400, and the capture side effects run only when both succeed.
5059pub async fn post_commerce_store_by_storeid_checkout_charge(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutChargeError>> {
5060    // add a prefix to parameters to efficiently prevent name collisions
5061    let p_storeid = storeid;
5062
5063    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/charge", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
5064    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5065
5066    if let Some(ref user_agent) = configuration.user_agent {
5067        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5068    }
5069    if let Some(ref token) = configuration.bearer_access_token {
5070        req_builder = req_builder.bearer_auth(token.to_owned());
5071    };
5072
5073    let req = req_builder.build()?;
5074    let resp = configuration.client.execute(req).await?;
5075
5076    let status = resp.status();
5077
5078    if !status.is_client_error() && !status.is_server_error() {
5079        Ok(())
5080    } else {
5081        let content = resp.text().await?;
5082        let entity: Option<PostCommerceStoreByStoreidCheckoutChargeError> = serde_json::from_str(&content).ok();
5083        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5084    }
5085}
5086
5087/// Meant to void the payments carrying the given pay key, stamp them cancelled and cancel the order, but the shared checkout handler resolves its order from an ORDER ID path parameter this route does not carry. The result is an untyped order and a cancel dispatch that refuses with 400 before the pay key lookup ever runs. Token gate, namespacing and store resolution happen first, so a missing token is still 401 and an unloadable store still 500. It is the same handler as the unprefixed cancel address, with the same outcome.
5088pub async fn post_commerce_store_by_storeid_checkout_paypal_cancel_by_paykey(configuration: &configuration::Configuration, storeid: &str, pay_key: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutPaypalCancelByPaykeyError>> {
5089    // add a prefix to parameters to efficiently prevent name collisions
5090    let p_storeid = storeid;
5091    let p_pay_key = pay_key;
5092
5093    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/paypal/cancel/{payKey}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), payKey=crate::apis::urlencode(p_pay_key));
5094    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5095
5096    if let Some(ref user_agent) = configuration.user_agent {
5097        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5098    }
5099    if let Some(ref token) = configuration.bearer_access_token {
5100        req_builder = req_builder.bearer_auth(token.to_owned());
5101    };
5102
5103    let req = req_builder.build()?;
5104    let resp = configuration.client.execute(req).await?;
5105
5106    let status = resp.status();
5107
5108    if !status.is_client_error() && !status.is_server_error() {
5109        Ok(())
5110    } else {
5111        let content = resp.text().await?;
5112        let entity: Option<PostCommerceStoreByStoreidCheckoutPaypalCancelByPaykeyError> = serde_json::from_str(&content).ok();
5113        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5114    }
5115}
5116
5117/// Meant to mark the payments carrying the given pay key as paid and set the order to paid, it cannot reach that work from this address: the shared checkout handler takes its order from an ORDER ID path parameter this route does not carry, so the order is always fresh and untyped and the confirm dispatch refuses with 400 before the pay key is queried. The token gate, the namespace middleware and the store lookup all run ahead of that, so authentication and store failures surface first. Behaviour is identical to the unprefixed confirm address; the checkout prefix changes nothing here.
5118pub async fn post_commerce_store_by_storeid_checkout_paypal_confirm_by_paykey(configuration: &configuration::Configuration, storeid: &str, pay_key: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutPaypalConfirmByPaykeyError>> {
5119    // add a prefix to parameters to efficiently prevent name collisions
5120    let p_storeid = storeid;
5121    let p_pay_key = pay_key;
5122
5123    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/paypal/confirm/{payKey}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), payKey=crate::apis::urlencode(p_pay_key));
5124    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5125
5126    if let Some(ref user_agent) = configuration.user_agent {
5127        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5128    }
5129    if let Some(ref token) = configuration.bearer_access_token {
5130        req_builder = req_builder.bearer_auth(token.to_owned());
5131    };
5132
5133    let req = req_builder.build()?;
5134    let resp = configuration.client.execute(req).await?;
5135
5136    let status = resp.status();
5137
5138    if !status.is_client_error() && !status.is_server_error() {
5139        Ok(())
5140    } else {
5141        let content = resp.text().await?;
5142        let entity: Option<PostCommerceStoreByStoreidCheckoutPaypalConfirmByPaykeyError> = serde_json::from_str(&content).ok();
5143        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5144    }
5145}
5146
5147/// Begins a PayPal authorization by running the ordinary store authorize flow, since the route binds that exact handler — body, store resolution, tally, reservations and failure behaviour are the authorize address's, unchanged. The processor is chosen from the body's payment type, so this path reaches PayPal only when that type says so. A successful PayPal authorization stamps a pay key onto the payment, which is the key the confirm and cancel addresses filter on. Build against the plain authorize address instead.
5148pub async fn post_commerce_store_by_storeid_checkout_paypal_pay(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidCheckoutPaypalPayError>> {
5149    // add a prefix to parameters to efficiently prevent name collisions
5150    let p_storeid = storeid;
5151
5152    let uri_str = format!("{}/v1/commerce/store/{storeid}/checkout/paypal/pay", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
5153    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5154
5155    if let Some(ref user_agent) = configuration.user_agent {
5156        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5157    }
5158    if let Some(ref token) = configuration.bearer_access_token {
5159        req_builder = req_builder.bearer_auth(token.to_owned());
5160    };
5161
5162    let req = req_builder.build()?;
5163    let resp = configuration.client.execute(req).await?;
5164
5165    let status = resp.status();
5166
5167    if !status.is_client_error() && !status.is_server_error() {
5168        Ok(())
5169    } else {
5170        let content = resp.text().await?;
5171        let entity: Option<PostCommerceStoreByStoreidCheckoutPaypalPayError> = serde_json::from_str(&content).ok();
5172        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5173    }
5174}
5175
5176/// Creates the override and answers the store's ENTIRE listing map at 201 with a Location header — not just the entry that was added. A key already present is refused 400: creation never silently overwrites, so changing an existing listing has to be an explicit replace. The stored listing has its currency stamped from the store's own, which the replace path does not do. The key is matched exactly here, with none of the slug or SKU fallback the read allows. Admin-gated and resolved inside the caller org's namespace.
5177pub async fn post_commerce_store_by_storeid_listing_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<PostCommerceStoreByStoreidListingByKeyError>> {
5178    // add a prefix to parameters to efficiently prevent name collisions
5179    let p_storeid = storeid;
5180    let p_key = key;
5181
5182    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
5183    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5184
5185    if let Some(ref user_agent) = configuration.user_agent {
5186        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5187    }
5188    if let Some(ref token) = configuration.bearer_access_token {
5189        req_builder = req_builder.bearer_auth(token.to_owned());
5190    };
5191
5192    let req = req_builder.build()?;
5193    let resp = configuration.client.execute(req).await?;
5194
5195    let status = resp.status();
5196
5197    if !status.is_client_error() && !status.is_server_error() {
5198        Ok(())
5199    } else {
5200        let content = resp.text().await?;
5201        let entity: Option<PostCommerceStoreByStoreidListingByKeyError> = serde_json::from_str(&content).ok();
5202        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5203    }
5204}
5205
5206/// Intended to void the payments carrying the given pay key, stamp them cancelled and cancel the order, it never reaches that work: the shared checkout handler reads its order from an ORDER ID path parameter this route does not carry, leaving an untyped order that the cancel dispatch refuses with 400 before the pay key lookup runs. Authentication, namespacing and store resolution happen ahead of the refusal, so a missing token is 401 and an unloadable store 500. Cancelling a real PayPal authorization needs an address that carries the order id.
5207pub async fn post_commerce_store_by_storeid_paypal_cancel_by_paykey(configuration: &configuration::Configuration, storeid: &str, pay_key: &str) -> Result<(), Error<PostCommerceStoreByStoreidPaypalCancelByPaykeyError>> {
5208    // add a prefix to parameters to efficiently prevent name collisions
5209    let p_storeid = storeid;
5210    let p_pay_key = pay_key;
5211
5212    let uri_str = format!("{}/v1/commerce/store/{storeid}/paypal/cancel/{payKey}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), payKey=crate::apis::urlencode(p_pay_key));
5213    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5214
5215    if let Some(ref user_agent) = configuration.user_agent {
5216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5217    }
5218    if let Some(ref token) = configuration.bearer_access_token {
5219        req_builder = req_builder.bearer_auth(token.to_owned());
5220    };
5221
5222    let req = req_builder.build()?;
5223    let resp = configuration.client.execute(req).await?;
5224
5225    let status = resp.status();
5226
5227    if !status.is_client_error() && !status.is_server_error() {
5228        Ok(())
5229    } else {
5230        let content = resp.text().await?;
5231        let entity: Option<PostCommerceStoreByStoreidPaypalCancelByPaykeyError> = serde_json::from_str(&content).ok();
5232        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5233    }
5234}
5235
5236/// Intended to mark every payment carrying the given pay key as paid and flip the order to paid, it cannot do that from this address and does not pretend to: the shared checkout handler resolves its order from an ORDER ID path parameter that this route does not carry, so it always works against a fresh untyped order and the confirm dispatch refuses it with 400 before the pay key is ever queried. The token gate, the namespace and the store lookup all run ahead of that, so a missing token is still 401 and an unloadable store still 500. Drive a PayPal return through an address that carries the order id.
5237pub async fn post_commerce_store_by_storeid_paypal_confirm_by_paykey(configuration: &configuration::Configuration, storeid: &str, pay_key: &str) -> Result<(), Error<PostCommerceStoreByStoreidPaypalConfirmByPaykeyError>> {
5238    // add a prefix to parameters to efficiently prevent name collisions
5239    let p_storeid = storeid;
5240    let p_pay_key = pay_key;
5241
5242    let uri_str = format!("{}/v1/commerce/store/{storeid}/paypal/confirm/{payKey}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), payKey=crate::apis::urlencode(p_pay_key));
5243    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5244
5245    if let Some(ref user_agent) = configuration.user_agent {
5246        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5247    }
5248    if let Some(ref token) = configuration.bearer_access_token {
5249        req_builder = req_builder.bearer_auth(token.to_owned());
5250    };
5251
5252    let req = req_builder.build()?;
5253    let resp = configuration.client.execute(req).await?;
5254
5255    let status = resp.status();
5256
5257    if !status.is_client_error() && !status.is_server_error() {
5258        Ok(())
5259    } else {
5260        let content = resp.text().await?;
5261        let entity: Option<PostCommerceStoreByStoreidPaypalConfirmByPaykeyError> = serde_json::from_str(&content).ok();
5262        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5263    }
5264}
5265
5266/// Runs the ordinary store authorize flow — the route binds that very handler, so the body, the store resolution, the tally, the reservations and the failure behaviour are the authorize address's, unchanged. It reaches PayPal only when the body's payment type says so; nothing about this path forces the processor, so a card-typed payment posted here authorizes on the card processor instead. A successful PayPal authorization stamps a pay key onto the payment, which is the key the confirm and cancel addresses filter on. It is the older entry point; the plain authorize address is the one to build against.
5267pub async fn post_commerce_store_by_storeid_paypal_pay(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidPaypalPayError>> {
5268    // add a prefix to parameters to efficiently prevent name collisions
5269    let p_storeid = storeid;
5270
5271    let uri_str = format!("{}/v1/commerce/store/{storeid}/paypal/pay", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
5272    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5273
5274    if let Some(ref user_agent) = configuration.user_agent {
5275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5276    }
5277    if let Some(ref token) = configuration.bearer_access_token {
5278        req_builder = req_builder.bearer_auth(token.to_owned());
5279    };
5280
5281    let req = req_builder.build()?;
5282    let resp = configuration.client.execute(req).await?;
5283
5284    let status = resp.status();
5285
5286    if !status.is_client_error() && !status.is_server_error() {
5287        Ok(())
5288    } else {
5289        let content = resp.text().await?;
5290        let entity: Option<PostCommerceStoreByStoreidPaypalPayError> = serde_json::from_str(&content).ok();
5291        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5292    }
5293}
5294
5295/// Creates a trialing subscription for the addressed store on the entry plan and grants that plan's trial credit, answering 201 when this call actually started one and 200 with a reason otherwise — not_new when the store already has billing history, trial_not_configured when no entry plan is wired. The window is always the SEVEN-DAY no-card trial, because this address never presents a card; the longer card-present window is reached only by adding a card afterwards. Entitlement is per store while the billing subject is the org, so every store an org owns takes its own trial. Admin-gated and namespaced to the caller's org: no resolvable store is 404 with store_required, and a backing-store failure is 503.
5296pub async fn post_commerce_store_by_storeid_trial(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PostCommerceStoreByStoreidTrialError>> {
5297    // add a prefix to parameters to efficiently prevent name collisions
5298    let p_storeid = storeid;
5299
5300    let uri_str = format!("{}/v1/commerce/store/{storeid}/trial", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
5301    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5302
5303    if let Some(ref user_agent) = configuration.user_agent {
5304        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5305    }
5306    if let Some(ref token) = configuration.bearer_access_token {
5307        req_builder = req_builder.bearer_auth(token.to_owned());
5308    };
5309
5310    let req = req_builder.build()?;
5311    let resp = configuration.client.execute(req).await?;
5312
5313    let status = resp.status();
5314
5315    if !status.is_client_error() && !status.is_server_error() {
5316        Ok(())
5317    } else {
5318        let content = resp.text().await?;
5319        let entity: Option<PostCommerceStoreByStoreidTrialError> = serde_json::from_str(&content).ok();
5320        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5321    }
5322}
5323
5324/// Answers a freshly minted token carrying ONLY the published-read permission — enough for a logged-out shopper's storefront to read your published catalog and nothing more, with no write and no admin scope. It is org-bound, signed with the org's own secret and subject to the org id, so unlike a shared service token it can never act on another tenant. Minting ROTATES rather than accumulates: the previous storefront token is dropped first and is invalid immediately, so re-minting is how you revoke. Admin is enforced by the handler as well as the route, because the route's token gate does not apply on the identity path and a plain member must not be able to mint their org's key.
5325pub async fn post_commerce_store_token(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceStoreTokenError>> {
5326
5327    let uri_str = format!("{}/v1/commerce/store/token", configuration.base_path);
5328    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5329
5330    if let Some(ref user_agent) = configuration.user_agent {
5331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5332    }
5333    if let Some(ref token) = configuration.bearer_access_token {
5334        req_builder = req_builder.bearer_auth(token.to_owned());
5335    };
5336
5337    let req = req_builder.build()?;
5338    let resp = configuration.client.execute(req).await?;
5339
5340    let status = resp.status();
5341
5342    if !status.is_client_error() && !status.is_server_error() {
5343        Ok(())
5344    } else {
5345        let content = resp.text().await?;
5346        let entity: Option<PostCommerceStoreTokenError> = serde_json::from_str(&content).ok();
5347        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5348    }
5349}
5350
5351/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5352pub async fn post_commerce_submission(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceSubmissionError>> {
5353
5354    let uri_str = format!("{}/v1/commerce/submission/", configuration.base_path);
5355    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5356
5357    if let Some(ref user_agent) = configuration.user_agent {
5358        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5359    }
5360    if let Some(ref token) = configuration.bearer_access_token {
5361        req_builder = req_builder.bearer_auth(token.to_owned());
5362    };
5363
5364    let req = req_builder.build()?;
5365    let resp = configuration.client.execute(req).await?;
5366
5367    let status = resp.status();
5368
5369    if !status.is_client_error() && !status.is_server_error() {
5370        Ok(())
5371    } else {
5372        let content = resp.text().await?;
5373        let entity: Option<PostCommerceSubmissionError> = serde_json::from_str(&content).ok();
5374        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5375    }
5376}
5377
5378/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
5379pub async fn post_commerce_submission_by_submissionid(configuration: &configuration::Configuration, submissionid: &str) -> Result<(), Error<PostCommerceSubmissionBySubmissionidError>> {
5380    // add a prefix to parameters to efficiently prevent name collisions
5381    let p_submissionid = submissionid;
5382
5383    let uri_str = format!("{}/v1/commerce/submission/{submissionid}", configuration.base_path, submissionid=crate::apis::urlencode(p_submissionid));
5384    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5385
5386    if let Some(ref user_agent) = configuration.user_agent {
5387        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5388    }
5389    if let Some(ref token) = configuration.bearer_access_token {
5390        req_builder = req_builder.bearer_auth(token.to_owned());
5391    };
5392
5393    let req = req_builder.build()?;
5394    let resp = configuration.client.execute(req).await?;
5395
5396    let status = resp.status();
5397
5398    if !status.is_client_error() && !status.is_server_error() {
5399        Ok(())
5400    } else {
5401        let content = resp.text().await?;
5402        let entity: Option<PostCommerceSubmissionBySubmissionidError> = serde_json::from_str(&content).ok();
5403        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5404    }
5405}
5406
5407/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The token must also carry Admin or WriteSubscriber.
5408pub async fn post_commerce_subscriber(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceSubscriberError>> {
5409
5410    let uri_str = format!("{}/v1/commerce/subscriber/", configuration.base_path);
5411    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5412
5413    if let Some(ref user_agent) = configuration.user_agent {
5414        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5415    }
5416    if let Some(ref token) = configuration.bearer_access_token {
5417        req_builder = req_builder.bearer_auth(token.to_owned());
5418    };
5419
5420    let req = req_builder.build()?;
5421    let resp = configuration.client.execute(req).await?;
5422
5423    let status = resp.status();
5424
5425    if !status.is_client_error() && !status.is_server_error() {
5426        Ok(())
5427    } else {
5428        let content = resp.text().await?;
5429        let entity: Option<PostCommerceSubscriberError> = serde_json::from_str(&content).ok();
5430        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5431    }
5432}
5433
5434/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
5435pub async fn post_commerce_subscriber_by_subscriberid(configuration: &configuration::Configuration, subscriberid: &str) -> Result<(), Error<PostCommerceSubscriberBySubscriberidError>> {
5436    // add a prefix to parameters to efficiently prevent name collisions
5437    let p_subscriberid = subscriberid;
5438
5439    let uri_str = format!("{}/v1/commerce/subscriber/{subscriberid}", configuration.base_path, subscriberid=crate::apis::urlencode(p_subscriberid));
5440    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5441
5442    if let Some(ref user_agent) = configuration.user_agent {
5443        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5444    }
5445    if let Some(ref token) = configuration.bearer_access_token {
5446        req_builder = req_builder.bearer_auth(token.to_owned());
5447    };
5448
5449    let req = req_builder.build()?;
5450    let resp = configuration.client.execute(req).await?;
5451
5452    let status = resp.status();
5453
5454    if !status.is_client_error() && !status.is_server_error() {
5455        Ok(())
5456    } else {
5457        let content = resp.text().await?;
5458        let entity: Option<PostCommerceSubscriberBySubscriberidError> = serde_json::from_str(&content).ok();
5459        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5460    }
5461}
5462
5463/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5464pub async fn post_commerce_tokentransaction(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceTokentransactionError>> {
5465
5466    let uri_str = format!("{}/v1/commerce/tokentransaction/", configuration.base_path);
5467    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5468
5469    if let Some(ref user_agent) = configuration.user_agent {
5470        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5471    }
5472    if let Some(ref token) = configuration.bearer_access_token {
5473        req_builder = req_builder.bearer_auth(token.to_owned());
5474    };
5475
5476    let req = req_builder.build()?;
5477    let resp = configuration.client.execute(req).await?;
5478
5479    let status = resp.status();
5480
5481    if !status.is_client_error() && !status.is_server_error() {
5482        Ok(())
5483    } else {
5484        let content = resp.text().await?;
5485        let entity: Option<PostCommerceTokentransactionError> = serde_json::from_str(&content).ok();
5486        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5487    }
5488}
5489
5490/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
5491pub async fn post_commerce_tokentransaction_by_tokentransactionid(configuration: &configuration::Configuration, tokentransactionid: &str) -> Result<(), Error<PostCommerceTokentransactionByTokentransactionidError>> {
5492    // add a prefix to parameters to efficiently prevent name collisions
5493    let p_tokentransactionid = tokentransactionid;
5494
5495    let uri_str = format!("{}/v1/commerce/tokentransaction/{tokentransactionid}", configuration.base_path, tokentransactionid=crate::apis::urlencode(p_tokentransactionid));
5496    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5497
5498    if let Some(ref user_agent) = configuration.user_agent {
5499        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5500    }
5501    if let Some(ref token) = configuration.bearer_access_token {
5502        req_builder = req_builder.bearer_auth(token.to_owned());
5503    };
5504
5505    let req = req_builder.build()?;
5506    let resp = configuration.client.execute(req).await?;
5507
5508    let status = resp.status();
5509
5510    if !status.is_client_error() && !status.is_server_error() {
5511        Ok(())
5512    } else {
5513        let content = resp.text().await?;
5514        let entity: Option<PostCommerceTokentransactionByTokentransactionidError> = serde_json::from_str(&content).ok();
5515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5516    }
5517}
5518
5519/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5520pub async fn post_commerce_transfer(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceTransferError>> {
5521
5522    let uri_str = format!("{}/v1/commerce/transfer/", configuration.base_path);
5523    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5524
5525    if let Some(ref user_agent) = configuration.user_agent {
5526        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5527    }
5528    if let Some(ref token) = configuration.bearer_access_token {
5529        req_builder = req_builder.bearer_auth(token.to_owned());
5530    };
5531
5532    let req = req_builder.build()?;
5533    let resp = configuration.client.execute(req).await?;
5534
5535    let status = resp.status();
5536
5537    if !status.is_client_error() && !status.is_server_error() {
5538        Ok(())
5539    } else {
5540        let content = resp.text().await?;
5541        let entity: Option<PostCommerceTransferError> = serde_json::from_str(&content).ok();
5542        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5543    }
5544}
5545
5546/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
5547pub async fn post_commerce_transfer_by_transferid(configuration: &configuration::Configuration, transferid: &str) -> Result<(), Error<PostCommerceTransferByTransferidError>> {
5548    // add a prefix to parameters to efficiently prevent name collisions
5549    let p_transferid = transferid;
5550
5551    let uri_str = format!("{}/v1/commerce/transfer/{transferid}", configuration.base_path, transferid=crate::apis::urlencode(p_transferid));
5552    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5553
5554    if let Some(ref user_agent) = configuration.user_agent {
5555        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5556    }
5557    if let Some(ref token) = configuration.bearer_access_token {
5558        req_builder = req_builder.bearer_auth(token.to_owned());
5559    };
5560
5561    let req = req_builder.build()?;
5562    let resp = configuration.client.execute(req).await?;
5563
5564    let status = resp.status();
5565
5566    if !status.is_client_error() && !status.is_server_error() {
5567        Ok(())
5568    } else {
5569        let content = resp.text().await?;
5570        let entity: Option<PostCommerceTransferByTransferidError> = serde_json::from_str(&content).ok();
5571        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5572    }
5573}
5574
5575/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteVariant.
5576pub async fn post_commerce_variant(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceVariantError>> {
5577
5578    let uri_str = format!("{}/v1/commerce/variant/", configuration.base_path);
5579    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5580
5581    if let Some(ref user_agent) = configuration.user_agent {
5582        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5583    }
5584    if let Some(ref token) = configuration.bearer_access_token {
5585        req_builder = req_builder.bearer_auth(token.to_owned());
5586    };
5587
5588    let req = req_builder.build()?;
5589    let resp = configuration.client.execute(req).await?;
5590
5591    let status = resp.status();
5592
5593    if !status.is_client_error() && !status.is_server_error() {
5594        Ok(())
5595    } else {
5596        let content = resp.text().await?;
5597        let entity: Option<PostCommerceVariantError> = serde_json::from_str(&content).ok();
5598        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5599    }
5600}
5601
5602/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
5603pub async fn post_commerce_variant_by_variantid(configuration: &configuration::Configuration, variantid: &str) -> Result<(), Error<PostCommerceVariantByVariantidError>> {
5604    // add a prefix to parameters to efficiently prevent name collisions
5605    let p_variantid = variantid;
5606
5607    let uri_str = format!("{}/v1/commerce/variant/{variantid}", configuration.base_path, variantid=crate::apis::urlencode(p_variantid));
5608    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5609
5610    if let Some(ref user_agent) = configuration.user_agent {
5611        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5612    }
5613    if let Some(ref token) = configuration.bearer_access_token {
5614        req_builder = req_builder.bearer_auth(token.to_owned());
5615    };
5616
5617    let req = req_builder.build()?;
5618    let resp = configuration.client.execute(req).await?;
5619
5620    let status = resp.status();
5621
5622    if !status.is_client_error() && !status.is_server_error() {
5623        Ok(())
5624    } else {
5625        let content = resp.text().await?;
5626        let entity: Option<PostCommerceVariantByVariantidError> = serde_json::from_str(&content).ok();
5627        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5628    }
5629}
5630
5631/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5632pub async fn post_commerce_wallet(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceWalletError>> {
5633
5634    let uri_str = format!("{}/v1/commerce/wallet/", configuration.base_path);
5635    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5636
5637    if let Some(ref user_agent) = configuration.user_agent {
5638        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5639    }
5640    if let Some(ref token) = configuration.bearer_access_token {
5641        req_builder = req_builder.bearer_auth(token.to_owned());
5642    };
5643
5644    let req = req_builder.build()?;
5645    let resp = configuration.client.execute(req).await?;
5646
5647    let status = resp.status();
5648
5649    if !status.is_client_error() && !status.is_server_error() {
5650        Ok(())
5651    } else {
5652        let content = resp.text().await?;
5653        let entity: Option<PostCommerceWalletError> = serde_json::from_str(&content).ok();
5654        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5655    }
5656}
5657
5658/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
5659pub async fn post_commerce_wallet_by_walletid(configuration: &configuration::Configuration, walletid: &str) -> Result<(), Error<PostCommerceWalletByWalletidError>> {
5660    // add a prefix to parameters to efficiently prevent name collisions
5661    let p_walletid = walletid;
5662
5663    let uri_str = format!("{}/v1/commerce/wallet/{walletid}", configuration.base_path, walletid=crate::apis::urlencode(p_walletid));
5664    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5665
5666    if let Some(ref user_agent) = configuration.user_agent {
5667        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5668    }
5669    if let Some(ref token) = configuration.bearer_access_token {
5670        req_builder = req_builder.bearer_auth(token.to_owned());
5671    };
5672
5673    let req = req_builder.build()?;
5674    let resp = configuration.client.execute(req).await?;
5675
5676    let status = resp.status();
5677
5678    if !status.is_client_error() && !status.is_server_error() {
5679        Ok(())
5680    } else {
5681        let content = resp.text().await?;
5682        let entity: Option<PostCommerceWalletByWalletidError> = serde_json::from_str(&content).ok();
5683        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5684    }
5685}
5686
5687/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5688pub async fn post_commerce_watchlist(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceWatchlistError>> {
5689
5690    let uri_str = format!("{}/v1/commerce/watchlist/", configuration.base_path);
5691    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5692
5693    if let Some(ref user_agent) = configuration.user_agent {
5694        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5695    }
5696    if let Some(ref token) = configuration.bearer_access_token {
5697        req_builder = req_builder.bearer_auth(token.to_owned());
5698    };
5699
5700    let req = req_builder.build()?;
5701    let resp = configuration.client.execute(req).await?;
5702
5703    let status = resp.status();
5704
5705    if !status.is_client_error() && !status.is_server_error() {
5706        Ok(())
5707    } else {
5708        let content = resp.text().await?;
5709        let entity: Option<PostCommerceWatchlistError> = serde_json::from_str(&content).ok();
5710        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5711    }
5712}
5713
5714/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
5715pub async fn post_commerce_watchlist_by_watchlistid(configuration: &configuration::Configuration, watchlistid: &str) -> Result<(), Error<PostCommerceWatchlistByWatchlistidError>> {
5716    // add a prefix to parameters to efficiently prevent name collisions
5717    let p_watchlistid = watchlistid;
5718
5719    let uri_str = format!("{}/v1/commerce/watchlist/{watchlistid}", configuration.base_path, watchlistid=crate::apis::urlencode(p_watchlistid));
5720    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5721
5722    if let Some(ref user_agent) = configuration.user_agent {
5723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5724    }
5725    if let Some(ref token) = configuration.bearer_access_token {
5726        req_builder = req_builder.bearer_auth(token.to_owned());
5727    };
5728
5729    let req = req_builder.build()?;
5730    let resp = configuration.client.execute(req).await?;
5731
5732    let status = resp.status();
5733
5734    if !status.is_client_error() && !status.is_server_error() {
5735        Ok(())
5736    } else {
5737        let content = resp.text().await?;
5738        let entity: Option<PostCommerceWatchlistByWatchlistidError> = serde_json::from_str(&content).ok();
5739        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5740    }
5741}
5742
5743/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5744pub async fn post_commerce_webhook(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCommerceWebhookError>> {
5745
5746    let uri_str = format!("{}/v1/commerce/webhook/", configuration.base_path);
5747    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5748
5749    if let Some(ref user_agent) = configuration.user_agent {
5750        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5751    }
5752    if let Some(ref token) = configuration.bearer_access_token {
5753        req_builder = req_builder.bearer_auth(token.to_owned());
5754    };
5755
5756    let req = req_builder.build()?;
5757    let resp = configuration.client.execute(req).await?;
5758
5759    let status = resp.status();
5760
5761    if !status.is_client_error() && !status.is_server_error() {
5762        Ok(())
5763    } else {
5764        let content = resp.text().await?;
5765        let entity: Option<PostCommerceWebhookError> = serde_json::from_str(&content).ok();
5766        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5767    }
5768}
5769
5770/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
5771pub async fn post_commerce_webhook_by_webhookid(configuration: &configuration::Configuration, webhookid: &str) -> Result<(), Error<PostCommerceWebhookByWebhookidError>> {
5772    // add a prefix to parameters to efficiently prevent name collisions
5773    let p_webhookid = webhookid;
5774
5775    let uri_str = format!("{}/v1/commerce/webhook/{webhookid}", configuration.base_path, webhookid=crate::apis::urlencode(p_webhookid));
5776    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5777
5778    if let Some(ref user_agent) = configuration.user_agent {
5779        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5780    }
5781    if let Some(ref token) = configuration.bearer_access_token {
5782        req_builder = req_builder.bearer_auth(token.to_owned());
5783    };
5784
5785    let req = req_builder.build()?;
5786    let resp = configuration.client.execute(req).await?;
5787
5788    let status = resp.status();
5789
5790    if !status.is_client_error() && !status.is_server_error() {
5791        Ok(())
5792    } else {
5793        let content = resp.text().await?;
5794        let entity: Option<PostCommerceWebhookByWebhookidError> = serde_json::from_str(&content).ok();
5795        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5796    }
5797}
5798
5799/// Accepts a payment provider's event, verifies it, records it for audit, and applies subscription lifecycle changes to the matching local row. There is no bearer here and there cannot be: the provider's SIGNATURE over the body IS the authentication, so a request with no recognized signature header is 400 and one whose signature does not verify is 401. The provider path segment is only a hint for dashboard configuration — verification picks the processor regardless of what the URL says. Redelivery is safe: an event id already recorded is acknowledged as a duplicate without re-applying any side effect, which matters because providers retry for days until they see a 2xx.
5800pub async fn post_commerce_webhooks_by_provider(configuration: &configuration::Configuration, provider: &str) -> Result<(), Error<PostCommerceWebhooksByProviderError>> {
5801    // add a prefix to parameters to efficiently prevent name collisions
5802    let p_provider = provider;
5803
5804    let uri_str = format!("{}/v1/commerce/webhooks/{provider}", configuration.base_path, provider=crate::apis::urlencode(p_provider));
5805    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5806
5807    if let Some(ref user_agent) = configuration.user_agent {
5808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5809    }
5810    if let Some(ref token) = configuration.bearer_access_token {
5811        req_builder = req_builder.bearer_auth(token.to_owned());
5812    };
5813
5814    let req = req_builder.build()?;
5815    let resp = configuration.client.execute(req).await?;
5816
5817    let status = resp.status();
5818
5819    if !status.is_client_error() && !status.is_server_error() {
5820        Ok(())
5821    } else {
5822        let content = resp.text().await?;
5823        let entity: Option<PostCommerceWebhooksByProviderError> = serde_json::from_str(&content).ok();
5824        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5825    }
5826}
5827
5828/// A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadCollection and WriteCollection together.
5829pub async fn put_commerce_collection_by_collectionid(configuration: &configuration::Configuration, collectionid: &str) -> Result<(), Error<PutCommerceCollectionByCollectionidError>> {
5830    // add a prefix to parameters to efficiently prevent name collisions
5831    let p_collectionid = collectionid;
5832
5833    let uri_str = format!("{}/v1/commerce/collection/{collectionid}", configuration.base_path, collectionid=crate::apis::urlencode(p_collectionid));
5834    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5835
5836    if let Some(ref user_agent) = configuration.user_agent {
5837        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5838    }
5839    if let Some(ref token) = configuration.bearer_access_token {
5840        req_builder = req_builder.bearer_auth(token.to_owned());
5841    };
5842
5843    let req = req_builder.build()?;
5844    let resp = configuration.client.execute(req).await?;
5845
5846    let status = resp.status();
5847
5848    if !status.is_client_error() && !status.is_server_error() {
5849        Ok(())
5850    } else {
5851        let content = resp.text().await?;
5852        let entity: Option<PutCommerceCollectionByCollectionidError> = serde_json::from_str(&content).ok();
5853        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5854    }
5855}
5856
5857/// A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5858pub async fn put_commerce_disclosure_by_disclosureid(configuration: &configuration::Configuration, disclosureid: &str) -> Result<(), Error<PutCommerceDisclosureByDisclosureidError>> {
5859    // add a prefix to parameters to efficiently prevent name collisions
5860    let p_disclosureid = disclosureid;
5861
5862    let uri_str = format!("{}/v1/commerce/disclosure/{disclosureid}", configuration.base_path, disclosureid=crate::apis::urlencode(p_disclosureid));
5863    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5864
5865    if let Some(ref user_agent) = configuration.user_agent {
5866        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5867    }
5868    if let Some(ref token) = configuration.bearer_access_token {
5869        req_builder = req_builder.bearer_auth(token.to_owned());
5870    };
5871
5872    let req = req_builder.build()?;
5873    let resp = configuration.client.execute(req).await?;
5874
5875    let status = resp.status();
5876
5877    if !status.is_client_error() && !status.is_server_error() {
5878        Ok(())
5879    } else {
5880        let content = resp.text().await?;
5881        let entity: Option<PutCommerceDisclosureByDisclosureidError> = serde_json::from_str(&content).ok();
5882        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5883    }
5884}
5885
5886/// A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5887pub async fn put_commerce_discount_by_discountid(configuration: &configuration::Configuration, discountid: &str) -> Result<(), Error<PutCommerceDiscountByDiscountidError>> {
5888    // add a prefix to parameters to efficiently prevent name collisions
5889    let p_discountid = discountid;
5890
5891    let uri_str = format!("{}/v1/commerce/discount/{discountid}", configuration.base_path, discountid=crate::apis::urlencode(p_discountid));
5892    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5893
5894    if let Some(ref user_agent) = configuration.user_agent {
5895        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5896    }
5897    if let Some(ref token) = configuration.bearer_access_token {
5898        req_builder = req_builder.bearer_auth(token.to_owned());
5899    };
5900
5901    let req = req_builder.build()?;
5902    let resp = configuration.client.execute(req).await?;
5903
5904    let status = resp.status();
5905
5906    if !status.is_client_error() && !status.is_server_error() {
5907        Ok(())
5908    } else {
5909        let content = resp.text().await?;
5910        let entity: Option<PutCommerceDiscountByDiscountidError> = serde_json::from_str(&content).ok();
5911        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5912    }
5913}
5914
5915/// A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5916pub async fn put_commerce_movie_by_movieid(configuration: &configuration::Configuration, movieid: &str) -> Result<(), Error<PutCommerceMovieByMovieidError>> {
5917    // add a prefix to parameters to efficiently prevent name collisions
5918    let p_movieid = movieid;
5919
5920    let uri_str = format!("{}/v1/commerce/movie/{movieid}", configuration.base_path, movieid=crate::apis::urlencode(p_movieid));
5921    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5922
5923    if let Some(ref user_agent) = configuration.user_agent {
5924        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5925    }
5926    if let Some(ref token) = configuration.bearer_access_token {
5927        req_builder = req_builder.bearer_auth(token.to_owned());
5928    };
5929
5930    let req = req_builder.build()?;
5931    let resp = configuration.client.execute(req).await?;
5932
5933    let status = resp.status();
5934
5935    if !status.is_client_error() && !status.is_server_error() {
5936        Ok(())
5937    } else {
5938        let content = resp.text().await?;
5939        let entity: Option<PutCommerceMovieByMovieidError> = serde_json::from_str(&content).ok();
5940        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5941    }
5942}
5943
5944/// A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
5945pub async fn put_commerce_note_by_noteid(configuration: &configuration::Configuration, noteid: &str) -> Result<(), Error<PutCommerceNoteByNoteidError>> {
5946    // add a prefix to parameters to efficiently prevent name collisions
5947    let p_noteid = noteid;
5948
5949    let uri_str = format!("{}/v1/commerce/note/{noteid}", configuration.base_path, noteid=crate::apis::urlencode(p_noteid));
5950    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5951
5952    if let Some(ref user_agent) = configuration.user_agent {
5953        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5954    }
5955    if let Some(ref token) = configuration.bearer_access_token {
5956        req_builder = req_builder.bearer_auth(token.to_owned());
5957    };
5958
5959    let req = req_builder.build()?;
5960    let resp = configuration.client.execute(req).await?;
5961
5962    let status = resp.status();
5963
5964    if !status.is_client_error() && !status.is_server_error() {
5965        Ok(())
5966    } else {
5967        let content = resp.text().await?;
5968        let entity: Option<PutCommerceNoteByNoteidError> = serde_json::from_str(&content).ok();
5969        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5970    }
5971}
5972
5973/// Loads the addressed plan, applies the body over it and answers the stored result, so a partial edit never silently zeroes a price or the contact-sales flag. The slug is IMMUTABLE: a body naming a different slug is rejected outright before anything is written, because a rename would orphan every subscription that stored the old id — deprecate and create instead. An admin edit marks the row authoritative so the seed stops correcting it. PLATFORM admin only; an unknown slug is 404.
5974pub async fn put_commerce_plans_entries_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<PutCommercePlansEntriesBySlugError>> {
5975    // add a prefix to parameters to efficiently prevent name collisions
5976    let p_slug = slug;
5977
5978    let uri_str = format!("{}/v1/commerce/plans/entries/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
5979    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5980
5981    if let Some(ref user_agent) = configuration.user_agent {
5982        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5983    }
5984    if let Some(ref token) = configuration.bearer_access_token {
5985        req_builder = req_builder.bearer_auth(token.to_owned());
5986    };
5987
5988    let req = req_builder.build()?;
5989    let resp = configuration.client.execute(req).await?;
5990
5991    let status = resp.status();
5992
5993    if !status.is_client_error() && !status.is_server_error() {
5994        Ok(())
5995    } else {
5996        let content = resp.text().await?;
5997        let entity: Option<PutCommercePlansEntriesBySlugError> = serde_json::from_str(&content).ok();
5998        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5999    }
6000}
6001
6002/// A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadProduct and WriteProduct together.
6003pub async fn put_commerce_product_by_productid(configuration: &configuration::Configuration, productid: &str) -> Result<(), Error<PutCommerceProductByProductidError>> {
6004    // add a prefix to parameters to efficiently prevent name collisions
6005    let p_productid = productid;
6006
6007    let uri_str = format!("{}/v1/commerce/product/{productid}", configuration.base_path, productid=crate::apis::urlencode(p_productid));
6008    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6009
6010    if let Some(ref user_agent) = configuration.user_agent {
6011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6012    }
6013    if let Some(ref token) = configuration.bearer_access_token {
6014        req_builder = req_builder.bearer_auth(token.to_owned());
6015    };
6016
6017    let req = req_builder.build()?;
6018    let resp = configuration.client.execute(req).await?;
6019
6020    let status = resp.status();
6021
6022    if !status.is_client_error() && !status.is_server_error() {
6023        Ok(())
6024    } else {
6025        let content = resp.text().await?;
6026        let entity: Option<PutCommerceProductByProductidError> = serde_json::from_str(&content).ok();
6027        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6028    }
6029}
6030
6031/// Edits one rate and MARKS it edited, which is the whole contract with the importer: an operator's price outranks the document it came from, so a later import leaves this row alone. Without that mark a price set here would apply, work, and silently revert on the next import. Only the editable fields move; identity and bookkeeping are not writable from the body. SuperAdmin only.
6032pub async fn put_commerce_rates_entries_by_product_by_meter(configuration: &configuration::Configuration, product: &str, meter: &str) -> Result<(), Error<PutCommerceRatesEntriesByProductByMeterError>> {
6033    // add a prefix to parameters to efficiently prevent name collisions
6034    let p_product = product;
6035    let p_meter = meter;
6036
6037    let uri_str = format!("{}/v1/commerce/rates/entries/{product}/{meter}", configuration.base_path, product=crate::apis::urlencode(p_product), meter=crate::apis::urlencode(p_meter));
6038    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6039
6040    if let Some(ref user_agent) = configuration.user_agent {
6041        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6042    }
6043    if let Some(ref token) = configuration.bearer_access_token {
6044        req_builder = req_builder.bearer_auth(token.to_owned());
6045    };
6046
6047    let req = req_builder.build()?;
6048    let resp = configuration.client.execute(req).await?;
6049
6050    let status = resp.status();
6051
6052    if !status.is_client_error() && !status.is_server_error() {
6053        Ok(())
6054    } else {
6055        let content = resp.text().await?;
6056        let entity: Option<PutCommerceRatesEntriesByProductByMeterError> = serde_json::from_str(&content).ok();
6057        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6058    }
6059}
6060
6061/// A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The token must also carry Admin, or ReadReturn and WriteReturn together.
6062pub async fn put_commerce_return_by_returnid(configuration: &configuration::Configuration, returnid: &str) -> Result<(), Error<PutCommerceReturnByReturnidError>> {
6063    // add a prefix to parameters to efficiently prevent name collisions
6064    let p_returnid = returnid;
6065
6066    let uri_str = format!("{}/v1/commerce/return/{returnid}", configuration.base_path, returnid=crate::apis::urlencode(p_returnid));
6067    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6068
6069    if let Some(ref user_agent) = configuration.user_agent {
6070        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6071    }
6072    if let Some(ref token) = configuration.bearer_access_token {
6073        req_builder = req_builder.bearer_auth(token.to_owned());
6074    };
6075
6076    let req = req_builder.build()?;
6077    let resp = configuration.client.execute(req).await?;
6078
6079    let status = resp.status();
6080
6081    if !status.is_client_error() && !status.is_server_error() {
6082        Ok(())
6083    } else {
6084        let content = resp.text().await?;
6085        let entity: Option<PutCommerceReturnByReturnidError> = serde_json::from_str(&content).ok();
6086        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6087    }
6088}
6089
6090/// A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6091pub async fn put_commerce_saleschannel_by_saleschannelid(configuration: &configuration::Configuration, saleschannelid: &str) -> Result<(), Error<PutCommerceSaleschannelBySaleschannelidError>> {
6092    // add a prefix to parameters to efficiently prevent name collisions
6093    let p_saleschannelid = saleschannelid;
6094
6095    let uri_str = format!("{}/v1/commerce/saleschannel/{saleschannelid}", configuration.base_path, saleschannelid=crate::apis::urlencode(p_saleschannelid));
6096    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6097
6098    if let Some(ref user_agent) = configuration.user_agent {
6099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6100    }
6101    if let Some(ref token) = configuration.bearer_access_token {
6102        req_builder = req_builder.bearer_auth(token.to_owned());
6103    };
6104
6105    let req = req_builder.build()?;
6106    let resp = configuration.client.execute(req).await?;
6107
6108    let status = resp.status();
6109
6110    if !status.is_client_error() && !status.is_server_error() {
6111        Ok(())
6112    } else {
6113        let content = resp.text().await?;
6114        let entity: Option<PutCommerceSaleschannelBySaleschannelidError> = serde_json::from_str(&content).ok();
6115        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6116    }
6117}
6118
6119/// A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6120pub async fn put_commerce_stocklocation_by_stocklocationid(configuration: &configuration::Configuration, stocklocationid: &str) -> Result<(), Error<PutCommerceStocklocationByStocklocationidError>> {
6121    // add a prefix to parameters to efficiently prevent name collisions
6122    let p_stocklocationid = stocklocationid;
6123
6124    let uri_str = format!("{}/v1/commerce/stocklocation/{stocklocationid}", configuration.base_path, stocklocationid=crate::apis::urlencode(p_stocklocationid));
6125    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6126
6127    if let Some(ref user_agent) = configuration.user_agent {
6128        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6129    }
6130    if let Some(ref token) = configuration.bearer_access_token {
6131        req_builder = req_builder.bearer_auth(token.to_owned());
6132    };
6133
6134    let req = req_builder.build()?;
6135    let resp = configuration.client.execute(req).await?;
6136
6137    let status = resp.status();
6138
6139    if !status.is_client_error() && !status.is_server_error() {
6140        Ok(())
6141    } else {
6142        let content = resp.text().await?;
6143        let entity: Option<PutCommerceStocklocationByStocklocationidError> = serde_json::from_str(&content).ok();
6144        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6145    }
6146}
6147
6148/// This is a true REPLACEMENT, not a merge: the stored key is preserved but the body is decoded onto a fresh entity, so every field the body omits is written back as its zero value. Use the partial update when you mean to change part of a store. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is a 404 before anything is written. Requires an admin token, or one holding both store read and store write.
6149pub async fn put_commerce_store_by_storeid(configuration: &configuration::Configuration, storeid: &str) -> Result<(), Error<PutCommerceStoreByStoreidError>> {
6150    // add a prefix to parameters to efficiently prevent name collisions
6151    let p_storeid = storeid;
6152
6153    let uri_str = format!("{}/v1/commerce/store/{storeid}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid));
6154    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6155
6156    if let Some(ref user_agent) = configuration.user_agent {
6157        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6158    }
6159    if let Some(ref token) = configuration.bearer_access_token {
6160        req_builder = req_builder.bearer_auth(token.to_owned());
6161    };
6162
6163    let req = req_builder.build()?;
6164    let resp = configuration.client.execute(req).await?;
6165
6166    let status = resp.status();
6167
6168    if !status.is_client_error() && !status.is_server_error() {
6169        Ok(())
6170    } else {
6171        let content = resp.text().await?;
6172        let entity: Option<PutCommerceStoreByStoreidError> = serde_json::from_str(&content).ok();
6173        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6174    }
6175}
6176
6177/// Decodes the body over the existing listing when the key is present, so fields it omits keep their stored values, and builds the listing from the body alone when the key is new. Answers 200 when it replaced something and 201 with a Location header when it created it; either way the body is the store's entire listing map, not the single entry. Unlike creation, this path does NOT restamp the listing's currency from the store. Admin-gated, with the store resolved inside the caller org's namespace.
6178pub async fn put_commerce_store_by_storeid_listing_by_key(configuration: &configuration::Configuration, storeid: &str, key: &str) -> Result<(), Error<PutCommerceStoreByStoreidListingByKeyError>> {
6179    // add a prefix to parameters to efficiently prevent name collisions
6180    let p_storeid = storeid;
6181    let p_key = key;
6182
6183    let uri_str = format!("{}/v1/commerce/store/{storeid}/listing/{key}", configuration.base_path, storeid=crate::apis::urlencode(p_storeid), key=crate::apis::urlencode(p_key));
6184    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6185
6186    if let Some(ref user_agent) = configuration.user_agent {
6187        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6188    }
6189    if let Some(ref token) = configuration.bearer_access_token {
6190        req_builder = req_builder.bearer_auth(token.to_owned());
6191    };
6192
6193    let req = req_builder.build()?;
6194    let resp = configuration.client.execute(req).await?;
6195
6196    let status = resp.status();
6197
6198    if !status.is_client_error() && !status.is_server_error() {
6199        Ok(())
6200    } else {
6201        let content = resp.text().await?;
6202        let entity: Option<PutCommerceStoreByStoreidListingByKeyError> = serde_json::from_str(&content).ok();
6203        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6204    }
6205}
6206
6207/// A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6208pub async fn put_commerce_submission_by_submissionid(configuration: &configuration::Configuration, submissionid: &str) -> Result<(), Error<PutCommerceSubmissionBySubmissionidError>> {
6209    // add a prefix to parameters to efficiently prevent name collisions
6210    let p_submissionid = submissionid;
6211
6212    let uri_str = format!("{}/v1/commerce/submission/{submissionid}", configuration.base_path, submissionid=crate::apis::urlencode(p_submissionid));
6213    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6214
6215    if let Some(ref user_agent) = configuration.user_agent {
6216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6217    }
6218    if let Some(ref token) = configuration.bearer_access_token {
6219        req_builder = req_builder.bearer_auth(token.to_owned());
6220    };
6221
6222    let req = req_builder.build()?;
6223    let resp = configuration.client.execute(req).await?;
6224
6225    let status = resp.status();
6226
6227    if !status.is_client_error() && !status.is_server_error() {
6228        Ok(())
6229    } else {
6230        let content = resp.text().await?;
6231        let entity: Option<PutCommerceSubmissionBySubmissionidError> = serde_json::from_str(&content).ok();
6232        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6233    }
6234}
6235
6236/// A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The token must also carry Admin, or ReadSubscriber and WriteSubscriber together.
6237pub async fn put_commerce_subscriber_by_subscriberid(configuration: &configuration::Configuration, subscriberid: &str) -> Result<(), Error<PutCommerceSubscriberBySubscriberidError>> {
6238    // add a prefix to parameters to efficiently prevent name collisions
6239    let p_subscriberid = subscriberid;
6240
6241    let uri_str = format!("{}/v1/commerce/subscriber/{subscriberid}", configuration.base_path, subscriberid=crate::apis::urlencode(p_subscriberid));
6242    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6243
6244    if let Some(ref user_agent) = configuration.user_agent {
6245        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6246    }
6247    if let Some(ref token) = configuration.bearer_access_token {
6248        req_builder = req_builder.bearer_auth(token.to_owned());
6249    };
6250
6251    let req = req_builder.build()?;
6252    let resp = configuration.client.execute(req).await?;
6253
6254    let status = resp.status();
6255
6256    if !status.is_client_error() && !status.is_server_error() {
6257        Ok(())
6258    } else {
6259        let content = resp.text().await?;
6260        let entity: Option<PutCommerceSubscriberBySubscriberidError> = serde_json::from_str(&content).ok();
6261        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6262    }
6263}
6264
6265/// A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6266pub async fn put_commerce_tokentransaction_by_tokentransactionid(configuration: &configuration::Configuration, tokentransactionid: &str) -> Result<(), Error<PutCommerceTokentransactionByTokentransactionidError>> {
6267    // add a prefix to parameters to efficiently prevent name collisions
6268    let p_tokentransactionid = tokentransactionid;
6269
6270    let uri_str = format!("{}/v1/commerce/tokentransaction/{tokentransactionid}", configuration.base_path, tokentransactionid=crate::apis::urlencode(p_tokentransactionid));
6271    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6272
6273    if let Some(ref user_agent) = configuration.user_agent {
6274        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6275    }
6276    if let Some(ref token) = configuration.bearer_access_token {
6277        req_builder = req_builder.bearer_auth(token.to_owned());
6278    };
6279
6280    let req = req_builder.build()?;
6281    let resp = configuration.client.execute(req).await?;
6282
6283    let status = resp.status();
6284
6285    if !status.is_client_error() && !status.is_server_error() {
6286        Ok(())
6287    } else {
6288        let content = resp.text().await?;
6289        let entity: Option<PutCommerceTokentransactionByTokentransactionidError> = serde_json::from_str(&content).ok();
6290        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6291    }
6292}
6293
6294/// A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6295pub async fn put_commerce_transfer_by_transferid(configuration: &configuration::Configuration, transferid: &str) -> Result<(), Error<PutCommerceTransferByTransferidError>> {
6296    // add a prefix to parameters to efficiently prevent name collisions
6297    let p_transferid = transferid;
6298
6299    let uri_str = format!("{}/v1/commerce/transfer/{transferid}", configuration.base_path, transferid=crate::apis::urlencode(p_transferid));
6300    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6301
6302    if let Some(ref user_agent) = configuration.user_agent {
6303        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6304    }
6305    if let Some(ref token) = configuration.bearer_access_token {
6306        req_builder = req_builder.bearer_auth(token.to_owned());
6307    };
6308
6309    let req = req_builder.build()?;
6310    let resp = configuration.client.execute(req).await?;
6311
6312    let status = resp.status();
6313
6314    if !status.is_client_error() && !status.is_server_error() {
6315        Ok(())
6316    } else {
6317        let content = resp.text().await?;
6318        let entity: Option<PutCommerceTransferByTransferidError> = serde_json::from_str(&content).ok();
6319        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6320    }
6321}
6322
6323/// A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadVariant and WriteVariant together.
6324pub async fn put_commerce_variant_by_variantid(configuration: &configuration::Configuration, variantid: &str) -> Result<(), Error<PutCommerceVariantByVariantidError>> {
6325    // add a prefix to parameters to efficiently prevent name collisions
6326    let p_variantid = variantid;
6327
6328    let uri_str = format!("{}/v1/commerce/variant/{variantid}", configuration.base_path, variantid=crate::apis::urlencode(p_variantid));
6329    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6330
6331    if let Some(ref user_agent) = configuration.user_agent {
6332        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6333    }
6334    if let Some(ref token) = configuration.bearer_access_token {
6335        req_builder = req_builder.bearer_auth(token.to_owned());
6336    };
6337
6338    let req = req_builder.build()?;
6339    let resp = configuration.client.execute(req).await?;
6340
6341    let status = resp.status();
6342
6343    if !status.is_client_error() && !status.is_server_error() {
6344        Ok(())
6345    } else {
6346        let content = resp.text().await?;
6347        let entity: Option<PutCommerceVariantByVariantidError> = serde_json::from_str(&content).ok();
6348        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6349    }
6350}
6351
6352/// A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6353pub async fn put_commerce_wallet_by_walletid(configuration: &configuration::Configuration, walletid: &str) -> Result<(), Error<PutCommerceWalletByWalletidError>> {
6354    // add a prefix to parameters to efficiently prevent name collisions
6355    let p_walletid = walletid;
6356
6357    let uri_str = format!("{}/v1/commerce/wallet/{walletid}", configuration.base_path, walletid=crate::apis::urlencode(p_walletid));
6358    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6359
6360    if let Some(ref user_agent) = configuration.user_agent {
6361        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6362    }
6363    if let Some(ref token) = configuration.bearer_access_token {
6364        req_builder = req_builder.bearer_auth(token.to_owned());
6365    };
6366
6367    let req = req_builder.build()?;
6368    let resp = configuration.client.execute(req).await?;
6369
6370    let status = resp.status();
6371
6372    if !status.is_client_error() && !status.is_server_error() {
6373        Ok(())
6374    } else {
6375        let content = resp.text().await?;
6376        let entity: Option<PutCommerceWalletByWalletidError> = serde_json::from_str(&content).ok();
6377        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6378    }
6379}
6380
6381/// A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6382pub async fn put_commerce_watchlist_by_watchlistid(configuration: &configuration::Configuration, watchlistid: &str) -> Result<(), Error<PutCommerceWatchlistByWatchlistidError>> {
6383    // add a prefix to parameters to efficiently prevent name collisions
6384    let p_watchlistid = watchlistid;
6385
6386    let uri_str = format!("{}/v1/commerce/watchlist/{watchlistid}", configuration.base_path, watchlistid=crate::apis::urlencode(p_watchlistid));
6387    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6388
6389    if let Some(ref user_agent) = configuration.user_agent {
6390        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6391    }
6392    if let Some(ref token) = configuration.bearer_access_token {
6393        req_builder = req_builder.bearer_auth(token.to_owned());
6394    };
6395
6396    let req = req_builder.build()?;
6397    let resp = configuration.client.execute(req).await?;
6398
6399    let status = resp.status();
6400
6401    if !status.is_client_error() && !status.is_server_error() {
6402        Ok(())
6403    } else {
6404        let content = resp.text().await?;
6405        let entity: Option<PutCommerceWatchlistByWatchlistidError> = serde_json::from_str(&content).ok();
6406        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6407    }
6408}
6409
6410/// A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
6411pub async fn put_commerce_webhook_by_webhookid(configuration: &configuration::Configuration, webhookid: &str) -> Result<(), Error<PutCommerceWebhookByWebhookidError>> {
6412    // add a prefix to parameters to efficiently prevent name collisions
6413    let p_webhookid = webhookid;
6414
6415    let uri_str = format!("{}/v1/commerce/webhook/{webhookid}", configuration.base_path, webhookid=crate::apis::urlencode(p_webhookid));
6416    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6417
6418    if let Some(ref user_agent) = configuration.user_agent {
6419        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6420    }
6421    if let Some(ref token) = configuration.bearer_access_token {
6422        req_builder = req_builder.bearer_auth(token.to_owned());
6423    };
6424
6425    let req = req_builder.build()?;
6426    let resp = configuration.client.execute(req).await?;
6427
6428    let status = resp.status();
6429
6430    if !status.is_client_error() && !status.is_server_error() {
6431        Ok(())
6432    } else {
6433        let content = resp.text().await?;
6434        let entity: Option<PutCommerceWebhookByWebhookidError> = serde_json::from_str(&content).ok();
6435        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6436    }
6437}
6438
6439/// Sets how many of one item a cart holds, and answers the whole updated cart.  This is the ONE way a cart's contents change. The quantity is the RESULT, not a delta: sending 3 leaves 3 however many were there before, so a retry is safe and a double-submit cannot double an order. ZERO REMOVES the line — there is deliberately no separate delete, because removal is the same act at the boundary value and a second spelling would be a second set of edge cases.  Name the item with EITHER product OR variant, never both. Prefer variant for anything sold in sizes, colours or tiers: the price and the stock belong to the variant, so a product-level line on a varianted product prices the wrong thing. Either may be given as an id or as the human key — a product's URL slug, a variant's SKU — which is what lets a storefront add to cart straight from a product page URL without a lookup first.  The item's price and name are CACHED onto the line as it is added, so the cart keeps the price the shopper was shown even if the catalog moves underneath it.  An item that resolves to nothing in the catalog is refused 400 and the cart is left exactly as it was; nothing is partially applied.  A named handler, not a closure, so zipdoc can lift this prose into the registry.
6440pub async fn set_cart_item(configuration: &configuration::Configuration, id: &str, cart_item_set: models::CartItemSet) -> Result<models::Cart, Error<SetCartItemError>> {
6441    // add a prefix to parameters to efficiently prevent name collisions
6442    let p_id = id;
6443    let p_cart_item_set = cart_item_set;
6444
6445    let uri_str = format!("{}/v1/commerce/cart/{id}/item", configuration.base_path, id=crate::apis::urlencode(p_id));
6446    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6447
6448    if let Some(ref user_agent) = configuration.user_agent {
6449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6450    }
6451    if let Some(ref token) = configuration.bearer_access_token {
6452        req_builder = req_builder.bearer_auth(token.to_owned());
6453    };
6454    req_builder = req_builder.json(&p_cart_item_set);
6455
6456    let req = req_builder.build()?;
6457    let resp = configuration.client.execute(req).await?;
6458
6459    let status = resp.status();
6460    let content_type = resp
6461        .headers()
6462        .get("content-type")
6463        .and_then(|v| v.to_str().ok())
6464        .unwrap_or("application/octet-stream");
6465    let content_type = super::ContentType::from(content_type);
6466
6467    if !status.is_client_error() && !status.is_server_error() {
6468        let content = resp.text().await?;
6469        match content_type {
6470            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6471            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Cart`"))),
6472            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Cart`")))),
6473        }
6474    } else {
6475        let content = resp.text().await?;
6476        let entity: Option<SetCartItemError> = serde_json::from_str(&content).ok();
6477        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6478    }
6479}
6480
6481/// Takes a payment: charges a single-use card token and credits the caller's org balance, exactly once.  This is the operation behind \"collect money from a customer\". It runs the SAME core the console's card top-up runs (commerce billing.TakePayment), so the server-side amount bounds, the idempotency guard and the ledger credit are shared rather than reimplemented — a second charge path would eventually double-charge somebody.  The ORG is the caller's, taken from the validated principal and never from the input, so a payment can only ever credit the account of whoever made the call.  A payment is RISK-SCREENED before the card is charged, so this can be refused without any money moving: 403 means the screen did not authorise it, and 503 means the screen could not reach a decision — that one is worth retrying, and no charge was attempted either way.  Send an idempotencyKey. An agent retries by construction, and the key is what turns a retry into a replay of the first receipt instead of a second charge.  The answer states whether it settled in SANDBOX or live mode (`test`), and carries the processor's own reference (`processorRef`) so the charge can be reconciled against the processor rather than taken on trust.  A named builder, not a closure, so zipdoc can lift this prose into the registry.  It BUILDS the handler rather than being it, because the screen has to sit inside the value every projection of this op dispatches to — see exposePayments. `charge` is the money move, `take` is the screened entry point onto it, and the only registrable one is the second.
6482pub async fn take_payment(configuration: &configuration::Configuration, payment_in: models::PaymentIn) -> Result<models::PaymentOut, Error<TakePaymentError>> {
6483    // add a prefix to parameters to efficiently prevent name collisions
6484    let p_payment_in = payment_in;
6485
6486    let uri_str = format!("{}/v1/commerce/payments", configuration.base_path);
6487    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6488
6489    if let Some(ref user_agent) = configuration.user_agent {
6490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6491    }
6492    if let Some(ref token) = configuration.bearer_access_token {
6493        req_builder = req_builder.bearer_auth(token.to_owned());
6494    };
6495    req_builder = req_builder.json(&p_payment_in);
6496
6497    let req = req_builder.build()?;
6498    let resp = configuration.client.execute(req).await?;
6499
6500    let status = resp.status();
6501    let content_type = resp
6502        .headers()
6503        .get("content-type")
6504        .and_then(|v| v.to_str().ok())
6505        .unwrap_or("application/octet-stream");
6506    let content_type = super::ContentType::from(content_type);
6507
6508    if !status.is_client_error() && !status.is_server_error() {
6509        let content = resp.text().await?;
6510        match content_type {
6511            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6512            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentOut`"))),
6513            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaymentOut`")))),
6514        }
6515    } else {
6516        let content = resp.text().await?;
6517        let entity: Option<TakePaymentError> = serde_json::from_str(&content).ok();
6518        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6519    }
6520}
6521