binance/spot/apis/
binance_link_api.rs

1/*
2 * Binance Spot API
3 *
4 * OpenAPI specification for Binance exchange - Spot API
5 *
6 * The version of the OpenAPI document: 0.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::spot::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17/// struct for passing parameters to the method [`create_api_referral_customization_v1`]
18#[derive(Clone, Debug, Default)]
19pub struct CreateApiReferralCustomizationV1Params {
20    pub customer_id: String,
21    pub email: String,
22    pub timestamp: i64,
23    pub recv_window: Option<i64>
24}
25
26/// struct for passing parameters to the method [`create_api_referral_user_customization_v1`]
27#[derive(Clone, Debug, Default)]
28pub struct CreateApiReferralUserCustomizationV1Params {
29    pub api_agent_code: String,
30    pub customer_id: String,
31    pub timestamp: i64,
32    pub recv_window: Option<i64>
33}
34
35/// struct for passing parameters to the method [`create_broker_sub_account_api_commission_coin_futures_v1`]
36#[derive(Clone, Debug, Default)]
37pub struct CreateBrokerSubAccountApiCommissionCoinFuturesV1Params {
38    pub maker_adjustment: i32,
39    pub pair: String,
40    pub sub_account_id: String,
41    pub taker_adjustment: i32,
42    pub timestamp: i64,
43    pub recv_window: Option<i64>
44}
45
46/// struct for passing parameters to the method [`create_broker_sub_account_api_commission_futures_v1`]
47#[derive(Clone, Debug, Default)]
48pub struct CreateBrokerSubAccountApiCommissionFuturesV1Params {
49    pub maker_adjustment: i32,
50    pub sub_account_id: String,
51    pub symbol: String,
52    pub taker_adjustment: i32,
53    pub timestamp: i64,
54    pub recv_window: Option<i64>
55}
56
57/// struct for passing parameters to the method [`create_broker_sub_account_api_commission_v1`]
58#[derive(Clone, Debug, Default)]
59pub struct CreateBrokerSubAccountApiCommissionV1Params {
60    pub maker_commission: f64,
61    pub sub_account_id: String,
62    pub taker_commission: f64,
63    pub timestamp: i64,
64    pub margin_maker_commission: Option<f64>,
65    pub margin_taker_commission: Option<f64>,
66    pub recv_window: Option<i64>
67}
68
69/// struct for passing parameters to the method [`create_broker_sub_account_api_ip_restriction_v2`]
70#[derive(Clone, Debug, Default)]
71pub struct CreateBrokerSubAccountApiIpRestrictionV2Params {
72    pub status: String,
73    pub sub_account_api_key: String,
74    pub sub_account_id: String,
75    pub timestamp: i64,
76    pub ip_address: Option<String>,
77    pub recv_window: Option<i64>
78}
79
80/// struct for passing parameters to the method [`create_broker_sub_account_api_permission_universal_transfer_v1`]
81#[derive(Clone, Debug, Default)]
82pub struct CreateBrokerSubAccountApiPermissionUniversalTransferV1Params {
83    pub can_universal_transfer: String,
84    pub sub_account_api_key: String,
85    pub sub_account_id: i64,
86    pub timestamp: i64,
87    pub recv_window: Option<i64>
88}
89
90/// struct for passing parameters to the method [`create_broker_sub_account_api_permission_v1`]
91#[derive(Clone, Debug, Default)]
92pub struct CreateBrokerSubAccountApiPermissionV1Params {
93    pub can_trade: String,
94    pub futures_trade: String,
95    pub margin_trade: String,
96    pub sub_account_api_key: String,
97    pub sub_account_id: String,
98    pub timestamp: i64,
99    pub recv_window: Option<i64>
100}
101
102/// struct for passing parameters to the method [`create_broker_sub_account_api_v1`]
103#[derive(Clone, Debug, Default)]
104pub struct CreateBrokerSubAccountApiV1Params {
105    pub can_trade: String,
106    pub sub_account_id: String,
107    pub timestamp: i64,
108    pub futures_trade: Option<String>,
109    pub margin_trade: Option<String>,
110    pub public_key: Option<String>,
111    pub recv_window: Option<i64>
112}
113
114/// struct for passing parameters to the method [`create_broker_sub_account_bnb_burn_margin_interest_v1`]
115#[derive(Clone, Debug, Default)]
116pub struct CreateBrokerSubAccountBnbBurnMarginInterestV1Params {
117    pub interest_bnb_burn: String,
118    pub sub_account_id: String,
119    pub timestamp: i64,
120    pub recv_window: Option<i64>
121}
122
123/// struct for passing parameters to the method [`create_broker_sub_account_bnb_burn_spot_v1`]
124#[derive(Clone, Debug, Default)]
125pub struct CreateBrokerSubAccountBnbBurnSpotV1Params {
126    pub spot_bnb_burn: String,
127    pub sub_account_id: String,
128    pub timestamp: i64,
129    pub recv_window: Option<i64>
130}
131
132/// struct for passing parameters to the method [`create_broker_sub_account_futures_v1`]
133#[derive(Clone, Debug, Default)]
134pub struct CreateBrokerSubAccountFuturesV1Params {
135    pub futures: String,
136    pub sub_account_id: String,
137    pub timestamp: i64,
138    pub recv_window: Option<i64>
139}
140
141/// struct for passing parameters to the method [`create_broker_sub_account_v1`]
142#[derive(Clone, Debug, Default)]
143pub struct CreateBrokerSubAccountV1Params {
144    pub timestamp: i64,
145    pub recv_window: Option<i64>,
146    pub tag: Option<String>
147}
148
149/// struct for passing parameters to the method [`create_broker_transfer_futures_v1`]
150#[derive(Clone, Debug, Default)]
151pub struct CreateBrokerTransferFuturesV1Params {
152    pub amount: String,
153    pub asset: String,
154    pub futures_type: i64,
155    pub timestamp: i64,
156    pub client_tran_id: Option<String>,
157    pub from_id: Option<String>,
158    pub recv_window: Option<i64>,
159    pub to_id: Option<String>
160}
161
162/// struct for passing parameters to the method [`create_broker_transfer_v1`]
163#[derive(Clone, Debug, Default)]
164pub struct CreateBrokerTransferV1Params {
165    pub amount: String,
166    pub asset: String,
167    pub timestamp: i64,
168    pub client_tran_id: Option<String>,
169    pub from_id: Option<String>,
170    pub recv_window: Option<i64>,
171    pub to_id: Option<String>
172}
173
174/// struct for passing parameters to the method [`create_broker_universal_transfer_v1`]
175#[derive(Clone, Debug, Default)]
176pub struct CreateBrokerUniversalTransferV1Params {
177    pub amount: String,
178    pub asset: String,
179    pub from_account_type: String,
180    pub timestamp: i64,
181    pub to_account_type: String,
182    pub client_tran_id: Option<String>,
183    pub from_id: Option<String>,
184    pub recv_window: Option<i64>,
185    pub to_id: Option<String>
186}
187
188/// struct for passing parameters to the method [`delete_broker_sub_account_api_ip_restriction_ip_list_v1`]
189#[derive(Clone, Debug, Default)]
190pub struct DeleteBrokerSubAccountApiIpRestrictionIpListV1Params {
191    pub sub_account_id: String,
192    pub sub_account_api_key: String,
193    pub timestamp: i64,
194    pub ip_address: Option<String>,
195    pub recv_window: Option<i64>
196}
197
198/// struct for passing parameters to the method [`delete_broker_sub_account_api_v1`]
199#[derive(Clone, Debug, Default)]
200pub struct DeleteBrokerSubAccountApiV1Params {
201    pub sub_account_id: String,
202    pub sub_account_api_key: String,
203    pub timestamp: i64,
204    pub recv_window: Option<i64>
205}
206
207/// struct for passing parameters to the method [`delete_broker_sub_account_v1`]
208#[derive(Clone, Debug, Default)]
209pub struct DeleteBrokerSubAccountV1Params {
210    pub sub_account_id: String,
211    pub timestamp: i64,
212    pub recv_window: Option<i64>
213}
214
215/// struct for passing parameters to the method [`get_api_referral_customization_v1`]
216#[derive(Clone, Debug, Default)]
217pub struct GetApiReferralCustomizationV1Params {
218    pub timestamp: i64,
219    pub customer_id: Option<String>,
220    pub email: Option<String>,
221    pub recv_window: Option<i64>
222}
223
224/// struct for passing parameters to the method [`get_api_referral_if_new_user_v1`]
225#[derive(Clone, Debug, Default)]
226pub struct GetApiReferralIfNewUserV1Params {
227    /// brokerId
228    pub api_agent_code: String,
229    pub timestamp: i64,
230    pub recv_window: Option<i64>
231}
232
233/// struct for passing parameters to the method [`get_api_referral_kickback_recent_record_v1`]
234#[derive(Clone, Debug, Default)]
235pub struct GetApiReferralKickbackRecentRecordV1Params {
236    pub timestamp: i64,
237    pub start_time: Option<i64>,
238    pub end_time: Option<i64>,
239    /// Default 500, max 1000
240    pub limit: Option<i32>,
241    pub recv_window: Option<i64>
242}
243
244/// struct for passing parameters to the method [`get_api_referral_rebate_recent_record_v1`]
245#[derive(Clone, Debug, Default)]
246pub struct GetApiReferralRebateRecentRecordV1Params {
247    pub start_time: i64,
248    pub end_time: i64,
249    /// max 500
250    pub limit: i32,
251    pub timestamp: i64,
252    pub customer_id: Option<String>,
253    pub recv_window: Option<i64>
254}
255
256/// struct for passing parameters to the method [`get_api_referral_user_customization_v1`]
257#[derive(Clone, Debug, Default)]
258pub struct GetApiReferralUserCustomizationV1Params {
259    /// brokerId
260    pub api_agent_code: String,
261    pub timestamp: i64,
262    pub recv_window: Option<i64>
263}
264
265/// struct for passing parameters to the method [`get_broker_info_v1`]
266#[derive(Clone, Debug, Default)]
267pub struct GetBrokerInfoV1Params {
268    pub timestamp: i64,
269    pub recv_window: Option<i64>
270}
271
272/// struct for passing parameters to the method [`get_broker_rebate_futures_recent_record_v1`]
273#[derive(Clone, Debug, Default)]
274pub struct GetBrokerRebateFuturesRecentRecordV1Params {
275    /// 1:USDT Futures, 2: Coin Futures
276    pub futures_type: i64,
277    pub start_time: i64,
278    pub end_time: i64,
279    pub timestamp: i64,
280    /// default 1
281    pub page: Option<i64>,
282    /// default 10, max 100
283    pub size: Option<i64>,
284    /// TRUE or FALSE. Default: FALSE
285    pub filter_result: Option<bool>,
286    pub recv_window: Option<i64>
287}
288
289/// struct for passing parameters to the method [`get_broker_rebate_recent_record_v1`]
290#[derive(Clone, Debug, Default)]
291pub struct GetBrokerRebateRecentRecordV1Params {
292    pub timestamp: i64,
293    pub sub_account_id: Option<String>,
294    /// Default: 7 days from current timestamp
295    pub start_time: Option<i64>,
296    /// Default: present timestamp
297    pub end_time: Option<i64>,
298    /// default 1
299    pub page: Option<i64>,
300    /// default 500,max500
301    pub size: Option<i64>,
302    pub recv_window: Option<i64>
303}
304
305/// struct for passing parameters to the method [`get_broker_sub_account_api_commission_coin_futures_v1`]
306#[derive(Clone, Debug, Default)]
307pub struct GetBrokerSubAccountApiCommissionCoinFuturesV1Params {
308    pub sub_account_id: String,
309    pub timestamp: i64,
310    /// BTCUSD
311    pub pair: Option<String>,
312    pub recv_window: Option<i64>
313}
314
315/// struct for passing parameters to the method [`get_broker_sub_account_api_commission_futures_v1`]
316#[derive(Clone, Debug, Default)]
317pub struct GetBrokerSubAccountApiCommissionFuturesV1Params {
318    pub sub_account_id: String,
319    pub timestamp: i64,
320    pub symbol: Option<String>,
321    pub recv_window: Option<i64>
322}
323
324/// struct for passing parameters to the method [`get_broker_sub_account_api_ip_restriction_v1`]
325#[derive(Clone, Debug, Default)]
326pub struct GetBrokerSubAccountApiIpRestrictionV1Params {
327    pub sub_account_id: String,
328    pub sub_account_api_key: String,
329    pub timestamp: i64,
330    pub recv_window: Option<i64>
331}
332
333/// struct for passing parameters to the method [`get_broker_sub_account_api_v1`]
334#[derive(Clone, Debug, Default)]
335pub struct GetBrokerSubAccountApiV1Params {
336    pub sub_account_id: String,
337    pub timestamp: i64,
338    pub sub_account_api_key: Option<String>,
339    /// default 1
340    pub page: Option<i64>,
341    /// default 500, max 500
342    pub size: Option<i64>,
343    pub recv_window: Option<i64>
344}
345
346/// struct for passing parameters to the method [`get_broker_sub_account_bnb_burn_status_v1`]
347#[derive(Clone, Debug, Default)]
348pub struct GetBrokerSubAccountBnbBurnStatusV1Params {
349    pub sub_account_id: String,
350    pub timestamp: i64,
351    pub recv_window: Option<i64>
352}
353
354/// struct for passing parameters to the method [`get_broker_sub_account_deposit_hist_v1`]
355#[derive(Clone, Debug, Default)]
356pub struct GetBrokerSubAccountDepositHistV1Params {
357    pub timestamp: i64,
358    pub sub_account_id: Option<String>,
359    pub coin: Option<String>,
360    /// 0(0:pending,6: credited but cannot withdraw, 1:success)
361    pub status: Option<i32>,
362    /// Default: 7 days from current timestamp
363    pub start_time: Option<i64>,
364    /// Default: present timestamp
365    pub end_time: Option<i64>,
366    /// Default:500
367    pub limit: Option<i32>,
368    /// Default:0
369    pub offset: Option<i32>,
370    pub recv_window: Option<i64>
371}
372
373/// struct for passing parameters to the method [`get_broker_sub_account_deposit_hist_v2`]
374#[derive(Clone, Debug, Default)]
375pub struct GetBrokerSubAccountDepositHistV2Params {
376    pub deposit_id: String,
377    pub sub_account_id: String,
378    pub timestamp: i64,
379    /// Default:500
380    pub limit: Option<i32>,
381    /// Default:0
382    pub offset: Option<i32>,
383    pub recv_window: Option<i64>
384}
385
386/// struct for passing parameters to the method [`get_broker_sub_account_futures_summary_v3`]
387#[derive(Clone, Debug, Default)]
388pub struct GetBrokerSubAccountFuturesSummaryV3Params {
389    /// 1:USD Margined Futures, 2:COIN Margined Futures
390    pub futures_type: i32,
391    pub timestamp: i64,
392    pub sub_account_id: Option<String>,
393    /// default 1
394    pub page: Option<i64>,
395    /// default 10, max 20
396    pub size: Option<i64>,
397    pub recv_window: Option<i64>
398}
399
400/// struct for passing parameters to the method [`get_broker_sub_account_margin_summary_v1`]
401#[derive(Clone, Debug, Default)]
402pub struct GetBrokerSubAccountMarginSummaryV1Params {
403    pub timestamp: i64,
404    pub sub_account_id: Option<String>,
405    /// default 1
406    pub page: Option<i64>,
407    /// default 10, max 20
408    pub size: Option<i64>,
409    pub recv_window: Option<i64>
410}
411
412/// struct for passing parameters to the method [`get_broker_sub_account_spot_summary_v1`]
413#[derive(Clone, Debug, Default)]
414pub struct GetBrokerSubAccountSpotSummaryV1Params {
415    pub timestamp: i64,
416    pub sub_account_id: Option<String>,
417    /// default 1
418    pub page: Option<i64>,
419    /// default 10, max 20
420    pub size: Option<i64>,
421    pub recv_window: Option<i64>
422}
423
424/// struct for passing parameters to the method [`get_broker_sub_account_v1`]
425#[derive(Clone, Debug, Default)]
426pub struct GetBrokerSubAccountV1Params {
427    pub timestamp: i64,
428    pub sub_account_id: Option<String>,
429    /// default 1
430    pub page: Option<i64>,
431    /// default 500
432    pub size: Option<i64>,
433    pub recv_window: Option<i64>
434}
435
436/// struct for passing parameters to the method [`get_broker_transfer_futures_v1`]
437#[derive(Clone, Debug, Default)]
438pub struct GetBrokerTransferFuturesV1Params {
439    pub sub_account_id: String,
440    /// 1:USDT Futures,2: COIN Futures
441    pub futures_type: i64,
442    pub timestamp: i64,
443    pub client_tran_id: Option<String>,
444    /// default 30 days records
445    pub start_time: Option<i64>,
446    /// default 30 days records
447    pub end_time: Option<i64>,
448    /// default 1
449    pub page: Option<i32>,
450    /// default 50, max 500
451    pub limit: Option<i32>,
452    pub recv_window: Option<i64>
453}
454
455/// struct for passing parameters to the method [`get_broker_transfer_v1`]
456#[derive(Clone, Debug, Default)]
457pub struct GetBrokerTransferV1Params {
458    pub timestamp: i64,
459    pub from_id: Option<String>,
460    pub to_id: Option<String>,
461    /// client transfer id
462    pub client_tran_id: Option<String>,
463    /// true or false, default: false
464    pub show_all_status: Option<String>,
465    pub start_time: Option<i64>,
466    pub end_time: Option<i64>,
467    pub page: Option<i32>,
468    /// default 500, max 500
469    pub limit: Option<i32>,
470    pub recv_window: Option<i64>
471}
472
473/// struct for passing parameters to the method [`get_broker_universal_transfer_v1`]
474#[derive(Clone, Debug, Default)]
475pub struct GetBrokerUniversalTransferV1Params {
476    pub timestamp: i64,
477    pub from_id: Option<String>,
478    pub to_id: Option<String>,
479    /// client transfer id
480    pub client_tran_id: Option<String>,
481    pub start_time: Option<i64>,
482    pub end_time: Option<i64>,
483    /// default 1
484    pub page: Option<i32>,
485    /// default 500, max 500
486    pub limit: Option<i32>,
487    /// TRUE or FALSE
488    pub show_all_status: Option<bool>,
489    pub recv_window: Option<i64>
490}
491
492
493/// struct for typed errors of method [`create_api_referral_customization_v1`]
494#[derive(Debug, Clone, Serialize, Deserialize)]
495#[serde(untagged)]
496pub enum CreateApiReferralCustomizationV1Error {
497    Status4XX(models::ApiError),
498    Status5XX(models::ApiError),
499    UnknownValue(serde_json::Value),
500}
501
502/// struct for typed errors of method [`create_api_referral_user_customization_v1`]
503#[derive(Debug, Clone, Serialize, Deserialize)]
504#[serde(untagged)]
505pub enum CreateApiReferralUserCustomizationV1Error {
506    Status4XX(models::ApiError),
507    Status5XX(models::ApiError),
508    UnknownValue(serde_json::Value),
509}
510
511/// struct for typed errors of method [`create_broker_sub_account_api_commission_coin_futures_v1`]
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum CreateBrokerSubAccountApiCommissionCoinFuturesV1Error {
515    Status4XX(models::ApiError),
516    Status5XX(models::ApiError),
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`create_broker_sub_account_api_commission_futures_v1`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum CreateBrokerSubAccountApiCommissionFuturesV1Error {
524    Status4XX(models::ApiError),
525    Status5XX(models::ApiError),
526    UnknownValue(serde_json::Value),
527}
528
529/// struct for typed errors of method [`create_broker_sub_account_api_commission_v1`]
530#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum CreateBrokerSubAccountApiCommissionV1Error {
533    Status4XX(models::ApiError),
534    Status5XX(models::ApiError),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`create_broker_sub_account_api_ip_restriction_v2`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum CreateBrokerSubAccountApiIpRestrictionV2Error {
542    Status4XX(models::ApiError),
543    Status5XX(models::ApiError),
544    UnknownValue(serde_json::Value),
545}
546
547/// struct for typed errors of method [`create_broker_sub_account_api_permission_universal_transfer_v1`]
548#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum CreateBrokerSubAccountApiPermissionUniversalTransferV1Error {
551    Status4XX(models::ApiError),
552    Status5XX(models::ApiError),
553    UnknownValue(serde_json::Value),
554}
555
556/// struct for typed errors of method [`create_broker_sub_account_api_permission_v1`]
557#[derive(Debug, Clone, Serialize, Deserialize)]
558#[serde(untagged)]
559pub enum CreateBrokerSubAccountApiPermissionV1Error {
560    Status4XX(models::ApiError),
561    Status5XX(models::ApiError),
562    UnknownValue(serde_json::Value),
563}
564
565/// struct for typed errors of method [`create_broker_sub_account_api_v1`]
566#[derive(Debug, Clone, Serialize, Deserialize)]
567#[serde(untagged)]
568pub enum CreateBrokerSubAccountApiV1Error {
569    Status4XX(models::ApiError),
570    Status5XX(models::ApiError),
571    UnknownValue(serde_json::Value),
572}
573
574/// struct for typed errors of method [`create_broker_sub_account_bnb_burn_margin_interest_v1`]
575#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(untagged)]
577pub enum CreateBrokerSubAccountBnbBurnMarginInterestV1Error {
578    Status4XX(models::ApiError),
579    Status5XX(models::ApiError),
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`create_broker_sub_account_bnb_burn_spot_v1`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum CreateBrokerSubAccountBnbBurnSpotV1Error {
587    Status4XX(models::ApiError),
588    Status5XX(models::ApiError),
589    UnknownValue(serde_json::Value),
590}
591
592/// struct for typed errors of method [`create_broker_sub_account_futures_v1`]
593#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum CreateBrokerSubAccountFuturesV1Error {
596    Status4XX(models::ApiError),
597    Status5XX(models::ApiError),
598    UnknownValue(serde_json::Value),
599}
600
601/// struct for typed errors of method [`create_broker_sub_account_v1`]
602#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum CreateBrokerSubAccountV1Error {
605    Status4XX(models::ApiError),
606    Status5XX(models::ApiError),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`create_broker_transfer_futures_v1`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum CreateBrokerTransferFuturesV1Error {
614    Status4XX(models::ApiError),
615    Status5XX(models::ApiError),
616    UnknownValue(serde_json::Value),
617}
618
619/// struct for typed errors of method [`create_broker_transfer_v1`]
620#[derive(Debug, Clone, Serialize, Deserialize)]
621#[serde(untagged)]
622pub enum CreateBrokerTransferV1Error {
623    Status4XX(models::ApiError),
624    Status5XX(models::ApiError),
625    UnknownValue(serde_json::Value),
626}
627
628/// struct for typed errors of method [`create_broker_universal_transfer_v1`]
629#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum CreateBrokerUniversalTransferV1Error {
632    Status4XX(models::ApiError),
633    Status5XX(models::ApiError),
634    UnknownValue(serde_json::Value),
635}
636
637/// struct for typed errors of method [`delete_broker_sub_account_api_ip_restriction_ip_list_v1`]
638#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum DeleteBrokerSubAccountApiIpRestrictionIpListV1Error {
641    Status4XX(models::ApiError),
642    Status5XX(models::ApiError),
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`delete_broker_sub_account_api_v1`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum DeleteBrokerSubAccountApiV1Error {
650    Status4XX(models::ApiError),
651    Status5XX(models::ApiError),
652    UnknownValue(serde_json::Value),
653}
654
655/// struct for typed errors of method [`delete_broker_sub_account_v1`]
656#[derive(Debug, Clone, Serialize, Deserialize)]
657#[serde(untagged)]
658pub enum DeleteBrokerSubAccountV1Error {
659    Status4XX(models::ApiError),
660    Status5XX(models::ApiError),
661    UnknownValue(serde_json::Value),
662}
663
664/// struct for typed errors of method [`get_api_referral_customization_v1`]
665#[derive(Debug, Clone, Serialize, Deserialize)]
666#[serde(untagged)]
667pub enum GetApiReferralCustomizationV1Error {
668    Status4XX(models::ApiError),
669    Status5XX(models::ApiError),
670    UnknownValue(serde_json::Value),
671}
672
673/// struct for typed errors of method [`get_api_referral_if_new_user_v1`]
674#[derive(Debug, Clone, Serialize, Deserialize)]
675#[serde(untagged)]
676pub enum GetApiReferralIfNewUserV1Error {
677    Status4XX(models::ApiError),
678    Status5XX(models::ApiError),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`get_api_referral_kickback_recent_record_v1`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum GetApiReferralKickbackRecentRecordV1Error {
686    Status4XX(models::ApiError),
687    Status5XX(models::ApiError),
688    UnknownValue(serde_json::Value),
689}
690
691/// struct for typed errors of method [`get_api_referral_rebate_recent_record_v1`]
692#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum GetApiReferralRebateRecentRecordV1Error {
695    Status4XX(models::ApiError),
696    Status5XX(models::ApiError),
697    UnknownValue(serde_json::Value),
698}
699
700/// struct for typed errors of method [`get_api_referral_user_customization_v1`]
701#[derive(Debug, Clone, Serialize, Deserialize)]
702#[serde(untagged)]
703pub enum GetApiReferralUserCustomizationV1Error {
704    Status4XX(models::ApiError),
705    Status5XX(models::ApiError),
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`get_broker_info_v1`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum GetBrokerInfoV1Error {
713    Status4XX(models::ApiError),
714    Status5XX(models::ApiError),
715    UnknownValue(serde_json::Value),
716}
717
718/// struct for typed errors of method [`get_broker_rebate_futures_recent_record_v1`]
719#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum GetBrokerRebateFuturesRecentRecordV1Error {
722    Status4XX(models::ApiError),
723    Status5XX(models::ApiError),
724    UnknownValue(serde_json::Value),
725}
726
727/// struct for typed errors of method [`get_broker_rebate_recent_record_v1`]
728#[derive(Debug, Clone, Serialize, Deserialize)]
729#[serde(untagged)]
730pub enum GetBrokerRebateRecentRecordV1Error {
731    Status4XX(models::ApiError),
732    Status5XX(models::ApiError),
733    UnknownValue(serde_json::Value),
734}
735
736/// struct for typed errors of method [`get_broker_sub_account_api_commission_coin_futures_v1`]
737#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum GetBrokerSubAccountApiCommissionCoinFuturesV1Error {
740    Status4XX(models::ApiError),
741    Status5XX(models::ApiError),
742    UnknownValue(serde_json::Value),
743}
744
745/// struct for typed errors of method [`get_broker_sub_account_api_commission_futures_v1`]
746#[derive(Debug, Clone, Serialize, Deserialize)]
747#[serde(untagged)]
748pub enum GetBrokerSubAccountApiCommissionFuturesV1Error {
749    Status4XX(models::ApiError),
750    Status5XX(models::ApiError),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`get_broker_sub_account_api_ip_restriction_v1`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum GetBrokerSubAccountApiIpRestrictionV1Error {
758    Status4XX(models::ApiError),
759    Status5XX(models::ApiError),
760    UnknownValue(serde_json::Value),
761}
762
763/// struct for typed errors of method [`get_broker_sub_account_api_v1`]
764#[derive(Debug, Clone, Serialize, Deserialize)]
765#[serde(untagged)]
766pub enum GetBrokerSubAccountApiV1Error {
767    Status4XX(models::ApiError),
768    Status5XX(models::ApiError),
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`get_broker_sub_account_bnb_burn_status_v1`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum GetBrokerSubAccountBnbBurnStatusV1Error {
776    Status4XX(models::ApiError),
777    Status5XX(models::ApiError),
778    UnknownValue(serde_json::Value),
779}
780
781/// struct for typed errors of method [`get_broker_sub_account_deposit_hist_v1`]
782#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum GetBrokerSubAccountDepositHistV1Error {
785    Status4XX(models::ApiError),
786    Status5XX(models::ApiError),
787    UnknownValue(serde_json::Value),
788}
789
790/// struct for typed errors of method [`get_broker_sub_account_deposit_hist_v2`]
791#[derive(Debug, Clone, Serialize, Deserialize)]
792#[serde(untagged)]
793pub enum GetBrokerSubAccountDepositHistV2Error {
794    Status4XX(models::ApiError),
795    Status5XX(models::ApiError),
796    UnknownValue(serde_json::Value),
797}
798
799/// struct for typed errors of method [`get_broker_sub_account_futures_summary_v3`]
800#[derive(Debug, Clone, Serialize, Deserialize)]
801#[serde(untagged)]
802pub enum GetBrokerSubAccountFuturesSummaryV3Error {
803    Status4XX(models::ApiError),
804    Status5XX(models::ApiError),
805    UnknownValue(serde_json::Value),
806}
807
808/// struct for typed errors of method [`get_broker_sub_account_margin_summary_v1`]
809#[derive(Debug, Clone, Serialize, Deserialize)]
810#[serde(untagged)]
811pub enum GetBrokerSubAccountMarginSummaryV1Error {
812    Status4XX(models::ApiError),
813    Status5XX(models::ApiError),
814    UnknownValue(serde_json::Value),
815}
816
817/// struct for typed errors of method [`get_broker_sub_account_spot_summary_v1`]
818#[derive(Debug, Clone, Serialize, Deserialize)]
819#[serde(untagged)]
820pub enum GetBrokerSubAccountSpotSummaryV1Error {
821    Status4XX(models::ApiError),
822    Status5XX(models::ApiError),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`get_broker_sub_account_v1`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum GetBrokerSubAccountV1Error {
830    Status4XX(models::ApiError),
831    Status5XX(models::ApiError),
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`get_broker_transfer_futures_v1`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum GetBrokerTransferFuturesV1Error {
839    Status4XX(models::ApiError),
840    Status5XX(models::ApiError),
841    UnknownValue(serde_json::Value),
842}
843
844/// struct for typed errors of method [`get_broker_transfer_v1`]
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum GetBrokerTransferV1Error {
848    Status4XX(models::ApiError),
849    Status5XX(models::ApiError),
850    UnknownValue(serde_json::Value),
851}
852
853/// struct for typed errors of method [`get_broker_universal_transfer_v1`]
854#[derive(Debug, Clone, Serialize, Deserialize)]
855#[serde(untagged)]
856pub enum GetBrokerUniversalTransferV1Error {
857    Status4XX(models::ApiError),
858    Status5XX(models::ApiError),
859    UnknownValue(serde_json::Value),
860}
861
862
863/// - CustomerId must be unique - For the same email, the customerId will be modified in real time
864pub async fn create_api_referral_customization_v1(configuration: &configuration::Configuration, params: CreateApiReferralCustomizationV1Params) -> Result<models::CreateApiReferralCustomizationV1Resp, Error<CreateApiReferralCustomizationV1Error>> {
865
866    let uri_str = format!("{}/sapi/v1/apiReferral/customization", configuration.base_path);
867    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
868
869    // Create a mutable vector for query parameters
870    let mut query_params: Vec<(String, String)> = Vec::new();
871
872
873    // Create header parameters collection
874    let mut header_params = std::collections::HashMap::new();
875
876    // Handle Binance Auth first if configured
877    if let Some(ref binance_auth) = configuration.binance_auth {
878        // Add API key to headers
879        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
880        
881        // Generate request body for signing (if any)
882        let body_string: Option<Vec<u8>> = None;
883        
884        // Sign the request
885        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
886            Ok(sig) => sig,
887            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
888        };
889        
890        // Add signature to query params
891        query_params.push(("signature".to_string(), signature));
892    }
893
894    // Apply all query parameters
895    if !query_params.is_empty() {
896        req_builder = req_builder.query(&query_params);
897    }
898
899
900    // Add user agent if configured
901    if let Some(ref user_agent) = configuration.user_agent {
902        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
903    }
904
905    // Apply all header parameters
906    for (header_name, header_value) in header_params {
907        req_builder = req_builder.header(&header_name, &header_value);
908    }
909
910    let mut multipart_form_params = std::collections::HashMap::new();
911    multipart_form_params.insert("customerId", params.customer_id.to_string());
912    multipart_form_params.insert("email", params.email.to_string());
913    if let Some(param_value) = params.recv_window {
914        multipart_form_params.insert("recvWindow", param_value.to_string());
915    }
916    multipart_form_params.insert("timestamp", params.timestamp.to_string());
917    req_builder = req_builder.form(&multipart_form_params);
918
919    let req = req_builder.build()?;
920    let resp = configuration.client.execute(req).await?;
921
922    let status = resp.status();
923    let content_type = resp
924        .headers()
925        .get("content-type")
926        .and_then(|v| v.to_str().ok())
927        .unwrap_or("application/octet-stream");
928    let content_type = super::ContentType::from(content_type);
929
930    if !status.is_client_error() && !status.is_server_error() {
931        let content = resp.text().await?;
932        match content_type {
933            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
934            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateApiReferralCustomizationV1Resp`"))),
935            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::CreateApiReferralCustomizationV1Resp`")))),
936        }
937    } else {
938        let content = resp.text().await?;
939        let entity: Option<CreateApiReferralCustomizationV1Error> = serde_json::from_str(&content).ok();
940        Err(Error::ResponseError(ResponseContent { status, content, entity }))
941    }
942}
943
944/// - CustomerId must be unique for each apiAgent
945pub async fn create_api_referral_user_customization_v1(configuration: &configuration::Configuration, params: CreateApiReferralUserCustomizationV1Params) -> Result<models::CreateApiReferralUserCustomizationV1Resp, Error<CreateApiReferralUserCustomizationV1Error>> {
946
947    let uri_str = format!("{}/sapi/v1/apiReferral/userCustomization", configuration.base_path);
948    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
949
950    // Create a mutable vector for query parameters
951    let mut query_params: Vec<(String, String)> = Vec::new();
952
953
954    // Create header parameters collection
955    let mut header_params = std::collections::HashMap::new();
956
957    // Handle Binance Auth first if configured
958    if let Some(ref binance_auth) = configuration.binance_auth {
959        // Add API key to headers
960        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
961        
962        // Generate request body for signing (if any)
963        let body_string: Option<Vec<u8>> = None;
964        
965        // Sign the request
966        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
967            Ok(sig) => sig,
968            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
969        };
970        
971        // Add signature to query params
972        query_params.push(("signature".to_string(), signature));
973    }
974
975    // Apply all query parameters
976    if !query_params.is_empty() {
977        req_builder = req_builder.query(&query_params);
978    }
979
980
981    // Add user agent if configured
982    if let Some(ref user_agent) = configuration.user_agent {
983        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
984    }
985
986    // Apply all header parameters
987    for (header_name, header_value) in header_params {
988        req_builder = req_builder.header(&header_name, &header_value);
989    }
990
991    let mut multipart_form_params = std::collections::HashMap::new();
992    multipart_form_params.insert("apiAgentCode", params.api_agent_code.to_string());
993    multipart_form_params.insert("customerId", params.customer_id.to_string());
994    if let Some(param_value) = params.recv_window {
995        multipart_form_params.insert("recvWindow", param_value.to_string());
996    }
997    multipart_form_params.insert("timestamp", params.timestamp.to_string());
998    req_builder = req_builder.form(&multipart_form_params);
999
1000    let req = req_builder.build()?;
1001    let resp = configuration.client.execute(req).await?;
1002
1003    let status = resp.status();
1004    let content_type = resp
1005        .headers()
1006        .get("content-type")
1007        .and_then(|v| v.to_str().ok())
1008        .unwrap_or("application/octet-stream");
1009    let content_type = super::ContentType::from(content_type);
1010
1011    if !status.is_client_error() && !status.is_server_error() {
1012        let content = resp.text().await?;
1013        match content_type {
1014            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1015            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateApiReferralUserCustomizationV1Resp`"))),
1016            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::CreateApiReferralUserCustomizationV1Resp`")))),
1017        }
1018    } else {
1019        let content = resp.text().await?;
1020        let entity: Option<CreateApiReferralUserCustomizationV1Error> = serde_json::from_str(&content).ok();
1021        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1022    }
1023}
1024
1025/// This request will change the COIN-Ⓜ futures commission for a sub account. You need to enable \"trade\" option for the api key which requests this endpoint. The sub-account's COIN-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.
1026pub async fn create_broker_sub_account_api_commission_coin_futures_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiCommissionCoinFuturesV1Params) -> Result<models::CreateBrokerSubAccountApiCommissionCoinFuturesV1Resp, Error<CreateBrokerSubAccountApiCommissionCoinFuturesV1Error>> {
1027
1028    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/commission/coinFutures", configuration.base_path);
1029    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1030
1031    // Create a mutable vector for query parameters
1032    let mut query_params: Vec<(String, String)> = Vec::new();
1033
1034
1035    // Create header parameters collection
1036    let mut header_params = std::collections::HashMap::new();
1037
1038    // Handle Binance Auth first if configured
1039    if let Some(ref binance_auth) = configuration.binance_auth {
1040        // Add API key to headers
1041        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1042        
1043        // Generate request body for signing (if any)
1044        let body_string: Option<Vec<u8>> = None;
1045        
1046        // Sign the request
1047        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1048            Ok(sig) => sig,
1049            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1050        };
1051        
1052        // Add signature to query params
1053        query_params.push(("signature".to_string(), signature));
1054    }
1055
1056    // Apply all query parameters
1057    if !query_params.is_empty() {
1058        req_builder = req_builder.query(&query_params);
1059    }
1060
1061
1062    // Add user agent if configured
1063    if let Some(ref user_agent) = configuration.user_agent {
1064        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1065    }
1066
1067    // Apply all header parameters
1068    for (header_name, header_value) in header_params {
1069        req_builder = req_builder.header(&header_name, &header_value);
1070    }
1071
1072    let mut multipart_form_params = std::collections::HashMap::new();
1073    multipart_form_params.insert("makerAdjustment", params.maker_adjustment.to_string());
1074    multipart_form_params.insert("pair", params.pair.to_string());
1075    if let Some(param_value) = params.recv_window {
1076        multipart_form_params.insert("recvWindow", param_value.to_string());
1077    }
1078    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1079    multipart_form_params.insert("takerAdjustment", params.taker_adjustment.to_string());
1080    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1081    req_builder = req_builder.form(&multipart_form_params);
1082
1083    let req = req_builder.build()?;
1084    let resp = configuration.client.execute(req).await?;
1085
1086    let status = resp.status();
1087    let content_type = resp
1088        .headers()
1089        .get("content-type")
1090        .and_then(|v| v.to_str().ok())
1091        .unwrap_or("application/octet-stream");
1092    let content_type = super::ContentType::from(content_type);
1093
1094    if !status.is_client_error() && !status.is_server_error() {
1095        let content = resp.text().await?;
1096        match content_type {
1097            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1098            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiCommissionCoinFuturesV1Resp`"))),
1099            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::CreateBrokerSubAccountApiCommissionCoinFuturesV1Resp`")))),
1100        }
1101    } else {
1102        let content = resp.text().await?;
1103        let entity: Option<CreateBrokerSubAccountApiCommissionCoinFuturesV1Error> = serde_json::from_str(&content).ok();
1104        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1105    }
1106}
1107
1108/// This request will change the USDT-Ⓜ futures commission for a sub account. You need to enable \"trade\" option for the api key which requests this endpoint. The sub-account's USDT-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.
1109pub async fn create_broker_sub_account_api_commission_futures_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiCommissionFuturesV1Params) -> Result<models::CreateBrokerSubAccountApiCommissionFuturesV1Resp, Error<CreateBrokerSubAccountApiCommissionFuturesV1Error>> {
1110
1111    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/commission/futures", configuration.base_path);
1112    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1113
1114    // Create a mutable vector for query parameters
1115    let mut query_params: Vec<(String, String)> = Vec::new();
1116
1117
1118    // Create header parameters collection
1119    let mut header_params = std::collections::HashMap::new();
1120
1121    // Handle Binance Auth first if configured
1122    if let Some(ref binance_auth) = configuration.binance_auth {
1123        // Add API key to headers
1124        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1125        
1126        // Generate request body for signing (if any)
1127        let body_string: Option<Vec<u8>> = None;
1128        
1129        // Sign the request
1130        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1131            Ok(sig) => sig,
1132            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1133        };
1134        
1135        // Add signature to query params
1136        query_params.push(("signature".to_string(), signature));
1137    }
1138
1139    // Apply all query parameters
1140    if !query_params.is_empty() {
1141        req_builder = req_builder.query(&query_params);
1142    }
1143
1144
1145    // Add user agent if configured
1146    if let Some(ref user_agent) = configuration.user_agent {
1147        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1148    }
1149
1150    // Apply all header parameters
1151    for (header_name, header_value) in header_params {
1152        req_builder = req_builder.header(&header_name, &header_value);
1153    }
1154
1155    let mut multipart_form_params = std::collections::HashMap::new();
1156    multipart_form_params.insert("makerAdjustment", params.maker_adjustment.to_string());
1157    if let Some(param_value) = params.recv_window {
1158        multipart_form_params.insert("recvWindow", param_value.to_string());
1159    }
1160    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1161    multipart_form_params.insert("symbol", params.symbol.to_string());
1162    multipart_form_params.insert("takerAdjustment", params.taker_adjustment.to_string());
1163    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1164    req_builder = req_builder.form(&multipart_form_params);
1165
1166    let req = req_builder.build()?;
1167    let resp = configuration.client.execute(req).await?;
1168
1169    let status = resp.status();
1170    let content_type = resp
1171        .headers()
1172        .get("content-type")
1173        .and_then(|v| v.to_str().ok())
1174        .unwrap_or("application/octet-stream");
1175    let content_type = super::ContentType::from(content_type);
1176
1177    if !status.is_client_error() && !status.is_server_error() {
1178        let content = resp.text().await?;
1179        match content_type {
1180            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1181            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiCommissionFuturesV1Resp`"))),
1182            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::CreateBrokerSubAccountApiCommissionFuturesV1Resp`")))),
1183        }
1184    } else {
1185        let content = resp.text().await?;
1186        let entity: Option<CreateBrokerSubAccountApiCommissionFuturesV1Error> = serde_json::from_str(&content).ok();
1187        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1188    }
1189}
1190
1191/// This request will change the commission for a sub account. You need to enable \"trade\" option for the api key which requests this endpoint.
1192pub async fn create_broker_sub_account_api_commission_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiCommissionV1Params) -> Result<models::CreateBrokerSubAccountApiCommissionV1Resp, Error<CreateBrokerSubAccountApiCommissionV1Error>> {
1193
1194    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/commission", configuration.base_path);
1195    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1196
1197    // Create a mutable vector for query parameters
1198    let mut query_params: Vec<(String, String)> = Vec::new();
1199
1200
1201    // Create header parameters collection
1202    let mut header_params = std::collections::HashMap::new();
1203
1204    // Handle Binance Auth first if configured
1205    if let Some(ref binance_auth) = configuration.binance_auth {
1206        // Add API key to headers
1207        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1208        
1209        // Generate request body for signing (if any)
1210        let body_string: Option<Vec<u8>> = None;
1211        
1212        // Sign the request
1213        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1214            Ok(sig) => sig,
1215            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1216        };
1217        
1218        // Add signature to query params
1219        query_params.push(("signature".to_string(), signature));
1220    }
1221
1222    // Apply all query parameters
1223    if !query_params.is_empty() {
1224        req_builder = req_builder.query(&query_params);
1225    }
1226
1227
1228    // Add user agent if configured
1229    if let Some(ref user_agent) = configuration.user_agent {
1230        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1231    }
1232
1233    // Apply all header parameters
1234    for (header_name, header_value) in header_params {
1235        req_builder = req_builder.header(&header_name, &header_value);
1236    }
1237
1238    let mut multipart_form_params = std::collections::HashMap::new();
1239    multipart_form_params.insert("makerCommission", params.maker_commission.to_string());
1240    if let Some(param_value) = params.margin_maker_commission {
1241        multipart_form_params.insert("marginMakerCommission", param_value.to_string());
1242    }
1243    if let Some(param_value) = params.margin_taker_commission {
1244        multipart_form_params.insert("marginTakerCommission", param_value.to_string());
1245    }
1246    if let Some(param_value) = params.recv_window {
1247        multipart_form_params.insert("recvWindow", param_value.to_string());
1248    }
1249    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1250    multipart_form_params.insert("takerCommission", params.taker_commission.to_string());
1251    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1252    req_builder = req_builder.form(&multipart_form_params);
1253
1254    let req = req_builder.build()?;
1255    let resp = configuration.client.execute(req).await?;
1256
1257    let status = resp.status();
1258    let content_type = resp
1259        .headers()
1260        .get("content-type")
1261        .and_then(|v| v.to_str().ok())
1262        .unwrap_or("application/octet-stream");
1263    let content_type = super::ContentType::from(content_type);
1264
1265    if !status.is_client_error() && !status.is_server_error() {
1266        let content = resp.text().await?;
1267        match content_type {
1268            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1269            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiCommissionV1Resp`"))),
1270            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::CreateBrokerSubAccountApiCommissionV1Resp`")))),
1271        }
1272    } else {
1273        let content = resp.text().await?;
1274        let entity: Option<CreateBrokerSubAccountApiCommissionV1Error> = serde_json::from_str(&content).ok();
1275        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1276    }
1277}
1278
1279pub async fn create_broker_sub_account_api_ip_restriction_v2(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiIpRestrictionV2Params) -> Result<models::CreateBrokerSubAccountApiIpRestrictionV2Resp, Error<CreateBrokerSubAccountApiIpRestrictionV2Error>> {
1280
1281    let uri_str = format!("{}/sapi/v2/broker/subAccountApi/ipRestriction", configuration.base_path);
1282    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1283
1284    // Create a mutable vector for query parameters
1285    let mut query_params: Vec<(String, String)> = Vec::new();
1286
1287
1288    // Create header parameters collection
1289    let mut header_params = std::collections::HashMap::new();
1290
1291    // Handle Binance Auth first if configured
1292    if let Some(ref binance_auth) = configuration.binance_auth {
1293        // Add API key to headers
1294        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1295        
1296        // Generate request body for signing (if any)
1297        let body_string: Option<Vec<u8>> = None;
1298        
1299        // Sign the request
1300        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1301            Ok(sig) => sig,
1302            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1303        };
1304        
1305        // Add signature to query params
1306        query_params.push(("signature".to_string(), signature));
1307    }
1308
1309    // Apply all query parameters
1310    if !query_params.is_empty() {
1311        req_builder = req_builder.query(&query_params);
1312    }
1313
1314
1315    // Add user agent if configured
1316    if let Some(ref user_agent) = configuration.user_agent {
1317        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1318    }
1319
1320    // Apply all header parameters
1321    for (header_name, header_value) in header_params {
1322        req_builder = req_builder.header(&header_name, &header_value);
1323    }
1324
1325    let mut multipart_form_params = std::collections::HashMap::new();
1326    if let Some(param_value) = params.ip_address {
1327        multipart_form_params.insert("ipAddress", param_value.to_string());
1328    }
1329    if let Some(param_value) = params.recv_window {
1330        multipart_form_params.insert("recvWindow", param_value.to_string());
1331    }
1332    multipart_form_params.insert("status", params.status.to_string());
1333    multipart_form_params.insert("subAccountApiKey", params.sub_account_api_key.to_string());
1334    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1335    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1336    req_builder = req_builder.form(&multipart_form_params);
1337
1338    let req = req_builder.build()?;
1339    let resp = configuration.client.execute(req).await?;
1340
1341    let status = resp.status();
1342    let content_type = resp
1343        .headers()
1344        .get("content-type")
1345        .and_then(|v| v.to_str().ok())
1346        .unwrap_or("application/octet-stream");
1347    let content_type = super::ContentType::from(content_type);
1348
1349    if !status.is_client_error() && !status.is_server_error() {
1350        let content = resp.text().await?;
1351        match content_type {
1352            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1353            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiIpRestrictionV2Resp`"))),
1354            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::CreateBrokerSubAccountApiIpRestrictionV2Resp`")))),
1355        }
1356    } else {
1357        let content = resp.text().await?;
1358        let entity: Option<CreateBrokerSubAccountApiIpRestrictionV2Error> = serde_json::from_str(&content).ok();
1359        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1360    }
1361}
1362
1363/// Caution: - This request will enable the api permission for a sub account to use POST /sapi/v1/asset/transferendpoint. - You need to enable \"trade\" option for the api key which requests this endpoint.
1364pub async fn create_broker_sub_account_api_permission_universal_transfer_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiPermissionUniversalTransferV1Params) -> Result<models::CreateBrokerSubAccountApiPermissionUniversalTransferV1Resp, Error<CreateBrokerSubAccountApiPermissionUniversalTransferV1Error>> {
1365
1366    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/permission/universalTransfer", configuration.base_path);
1367    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1368
1369    // Create a mutable vector for query parameters
1370    let mut query_params: Vec<(String, String)> = Vec::new();
1371
1372
1373    // Create header parameters collection
1374    let mut header_params = std::collections::HashMap::new();
1375
1376    // Handle Binance Auth first if configured
1377    if let Some(ref binance_auth) = configuration.binance_auth {
1378        // Add API key to headers
1379        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1380        
1381        // Generate request body for signing (if any)
1382        let body_string: Option<Vec<u8>> = None;
1383        
1384        // Sign the request
1385        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1386            Ok(sig) => sig,
1387            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1388        };
1389        
1390        // Add signature to query params
1391        query_params.push(("signature".to_string(), signature));
1392    }
1393
1394    // Apply all query parameters
1395    if !query_params.is_empty() {
1396        req_builder = req_builder.query(&query_params);
1397    }
1398
1399
1400    // Add user agent if configured
1401    if let Some(ref user_agent) = configuration.user_agent {
1402        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1403    }
1404
1405    // Apply all header parameters
1406    for (header_name, header_value) in header_params {
1407        req_builder = req_builder.header(&header_name, &header_value);
1408    }
1409
1410    let mut multipart_form_params = std::collections::HashMap::new();
1411    multipart_form_params.insert("canUniversalTransfer", params.can_universal_transfer.to_string());
1412    if let Some(param_value) = params.recv_window {
1413        multipart_form_params.insert("recvWindow", param_value.to_string());
1414    }
1415    multipart_form_params.insert("subAccountApiKey", params.sub_account_api_key.to_string());
1416    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1417    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1418    req_builder = req_builder.form(&multipart_form_params);
1419
1420    let req = req_builder.build()?;
1421    let resp = configuration.client.execute(req).await?;
1422
1423    let status = resp.status();
1424    let content_type = resp
1425        .headers()
1426        .get("content-type")
1427        .and_then(|v| v.to_str().ok())
1428        .unwrap_or("application/octet-stream");
1429    let content_type = super::ContentType::from(content_type);
1430
1431    if !status.is_client_error() && !status.is_server_error() {
1432        let content = resp.text().await?;
1433        match content_type {
1434            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1435            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiPermissionUniversalTransferV1Resp`"))),
1436            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::CreateBrokerSubAccountApiPermissionUniversalTransferV1Resp`")))),
1437        }
1438    } else {
1439        let content = resp.text().await?;
1440        let entity: Option<CreateBrokerSubAccountApiPermissionUniversalTransferV1Error> = serde_json::from_str(&content).ok();
1441        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1442    }
1443}
1444
1445/// Caution: - This request will change the api permission for a sub account. - You need to enable \"trade\" option for the api key which requests this endpoint. - Sub account should be enable margin before its api-key's marginTrade being enabled. - Sub account should be enable futures before its api-key's futuresTrade being enabled.
1446pub async fn create_broker_sub_account_api_permission_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiPermissionV1Params) -> Result<models::CreateBrokerSubAccountApiPermissionV1Resp, Error<CreateBrokerSubAccountApiPermissionV1Error>> {
1447
1448    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/permission", configuration.base_path);
1449    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1450
1451    // Create a mutable vector for query parameters
1452    let mut query_params: Vec<(String, String)> = Vec::new();
1453
1454
1455    // Create header parameters collection
1456    let mut header_params = std::collections::HashMap::new();
1457
1458    // Handle Binance Auth first if configured
1459    if let Some(ref binance_auth) = configuration.binance_auth {
1460        // Add API key to headers
1461        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1462        
1463        // Generate request body for signing (if any)
1464        let body_string: Option<Vec<u8>> = None;
1465        
1466        // Sign the request
1467        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1468            Ok(sig) => sig,
1469            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1470        };
1471        
1472        // Add signature to query params
1473        query_params.push(("signature".to_string(), signature));
1474    }
1475
1476    // Apply all query parameters
1477    if !query_params.is_empty() {
1478        req_builder = req_builder.query(&query_params);
1479    }
1480
1481
1482    // Add user agent if configured
1483    if let Some(ref user_agent) = configuration.user_agent {
1484        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1485    }
1486
1487    // Apply all header parameters
1488    for (header_name, header_value) in header_params {
1489        req_builder = req_builder.header(&header_name, &header_value);
1490    }
1491
1492    let mut multipart_form_params = std::collections::HashMap::new();
1493    multipart_form_params.insert("canTrade", params.can_trade.to_string());
1494    multipart_form_params.insert("futuresTrade", params.futures_trade.to_string());
1495    multipart_form_params.insert("marginTrade", params.margin_trade.to_string());
1496    if let Some(param_value) = params.recv_window {
1497        multipart_form_params.insert("recvWindow", param_value.to_string());
1498    }
1499    multipart_form_params.insert("subAccountApiKey", params.sub_account_api_key.to_string());
1500    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1501    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1502    req_builder = req_builder.form(&multipart_form_params);
1503
1504    let req = req_builder.build()?;
1505    let resp = configuration.client.execute(req).await?;
1506
1507    let status = resp.status();
1508    let content_type = resp
1509        .headers()
1510        .get("content-type")
1511        .and_then(|v| v.to_str().ok())
1512        .unwrap_or("application/octet-stream");
1513    let content_type = super::ContentType::from(content_type);
1514
1515    if !status.is_client_error() && !status.is_server_error() {
1516        let content = resp.text().await?;
1517        match content_type {
1518            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1519            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiPermissionV1Resp`"))),
1520            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::CreateBrokerSubAccountApiPermissionV1Resp`")))),
1521        }
1522    } else {
1523        let content = resp.text().await?;
1524        let entity: Option<CreateBrokerSubAccountApiPermissionV1Error> = serde_json::from_str(&content).ok();
1525        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1526    }
1527}
1528
1529/// Caution: - This request will generate a api key for a sub account. - You need to enable \"trade\" option for the api key which requests this endpoint - Sub account should be enable margin before its api-key's marginTrade being enabled - Sub account should be enable futures before its api-key's futuresTrade being enabled - You can only create 1 api key for each sub account per second
1530pub async fn create_broker_sub_account_api_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountApiV1Params) -> Result<models::CreateBrokerSubAccountApiV1Resp, Error<CreateBrokerSubAccountApiV1Error>> {
1531
1532    let uri_str = format!("{}/sapi/v1/broker/subAccountApi", configuration.base_path);
1533    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1534
1535    // Create a mutable vector for query parameters
1536    let mut query_params: Vec<(String, String)> = Vec::new();
1537
1538
1539    // Create header parameters collection
1540    let mut header_params = std::collections::HashMap::new();
1541
1542    // Handle Binance Auth first if configured
1543    if let Some(ref binance_auth) = configuration.binance_auth {
1544        // Add API key to headers
1545        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1546        
1547        // Generate request body for signing (if any)
1548        let body_string: Option<Vec<u8>> = None;
1549        
1550        // Sign the request
1551        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1552            Ok(sig) => sig,
1553            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1554        };
1555        
1556        // Add signature to query params
1557        query_params.push(("signature".to_string(), signature));
1558    }
1559
1560    // Apply all query parameters
1561    if !query_params.is_empty() {
1562        req_builder = req_builder.query(&query_params);
1563    }
1564
1565
1566    // Add user agent if configured
1567    if let Some(ref user_agent) = configuration.user_agent {
1568        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1569    }
1570
1571    // Apply all header parameters
1572    for (header_name, header_value) in header_params {
1573        req_builder = req_builder.header(&header_name, &header_value);
1574    }
1575
1576    let mut multipart_form_params = std::collections::HashMap::new();
1577    multipart_form_params.insert("canTrade", params.can_trade.to_string());
1578    if let Some(param_value) = params.futures_trade {
1579        multipart_form_params.insert("futuresTrade", param_value.to_string());
1580    }
1581    if let Some(param_value) = params.margin_trade {
1582        multipart_form_params.insert("marginTrade", param_value.to_string());
1583    }
1584    if let Some(param_value) = params.public_key {
1585        multipart_form_params.insert("publicKey", param_value.to_string());
1586    }
1587    if let Some(param_value) = params.recv_window {
1588        multipart_form_params.insert("recvWindow", param_value.to_string());
1589    }
1590    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1591    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1592    req_builder = req_builder.form(&multipart_form_params);
1593
1594    let req = req_builder.build()?;
1595    let resp = configuration.client.execute(req).await?;
1596
1597    let status = resp.status();
1598    let content_type = resp
1599        .headers()
1600        .get("content-type")
1601        .and_then(|v| v.to_str().ok())
1602        .unwrap_or("application/octet-stream");
1603    let content_type = super::ContentType::from(content_type);
1604
1605    if !status.is_client_error() && !status.is_server_error() {
1606        let content = resp.text().await?;
1607        match content_type {
1608            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1609            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountApiV1Resp`"))),
1610            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::CreateBrokerSubAccountApiV1Resp`")))),
1611        }
1612    } else {
1613        let content = resp.text().await?;
1614        let entity: Option<CreateBrokerSubAccountApiV1Error> = serde_json::from_str(&content).ok();
1615        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1616    }
1617}
1618
1619/// - Subaccount must be enabled margin before using this switch
1620pub async fn create_broker_sub_account_bnb_burn_margin_interest_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountBnbBurnMarginInterestV1Params) -> Result<models::CreateBrokerSubAccountBnbBurnMarginInterestV1Resp, Error<CreateBrokerSubAccountBnbBurnMarginInterestV1Error>> {
1621
1622    let uri_str = format!("{}/sapi/v1/broker/subAccount/bnbBurn/marginInterest", configuration.base_path);
1623    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1624
1625    // Create a mutable vector for query parameters
1626    let mut query_params: Vec<(String, String)> = Vec::new();
1627
1628
1629    // Create header parameters collection
1630    let mut header_params = std::collections::HashMap::new();
1631
1632    // Handle Binance Auth first if configured
1633    if let Some(ref binance_auth) = configuration.binance_auth {
1634        // Add API key to headers
1635        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1636        
1637        // Generate request body for signing (if any)
1638        let body_string: Option<Vec<u8>> = None;
1639        
1640        // Sign the request
1641        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1642            Ok(sig) => sig,
1643            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1644        };
1645        
1646        // Add signature to query params
1647        query_params.push(("signature".to_string(), signature));
1648    }
1649
1650    // Apply all query parameters
1651    if !query_params.is_empty() {
1652        req_builder = req_builder.query(&query_params);
1653    }
1654
1655
1656    // Add user agent if configured
1657    if let Some(ref user_agent) = configuration.user_agent {
1658        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1659    }
1660
1661    // Apply all header parameters
1662    for (header_name, header_value) in header_params {
1663        req_builder = req_builder.header(&header_name, &header_value);
1664    }
1665
1666    let mut multipart_form_params = std::collections::HashMap::new();
1667    multipart_form_params.insert("interestBNBBurn", params.interest_bnb_burn.to_string());
1668    if let Some(param_value) = params.recv_window {
1669        multipart_form_params.insert("recvWindow", param_value.to_string());
1670    }
1671    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1672    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1673    req_builder = req_builder.form(&multipart_form_params);
1674
1675    let req = req_builder.build()?;
1676    let resp = configuration.client.execute(req).await?;
1677
1678    let status = resp.status();
1679    let content_type = resp
1680        .headers()
1681        .get("content-type")
1682        .and_then(|v| v.to_str().ok())
1683        .unwrap_or("application/octet-stream");
1684    let content_type = super::ContentType::from(content_type);
1685
1686    if !status.is_client_error() && !status.is_server_error() {
1687        let content = resp.text().await?;
1688        match content_type {
1689            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1690            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountBnbBurnMarginInterestV1Resp`"))),
1691            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::CreateBrokerSubAccountBnbBurnMarginInterestV1Resp`")))),
1692        }
1693    } else {
1694        let content = resp.text().await?;
1695        let entity: Option<CreateBrokerSubAccountBnbBurnMarginInterestV1Error> = serde_json::from_str(&content).ok();
1696        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1697    }
1698}
1699
1700pub async fn create_broker_sub_account_bnb_burn_spot_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountBnbBurnSpotV1Params) -> Result<models::CreateBrokerSubAccountBnbBurnSpotV1Resp, Error<CreateBrokerSubAccountBnbBurnSpotV1Error>> {
1701
1702    let uri_str = format!("{}/sapi/v1/broker/subAccount/bnbBurn/spot", configuration.base_path);
1703    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1704
1705    // Create a mutable vector for query parameters
1706    let mut query_params: Vec<(String, String)> = Vec::new();
1707
1708
1709    // Create header parameters collection
1710    let mut header_params = std::collections::HashMap::new();
1711
1712    // Handle Binance Auth first if configured
1713    if let Some(ref binance_auth) = configuration.binance_auth {
1714        // Add API key to headers
1715        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1716        
1717        // Generate request body for signing (if any)
1718        let body_string: Option<Vec<u8>> = None;
1719        
1720        // Sign the request
1721        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1722            Ok(sig) => sig,
1723            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1724        };
1725        
1726        // Add signature to query params
1727        query_params.push(("signature".to_string(), signature));
1728    }
1729
1730    // Apply all query parameters
1731    if !query_params.is_empty() {
1732        req_builder = req_builder.query(&query_params);
1733    }
1734
1735
1736    // Add user agent if configured
1737    if let Some(ref user_agent) = configuration.user_agent {
1738        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1739    }
1740
1741    // Apply all header parameters
1742    for (header_name, header_value) in header_params {
1743        req_builder = req_builder.header(&header_name, &header_value);
1744    }
1745
1746    let mut multipart_form_params = std::collections::HashMap::new();
1747    if let Some(param_value) = params.recv_window {
1748        multipart_form_params.insert("recvWindow", param_value.to_string());
1749    }
1750    multipart_form_params.insert("spotBNBBurn", params.spot_bnb_burn.to_string());
1751    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1752    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1753    req_builder = req_builder.form(&multipart_form_params);
1754
1755    let req = req_builder.build()?;
1756    let resp = configuration.client.execute(req).await?;
1757
1758    let status = resp.status();
1759    let content_type = resp
1760        .headers()
1761        .get("content-type")
1762        .and_then(|v| v.to_str().ok())
1763        .unwrap_or("application/octet-stream");
1764    let content_type = super::ContentType::from(content_type);
1765
1766    if !status.is_client_error() && !status.is_server_error() {
1767        let content = resp.text().await?;
1768        match content_type {
1769            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1770            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountBnbBurnSpotV1Resp`"))),
1771            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::CreateBrokerSubAccountBnbBurnSpotV1Resp`")))),
1772        }
1773    } else {
1774        let content = resp.text().await?;
1775        let entity: Option<CreateBrokerSubAccountBnbBurnSpotV1Error> = serde_json::from_str(&content).ok();
1776        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1777    }
1778}
1779
1780pub async fn create_broker_sub_account_futures_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountFuturesV1Params) -> Result<models::CreateBrokerSubAccountFuturesV1Resp, Error<CreateBrokerSubAccountFuturesV1Error>> {
1781
1782    let uri_str = format!("{}/sapi/v1/broker/subAccount/futures", configuration.base_path);
1783    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1784
1785    // Create a mutable vector for query parameters
1786    let mut query_params: Vec<(String, String)> = Vec::new();
1787
1788
1789    // Create header parameters collection
1790    let mut header_params = std::collections::HashMap::new();
1791
1792    // Handle Binance Auth first if configured
1793    if let Some(ref binance_auth) = configuration.binance_auth {
1794        // Add API key to headers
1795        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1796        
1797        // Generate request body for signing (if any)
1798        let body_string: Option<Vec<u8>> = None;
1799        
1800        // Sign the request
1801        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1802            Ok(sig) => sig,
1803            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1804        };
1805        
1806        // Add signature to query params
1807        query_params.push(("signature".to_string(), signature));
1808    }
1809
1810    // Apply all query parameters
1811    if !query_params.is_empty() {
1812        req_builder = req_builder.query(&query_params);
1813    }
1814
1815
1816    // Add user agent if configured
1817    if let Some(ref user_agent) = configuration.user_agent {
1818        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1819    }
1820
1821    // Apply all header parameters
1822    for (header_name, header_value) in header_params {
1823        req_builder = req_builder.header(&header_name, &header_value);
1824    }
1825
1826    let mut multipart_form_params = std::collections::HashMap::new();
1827    multipart_form_params.insert("futures", params.futures.to_string());
1828    if let Some(param_value) = params.recv_window {
1829        multipart_form_params.insert("recvWindow", param_value.to_string());
1830    }
1831    multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1832    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1833    req_builder = req_builder.form(&multipart_form_params);
1834
1835    let req = req_builder.build()?;
1836    let resp = configuration.client.execute(req).await?;
1837
1838    let status = resp.status();
1839    let content_type = resp
1840        .headers()
1841        .get("content-type")
1842        .and_then(|v| v.to_str().ok())
1843        .unwrap_or("application/octet-stream");
1844    let content_type = super::ContentType::from(content_type);
1845
1846    if !status.is_client_error() && !status.is_server_error() {
1847        let content = resp.text().await?;
1848        match content_type {
1849            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1850            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountFuturesV1Resp`"))),
1851            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::CreateBrokerSubAccountFuturesV1Resp`")))),
1852        }
1853    } else {
1854        let content = resp.text().await?;
1855        let entity: Option<CreateBrokerSubAccountFuturesV1Error> = serde_json::from_str(&content).ok();
1856        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1857    }
1858}
1859
1860/// To create a link sub-account
1861pub async fn create_broker_sub_account_v1(configuration: &configuration::Configuration, params: CreateBrokerSubAccountV1Params) -> Result<models::CreateBrokerSubAccountV1Resp, Error<CreateBrokerSubAccountV1Error>> {
1862
1863    let uri_str = format!("{}/sapi/v1/broker/subAccount", configuration.base_path);
1864    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1865
1866    // Create a mutable vector for query parameters
1867    let mut query_params: Vec<(String, String)> = Vec::new();
1868
1869
1870    // Create header parameters collection
1871    let mut header_params = std::collections::HashMap::new();
1872
1873    // Handle Binance Auth first if configured
1874    if let Some(ref binance_auth) = configuration.binance_auth {
1875        // Add API key to headers
1876        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1877        
1878        // Generate request body for signing (if any)
1879        let body_string: Option<Vec<u8>> = None;
1880        
1881        // Sign the request
1882        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1883            Ok(sig) => sig,
1884            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1885        };
1886        
1887        // Add signature to query params
1888        query_params.push(("signature".to_string(), signature));
1889    }
1890
1891    // Apply all query parameters
1892    if !query_params.is_empty() {
1893        req_builder = req_builder.query(&query_params);
1894    }
1895
1896
1897    // Add user agent if configured
1898    if let Some(ref user_agent) = configuration.user_agent {
1899        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1900    }
1901
1902    // Apply all header parameters
1903    for (header_name, header_value) in header_params {
1904        req_builder = req_builder.header(&header_name, &header_value);
1905    }
1906
1907    let mut multipart_form_params = std::collections::HashMap::new();
1908    if let Some(param_value) = params.recv_window {
1909        multipart_form_params.insert("recvWindow", param_value.to_string());
1910    }
1911    if let Some(param_value) = params.tag {
1912        multipart_form_params.insert("tag", param_value.to_string());
1913    }
1914    multipart_form_params.insert("timestamp", params.timestamp.to_string());
1915    req_builder = req_builder.form(&multipart_form_params);
1916
1917    let req = req_builder.build()?;
1918    let resp = configuration.client.execute(req).await?;
1919
1920    let status = resp.status();
1921    let content_type = resp
1922        .headers()
1923        .get("content-type")
1924        .and_then(|v| v.to_str().ok())
1925        .unwrap_or("application/octet-stream");
1926    let content_type = super::ContentType::from(content_type);
1927
1928    if !status.is_client_error() && !status.is_server_error() {
1929        let content = resp.text().await?;
1930        match content_type {
1931            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1932            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerSubAccountV1Resp`"))),
1933            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::CreateBrokerSubAccountV1Resp`")))),
1934        }
1935    } else {
1936        let content = resp.text().await?;
1937        let entity: Option<CreateBrokerSubAccountV1Error> = serde_json::from_str(&content).ok();
1938        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1939    }
1940}
1941
1942/// Caution: - You need to enable \"internal transfer\" option for the api key which requests this endpoint. - Transfer from master account if fromId not sent. - Transfer to master account if toId not sent. - Each master account could transfer 5000 times/min
1943pub async fn create_broker_transfer_futures_v1(configuration: &configuration::Configuration, params: CreateBrokerTransferFuturesV1Params) -> Result<models::CreateBrokerTransferFuturesV1Resp, Error<CreateBrokerTransferFuturesV1Error>> {
1944
1945    let uri_str = format!("{}/sapi/v1/broker/transfer/futures", configuration.base_path);
1946    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1947
1948    // Create a mutable vector for query parameters
1949    let mut query_params: Vec<(String, String)> = Vec::new();
1950
1951
1952    // Create header parameters collection
1953    let mut header_params = std::collections::HashMap::new();
1954
1955    // Handle Binance Auth first if configured
1956    if let Some(ref binance_auth) = configuration.binance_auth {
1957        // Add API key to headers
1958        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1959        
1960        // Generate request body for signing (if any)
1961        let body_string: Option<Vec<u8>> = None;
1962        
1963        // Sign the request
1964        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1965            Ok(sig) => sig,
1966            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1967        };
1968        
1969        // Add signature to query params
1970        query_params.push(("signature".to_string(), signature));
1971    }
1972
1973    // Apply all query parameters
1974    if !query_params.is_empty() {
1975        req_builder = req_builder.query(&query_params);
1976    }
1977
1978
1979    // Add user agent if configured
1980    if let Some(ref user_agent) = configuration.user_agent {
1981        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1982    }
1983
1984    // Apply all header parameters
1985    for (header_name, header_value) in header_params {
1986        req_builder = req_builder.header(&header_name, &header_value);
1987    }
1988
1989    let mut multipart_form_params = std::collections::HashMap::new();
1990    multipart_form_params.insert("amount", params.amount.to_string());
1991    multipart_form_params.insert("asset", params.asset.to_string());
1992    if let Some(param_value) = params.client_tran_id {
1993        multipart_form_params.insert("clientTranId", param_value.to_string());
1994    }
1995    if let Some(param_value) = params.from_id {
1996        multipart_form_params.insert("fromId", param_value.to_string());
1997    }
1998    multipart_form_params.insert("futuresType", params.futures_type.to_string());
1999    if let Some(param_value) = params.recv_window {
2000        multipart_form_params.insert("recvWindow", param_value.to_string());
2001    }
2002    multipart_form_params.insert("timestamp", params.timestamp.to_string());
2003    if let Some(param_value) = params.to_id {
2004        multipart_form_params.insert("toId", param_value.to_string());
2005    }
2006    req_builder = req_builder.form(&multipart_form_params);
2007
2008    let req = req_builder.build()?;
2009    let resp = configuration.client.execute(req).await?;
2010
2011    let status = resp.status();
2012    let content_type = resp
2013        .headers()
2014        .get("content-type")
2015        .and_then(|v| v.to_str().ok())
2016        .unwrap_or("application/octet-stream");
2017    let content_type = super::ContentType::from(content_type);
2018
2019    if !status.is_client_error() && !status.is_server_error() {
2020        let content = resp.text().await?;
2021        match content_type {
2022            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2023            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerTransferFuturesV1Resp`"))),
2024            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::CreateBrokerTransferFuturesV1Resp`")))),
2025        }
2026    } else {
2027        let content = resp.text().await?;
2028        let entity: Option<CreateBrokerTransferFuturesV1Error> = serde_json::from_str(&content).ok();
2029        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2030    }
2031}
2032
2033/// Caution: - You need to enable \"internal transfer\" option for the api key which requests this endpoint. - Transfer from master account if fromId not sent. - Transfer to master account if toId not sent.
2034pub async fn create_broker_transfer_v1(configuration: &configuration::Configuration, params: CreateBrokerTransferV1Params) -> Result<models::CreateBrokerTransferV1Resp, Error<CreateBrokerTransferV1Error>> {
2035
2036    let uri_str = format!("{}/sapi/v1/broker/transfer", configuration.base_path);
2037    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2038
2039    // Create a mutable vector for query parameters
2040    let mut query_params: Vec<(String, String)> = Vec::new();
2041
2042
2043    // Create header parameters collection
2044    let mut header_params = std::collections::HashMap::new();
2045
2046    // Handle Binance Auth first if configured
2047    if let Some(ref binance_auth) = configuration.binance_auth {
2048        // Add API key to headers
2049        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2050        
2051        // Generate request body for signing (if any)
2052        let body_string: Option<Vec<u8>> = None;
2053        
2054        // Sign the request
2055        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2056            Ok(sig) => sig,
2057            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2058        };
2059        
2060        // Add signature to query params
2061        query_params.push(("signature".to_string(), signature));
2062    }
2063
2064    // Apply all query parameters
2065    if !query_params.is_empty() {
2066        req_builder = req_builder.query(&query_params);
2067    }
2068
2069
2070    // Add user agent if configured
2071    if let Some(ref user_agent) = configuration.user_agent {
2072        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2073    }
2074
2075    // Apply all header parameters
2076    for (header_name, header_value) in header_params {
2077        req_builder = req_builder.header(&header_name, &header_value);
2078    }
2079
2080    let mut multipart_form_params = std::collections::HashMap::new();
2081    multipart_form_params.insert("amount", params.amount.to_string());
2082    multipart_form_params.insert("asset", params.asset.to_string());
2083    if let Some(param_value) = params.client_tran_id {
2084        multipart_form_params.insert("clientTranId", param_value.to_string());
2085    }
2086    if let Some(param_value) = params.from_id {
2087        multipart_form_params.insert("fromId", param_value.to_string());
2088    }
2089    if let Some(param_value) = params.recv_window {
2090        multipart_form_params.insert("recvWindow", param_value.to_string());
2091    }
2092    multipart_form_params.insert("timestamp", params.timestamp.to_string());
2093    if let Some(param_value) = params.to_id {
2094        multipart_form_params.insert("toId", param_value.to_string());
2095    }
2096    req_builder = req_builder.form(&multipart_form_params);
2097
2098    let req = req_builder.build()?;
2099    let resp = configuration.client.execute(req).await?;
2100
2101    let status = resp.status();
2102    let content_type = resp
2103        .headers()
2104        .get("content-type")
2105        .and_then(|v| v.to_str().ok())
2106        .unwrap_or("application/octet-stream");
2107    let content_type = super::ContentType::from(content_type);
2108
2109    if !status.is_client_error() && !status.is_server_error() {
2110        let content = resp.text().await?;
2111        match content_type {
2112            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2113            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerTransferV1Resp`"))),
2114            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::CreateBrokerTransferV1Resp`")))),
2115        }
2116    } else {
2117        let content = resp.text().await?;
2118        let entity: Option<CreateBrokerTransferV1Error> = serde_json::from_str(&content).ok();
2119        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2120    }
2121}
2122
2123/// Caution: - You need to enable \"internal transfer\" option for the api key which requests this endpoint. - Transfer from master account if fromId not sent. - Transfer to master account if toId not sent. - Transfer between futures acount is not supported.
2124pub async fn create_broker_universal_transfer_v1(configuration: &configuration::Configuration, params: CreateBrokerUniversalTransferV1Params) -> Result<models::CreateBrokerUniversalTransferV1Resp, Error<CreateBrokerUniversalTransferV1Error>> {
2125
2126    let uri_str = format!("{}/sapi/v1/broker/universalTransfer", configuration.base_path);
2127    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2128
2129    // Create a mutable vector for query parameters
2130    let mut query_params: Vec<(String, String)> = Vec::new();
2131
2132
2133    // Create header parameters collection
2134    let mut header_params = std::collections::HashMap::new();
2135
2136    // Handle Binance Auth first if configured
2137    if let Some(ref binance_auth) = configuration.binance_auth {
2138        // Add API key to headers
2139        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2140        
2141        // Generate request body for signing (if any)
2142        let body_string: Option<Vec<u8>> = None;
2143        
2144        // Sign the request
2145        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2146            Ok(sig) => sig,
2147            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2148        };
2149        
2150        // Add signature to query params
2151        query_params.push(("signature".to_string(), signature));
2152    }
2153
2154    // Apply all query parameters
2155    if !query_params.is_empty() {
2156        req_builder = req_builder.query(&query_params);
2157    }
2158
2159
2160    // Add user agent if configured
2161    if let Some(ref user_agent) = configuration.user_agent {
2162        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2163    }
2164
2165    // Apply all header parameters
2166    for (header_name, header_value) in header_params {
2167        req_builder = req_builder.header(&header_name, &header_value);
2168    }
2169
2170    let mut multipart_form_params = std::collections::HashMap::new();
2171    multipart_form_params.insert("amount", params.amount.to_string());
2172    multipart_form_params.insert("asset", params.asset.to_string());
2173    if let Some(param_value) = params.client_tran_id {
2174        multipart_form_params.insert("clientTranId", param_value.to_string());
2175    }
2176    multipart_form_params.insert("fromAccountType", params.from_account_type.to_string());
2177    if let Some(param_value) = params.from_id {
2178        multipart_form_params.insert("fromId", param_value.to_string());
2179    }
2180    if let Some(param_value) = params.recv_window {
2181        multipart_form_params.insert("recvWindow", param_value.to_string());
2182    }
2183    multipart_form_params.insert("timestamp", params.timestamp.to_string());
2184    multipart_form_params.insert("toAccountType", params.to_account_type.to_string());
2185    if let Some(param_value) = params.to_id {
2186        multipart_form_params.insert("toId", param_value.to_string());
2187    }
2188    req_builder = req_builder.form(&multipart_form_params);
2189
2190    let req = req_builder.build()?;
2191    let resp = configuration.client.execute(req).await?;
2192
2193    let status = resp.status();
2194    let content_type = resp
2195        .headers()
2196        .get("content-type")
2197        .and_then(|v| v.to_str().ok())
2198        .unwrap_or("application/octet-stream");
2199    let content_type = super::ContentType::from(content_type);
2200
2201    if !status.is_client_error() && !status.is_server_error() {
2202        let content = resp.text().await?;
2203        match content_type {
2204            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2205            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBrokerUniversalTransferV1Resp`"))),
2206            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::CreateBrokerUniversalTransferV1Resp`")))),
2207        }
2208    } else {
2209        let content = resp.text().await?;
2210        let entity: Option<CreateBrokerUniversalTransferV1Error> = serde_json::from_str(&content).ok();
2211        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2212    }
2213}
2214
2215pub async fn delete_broker_sub_account_api_ip_restriction_ip_list_v1(configuration: &configuration::Configuration, params: DeleteBrokerSubAccountApiIpRestrictionIpListV1Params) -> Result<models::DeleteBrokerSubAccountApiIpRestrictionIpListV1Resp, Error<DeleteBrokerSubAccountApiIpRestrictionIpListV1Error>> {
2216
2217    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/ipRestriction/ipList", configuration.base_path);
2218    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2219
2220    // Create a mutable vector for query parameters
2221    let mut query_params: Vec<(String, String)> = Vec::new();
2222
2223    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
2224    query_params.push(("subAccountApiKey".to_string(), params.sub_account_api_key.to_string()));
2225    if let Some(ref param_value) = params.ip_address {
2226        query_params.push(("ipAddress".to_string(), param_value.to_string()));
2227    }
2228    if let Some(ref param_value) = params.recv_window {
2229        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2230    }
2231    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2232
2233    // Create header parameters collection
2234    let mut header_params = std::collections::HashMap::new();
2235
2236    // Handle Binance Auth first if configured
2237    if let Some(ref binance_auth) = configuration.binance_auth {
2238        // Add API key to headers
2239        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2240        
2241        // Generate request body for signing (if any)
2242        let body_string: Option<Vec<u8>> = None;
2243        
2244        // Sign the request
2245        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2246            Ok(sig) => sig,
2247            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2248        };
2249        
2250        // Add signature to query params
2251        query_params.push(("signature".to_string(), signature));
2252    }
2253
2254    // Apply all query parameters
2255    if !query_params.is_empty() {
2256        req_builder = req_builder.query(&query_params);
2257    }
2258
2259
2260    // Add user agent if configured
2261    if let Some(ref user_agent) = configuration.user_agent {
2262        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2263    }
2264
2265    // Apply all header parameters
2266    for (header_name, header_value) in header_params {
2267        req_builder = req_builder.header(&header_name, &header_value);
2268    }
2269
2270
2271    let req = req_builder.build()?;
2272    let resp = configuration.client.execute(req).await?;
2273
2274    let status = resp.status();
2275    let content_type = resp
2276        .headers()
2277        .get("content-type")
2278        .and_then(|v| v.to_str().ok())
2279        .unwrap_or("application/octet-stream");
2280    let content_type = super::ContentType::from(content_type);
2281
2282    if !status.is_client_error() && !status.is_server_error() {
2283        let content = resp.text().await?;
2284        match content_type {
2285            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2286            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteBrokerSubAccountApiIpRestrictionIpListV1Resp`"))),
2287            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::DeleteBrokerSubAccountApiIpRestrictionIpListV1Resp`")))),
2288        }
2289    } else {
2290        let content = resp.text().await?;
2291        let entity: Option<DeleteBrokerSubAccountApiIpRestrictionIpListV1Error> = serde_json::from_str(&content).ok();
2292        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2293    }
2294}
2295
2296/// Caution: - This request will delete a api key for a sub account - You need to enable \"trade\" option for the api key which requests this endpoint - You can only delete 1 api key for each sub account per second
2297pub async fn delete_broker_sub_account_api_v1(configuration: &configuration::Configuration, params: DeleteBrokerSubAccountApiV1Params) -> Result<serde_json::Value, Error<DeleteBrokerSubAccountApiV1Error>> {
2298
2299    let uri_str = format!("{}/sapi/v1/broker/subAccountApi", configuration.base_path);
2300    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2301
2302    // Create a mutable vector for query parameters
2303    let mut query_params: Vec<(String, String)> = Vec::new();
2304
2305    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
2306    query_params.push(("subAccountApiKey".to_string(), params.sub_account_api_key.to_string()));
2307    if let Some(ref param_value) = params.recv_window {
2308        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2309    }
2310    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2311
2312    // Create header parameters collection
2313    let mut header_params = std::collections::HashMap::new();
2314
2315    // Handle Binance Auth first if configured
2316    if let Some(ref binance_auth) = configuration.binance_auth {
2317        // Add API key to headers
2318        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2319        
2320        // Generate request body for signing (if any)
2321        let body_string: Option<Vec<u8>> = None;
2322        
2323        // Sign the request
2324        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2325            Ok(sig) => sig,
2326            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2327        };
2328        
2329        // Add signature to query params
2330        query_params.push(("signature".to_string(), signature));
2331    }
2332
2333    // Apply all query parameters
2334    if !query_params.is_empty() {
2335        req_builder = req_builder.query(&query_params);
2336    }
2337
2338
2339    // Add user agent if configured
2340    if let Some(ref user_agent) = configuration.user_agent {
2341        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2342    }
2343
2344    // Apply all header parameters
2345    for (header_name, header_value) in header_params {
2346        req_builder = req_builder.header(&header_name, &header_value);
2347    }
2348
2349
2350    let req = req_builder.build()?;
2351    let resp = configuration.client.execute(req).await?;
2352
2353    let status = resp.status();
2354    let content_type = resp
2355        .headers()
2356        .get("content-type")
2357        .and_then(|v| v.to_str().ok())
2358        .unwrap_or("application/octet-stream");
2359    let content_type = super::ContentType::from(content_type);
2360
2361    if !status.is_client_error() && !status.is_server_error() {
2362        let content = resp.text().await?;
2363        match content_type {
2364            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2365            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
2366            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
2367        }
2368    } else {
2369        let content = resp.text().await?;
2370        let entity: Option<DeleteBrokerSubAccountApiV1Error> = serde_json::from_str(&content).ok();
2371        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2372    }
2373}
2374
2375pub async fn delete_broker_sub_account_v1(configuration: &configuration::Configuration, params: DeleteBrokerSubAccountV1Params) -> Result<serde_json::Value, Error<DeleteBrokerSubAccountV1Error>> {
2376
2377    let uri_str = format!("{}/sapi/v1/broker/subAccount", configuration.base_path);
2378    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2379
2380    // Create a mutable vector for query parameters
2381    let mut query_params: Vec<(String, String)> = Vec::new();
2382
2383    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
2384    if let Some(ref param_value) = params.recv_window {
2385        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2386    }
2387    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2388
2389    // Create header parameters collection
2390    let mut header_params = std::collections::HashMap::new();
2391
2392    // Handle Binance Auth first if configured
2393    if let Some(ref binance_auth) = configuration.binance_auth {
2394        // Add API key to headers
2395        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2396        
2397        // Generate request body for signing (if any)
2398        let body_string: Option<Vec<u8>> = None;
2399        
2400        // Sign the request
2401        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2402            Ok(sig) => sig,
2403            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2404        };
2405        
2406        // Add signature to query params
2407        query_params.push(("signature".to_string(), signature));
2408    }
2409
2410    // Apply all query parameters
2411    if !query_params.is_empty() {
2412        req_builder = req_builder.query(&query_params);
2413    }
2414
2415
2416    // Add user agent if configured
2417    if let Some(ref user_agent) = configuration.user_agent {
2418        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2419    }
2420
2421    // Apply all header parameters
2422    for (header_name, header_value) in header_params {
2423        req_builder = req_builder.header(&header_name, &header_value);
2424    }
2425
2426
2427    let req = req_builder.build()?;
2428    let resp = configuration.client.execute(req).await?;
2429
2430    let status = resp.status();
2431    let content_type = resp
2432        .headers()
2433        .get("content-type")
2434        .and_then(|v| v.to_str().ok())
2435        .unwrap_or("application/octet-stream");
2436    let content_type = super::ContentType::from(content_type);
2437
2438    if !status.is_client_error() && !status.is_server_error() {
2439        let content = resp.text().await?;
2440        match content_type {
2441            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2442            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
2443            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
2444        }
2445    } else {
2446        let content = resp.text().await?;
2447        let entity: Option<DeleteBrokerSubAccountV1Error> = serde_json::from_str(&content).ok();
2448        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2449    }
2450}
2451
2452/// - CustomerId and email can not be sent at the same time
2453pub async fn get_api_referral_customization_v1(configuration: &configuration::Configuration, params: GetApiReferralCustomizationV1Params) -> Result<Vec<models::GetApiReferralCustomizationV1RespItem>, Error<GetApiReferralCustomizationV1Error>> {
2454
2455    let uri_str = format!("{}/sapi/v1/apiReferral/customization", configuration.base_path);
2456    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2457
2458    // Create a mutable vector for query parameters
2459    let mut query_params: Vec<(String, String)> = Vec::new();
2460
2461    if let Some(ref param_value) = params.customer_id {
2462        query_params.push(("customerId".to_string(), param_value.to_string()));
2463    }
2464    if let Some(ref param_value) = params.email {
2465        query_params.push(("email".to_string(), param_value.to_string()));
2466    }
2467    if let Some(ref param_value) = params.recv_window {
2468        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2469    }
2470    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2471
2472    // Create header parameters collection
2473    let mut header_params = std::collections::HashMap::new();
2474
2475    // Handle Binance Auth first if configured
2476    if let Some(ref binance_auth) = configuration.binance_auth {
2477        // Add API key to headers
2478        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2479        
2480        // Generate request body for signing (if any)
2481        let body_string: Option<Vec<u8>> = None;
2482        
2483        // Sign the request
2484        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2485            Ok(sig) => sig,
2486            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2487        };
2488        
2489        // Add signature to query params
2490        query_params.push(("signature".to_string(), signature));
2491    }
2492
2493    // Apply all query parameters
2494    if !query_params.is_empty() {
2495        req_builder = req_builder.query(&query_params);
2496    }
2497
2498
2499    // Add user agent if configured
2500    if let Some(ref user_agent) = configuration.user_agent {
2501        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2502    }
2503
2504    // Apply all header parameters
2505    for (header_name, header_value) in header_params {
2506        req_builder = req_builder.header(&header_name, &header_value);
2507    }
2508
2509
2510    let req = req_builder.build()?;
2511    let resp = configuration.client.execute(req).await?;
2512
2513    let status = resp.status();
2514    let content_type = resp
2515        .headers()
2516        .get("content-type")
2517        .and_then(|v| v.to_str().ok())
2518        .unwrap_or("application/octet-stream");
2519    let content_type = super::ContentType::from(content_type);
2520
2521    if !status.is_client_error() && !status.is_server_error() {
2522        let content = resp.text().await?;
2523        match content_type {
2524            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2525            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetApiReferralCustomizationV1RespItem&gt;`"))),
2526            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetApiReferralCustomizationV1RespItem&gt;`")))),
2527        }
2528    } else {
2529        let content = resp.text().await?;
2530        let entity: Option<GetApiReferralCustomizationV1Error> = serde_json::from_str(&content).ok();
2531        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2532    }
2533}
2534
2535pub async fn get_api_referral_if_new_user_v1(configuration: &configuration::Configuration, params: GetApiReferralIfNewUserV1Params) -> Result<models::GetApiReferralIfNewUserV1Resp, Error<GetApiReferralIfNewUserV1Error>> {
2536
2537    let uri_str = format!("{}/sapi/v1/apiReferral/ifNewUser", configuration.base_path);
2538    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2539
2540    // Create a mutable vector for query parameters
2541    let mut query_params: Vec<(String, String)> = Vec::new();
2542
2543    query_params.push(("apiAgentCode".to_string(), params.api_agent_code.to_string()));
2544    if let Some(ref param_value) = params.recv_window {
2545        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2546    }
2547    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2548
2549    // Create header parameters collection
2550    let mut header_params = std::collections::HashMap::new();
2551
2552    // Handle Binance Auth first if configured
2553    if let Some(ref binance_auth) = configuration.binance_auth {
2554        // Add API key to headers
2555        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2556        
2557        // Generate request body for signing (if any)
2558        let body_string: Option<Vec<u8>> = None;
2559        
2560        // Sign the request
2561        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2562            Ok(sig) => sig,
2563            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2564        };
2565        
2566        // Add signature to query params
2567        query_params.push(("signature".to_string(), signature));
2568    }
2569
2570    // Apply all query parameters
2571    if !query_params.is_empty() {
2572        req_builder = req_builder.query(&query_params);
2573    }
2574
2575
2576    // Add user agent if configured
2577    if let Some(ref user_agent) = configuration.user_agent {
2578        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2579    }
2580
2581    // Apply all header parameters
2582    for (header_name, header_value) in header_params {
2583        req_builder = req_builder.header(&header_name, &header_value);
2584    }
2585
2586
2587    let req = req_builder.build()?;
2588    let resp = configuration.client.execute(req).await?;
2589
2590    let status = resp.status();
2591    let content_type = resp
2592        .headers()
2593        .get("content-type")
2594        .and_then(|v| v.to_str().ok())
2595        .unwrap_or("application/octet-stream");
2596    let content_type = super::ContentType::from(content_type);
2597
2598    if !status.is_client_error() && !status.is_server_error() {
2599        let content = resp.text().await?;
2600        match content_type {
2601            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2602            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetApiReferralIfNewUserV1Resp`"))),
2603            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::GetApiReferralIfNewUserV1Resp`")))),
2604        }
2605    } else {
2606        let content = resp.text().await?;
2607        let entity: Option<GetApiReferralIfNewUserV1Error> = serde_json::from_str(&content).ok();
2608        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2609    }
2610}
2611
2612/// - Only get the latest history of past 7 days.
2613pub async fn get_api_referral_kickback_recent_record_v1(configuration: &configuration::Configuration, params: GetApiReferralKickbackRecentRecordV1Params) -> Result<Vec<models::GetApiReferralKickbackRecentRecordV1RespItem>, Error<GetApiReferralKickbackRecentRecordV1Error>> {
2614
2615    let uri_str = format!("{}/sapi/v1/apiReferral/kickback/recentRecord", configuration.base_path);
2616    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2617
2618    // Create a mutable vector for query parameters
2619    let mut query_params: Vec<(String, String)> = Vec::new();
2620
2621    if let Some(ref param_value) = params.start_time {
2622        query_params.push(("startTime".to_string(), param_value.to_string()));
2623    }
2624    if let Some(ref param_value) = params.end_time {
2625        query_params.push(("endTime".to_string(), param_value.to_string()));
2626    }
2627    if let Some(ref param_value) = params.limit {
2628        query_params.push(("limit".to_string(), param_value.to_string()));
2629    }
2630    if let Some(ref param_value) = params.recv_window {
2631        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2632    }
2633    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2634
2635    // Create header parameters collection
2636    let mut header_params = std::collections::HashMap::new();
2637
2638    // Handle Binance Auth first if configured
2639    if let Some(ref binance_auth) = configuration.binance_auth {
2640        // Add API key to headers
2641        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2642        
2643        // Generate request body for signing (if any)
2644        let body_string: Option<Vec<u8>> = None;
2645        
2646        // Sign the request
2647        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2648            Ok(sig) => sig,
2649            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2650        };
2651        
2652        // Add signature to query params
2653        query_params.push(("signature".to_string(), signature));
2654    }
2655
2656    // Apply all query parameters
2657    if !query_params.is_empty() {
2658        req_builder = req_builder.query(&query_params);
2659    }
2660
2661
2662    // Add user agent if configured
2663    if let Some(ref user_agent) = configuration.user_agent {
2664        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2665    }
2666
2667    // Apply all header parameters
2668    for (header_name, header_value) in header_params {
2669        req_builder = req_builder.header(&header_name, &header_value);
2670    }
2671
2672
2673    let req = req_builder.build()?;
2674    let resp = configuration.client.execute(req).await?;
2675
2676    let status = resp.status();
2677    let content_type = resp
2678        .headers()
2679        .get("content-type")
2680        .and_then(|v| v.to_str().ok())
2681        .unwrap_or("application/octet-stream");
2682    let content_type = super::ContentType::from(content_type);
2683
2684    if !status.is_client_error() && !status.is_server_error() {
2685        let content = resp.text().await?;
2686        match content_type {
2687            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2688            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetApiReferralKickbackRecentRecordV1RespItem&gt;`"))),
2689            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetApiReferralKickbackRecentRecordV1RespItem&gt;`")))),
2690        }
2691    } else {
2692        let content = resp.text().await?;
2693        let entity: Option<GetApiReferralKickbackRecentRecordV1Error> = serde_json::from_str(&content).ok();
2694        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2695    }
2696}
2697
2698/// - startTime and endTime must be both specified or both omitted. - When both omitted it returns last 7 days. - When both specified the span has to be within 7 days.
2699pub async fn get_api_referral_rebate_recent_record_v1(configuration: &configuration::Configuration, params: GetApiReferralRebateRecentRecordV1Params) -> Result<Vec<models::GetApiReferralRebateRecentRecordV1RespItem>, Error<GetApiReferralRebateRecentRecordV1Error>> {
2700
2701    let uri_str = format!("{}/sapi/v1/apiReferral/rebate/recentRecord", configuration.base_path);
2702    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2703
2704    // Create a mutable vector for query parameters
2705    let mut query_params: Vec<(String, String)> = Vec::new();
2706
2707    if let Some(ref param_value) = params.customer_id {
2708        query_params.push(("customerId".to_string(), param_value.to_string()));
2709    }
2710    query_params.push(("startTime".to_string(), params.start_time.to_string()));
2711    query_params.push(("endTime".to_string(), params.end_time.to_string()));
2712    query_params.push(("limit".to_string(), params.limit.to_string()));
2713    if let Some(ref param_value) = params.recv_window {
2714        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2715    }
2716    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2717
2718    // Create header parameters collection
2719    let mut header_params = std::collections::HashMap::new();
2720
2721    // Handle Binance Auth first if configured
2722    if let Some(ref binance_auth) = configuration.binance_auth {
2723        // Add API key to headers
2724        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2725        
2726        // Generate request body for signing (if any)
2727        let body_string: Option<Vec<u8>> = None;
2728        
2729        // Sign the request
2730        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2731            Ok(sig) => sig,
2732            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2733        };
2734        
2735        // Add signature to query params
2736        query_params.push(("signature".to_string(), signature));
2737    }
2738
2739    // Apply all query parameters
2740    if !query_params.is_empty() {
2741        req_builder = req_builder.query(&query_params);
2742    }
2743
2744
2745    // Add user agent if configured
2746    if let Some(ref user_agent) = configuration.user_agent {
2747        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2748    }
2749
2750    // Apply all header parameters
2751    for (header_name, header_value) in header_params {
2752        req_builder = req_builder.header(&header_name, &header_value);
2753    }
2754
2755
2756    let req = req_builder.build()?;
2757    let resp = configuration.client.execute(req).await?;
2758
2759    let status = resp.status();
2760    let content_type = resp
2761        .headers()
2762        .get("content-type")
2763        .and_then(|v| v.to_str().ok())
2764        .unwrap_or("application/octet-stream");
2765    let content_type = super::ContentType::from(content_type);
2766
2767    if !status.is_client_error() && !status.is_server_error() {
2768        let content = resp.text().await?;
2769        match content_type {
2770            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2771            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetApiReferralRebateRecentRecordV1RespItem&gt;`"))),
2772            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetApiReferralRebateRecentRecordV1RespItem&gt;`")))),
2773        }
2774    } else {
2775        let content = resp.text().await?;
2776        let entity: Option<GetApiReferralRebateRecentRecordV1Error> = serde_json::from_str(&content).ok();
2777        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2778    }
2779}
2780
2781/// - CustomerId must be unique
2782pub async fn get_api_referral_user_customization_v1(configuration: &configuration::Configuration, params: GetApiReferralUserCustomizationV1Params) -> Result<models::GetApiReferralUserCustomizationV1Resp, Error<GetApiReferralUserCustomizationV1Error>> {
2783
2784    let uri_str = format!("{}/sapi/v1/apiReferral/userCustomization", configuration.base_path);
2785    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2786
2787    // Create a mutable vector for query parameters
2788    let mut query_params: Vec<(String, String)> = Vec::new();
2789
2790    query_params.push(("apiAgentCode".to_string(), params.api_agent_code.to_string()));
2791    if let Some(ref param_value) = params.recv_window {
2792        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2793    }
2794    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2795
2796    // Create header parameters collection
2797    let mut header_params = std::collections::HashMap::new();
2798
2799    // Handle Binance Auth first if configured
2800    if let Some(ref binance_auth) = configuration.binance_auth {
2801        // Add API key to headers
2802        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2803        
2804        // Generate request body for signing (if any)
2805        let body_string: Option<Vec<u8>> = None;
2806        
2807        // Sign the request
2808        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2809            Ok(sig) => sig,
2810            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2811        };
2812        
2813        // Add signature to query params
2814        query_params.push(("signature".to_string(), signature));
2815    }
2816
2817    // Apply all query parameters
2818    if !query_params.is_empty() {
2819        req_builder = req_builder.query(&query_params);
2820    }
2821
2822
2823    // Add user agent if configured
2824    if let Some(ref user_agent) = configuration.user_agent {
2825        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2826    }
2827
2828    // Apply all header parameters
2829    for (header_name, header_value) in header_params {
2830        req_builder = req_builder.header(&header_name, &header_value);
2831    }
2832
2833
2834    let req = req_builder.build()?;
2835    let resp = configuration.client.execute(req).await?;
2836
2837    let status = resp.status();
2838    let content_type = resp
2839        .headers()
2840        .get("content-type")
2841        .and_then(|v| v.to_str().ok())
2842        .unwrap_or("application/octet-stream");
2843    let content_type = super::ContentType::from(content_type);
2844
2845    if !status.is_client_error() && !status.is_server_error() {
2846        let content = resp.text().await?;
2847        match content_type {
2848            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2849            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetApiReferralUserCustomizationV1Resp`"))),
2850            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::GetApiReferralUserCustomizationV1Resp`")))),
2851        }
2852    } else {
2853        let content = resp.text().await?;
2854        let entity: Option<GetApiReferralUserCustomizationV1Error> = serde_json::from_str(&content).ok();
2855        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2856    }
2857}
2858
2859pub async fn get_broker_info_v1(configuration: &configuration::Configuration, params: GetBrokerInfoV1Params) -> Result<models::GetBrokerInfoV1Resp, Error<GetBrokerInfoV1Error>> {
2860
2861    let uri_str = format!("{}/sapi/v1/broker/info", configuration.base_path);
2862    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2863
2864    // Create a mutable vector for query parameters
2865    let mut query_params: Vec<(String, String)> = Vec::new();
2866
2867    if let Some(ref param_value) = params.recv_window {
2868        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2869    }
2870    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2871
2872    // Create header parameters collection
2873    let mut header_params = std::collections::HashMap::new();
2874
2875    // Handle Binance Auth first if configured
2876    if let Some(ref binance_auth) = configuration.binance_auth {
2877        // Add API key to headers
2878        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2879        
2880        // Generate request body for signing (if any)
2881        let body_string: Option<Vec<u8>> = None;
2882        
2883        // Sign the request
2884        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2885            Ok(sig) => sig,
2886            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2887        };
2888        
2889        // Add signature to query params
2890        query_params.push(("signature".to_string(), signature));
2891    }
2892
2893    // Apply all query parameters
2894    if !query_params.is_empty() {
2895        req_builder = req_builder.query(&query_params);
2896    }
2897
2898
2899    // Add user agent if configured
2900    if let Some(ref user_agent) = configuration.user_agent {
2901        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2902    }
2903
2904    // Apply all header parameters
2905    for (header_name, header_value) in header_params {
2906        req_builder = req_builder.header(&header_name, &header_value);
2907    }
2908
2909
2910    let req = req_builder.build()?;
2911    let resp = configuration.client.execute(req).await?;
2912
2913    let status = resp.status();
2914    let content_type = resp
2915        .headers()
2916        .get("content-type")
2917        .and_then(|v| v.to_str().ok())
2918        .unwrap_or("application/octet-stream");
2919    let content_type = super::ContentType::from(content_type);
2920
2921    if !status.is_client_error() && !status.is_server_error() {
2922        let content = resp.text().await?;
2923        match content_type {
2924            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2925            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerInfoV1Resp`"))),
2926            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::GetBrokerInfoV1Resp`")))),
2927        }
2928    } else {
2929        let content = resp.text().await?;
2930        let entity: Option<GetBrokerInfoV1Error> = serde_json::from_str(&content).ok();
2931        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2932    }
2933}
2934
2935/// - If filterResult = TRUE, rebates not from its own sub accounts will be filtered out in response.
2936pub async fn get_broker_rebate_futures_recent_record_v1(configuration: &configuration::Configuration, params: GetBrokerRebateFuturesRecentRecordV1Params) -> Result<Vec<models::GetBrokerRebateFuturesRecentRecordV1RespItem>, Error<GetBrokerRebateFuturesRecentRecordV1Error>> {
2937
2938    let uri_str = format!("{}/sapi/v1/broker/rebate/futures/recentRecord", configuration.base_path);
2939    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2940
2941    // Create a mutable vector for query parameters
2942    let mut query_params: Vec<(String, String)> = Vec::new();
2943
2944    query_params.push(("futuresType".to_string(), params.futures_type.to_string()));
2945    query_params.push(("startTime".to_string(), params.start_time.to_string()));
2946    query_params.push(("endTime".to_string(), params.end_time.to_string()));
2947    if let Some(ref param_value) = params.page {
2948        query_params.push(("page".to_string(), param_value.to_string()));
2949    }
2950    if let Some(ref param_value) = params.size {
2951        query_params.push(("size".to_string(), param_value.to_string()));
2952    }
2953    if let Some(ref param_value) = params.filter_result {
2954        query_params.push(("filterResult".to_string(), param_value.to_string()));
2955    }
2956    if let Some(ref param_value) = params.recv_window {
2957        query_params.push(("recvWindow".to_string(), param_value.to_string()));
2958    }
2959    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2960
2961    // Create header parameters collection
2962    let mut header_params = std::collections::HashMap::new();
2963
2964    // Handle Binance Auth first if configured
2965    if let Some(ref binance_auth) = configuration.binance_auth {
2966        // Add API key to headers
2967        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2968        
2969        // Generate request body for signing (if any)
2970        let body_string: Option<Vec<u8>> = None;
2971        
2972        // Sign the request
2973        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2974            Ok(sig) => sig,
2975            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2976        };
2977        
2978        // Add signature to query params
2979        query_params.push(("signature".to_string(), signature));
2980    }
2981
2982    // Apply all query parameters
2983    if !query_params.is_empty() {
2984        req_builder = req_builder.query(&query_params);
2985    }
2986
2987
2988    // Add user agent if configured
2989    if let Some(ref user_agent) = configuration.user_agent {
2990        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2991    }
2992
2993    // Apply all header parameters
2994    for (header_name, header_value) in header_params {
2995        req_builder = req_builder.header(&header_name, &header_value);
2996    }
2997
2998
2999    let req = req_builder.build()?;
3000    let resp = configuration.client.execute(req).await?;
3001
3002    let status = resp.status();
3003    let content_type = resp
3004        .headers()
3005        .get("content-type")
3006        .and_then(|v| v.to_str().ok())
3007        .unwrap_or("application/octet-stream");
3008    let content_type = super::ContentType::from(content_type);
3009
3010    if !status.is_client_error() && !status.is_server_error() {
3011        let content = resp.text().await?;
3012        match content_type {
3013            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3014            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerRebateFuturesRecentRecordV1RespItem&gt;`"))),
3015            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerRebateFuturesRecentRecordV1RespItem&gt;`")))),
3016        }
3017    } else {
3018        let content = resp.text().await?;
3019        let entity: Option<GetBrokerRebateFuturesRecentRecordV1Error> = serde_json::from_str(&content).ok();
3020        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3021    }
3022}
3023
3024/// - The query time period must be less than 7 days (default as the recent 7 days).
3025pub async fn get_broker_rebate_recent_record_v1(configuration: &configuration::Configuration, params: GetBrokerRebateRecentRecordV1Params) -> Result<Vec<models::GetBrokerRebateRecentRecordV1RespItem>, Error<GetBrokerRebateRecentRecordV1Error>> {
3026
3027    let uri_str = format!("{}/sapi/v1/broker/rebate/recentRecord", configuration.base_path);
3028    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3029
3030    // Create a mutable vector for query parameters
3031    let mut query_params: Vec<(String, String)> = Vec::new();
3032
3033    if let Some(ref param_value) = params.sub_account_id {
3034        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3035    }
3036    if let Some(ref param_value) = params.start_time {
3037        query_params.push(("startTime".to_string(), param_value.to_string()));
3038    }
3039    if let Some(ref param_value) = params.end_time {
3040        query_params.push(("endTime".to_string(), param_value.to_string()));
3041    }
3042    if let Some(ref param_value) = params.page {
3043        query_params.push(("page".to_string(), param_value.to_string()));
3044    }
3045    if let Some(ref param_value) = params.size {
3046        query_params.push(("size".to_string(), param_value.to_string()));
3047    }
3048    if let Some(ref param_value) = params.recv_window {
3049        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3050    }
3051    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3052
3053    // Create header parameters collection
3054    let mut header_params = std::collections::HashMap::new();
3055
3056    // Handle Binance Auth first if configured
3057    if let Some(ref binance_auth) = configuration.binance_auth {
3058        // Add API key to headers
3059        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3060        
3061        // Generate request body for signing (if any)
3062        let body_string: Option<Vec<u8>> = None;
3063        
3064        // Sign the request
3065        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3066            Ok(sig) => sig,
3067            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3068        };
3069        
3070        // Add signature to query params
3071        query_params.push(("signature".to_string(), signature));
3072    }
3073
3074    // Apply all query parameters
3075    if !query_params.is_empty() {
3076        req_builder = req_builder.query(&query_params);
3077    }
3078
3079
3080    // Add user agent if configured
3081    if let Some(ref user_agent) = configuration.user_agent {
3082        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3083    }
3084
3085    // Apply all header parameters
3086    for (header_name, header_value) in header_params {
3087        req_builder = req_builder.header(&header_name, &header_value);
3088    }
3089
3090
3091    let req = req_builder.build()?;
3092    let resp = configuration.client.execute(req).await?;
3093
3094    let status = resp.status();
3095    let content_type = resp
3096        .headers()
3097        .get("content-type")
3098        .and_then(|v| v.to_str().ok())
3099        .unwrap_or("application/octet-stream");
3100    let content_type = super::ContentType::from(content_type);
3101
3102    if !status.is_client_error() && !status.is_server_error() {
3103        let content = resp.text().await?;
3104        match content_type {
3105            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3106            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerRebateRecentRecordV1RespItem&gt;`"))),
3107            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerRebateRecentRecordV1RespItem&gt;`")))),
3108        }
3109    } else {
3110        let content = resp.text().await?;
3111        let entity: Option<GetBrokerRebateRecentRecordV1Error> = serde_json::from_str(&content).ok();
3112        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3113    }
3114}
3115
3116/// - The sub-account's COIN-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment. - If symbol not sent, commission adjustment of all symbols will be returned. - If futures disabled, it is not allowed to set subaccount's COIN-Ⓜ futures commission adjustment on any symbol. - Different symbols have the same commission for the same pair
3117pub async fn get_broker_sub_account_api_commission_coin_futures_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountApiCommissionCoinFuturesV1Params) -> Result<Vec<models::GetBrokerSubAccountApiCommissionCoinFuturesV1RespItem>, Error<GetBrokerSubAccountApiCommissionCoinFuturesV1Error>> {
3118
3119    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/commission/coinFutures", configuration.base_path);
3120    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3121
3122    // Create a mutable vector for query parameters
3123    let mut query_params: Vec<(String, String)> = Vec::new();
3124
3125    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3126    if let Some(ref param_value) = params.pair {
3127        query_params.push(("pair".to_string(), param_value.to_string()));
3128    }
3129    if let Some(ref param_value) = params.recv_window {
3130        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3131    }
3132    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3133
3134    // Create header parameters collection
3135    let mut header_params = std::collections::HashMap::new();
3136
3137    // Handle Binance Auth first if configured
3138    if let Some(ref binance_auth) = configuration.binance_auth {
3139        // Add API key to headers
3140        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3141        
3142        // Generate request body for signing (if any)
3143        let body_string: Option<Vec<u8>> = None;
3144        
3145        // Sign the request
3146        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3147            Ok(sig) => sig,
3148            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3149        };
3150        
3151        // Add signature to query params
3152        query_params.push(("signature".to_string(), signature));
3153    }
3154
3155    // Apply all query parameters
3156    if !query_params.is_empty() {
3157        req_builder = req_builder.query(&query_params);
3158    }
3159
3160
3161    // Add user agent if configured
3162    if let Some(ref user_agent) = configuration.user_agent {
3163        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3164    }
3165
3166    // Apply all header parameters
3167    for (header_name, header_value) in header_params {
3168        req_builder = req_builder.header(&header_name, &header_value);
3169    }
3170
3171
3172    let req = req_builder.build()?;
3173    let resp = configuration.client.execute(req).await?;
3174
3175    let status = resp.status();
3176    let content_type = resp
3177        .headers()
3178        .get("content-type")
3179        .and_then(|v| v.to_str().ok())
3180        .unwrap_or("application/octet-stream");
3181    let content_type = super::ContentType::from(content_type);
3182
3183    if !status.is_client_error() && !status.is_server_error() {
3184        let content = resp.text().await?;
3185        match content_type {
3186            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3187            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiCommissionCoinFuturesV1RespItem&gt;`"))),
3188            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiCommissionCoinFuturesV1RespItem&gt;`")))),
3189        }
3190    } else {
3191        let content = resp.text().await?;
3192        let entity: Option<GetBrokerSubAccountApiCommissionCoinFuturesV1Error> = serde_json::from_str(&content).ok();
3193        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3194    }
3195}
3196
3197/// The sub-account's USDT-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.
3198pub async fn get_broker_sub_account_api_commission_futures_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountApiCommissionFuturesV1Params) -> Result<Vec<models::GetBrokerSubAccountApiCommissionFuturesV1RespItem>, Error<GetBrokerSubAccountApiCommissionFuturesV1Error>> {
3199
3200    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/commission/futures", configuration.base_path);
3201    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3202
3203    // Create a mutable vector for query parameters
3204    let mut query_params: Vec<(String, String)> = Vec::new();
3205
3206    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3207    if let Some(ref param_value) = params.symbol {
3208        query_params.push(("symbol".to_string(), param_value.to_string()));
3209    }
3210    if let Some(ref param_value) = params.recv_window {
3211        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3212    }
3213    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3214
3215    // Create header parameters collection
3216    let mut header_params = std::collections::HashMap::new();
3217
3218    // Handle Binance Auth first if configured
3219    if let Some(ref binance_auth) = configuration.binance_auth {
3220        // Add API key to headers
3221        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3222        
3223        // Generate request body for signing (if any)
3224        let body_string: Option<Vec<u8>> = None;
3225        
3226        // Sign the request
3227        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3228            Ok(sig) => sig,
3229            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3230        };
3231        
3232        // Add signature to query params
3233        query_params.push(("signature".to_string(), signature));
3234    }
3235
3236    // Apply all query parameters
3237    if !query_params.is_empty() {
3238        req_builder = req_builder.query(&query_params);
3239    }
3240
3241
3242    // Add user agent if configured
3243    if let Some(ref user_agent) = configuration.user_agent {
3244        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3245    }
3246
3247    // Apply all header parameters
3248    for (header_name, header_value) in header_params {
3249        req_builder = req_builder.header(&header_name, &header_value);
3250    }
3251
3252
3253    let req = req_builder.build()?;
3254    let resp = configuration.client.execute(req).await?;
3255
3256    let status = resp.status();
3257    let content_type = resp
3258        .headers()
3259        .get("content-type")
3260        .and_then(|v| v.to_str().ok())
3261        .unwrap_or("application/octet-stream");
3262    let content_type = super::ContentType::from(content_type);
3263
3264    if !status.is_client_error() && !status.is_server_error() {
3265        let content = resp.text().await?;
3266        match content_type {
3267            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3268            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiCommissionFuturesV1RespItem&gt;`"))),
3269            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiCommissionFuturesV1RespItem&gt;`")))),
3270        }
3271    } else {
3272        let content = resp.text().await?;
3273        let entity: Option<GetBrokerSubAccountApiCommissionFuturesV1Error> = serde_json::from_str(&content).ok();
3274        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3275    }
3276}
3277
3278pub async fn get_broker_sub_account_api_ip_restriction_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountApiIpRestrictionV1Params) -> Result<models::GetBrokerSubAccountApiIpRestrictionV1Resp, Error<GetBrokerSubAccountApiIpRestrictionV1Error>> {
3279
3280    let uri_str = format!("{}/sapi/v1/broker/subAccountApi/ipRestriction", configuration.base_path);
3281    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3282
3283    // Create a mutable vector for query parameters
3284    let mut query_params: Vec<(String, String)> = Vec::new();
3285
3286    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3287    query_params.push(("subAccountApiKey".to_string(), params.sub_account_api_key.to_string()));
3288    if let Some(ref param_value) = params.recv_window {
3289        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3290    }
3291    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3292
3293    // Create header parameters collection
3294    let mut header_params = std::collections::HashMap::new();
3295
3296    // Handle Binance Auth first if configured
3297    if let Some(ref binance_auth) = configuration.binance_auth {
3298        // Add API key to headers
3299        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3300        
3301        // Generate request body for signing (if any)
3302        let body_string: Option<Vec<u8>> = None;
3303        
3304        // Sign the request
3305        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3306            Ok(sig) => sig,
3307            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3308        };
3309        
3310        // Add signature to query params
3311        query_params.push(("signature".to_string(), signature));
3312    }
3313
3314    // Apply all query parameters
3315    if !query_params.is_empty() {
3316        req_builder = req_builder.query(&query_params);
3317    }
3318
3319
3320    // Add user agent if configured
3321    if let Some(ref user_agent) = configuration.user_agent {
3322        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3323    }
3324
3325    // Apply all header parameters
3326    for (header_name, header_value) in header_params {
3327        req_builder = req_builder.header(&header_name, &header_value);
3328    }
3329
3330
3331    let req = req_builder.build()?;
3332    let resp = configuration.client.execute(req).await?;
3333
3334    let status = resp.status();
3335    let content_type = resp
3336        .headers()
3337        .get("content-type")
3338        .and_then(|v| v.to_str().ok())
3339        .unwrap_or("application/octet-stream");
3340    let content_type = super::ContentType::from(content_type);
3341
3342    if !status.is_client_error() && !status.is_server_error() {
3343        let content = resp.text().await?;
3344        match content_type {
3345            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3346            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerSubAccountApiIpRestrictionV1Resp`"))),
3347            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::GetBrokerSubAccountApiIpRestrictionV1Resp`")))),
3348        }
3349    } else {
3350        let content = resp.text().await?;
3351        let entity: Option<GetBrokerSubAccountApiIpRestrictionV1Error> = serde_json::from_str(&content).ok();
3352        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3353    }
3354}
3355
3356/// Caution: - You need to enable \"trade\" option for the api key which requests this endpoint
3357pub async fn get_broker_sub_account_api_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountApiV1Params) -> Result<Vec<models::GetBrokerSubAccountApiV1RespItem>, Error<GetBrokerSubAccountApiV1Error>> {
3358
3359    let uri_str = format!("{}/sapi/v1/broker/subAccountApi", configuration.base_path);
3360    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3361
3362    // Create a mutable vector for query parameters
3363    let mut query_params: Vec<(String, String)> = Vec::new();
3364
3365    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3366    if let Some(ref param_value) = params.sub_account_api_key {
3367        query_params.push(("subAccountApiKey".to_string(), param_value.to_string()));
3368    }
3369    if let Some(ref param_value) = params.page {
3370        query_params.push(("page".to_string(), param_value.to_string()));
3371    }
3372    if let Some(ref param_value) = params.size {
3373        query_params.push(("size".to_string(), param_value.to_string()));
3374    }
3375    if let Some(ref param_value) = params.recv_window {
3376        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3377    }
3378    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3379
3380    // Create header parameters collection
3381    let mut header_params = std::collections::HashMap::new();
3382
3383    // Handle Binance Auth first if configured
3384    if let Some(ref binance_auth) = configuration.binance_auth {
3385        // Add API key to headers
3386        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3387        
3388        // Generate request body for signing (if any)
3389        let body_string: Option<Vec<u8>> = None;
3390        
3391        // Sign the request
3392        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3393            Ok(sig) => sig,
3394            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3395        };
3396        
3397        // Add signature to query params
3398        query_params.push(("signature".to_string(), signature));
3399    }
3400
3401    // Apply all query parameters
3402    if !query_params.is_empty() {
3403        req_builder = req_builder.query(&query_params);
3404    }
3405
3406
3407    // Add user agent if configured
3408    if let Some(ref user_agent) = configuration.user_agent {
3409        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3410    }
3411
3412    // Apply all header parameters
3413    for (header_name, header_value) in header_params {
3414        req_builder = req_builder.header(&header_name, &header_value);
3415    }
3416
3417
3418    let req = req_builder.build()?;
3419    let resp = configuration.client.execute(req).await?;
3420
3421    let status = resp.status();
3422    let content_type = resp
3423        .headers()
3424        .get("content-type")
3425        .and_then(|v| v.to_str().ok())
3426        .unwrap_or("application/octet-stream");
3427    let content_type = super::ContentType::from(content_type);
3428
3429    if !status.is_client_error() && !status.is_server_error() {
3430        let content = resp.text().await?;
3431        match content_type {
3432            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3433            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiV1RespItem&gt;`"))),
3434            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountApiV1RespItem&gt;`")))),
3435        }
3436    } else {
3437        let content = resp.text().await?;
3438        let entity: Option<GetBrokerSubAccountApiV1Error> = serde_json::from_str(&content).ok();
3439        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3440    }
3441}
3442
3443pub async fn get_broker_sub_account_bnb_burn_status_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountBnbBurnStatusV1Params) -> Result<models::GetBrokerSubAccountBnbBurnStatusV1Resp, Error<GetBrokerSubAccountBnbBurnStatusV1Error>> {
3444
3445    let uri_str = format!("{}/sapi/v1/broker/subAccount/bnbBurn/status", configuration.base_path);
3446    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3447
3448    // Create a mutable vector for query parameters
3449    let mut query_params: Vec<(String, String)> = Vec::new();
3450
3451    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3452    if let Some(ref param_value) = params.recv_window {
3453        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3454    }
3455    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3456
3457    // Create header parameters collection
3458    let mut header_params = std::collections::HashMap::new();
3459
3460    // Handle Binance Auth first if configured
3461    if let Some(ref binance_auth) = configuration.binance_auth {
3462        // Add API key to headers
3463        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3464        
3465        // Generate request body for signing (if any)
3466        let body_string: Option<Vec<u8>> = None;
3467        
3468        // Sign the request
3469        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3470            Ok(sig) => sig,
3471            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3472        };
3473        
3474        // Add signature to query params
3475        query_params.push(("signature".to_string(), signature));
3476    }
3477
3478    // Apply all query parameters
3479    if !query_params.is_empty() {
3480        req_builder = req_builder.query(&query_params);
3481    }
3482
3483
3484    // Add user agent if configured
3485    if let Some(ref user_agent) = configuration.user_agent {
3486        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3487    }
3488
3489    // Apply all header parameters
3490    for (header_name, header_value) in header_params {
3491        req_builder = req_builder.header(&header_name, &header_value);
3492    }
3493
3494
3495    let req = req_builder.build()?;
3496    let resp = configuration.client.execute(req).await?;
3497
3498    let status = resp.status();
3499    let content_type = resp
3500        .headers()
3501        .get("content-type")
3502        .and_then(|v| v.to_str().ok())
3503        .unwrap_or("application/octet-stream");
3504    let content_type = super::ContentType::from(content_type);
3505
3506    if !status.is_client_error() && !status.is_server_error() {
3507        let content = resp.text().await?;
3508        match content_type {
3509            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3510            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerSubAccountBnbBurnStatusV1Resp`"))),
3511            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::GetBrokerSubAccountBnbBurnStatusV1Resp`")))),
3512        }
3513    } else {
3514        let content = resp.text().await?;
3515        let entity: Option<GetBrokerSubAccountBnbBurnStatusV1Error> = serde_json::from_str(&content).ok();
3516        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3517    }
3518}
3519
3520/// - The query time period must be less than 7 days( default as the recent 7 days).
3521pub async fn get_broker_sub_account_deposit_hist_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountDepositHistV1Params) -> Result<Vec<models::GetBrokerSubAccountDepositHistV1RespItem>, Error<GetBrokerSubAccountDepositHistV1Error>> {
3522
3523    let uri_str = format!("{}/sapi/v1/broker/subAccount/depositHist", configuration.base_path);
3524    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3525
3526    // Create a mutable vector for query parameters
3527    let mut query_params: Vec<(String, String)> = Vec::new();
3528
3529    if let Some(ref param_value) = params.sub_account_id {
3530        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3531    }
3532    if let Some(ref param_value) = params.coin {
3533        query_params.push(("coin".to_string(), param_value.to_string()));
3534    }
3535    if let Some(ref param_value) = params.status {
3536        query_params.push(("status".to_string(), param_value.to_string()));
3537    }
3538    if let Some(ref param_value) = params.start_time {
3539        query_params.push(("startTime".to_string(), param_value.to_string()));
3540    }
3541    if let Some(ref param_value) = params.end_time {
3542        query_params.push(("endTime".to_string(), param_value.to_string()));
3543    }
3544    if let Some(ref param_value) = params.limit {
3545        query_params.push(("limit".to_string(), param_value.to_string()));
3546    }
3547    if let Some(ref param_value) = params.offset {
3548        query_params.push(("offset".to_string(), param_value.to_string()));
3549    }
3550    if let Some(ref param_value) = params.recv_window {
3551        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3552    }
3553    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3554
3555    // Create header parameters collection
3556    let mut header_params = std::collections::HashMap::new();
3557
3558    // Handle Binance Auth first if configured
3559    if let Some(ref binance_auth) = configuration.binance_auth {
3560        // Add API key to headers
3561        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3562        
3563        // Generate request body for signing (if any)
3564        let body_string: Option<Vec<u8>> = None;
3565        
3566        // Sign the request
3567        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3568            Ok(sig) => sig,
3569            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3570        };
3571        
3572        // Add signature to query params
3573        query_params.push(("signature".to_string(), signature));
3574    }
3575
3576    // Apply all query parameters
3577    if !query_params.is_empty() {
3578        req_builder = req_builder.query(&query_params);
3579    }
3580
3581
3582    // Add user agent if configured
3583    if let Some(ref user_agent) = configuration.user_agent {
3584        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3585    }
3586
3587    // Apply all header parameters
3588    for (header_name, header_value) in header_params {
3589        req_builder = req_builder.header(&header_name, &header_value);
3590    }
3591
3592
3593    let req = req_builder.build()?;
3594    let resp = configuration.client.execute(req).await?;
3595
3596    let status = resp.status();
3597    let content_type = resp
3598        .headers()
3599        .get("content-type")
3600        .and_then(|v| v.to_str().ok())
3601        .unwrap_or("application/octet-stream");
3602    let content_type = super::ContentType::from(content_type);
3603
3604    if !status.is_client_error() && !status.is_server_error() {
3605        let content = resp.text().await?;
3606        match content_type {
3607            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3608            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountDepositHistV1RespItem&gt;`"))),
3609            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountDepositHistV1RespItem&gt;`")))),
3610        }
3611    } else {
3612        let content = resp.text().await?;
3613        let entity: Option<GetBrokerSubAccountDepositHistV1Error> = serde_json::from_str(&content).ok();
3614        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3615    }
3616}
3617
3618pub async fn get_broker_sub_account_deposit_hist_v2(configuration: &configuration::Configuration, params: GetBrokerSubAccountDepositHistV2Params) -> Result<Vec<models::GetBrokerSubAccountDepositHistV2RespItem>, Error<GetBrokerSubAccountDepositHistV2Error>> {
3619
3620    let uri_str = format!("{}/sapi/v2/broker/subAccount/depositHist", configuration.base_path);
3621    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3622
3623    // Create a mutable vector for query parameters
3624    let mut query_params: Vec<(String, String)> = Vec::new();
3625
3626    query_params.push(("depositId".to_string(), params.deposit_id.to_string()));
3627    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
3628    if let Some(ref param_value) = params.limit {
3629        query_params.push(("limit".to_string(), param_value.to_string()));
3630    }
3631    if let Some(ref param_value) = params.offset {
3632        query_params.push(("offset".to_string(), param_value.to_string()));
3633    }
3634    if let Some(ref param_value) = params.recv_window {
3635        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3636    }
3637    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3638
3639    // Create header parameters collection
3640    let mut header_params = std::collections::HashMap::new();
3641
3642    // Handle Binance Auth first if configured
3643    if let Some(ref binance_auth) = configuration.binance_auth {
3644        // Add API key to headers
3645        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3646        
3647        // Generate request body for signing (if any)
3648        let body_string: Option<Vec<u8>> = None;
3649        
3650        // Sign the request
3651        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3652            Ok(sig) => sig,
3653            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3654        };
3655        
3656        // Add signature to query params
3657        query_params.push(("signature".to_string(), signature));
3658    }
3659
3660    // Apply all query parameters
3661    if !query_params.is_empty() {
3662        req_builder = req_builder.query(&query_params);
3663    }
3664
3665
3666    // Add user agent if configured
3667    if let Some(ref user_agent) = configuration.user_agent {
3668        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3669    }
3670
3671    // Apply all header parameters
3672    for (header_name, header_value) in header_params {
3673        req_builder = req_builder.header(&header_name, &header_value);
3674    }
3675
3676
3677    let req = req_builder.build()?;
3678    let resp = configuration.client.execute(req).await?;
3679
3680    let status = resp.status();
3681    let content_type = resp
3682        .headers()
3683        .get("content-type")
3684        .and_then(|v| v.to_str().ok())
3685        .unwrap_or("application/octet-stream");
3686    let content_type = super::ContentType::from(content_type);
3687
3688    if !status.is_client_error() && !status.is_server_error() {
3689        let content = resp.text().await?;
3690        match content_type {
3691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3692            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountDepositHistV2RespItem&gt;`"))),
3693            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountDepositHistV2RespItem&gt;`")))),
3694        }
3695    } else {
3696        let content = resp.text().await?;
3697        let entity: Option<GetBrokerSubAccountDepositHistV2Error> = serde_json::from_str(&content).ok();
3698        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3699    }
3700}
3701
3702pub async fn get_broker_sub_account_futures_summary_v3(configuration: &configuration::Configuration, params: GetBrokerSubAccountFuturesSummaryV3Params) -> Result<models::ExchangelinkGetBrokerSubAccountFuturesSummaryV3Resp, Error<GetBrokerSubAccountFuturesSummaryV3Error>> {
3703
3704    let uri_str = format!("{}/sapi/v3/broker/subAccount/futuresSummary", configuration.base_path);
3705    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3706
3707    // Create a mutable vector for query parameters
3708    let mut query_params: Vec<(String, String)> = Vec::new();
3709
3710    if let Some(ref param_value) = params.sub_account_id {
3711        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3712    }
3713    query_params.push(("futuresType".to_string(), params.futures_type.to_string()));
3714    if let Some(ref param_value) = params.page {
3715        query_params.push(("page".to_string(), param_value.to_string()));
3716    }
3717    if let Some(ref param_value) = params.size {
3718        query_params.push(("size".to_string(), param_value.to_string()));
3719    }
3720    if let Some(ref param_value) = params.recv_window {
3721        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3722    }
3723    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3724
3725    // Create header parameters collection
3726    let mut header_params = std::collections::HashMap::new();
3727
3728    // Handle Binance Auth first if configured
3729    if let Some(ref binance_auth) = configuration.binance_auth {
3730        // Add API key to headers
3731        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3732        
3733        // Generate request body for signing (if any)
3734        let body_string: Option<Vec<u8>> = None;
3735        
3736        // Sign the request
3737        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3738            Ok(sig) => sig,
3739            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3740        };
3741        
3742        // Add signature to query params
3743        query_params.push(("signature".to_string(), signature));
3744    }
3745
3746    // Apply all query parameters
3747    if !query_params.is_empty() {
3748        req_builder = req_builder.query(&query_params);
3749    }
3750
3751
3752    // Add user agent if configured
3753    if let Some(ref user_agent) = configuration.user_agent {
3754        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3755    }
3756
3757    // Apply all header parameters
3758    for (header_name, header_value) in header_params {
3759        req_builder = req_builder.header(&header_name, &header_value);
3760    }
3761
3762
3763    let req = req_builder.build()?;
3764    let resp = configuration.client.execute(req).await?;
3765
3766    let status = resp.status();
3767    let content_type = resp
3768        .headers()
3769        .get("content-type")
3770        .and_then(|v| v.to_str().ok())
3771        .unwrap_or("application/octet-stream");
3772    let content_type = super::ContentType::from(content_type);
3773
3774    if !status.is_client_error() && !status.is_server_error() {
3775        let content = resp.text().await?;
3776        match content_type {
3777            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3778            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ExchangelinkGetBrokerSubAccountFuturesSummaryV3Resp`"))),
3779            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::ExchangelinkGetBrokerSubAccountFuturesSummaryV3Resp`")))),
3780        }
3781    } else {
3782        let content = resp.text().await?;
3783        let entity: Option<GetBrokerSubAccountFuturesSummaryV3Error> = serde_json::from_str(&content).ok();
3784        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3785    }
3786}
3787
3788/// - If subaccountId is not sent, the size must be sent
3789pub async fn get_broker_sub_account_margin_summary_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountMarginSummaryV1Params) -> Result<models::GetBrokerSubAccountMarginSummaryV1Resp, Error<GetBrokerSubAccountMarginSummaryV1Error>> {
3790
3791    let uri_str = format!("{}/sapi/v1/broker/subAccount/marginSummary", configuration.base_path);
3792    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3793
3794    // Create a mutable vector for query parameters
3795    let mut query_params: Vec<(String, String)> = Vec::new();
3796
3797    if let Some(ref param_value) = params.sub_account_id {
3798        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3799    }
3800    if let Some(ref param_value) = params.page {
3801        query_params.push(("page".to_string(), param_value.to_string()));
3802    }
3803    if let Some(ref param_value) = params.size {
3804        query_params.push(("size".to_string(), param_value.to_string()));
3805    }
3806    if let Some(ref param_value) = params.recv_window {
3807        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3808    }
3809    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3810
3811    // Create header parameters collection
3812    let mut header_params = std::collections::HashMap::new();
3813
3814    // Handle Binance Auth first if configured
3815    if let Some(ref binance_auth) = configuration.binance_auth {
3816        // Add API key to headers
3817        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3818        
3819        // Generate request body for signing (if any)
3820        let body_string: Option<Vec<u8>> = None;
3821        
3822        // Sign the request
3823        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3824            Ok(sig) => sig,
3825            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3826        };
3827        
3828        // Add signature to query params
3829        query_params.push(("signature".to_string(), signature));
3830    }
3831
3832    // Apply all query parameters
3833    if !query_params.is_empty() {
3834        req_builder = req_builder.query(&query_params);
3835    }
3836
3837
3838    // Add user agent if configured
3839    if let Some(ref user_agent) = configuration.user_agent {
3840        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3841    }
3842
3843    // Apply all header parameters
3844    for (header_name, header_value) in header_params {
3845        req_builder = req_builder.header(&header_name, &header_value);
3846    }
3847
3848
3849    let req = req_builder.build()?;
3850    let resp = configuration.client.execute(req).await?;
3851
3852    let status = resp.status();
3853    let content_type = resp
3854        .headers()
3855        .get("content-type")
3856        .and_then(|v| v.to_str().ok())
3857        .unwrap_or("application/octet-stream");
3858    let content_type = super::ContentType::from(content_type);
3859
3860    if !status.is_client_error() && !status.is_server_error() {
3861        let content = resp.text().await?;
3862        match content_type {
3863            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3864            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerSubAccountMarginSummaryV1Resp`"))),
3865            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::GetBrokerSubAccountMarginSummaryV1Resp`")))),
3866        }
3867    } else {
3868        let content = resp.text().await?;
3869        let entity: Option<GetBrokerSubAccountMarginSummaryV1Error> = serde_json::from_str(&content).ok();
3870        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3871    }
3872}
3873
3874/// - If subaccountId is not sent, the size must be sent - Requests per UID are limited to 60 requests per minute
3875pub async fn get_broker_sub_account_spot_summary_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountSpotSummaryV1Params) -> Result<models::GetBrokerSubAccountSpotSummaryV1Resp, Error<GetBrokerSubAccountSpotSummaryV1Error>> {
3876
3877    let uri_str = format!("{}/sapi/v1/broker/subAccount/spotSummary", configuration.base_path);
3878    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3879
3880    // Create a mutable vector for query parameters
3881    let mut query_params: Vec<(String, String)> = Vec::new();
3882
3883    if let Some(ref param_value) = params.sub_account_id {
3884        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3885    }
3886    if let Some(ref param_value) = params.page {
3887        query_params.push(("page".to_string(), param_value.to_string()));
3888    }
3889    if let Some(ref param_value) = params.size {
3890        query_params.push(("size".to_string(), param_value.to_string()));
3891    }
3892    if let Some(ref param_value) = params.recv_window {
3893        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3894    }
3895    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3896
3897    // Create header parameters collection
3898    let mut header_params = std::collections::HashMap::new();
3899
3900    // Handle Binance Auth first if configured
3901    if let Some(ref binance_auth) = configuration.binance_auth {
3902        // Add API key to headers
3903        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3904        
3905        // Generate request body for signing (if any)
3906        let body_string: Option<Vec<u8>> = None;
3907        
3908        // Sign the request
3909        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3910            Ok(sig) => sig,
3911            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3912        };
3913        
3914        // Add signature to query params
3915        query_params.push(("signature".to_string(), signature));
3916    }
3917
3918    // Apply all query parameters
3919    if !query_params.is_empty() {
3920        req_builder = req_builder.query(&query_params);
3921    }
3922
3923
3924    // Add user agent if configured
3925    if let Some(ref user_agent) = configuration.user_agent {
3926        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3927    }
3928
3929    // Apply all header parameters
3930    for (header_name, header_value) in header_params {
3931        req_builder = req_builder.header(&header_name, &header_value);
3932    }
3933
3934
3935    let req = req_builder.build()?;
3936    let resp = configuration.client.execute(req).await?;
3937
3938    let status = resp.status();
3939    let content_type = resp
3940        .headers()
3941        .get("content-type")
3942        .and_then(|v| v.to_str().ok())
3943        .unwrap_or("application/octet-stream");
3944    let content_type = super::ContentType::from(content_type);
3945
3946    if !status.is_client_error() && !status.is_server_error() {
3947        let content = resp.text().await?;
3948        match content_type {
3949            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3950            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerSubAccountSpotSummaryV1Resp`"))),
3951            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::GetBrokerSubAccountSpotSummaryV1Resp`")))),
3952        }
3953    } else {
3954        let content = resp.text().await?;
3955        let entity: Option<GetBrokerSubAccountSpotSummaryV1Error> = serde_json::from_str(&content).ok();
3956        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3957    }
3958}
3959
3960pub async fn get_broker_sub_account_v1(configuration: &configuration::Configuration, params: GetBrokerSubAccountV1Params) -> Result<Vec<models::GetBrokerSubAccountV1RespItem>, Error<GetBrokerSubAccountV1Error>> {
3961
3962    let uri_str = format!("{}/sapi/v1/broker/subAccount", configuration.base_path);
3963    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3964
3965    // Create a mutable vector for query parameters
3966    let mut query_params: Vec<(String, String)> = Vec::new();
3967
3968    if let Some(ref param_value) = params.sub_account_id {
3969        query_params.push(("subAccountId".to_string(), param_value.to_string()));
3970    }
3971    if let Some(ref param_value) = params.page {
3972        query_params.push(("page".to_string(), param_value.to_string()));
3973    }
3974    if let Some(ref param_value) = params.size {
3975        query_params.push(("size".to_string(), param_value.to_string()));
3976    }
3977    if let Some(ref param_value) = params.recv_window {
3978        query_params.push(("recvWindow".to_string(), param_value.to_string()));
3979    }
3980    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3981
3982    // Create header parameters collection
3983    let mut header_params = std::collections::HashMap::new();
3984
3985    // Handle Binance Auth first if configured
3986    if let Some(ref binance_auth) = configuration.binance_auth {
3987        // Add API key to headers
3988        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3989        
3990        // Generate request body for signing (if any)
3991        let body_string: Option<Vec<u8>> = None;
3992        
3993        // Sign the request
3994        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3995            Ok(sig) => sig,
3996            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3997        };
3998        
3999        // Add signature to query params
4000        query_params.push(("signature".to_string(), signature));
4001    }
4002
4003    // Apply all query parameters
4004    if !query_params.is_empty() {
4005        req_builder = req_builder.query(&query_params);
4006    }
4007
4008
4009    // Add user agent if configured
4010    if let Some(ref user_agent) = configuration.user_agent {
4011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4012    }
4013
4014    // Apply all header parameters
4015    for (header_name, header_value) in header_params {
4016        req_builder = req_builder.header(&header_name, &header_value);
4017    }
4018
4019
4020    let req = req_builder.build()?;
4021    let resp = configuration.client.execute(req).await?;
4022
4023    let status = resp.status();
4024    let content_type = resp
4025        .headers()
4026        .get("content-type")
4027        .and_then(|v| v.to_str().ok())
4028        .unwrap_or("application/octet-stream");
4029    let content_type = super::ContentType::from(content_type);
4030
4031    if !status.is_client_error() && !status.is_server_error() {
4032        let content = resp.text().await?;
4033        match content_type {
4034            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4035            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountV1RespItem&gt;`"))),
4036            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerSubAccountV1RespItem&gt;`")))),
4037        }
4038    } else {
4039        let content = resp.text().await?;
4040        let entity: Option<GetBrokerSubAccountV1Error> = serde_json::from_str(&content).ok();
4041        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4042    }
4043}
4044
4045/// - Only get the latest history of past 30 days.
4046pub async fn get_broker_transfer_futures_v1(configuration: &configuration::Configuration, params: GetBrokerTransferFuturesV1Params) -> Result<models::GetBrokerTransferFuturesV1Resp, Error<GetBrokerTransferFuturesV1Error>> {
4047
4048    let uri_str = format!("{}/sapi/v1/broker/transfer/futures", configuration.base_path);
4049    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4050
4051    // Create a mutable vector for query parameters
4052    let mut query_params: Vec<(String, String)> = Vec::new();
4053
4054    query_params.push(("subAccountId".to_string(), params.sub_account_id.to_string()));
4055    query_params.push(("futuresType".to_string(), params.futures_type.to_string()));
4056    if let Some(ref param_value) = params.client_tran_id {
4057        query_params.push(("clientTranId".to_string(), param_value.to_string()));
4058    }
4059    if let Some(ref param_value) = params.start_time {
4060        query_params.push(("startTime".to_string(), param_value.to_string()));
4061    }
4062    if let Some(ref param_value) = params.end_time {
4063        query_params.push(("endTime".to_string(), param_value.to_string()));
4064    }
4065    if let Some(ref param_value) = params.page {
4066        query_params.push(("page".to_string(), param_value.to_string()));
4067    }
4068    if let Some(ref param_value) = params.limit {
4069        query_params.push(("limit".to_string(), param_value.to_string()));
4070    }
4071    if let Some(ref param_value) = params.recv_window {
4072        query_params.push(("recvWindow".to_string(), param_value.to_string()));
4073    }
4074    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
4075
4076    // Create header parameters collection
4077    let mut header_params = std::collections::HashMap::new();
4078
4079    // Handle Binance Auth first if configured
4080    if let Some(ref binance_auth) = configuration.binance_auth {
4081        // Add API key to headers
4082        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4083        
4084        // Generate request body for signing (if any)
4085        let body_string: Option<Vec<u8>> = None;
4086        
4087        // Sign the request
4088        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4089            Ok(sig) => sig,
4090            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4091        };
4092        
4093        // Add signature to query params
4094        query_params.push(("signature".to_string(), signature));
4095    }
4096
4097    // Apply all query parameters
4098    if !query_params.is_empty() {
4099        req_builder = req_builder.query(&query_params);
4100    }
4101
4102
4103    // Add user agent if configured
4104    if let Some(ref user_agent) = configuration.user_agent {
4105        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4106    }
4107
4108    // Apply all header parameters
4109    for (header_name, header_value) in header_params {
4110        req_builder = req_builder.header(&header_name, &header_value);
4111    }
4112
4113
4114    let req = req_builder.build()?;
4115    let resp = configuration.client.execute(req).await?;
4116
4117    let status = resp.status();
4118    let content_type = resp
4119        .headers()
4120        .get("content-type")
4121        .and_then(|v| v.to_str().ok())
4122        .unwrap_or("application/octet-stream");
4123    let content_type = super::ContentType::from(content_type);
4124
4125    if !status.is_client_error() && !status.is_server_error() {
4126        let content = resp.text().await?;
4127        match content_type {
4128            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4129            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetBrokerTransferFuturesV1Resp`"))),
4130            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::GetBrokerTransferFuturesV1Resp`")))),
4131        }
4132    } else {
4133        let content = resp.text().await?;
4134        let entity: Option<GetBrokerTransferFuturesV1Error> = serde_json::from_str(&content).ok();
4135        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4136    }
4137}
4138
4139/// Caution: - If showAllStatus is true, the status in response will show four types: INIT,PROCESS,SUCCESS,FAILURE. - If showAllStatus is false, the status in response will show three types: INIT,PROCESS,SUCCESS. - Either fromId or toId must be sent. Return fromId equal master account by default. Query scope is limited to 100 days: - Both startTime and endTime are provided: If it exceeds, the endTime will be re-calculated 100 days after the startTime. - Neither startTime nor endTime are provided: Calculate 100 days before today. - endTime is not provided: Calculate 100 days after startTime. - startTime is not provided: Calculate 100 days before endTime.
4140pub async fn get_broker_transfer_v1(configuration: &configuration::Configuration, params: GetBrokerTransferV1Params) -> Result<Vec<models::GetBrokerTransferV1RespItem>, Error<GetBrokerTransferV1Error>> {
4141
4142    let uri_str = format!("{}/sapi/v1/broker/transfer", configuration.base_path);
4143    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4144
4145    // Create a mutable vector for query parameters
4146    let mut query_params: Vec<(String, String)> = Vec::new();
4147
4148    if let Some(ref param_value) = params.from_id {
4149        query_params.push(("fromId".to_string(), param_value.to_string()));
4150    }
4151    if let Some(ref param_value) = params.to_id {
4152        query_params.push(("toId".to_string(), param_value.to_string()));
4153    }
4154    if let Some(ref param_value) = params.client_tran_id {
4155        query_params.push(("clientTranId".to_string(), param_value.to_string()));
4156    }
4157    if let Some(ref param_value) = params.show_all_status {
4158        query_params.push(("showAllStatus".to_string(), param_value.to_string()));
4159    }
4160    if let Some(ref param_value) = params.start_time {
4161        query_params.push(("startTime".to_string(), param_value.to_string()));
4162    }
4163    if let Some(ref param_value) = params.end_time {
4164        query_params.push(("endTime".to_string(), param_value.to_string()));
4165    }
4166    if let Some(ref param_value) = params.page {
4167        query_params.push(("page".to_string(), param_value.to_string()));
4168    }
4169    if let Some(ref param_value) = params.limit {
4170        query_params.push(("limit".to_string(), param_value.to_string()));
4171    }
4172    if let Some(ref param_value) = params.recv_window {
4173        query_params.push(("recvWindow".to_string(), param_value.to_string()));
4174    }
4175    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
4176
4177    // Create header parameters collection
4178    let mut header_params = std::collections::HashMap::new();
4179
4180    // Handle Binance Auth first if configured
4181    if let Some(ref binance_auth) = configuration.binance_auth {
4182        // Add API key to headers
4183        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4184        
4185        // Generate request body for signing (if any)
4186        let body_string: Option<Vec<u8>> = None;
4187        
4188        // Sign the request
4189        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4190            Ok(sig) => sig,
4191            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4192        };
4193        
4194        // Add signature to query params
4195        query_params.push(("signature".to_string(), signature));
4196    }
4197
4198    // Apply all query parameters
4199    if !query_params.is_empty() {
4200        req_builder = req_builder.query(&query_params);
4201    }
4202
4203
4204    // Add user agent if configured
4205    if let Some(ref user_agent) = configuration.user_agent {
4206        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4207    }
4208
4209    // Apply all header parameters
4210    for (header_name, header_value) in header_params {
4211        req_builder = req_builder.header(&header_name, &header_value);
4212    }
4213
4214
4215    let req = req_builder.build()?;
4216    let resp = configuration.client.execute(req).await?;
4217
4218    let status = resp.status();
4219    let content_type = resp
4220        .headers()
4221        .get("content-type")
4222        .and_then(|v| v.to_str().ok())
4223        .unwrap_or("application/octet-stream");
4224    let content_type = super::ContentType::from(content_type);
4225
4226    if !status.is_client_error() && !status.is_server_error() {
4227        let content = resp.text().await?;
4228        match content_type {
4229            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4230            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerTransferV1RespItem&gt;`"))),
4231            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerTransferV1RespItem&gt;`")))),
4232        }
4233    } else {
4234        let content = resp.text().await?;
4235        let entity: Option<GetBrokerTransferV1Error> = serde_json::from_str(&content).ok();
4236        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4237    }
4238}
4239
4240/// Caution: - Either fromId or toId must be sent. - If either fromId or toId is the master account itself, it will not return in response. - If showAllStatus is true, the status in response will show four types: INIT,PROCESS,SUCCESS,FAILURE. Query scope is limited to 100 days: - Both startTime and endTime are provided: If it exceeds, the endTime will be re-calculated 100 days after the startTime. - Neither startTime nor endTime are provided: Calculate 30 days before today. - endTime is not provided: Calculate as Current time. - startTime is not provided: Calculate 30 days before endTime.
4241pub async fn get_broker_universal_transfer_v1(configuration: &configuration::Configuration, params: GetBrokerUniversalTransferV1Params) -> Result<Vec<models::GetBrokerUniversalTransferV1RespItem>, Error<GetBrokerUniversalTransferV1Error>> {
4242
4243    let uri_str = format!("{}/sapi/v1/broker/universalTransfer", configuration.base_path);
4244    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4245
4246    // Create a mutable vector for query parameters
4247    let mut query_params: Vec<(String, String)> = Vec::new();
4248
4249    if let Some(ref param_value) = params.from_id {
4250        query_params.push(("fromId".to_string(), param_value.to_string()));
4251    }
4252    if let Some(ref param_value) = params.to_id {
4253        query_params.push(("toId".to_string(), param_value.to_string()));
4254    }
4255    if let Some(ref param_value) = params.client_tran_id {
4256        query_params.push(("clientTranId".to_string(), param_value.to_string()));
4257    }
4258    if let Some(ref param_value) = params.start_time {
4259        query_params.push(("startTime".to_string(), param_value.to_string()));
4260    }
4261    if let Some(ref param_value) = params.end_time {
4262        query_params.push(("endTime".to_string(), param_value.to_string()));
4263    }
4264    if let Some(ref param_value) = params.page {
4265        query_params.push(("page".to_string(), param_value.to_string()));
4266    }
4267    if let Some(ref param_value) = params.limit {
4268        query_params.push(("limit".to_string(), param_value.to_string()));
4269    }
4270    if let Some(ref param_value) = params.show_all_status {
4271        query_params.push(("showAllStatus".to_string(), param_value.to_string()));
4272    }
4273    if let Some(ref param_value) = params.recv_window {
4274        query_params.push(("recvWindow".to_string(), param_value.to_string()));
4275    }
4276    query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
4277
4278    // Create header parameters collection
4279    let mut header_params = std::collections::HashMap::new();
4280
4281    // Handle Binance Auth first if configured
4282    if let Some(ref binance_auth) = configuration.binance_auth {
4283        // Add API key to headers
4284        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4285        
4286        // Generate request body for signing (if any)
4287        let body_string: Option<Vec<u8>> = None;
4288        
4289        // Sign the request
4290        let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4291            Ok(sig) => sig,
4292            Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4293        };
4294        
4295        // Add signature to query params
4296        query_params.push(("signature".to_string(), signature));
4297    }
4298
4299    // Apply all query parameters
4300    if !query_params.is_empty() {
4301        req_builder = req_builder.query(&query_params);
4302    }
4303
4304
4305    // Add user agent if configured
4306    if let Some(ref user_agent) = configuration.user_agent {
4307        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4308    }
4309
4310    // Apply all header parameters
4311    for (header_name, header_value) in header_params {
4312        req_builder = req_builder.header(&header_name, &header_value);
4313    }
4314
4315
4316    let req = req_builder.build()?;
4317    let resp = configuration.client.execute(req).await?;
4318
4319    let status = resp.status();
4320    let content_type = resp
4321        .headers()
4322        .get("content-type")
4323        .and_then(|v| v.to_str().ok())
4324        .unwrap_or("application/octet-stream");
4325    let content_type = super::ContentType::from(content_type);
4326
4327    if !status.is_client_error() && !status.is_server_error() {
4328        let content = resp.text().await?;
4329        match content_type {
4330            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4331            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GetBrokerUniversalTransferV1RespItem&gt;`"))),
4332            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GetBrokerUniversalTransferV1RespItem&gt;`")))),
4333        }
4334    } else {
4335        let content = resp.text().await?;
4336        let entity: Option<GetBrokerUniversalTransferV1Error> = serde_json::from_str(&content).ok();
4337        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4338    }
4339}
4340