1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::spot::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17#[derive(Clone, Debug, Default)]
19pub struct CreateMiningHashTransferConfigCancelV1Params {
20 pub config_id: i32,
21 pub timestamp: i64,
22 pub user_name: String,
23 pub recv_window: Option<i64>
24}
25
26#[derive(Clone, Debug, Default)]
28pub struct CreateMiningHashTransferConfigV1Params {
29 pub algo: String,
30 pub end_date: i64,
31 pub hash_rate: i64,
32 pub start_date: i64,
33 pub timestamp: i64,
34 pub to_pool_user: String,
35 pub user_name: String,
36 pub recv_window: Option<i64>
37}
38
39#[derive(Clone, Debug, Default)]
41pub struct GetMiningHashTransferConfigDetailsListV1Params {
42 pub timestamp: i64,
43 pub page_index: Option<i32>,
45 pub page_size: Option<i32>,
47 pub recv_window: Option<i64>
48}
49
50#[derive(Clone, Debug, Default)]
52pub struct GetMiningHashTransferProfitDetailsV1Params {
53 pub config_id: i32,
55 pub user_name: String,
57 pub timestamp: i64,
58 pub page_index: Option<i32>,
60 pub page_size: Option<i32>,
62 pub recv_window: Option<i64>
63}
64
65#[derive(Clone, Debug, Default)]
67pub struct GetMiningPaymentListV1Params {
68 pub algo: String,
70 pub user_name: String,
72 pub timestamp: i64,
73 pub coin: Option<String>,
75 pub start_date: Option<i64>,
77 pub end_date: Option<i64>,
79 pub page_index: Option<i32>,
81 pub page_size: Option<i32>,
83 pub recv_window: Option<i64>
84}
85
86#[derive(Clone, Debug, Default)]
88pub struct GetMiningPaymentOtherV1Params {
89 pub algo: String,
91 pub user_name: String,
93 pub timestamp: i64,
94 pub coin: Option<String>,
96 pub start_date: Option<i64>,
98 pub end_date: Option<i64>,
100 pub page_index: Option<i32>,
102 pub page_size: Option<i32>,
104 pub recv_window: Option<i64>
105}
106
107#[derive(Clone, Debug, Default)]
109pub struct GetMiningPaymentUidV1Params {
110 pub algo: String,
112 pub timestamp: i64,
113 pub start_date: Option<i64>,
115 pub end_date: Option<i64>,
117 pub page_index: Option<i32>,
119 pub page_size: Option<i32>,
121 pub recv_window: Option<i64>
122}
123
124#[derive(Clone, Debug, Default)]
126pub struct GetMiningStatisticsUserListV1Params {
127 pub algo: String,
129 pub user_name: String,
131 pub timestamp: i64,
132 pub recv_window: Option<i64>
133}
134
135#[derive(Clone, Debug, Default)]
137pub struct GetMiningStatisticsUserStatusV1Params {
138 pub algo: String,
140 pub user_name: String,
142 pub timestamp: i64,
143 pub recv_window: Option<i64>
144}
145
146#[derive(Clone, Debug, Default)]
148pub struct GetMiningWorkerDetailV1Params {
149 pub algo: String,
151 pub user_name: String,
153 pub worker_name: String,
155 pub timestamp: i64,
156 pub recv_window: Option<i64>
157}
158
159#[derive(Clone, Debug, Default)]
161pub struct GetMiningWorkerListV1Params {
162 pub algo: String,
164 pub user_name: String,
166 pub timestamp: i64,
167 pub page_index: Option<i32>,
169 pub sort: Option<i32>,
171 pub sort_column: Option<i32>,
173 pub worker_status: Option<i32>,
175 pub recv_window: Option<i64>
176}
177
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum CreateMiningHashTransferConfigCancelV1Error {
183 Status4XX(models::ApiError),
184 Status5XX(models::ApiError),
185 UnknownValue(serde_json::Value),
186}
187
188#[derive(Debug, Clone, Serialize, Deserialize)]
190#[serde(untagged)]
191pub enum CreateMiningHashTransferConfigV1Error {
192 Status4XX(models::ApiError),
193 Status5XX(models::ApiError),
194 UnknownValue(serde_json::Value),
195}
196
197#[derive(Debug, Clone, Serialize, Deserialize)]
199#[serde(untagged)]
200pub enum GetMiningHashTransferConfigDetailsListV1Error {
201 Status4XX(models::ApiError),
202 Status5XX(models::ApiError),
203 UnknownValue(serde_json::Value),
204}
205
206#[derive(Debug, Clone, Serialize, Deserialize)]
208#[serde(untagged)]
209pub enum GetMiningHashTransferProfitDetailsV1Error {
210 Status4XX(models::ApiError),
211 Status5XX(models::ApiError),
212 UnknownValue(serde_json::Value),
213}
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
217#[serde(untagged)]
218pub enum GetMiningPaymentListV1Error {
219 Status4XX(models::ApiError),
220 Status5XX(models::ApiError),
221 UnknownValue(serde_json::Value),
222}
223
224#[derive(Debug, Clone, Serialize, Deserialize)]
226#[serde(untagged)]
227pub enum GetMiningPaymentOtherV1Error {
228 Status4XX(models::ApiError),
229 Status5XX(models::ApiError),
230 UnknownValue(serde_json::Value),
231}
232
233#[derive(Debug, Clone, Serialize, Deserialize)]
235#[serde(untagged)]
236pub enum GetMiningPaymentUidV1Error {
237 Status4XX(models::ApiError),
238 Status5XX(models::ApiError),
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetMiningPubAlgoListV1Error {
246 Status4XX(models::ApiError),
247 Status5XX(models::ApiError),
248 UnknownValue(serde_json::Value),
249}
250
251#[derive(Debug, Clone, Serialize, Deserialize)]
253#[serde(untagged)]
254pub enum GetMiningPubCoinListV1Error {
255 Status4XX(models::ApiError),
256 Status5XX(models::ApiError),
257 UnknownValue(serde_json::Value),
258}
259
260#[derive(Debug, Clone, Serialize, Deserialize)]
262#[serde(untagged)]
263pub enum GetMiningStatisticsUserListV1Error {
264 Status4XX(models::ApiError),
265 Status5XX(models::ApiError),
266 UnknownValue(serde_json::Value),
267}
268
269#[derive(Debug, Clone, Serialize, Deserialize)]
271#[serde(untagged)]
272pub enum GetMiningStatisticsUserStatusV1Error {
273 Status4XX(models::ApiError),
274 Status5XX(models::ApiError),
275 UnknownValue(serde_json::Value),
276}
277
278#[derive(Debug, Clone, Serialize, Deserialize)]
280#[serde(untagged)]
281pub enum GetMiningWorkerDetailV1Error {
282 Status4XX(models::ApiError),
283 Status5XX(models::ApiError),
284 UnknownValue(serde_json::Value),
285}
286
287#[derive(Debug, Clone, Serialize, Deserialize)]
289#[serde(untagged)]
290pub enum GetMiningWorkerListV1Error {
291 Status4XX(models::ApiError),
292 Status5XX(models::ApiError),
293 UnknownValue(serde_json::Value),
294}
295
296
297pub async fn create_mining_hash_transfer_config_cancel_v1(configuration: &configuration::Configuration, params: CreateMiningHashTransferConfigCancelV1Params) -> Result<models::CreateMiningHashTransferConfigCancelV1Resp, Error<CreateMiningHashTransferConfigCancelV1Error>> {
298
299 let uri_str = format!("{}/sapi/v1/mining/hash-transfer/config/cancel", configuration.base_path);
300 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
301
302 let mut query_params: Vec<(String, String)> = Vec::new();
304
305
306 let mut header_params = std::collections::HashMap::new();
308
309 if let Some(ref binance_auth) = configuration.binance_auth {
311 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
313
314 let body_string: Option<Vec<u8>> = None;
316
317 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
319 Ok(sig) => sig,
320 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
321 };
322
323 query_params.push(("signature".to_string(), signature));
325 }
326
327 if !query_params.is_empty() {
329 req_builder = req_builder.query(&query_params);
330 }
331
332
333 if let Some(ref user_agent) = configuration.user_agent {
335 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
336 }
337
338 for (header_name, header_value) in header_params {
340 req_builder = req_builder.header(&header_name, &header_value);
341 }
342
343 let mut multipart_form_params = std::collections::HashMap::new();
344 multipart_form_params.insert("configId", params.config_id.to_string());
345 if let Some(param_value) = params.recv_window {
346 multipart_form_params.insert("recvWindow", param_value.to_string());
347 }
348 multipart_form_params.insert("timestamp", params.timestamp.to_string());
349 multipart_form_params.insert("userName", params.user_name.to_string());
350 req_builder = req_builder.form(&multipart_form_params);
351
352 let req = req_builder.build()?;
353 let resp = configuration.client.execute(req).await?;
354
355 let status = resp.status();
356 let content_type = resp
357 .headers()
358 .get("content-type")
359 .and_then(|v| v.to_str().ok())
360 .unwrap_or("application/octet-stream");
361 let content_type = super::ContentType::from(content_type);
362
363 if !status.is_client_error() && !status.is_server_error() {
364 let content = resp.text().await?;
365 match content_type {
366 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
367 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateMiningHashTransferConfigCancelV1Resp`"))),
368 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::CreateMiningHashTransferConfigCancelV1Resp`")))),
369 }
370 } else {
371 let content = resp.text().await?;
372 let entity: Option<CreateMiningHashTransferConfigCancelV1Error> = serde_json::from_str(&content).ok();
373 Err(Error::ResponseError(ResponseContent { status, content, entity }))
374 }
375}
376
377pub async fn create_mining_hash_transfer_config_v1(configuration: &configuration::Configuration, params: CreateMiningHashTransferConfigV1Params) -> Result<models::CreateMiningHashTransferConfigV1Resp, Error<CreateMiningHashTransferConfigV1Error>> {
379
380 let uri_str = format!("{}/sapi/v1/mining/hash-transfer/config", configuration.base_path);
381 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
382
383 let mut query_params: Vec<(String, String)> = Vec::new();
385
386
387 let mut header_params = std::collections::HashMap::new();
389
390 if let Some(ref binance_auth) = configuration.binance_auth {
392 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
394
395 let body_string: Option<Vec<u8>> = None;
397
398 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
400 Ok(sig) => sig,
401 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
402 };
403
404 query_params.push(("signature".to_string(), signature));
406 }
407
408 if !query_params.is_empty() {
410 req_builder = req_builder.query(&query_params);
411 }
412
413
414 if let Some(ref user_agent) = configuration.user_agent {
416 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
417 }
418
419 for (header_name, header_value) in header_params {
421 req_builder = req_builder.header(&header_name, &header_value);
422 }
423
424 let mut multipart_form_params = std::collections::HashMap::new();
425 multipart_form_params.insert("algo", params.algo.to_string());
426 multipart_form_params.insert("endDate", params.end_date.to_string());
427 multipart_form_params.insert("hashRate", params.hash_rate.to_string());
428 if let Some(param_value) = params.recv_window {
429 multipart_form_params.insert("recvWindow", param_value.to_string());
430 }
431 multipart_form_params.insert("startDate", params.start_date.to_string());
432 multipart_form_params.insert("timestamp", params.timestamp.to_string());
433 multipart_form_params.insert("toPoolUser", params.to_pool_user.to_string());
434 multipart_form_params.insert("userName", params.user_name.to_string());
435 req_builder = req_builder.form(&multipart_form_params);
436
437 let req = req_builder.build()?;
438 let resp = configuration.client.execute(req).await?;
439
440 let status = resp.status();
441 let content_type = resp
442 .headers()
443 .get("content-type")
444 .and_then(|v| v.to_str().ok())
445 .unwrap_or("application/octet-stream");
446 let content_type = super::ContentType::from(content_type);
447
448 if !status.is_client_error() && !status.is_server_error() {
449 let content = resp.text().await?;
450 match content_type {
451 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
452 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateMiningHashTransferConfigV1Resp`"))),
453 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::CreateMiningHashTransferConfigV1Resp`")))),
454 }
455 } else {
456 let content = resp.text().await?;
457 let entity: Option<CreateMiningHashTransferConfigV1Error> = serde_json::from_str(&content).ok();
458 Err(Error::ResponseError(ResponseContent { status, content, entity }))
459 }
460}
461
462pub async fn get_mining_hash_transfer_config_details_list_v1(configuration: &configuration::Configuration, params: GetMiningHashTransferConfigDetailsListV1Params) -> Result<models::GetMiningHashTransferConfigDetailsListV1Resp, Error<GetMiningHashTransferConfigDetailsListV1Error>> {
464
465 let uri_str = format!("{}/sapi/v1/mining/hash-transfer/config/details/list", configuration.base_path);
466 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
467
468 let mut query_params: Vec<(String, String)> = Vec::new();
470
471 if let Some(ref param_value) = params.page_index {
472 query_params.push(("pageIndex".to_string(), param_value.to_string()));
473 }
474 if let Some(ref param_value) = params.page_size {
475 query_params.push(("pageSize".to_string(), param_value.to_string()));
476 }
477 if let Some(ref param_value) = params.recv_window {
478 query_params.push(("recvWindow".to_string(), param_value.to_string()));
479 }
480 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
481
482 let mut header_params = std::collections::HashMap::new();
484
485 if let Some(ref binance_auth) = configuration.binance_auth {
487 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
489
490 let body_string: Option<Vec<u8>> = None;
492
493 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
495 Ok(sig) => sig,
496 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
497 };
498
499 query_params.push(("signature".to_string(), signature));
501 }
502
503 if !query_params.is_empty() {
505 req_builder = req_builder.query(&query_params);
506 }
507
508
509 if let Some(ref user_agent) = configuration.user_agent {
511 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
512 }
513
514 for (header_name, header_value) in header_params {
516 req_builder = req_builder.header(&header_name, &header_value);
517 }
518
519
520 let req = req_builder.build()?;
521 let resp = configuration.client.execute(req).await?;
522
523 let status = resp.status();
524 let content_type = resp
525 .headers()
526 .get("content-type")
527 .and_then(|v| v.to_str().ok())
528 .unwrap_or("application/octet-stream");
529 let content_type = super::ContentType::from(content_type);
530
531 if !status.is_client_error() && !status.is_server_error() {
532 let content = resp.text().await?;
533 match content_type {
534 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
535 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningHashTransferConfigDetailsListV1Resp`"))),
536 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::GetMiningHashTransferConfigDetailsListV1Resp`")))),
537 }
538 } else {
539 let content = resp.text().await?;
540 let entity: Option<GetMiningHashTransferConfigDetailsListV1Error> = serde_json::from_str(&content).ok();
541 Err(Error::ResponseError(ResponseContent { status, content, entity }))
542 }
543}
544
545pub async fn get_mining_hash_transfer_profit_details_v1(configuration: &configuration::Configuration, params: GetMiningHashTransferProfitDetailsV1Params) -> Result<models::GetMiningHashTransferProfitDetailsV1Resp, Error<GetMiningHashTransferProfitDetailsV1Error>> {
547
548 let uri_str = format!("{}/sapi/v1/mining/hash-transfer/profit/details", configuration.base_path);
549 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
550
551 let mut query_params: Vec<(String, String)> = Vec::new();
553
554 query_params.push(("configId".to_string(), params.config_id.to_string()));
555 query_params.push(("userName".to_string(), params.user_name.to_string()));
556 if let Some(ref param_value) = params.page_index {
557 query_params.push(("pageIndex".to_string(), param_value.to_string()));
558 }
559 if let Some(ref param_value) = params.page_size {
560 query_params.push(("pageSize".to_string(), param_value.to_string()));
561 }
562 if let Some(ref param_value) = params.recv_window {
563 query_params.push(("recvWindow".to_string(), param_value.to_string()));
564 }
565 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
566
567 let mut header_params = std::collections::HashMap::new();
569
570 if let Some(ref binance_auth) = configuration.binance_auth {
572 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
574
575 let body_string: Option<Vec<u8>> = None;
577
578 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
580 Ok(sig) => sig,
581 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
582 };
583
584 query_params.push(("signature".to_string(), signature));
586 }
587
588 if !query_params.is_empty() {
590 req_builder = req_builder.query(&query_params);
591 }
592
593
594 if let Some(ref user_agent) = configuration.user_agent {
596 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
597 }
598
599 for (header_name, header_value) in header_params {
601 req_builder = req_builder.header(&header_name, &header_value);
602 }
603
604
605 let req = req_builder.build()?;
606 let resp = configuration.client.execute(req).await?;
607
608 let status = resp.status();
609 let content_type = resp
610 .headers()
611 .get("content-type")
612 .and_then(|v| v.to_str().ok())
613 .unwrap_or("application/octet-stream");
614 let content_type = super::ContentType::from(content_type);
615
616 if !status.is_client_error() && !status.is_server_error() {
617 let content = resp.text().await?;
618 match content_type {
619 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
620 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningHashTransferProfitDetailsV1Resp`"))),
621 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::GetMiningHashTransferProfitDetailsV1Resp`")))),
622 }
623 } else {
624 let content = resp.text().await?;
625 let entity: Option<GetMiningHashTransferProfitDetailsV1Error> = serde_json::from_str(&content).ok();
626 Err(Error::ResponseError(ResponseContent { status, content, entity }))
627 }
628}
629
630pub async fn get_mining_payment_list_v1(configuration: &configuration::Configuration, params: GetMiningPaymentListV1Params) -> Result<models::GetMiningPaymentListV1Resp, Error<GetMiningPaymentListV1Error>> {
632
633 let uri_str = format!("{}/sapi/v1/mining/payment/list", configuration.base_path);
634 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
635
636 let mut query_params: Vec<(String, String)> = Vec::new();
638
639 query_params.push(("algo".to_string(), params.algo.to_string()));
640 query_params.push(("userName".to_string(), params.user_name.to_string()));
641 if let Some(ref param_value) = params.coin {
642 query_params.push(("coin".to_string(), param_value.to_string()));
643 }
644 if let Some(ref param_value) = params.start_date {
645 query_params.push(("startDate".to_string(), param_value.to_string()));
646 }
647 if let Some(ref param_value) = params.end_date {
648 query_params.push(("endDate".to_string(), param_value.to_string()));
649 }
650 if let Some(ref param_value) = params.page_index {
651 query_params.push(("pageIndex".to_string(), param_value.to_string()));
652 }
653 if let Some(ref param_value) = params.page_size {
654 query_params.push(("pageSize".to_string(), param_value.to_string()));
655 }
656 if let Some(ref param_value) = params.recv_window {
657 query_params.push(("recvWindow".to_string(), param_value.to_string()));
658 }
659 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
660
661 let mut header_params = std::collections::HashMap::new();
663
664 if let Some(ref binance_auth) = configuration.binance_auth {
666 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
668
669 let body_string: Option<Vec<u8>> = None;
671
672 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
674 Ok(sig) => sig,
675 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
676 };
677
678 query_params.push(("signature".to_string(), signature));
680 }
681
682 if !query_params.is_empty() {
684 req_builder = req_builder.query(&query_params);
685 }
686
687
688 if let Some(ref user_agent) = configuration.user_agent {
690 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
691 }
692
693 for (header_name, header_value) in header_params {
695 req_builder = req_builder.header(&header_name, &header_value);
696 }
697
698
699 let req = req_builder.build()?;
700 let resp = configuration.client.execute(req).await?;
701
702 let status = resp.status();
703 let content_type = resp
704 .headers()
705 .get("content-type")
706 .and_then(|v| v.to_str().ok())
707 .unwrap_or("application/octet-stream");
708 let content_type = super::ContentType::from(content_type);
709
710 if !status.is_client_error() && !status.is_server_error() {
711 let content = resp.text().await?;
712 match content_type {
713 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
714 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningPaymentListV1Resp`"))),
715 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::GetMiningPaymentListV1Resp`")))),
716 }
717 } else {
718 let content = resp.text().await?;
719 let entity: Option<GetMiningPaymentListV1Error> = serde_json::from_str(&content).ok();
720 Err(Error::ResponseError(ResponseContent { status, content, entity }))
721 }
722}
723
724pub async fn get_mining_payment_other_v1(configuration: &configuration::Configuration, params: GetMiningPaymentOtherV1Params) -> Result<models::GetMiningPaymentOtherV1Resp, Error<GetMiningPaymentOtherV1Error>> {
726
727 let uri_str = format!("{}/sapi/v1/mining/payment/other", configuration.base_path);
728 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
729
730 let mut query_params: Vec<(String, String)> = Vec::new();
732
733 query_params.push(("algo".to_string(), params.algo.to_string()));
734 query_params.push(("userName".to_string(), params.user_name.to_string()));
735 if let Some(ref param_value) = params.coin {
736 query_params.push(("coin".to_string(), param_value.to_string()));
737 }
738 if let Some(ref param_value) = params.start_date {
739 query_params.push(("startDate".to_string(), param_value.to_string()));
740 }
741 if let Some(ref param_value) = params.end_date {
742 query_params.push(("endDate".to_string(), param_value.to_string()));
743 }
744 if let Some(ref param_value) = params.page_index {
745 query_params.push(("pageIndex".to_string(), param_value.to_string()));
746 }
747 if let Some(ref param_value) = params.page_size {
748 query_params.push(("pageSize".to_string(), param_value.to_string()));
749 }
750 if let Some(ref param_value) = params.recv_window {
751 query_params.push(("recvWindow".to_string(), param_value.to_string()));
752 }
753 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
754
755 let mut header_params = std::collections::HashMap::new();
757
758 if let Some(ref binance_auth) = configuration.binance_auth {
760 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
762
763 let body_string: Option<Vec<u8>> = None;
765
766 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
768 Ok(sig) => sig,
769 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
770 };
771
772 query_params.push(("signature".to_string(), signature));
774 }
775
776 if !query_params.is_empty() {
778 req_builder = req_builder.query(&query_params);
779 }
780
781
782 if let Some(ref user_agent) = configuration.user_agent {
784 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
785 }
786
787 for (header_name, header_value) in header_params {
789 req_builder = req_builder.header(&header_name, &header_value);
790 }
791
792
793 let req = req_builder.build()?;
794 let resp = configuration.client.execute(req).await?;
795
796 let status = resp.status();
797 let content_type = resp
798 .headers()
799 .get("content-type")
800 .and_then(|v| v.to_str().ok())
801 .unwrap_or("application/octet-stream");
802 let content_type = super::ContentType::from(content_type);
803
804 if !status.is_client_error() && !status.is_server_error() {
805 let content = resp.text().await?;
806 match content_type {
807 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
808 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningPaymentOtherV1Resp`"))),
809 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::GetMiningPaymentOtherV1Resp`")))),
810 }
811 } else {
812 let content = resp.text().await?;
813 let entity: Option<GetMiningPaymentOtherV1Error> = serde_json::from_str(&content).ok();
814 Err(Error::ResponseError(ResponseContent { status, content, entity }))
815 }
816}
817
818pub async fn get_mining_payment_uid_v1(configuration: &configuration::Configuration, params: GetMiningPaymentUidV1Params) -> Result<models::GetMiningPaymentUidV1Resp, Error<GetMiningPaymentUidV1Error>> {
820
821 let uri_str = format!("{}/sapi/v1/mining/payment/uid", configuration.base_path);
822 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
823
824 let mut query_params: Vec<(String, String)> = Vec::new();
826
827 query_params.push(("algo".to_string(), params.algo.to_string()));
828 if let Some(ref param_value) = params.start_date {
829 query_params.push(("startDate".to_string(), param_value.to_string()));
830 }
831 if let Some(ref param_value) = params.end_date {
832 query_params.push(("endDate".to_string(), param_value.to_string()));
833 }
834 if let Some(ref param_value) = params.page_index {
835 query_params.push(("pageIndex".to_string(), param_value.to_string()));
836 }
837 if let Some(ref param_value) = params.page_size {
838 query_params.push(("pageSize".to_string(), param_value.to_string()));
839 }
840 if let Some(ref param_value) = params.recv_window {
841 query_params.push(("recvWindow".to_string(), param_value.to_string()));
842 }
843 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
844
845 let mut header_params = std::collections::HashMap::new();
847
848 if let Some(ref binance_auth) = configuration.binance_auth {
850 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
852
853 let body_string: Option<Vec<u8>> = None;
855
856 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
858 Ok(sig) => sig,
859 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
860 };
861
862 query_params.push(("signature".to_string(), signature));
864 }
865
866 if !query_params.is_empty() {
868 req_builder = req_builder.query(&query_params);
869 }
870
871
872 if let Some(ref user_agent) = configuration.user_agent {
874 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
875 }
876
877 for (header_name, header_value) in header_params {
879 req_builder = req_builder.header(&header_name, &header_value);
880 }
881
882
883 let req = req_builder.build()?;
884 let resp = configuration.client.execute(req).await?;
885
886 let status = resp.status();
887 let content_type = resp
888 .headers()
889 .get("content-type")
890 .and_then(|v| v.to_str().ok())
891 .unwrap_or("application/octet-stream");
892 let content_type = super::ContentType::from(content_type);
893
894 if !status.is_client_error() && !status.is_server_error() {
895 let content = resp.text().await?;
896 match content_type {
897 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
898 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningPaymentUidV1Resp`"))),
899 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::GetMiningPaymentUidV1Resp`")))),
900 }
901 } else {
902 let content = resp.text().await?;
903 let entity: Option<GetMiningPaymentUidV1Error> = serde_json::from_str(&content).ok();
904 Err(Error::ResponseError(ResponseContent { status, content, entity }))
905 }
906}
907
908pub async fn get_mining_pub_algo_list_v1(configuration: &configuration::Configuration) -> Result<models::GetMiningPubAlgoListV1Resp, Error<GetMiningPubAlgoListV1Error>> {
910
911 let uri_str = format!("{}/sapi/v1/mining/pub/algoList", configuration.base_path);
912 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
913
914 let mut query_params: Vec<(String, String)> = Vec::new();
916
917
918 let mut header_params = std::collections::HashMap::new();
920
921 if let Some(ref binance_auth) = configuration.binance_auth {
923 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
925
926 let body_string: Option<Vec<u8>> = None;
928
929 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
931 Ok(sig) => sig,
932 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
933 };
934
935 query_params.push(("signature".to_string(), signature));
937 }
938
939 if !query_params.is_empty() {
941 req_builder = req_builder.query(&query_params);
942 }
943
944
945 if let Some(ref user_agent) = configuration.user_agent {
947 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
948 }
949
950 for (header_name, header_value) in header_params {
952 req_builder = req_builder.header(&header_name, &header_value);
953 }
954
955
956 let req = req_builder.build()?;
957 let resp = configuration.client.execute(req).await?;
958
959 let status = resp.status();
960 let content_type = resp
961 .headers()
962 .get("content-type")
963 .and_then(|v| v.to_str().ok())
964 .unwrap_or("application/octet-stream");
965 let content_type = super::ContentType::from(content_type);
966
967 if !status.is_client_error() && !status.is_server_error() {
968 let content = resp.text().await?;
969 match content_type {
970 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
971 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningPubAlgoListV1Resp`"))),
972 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::GetMiningPubAlgoListV1Resp`")))),
973 }
974 } else {
975 let content = resp.text().await?;
976 let entity: Option<GetMiningPubAlgoListV1Error> = serde_json::from_str(&content).ok();
977 Err(Error::ResponseError(ResponseContent { status, content, entity }))
978 }
979}
980
981pub async fn get_mining_pub_coin_list_v1(configuration: &configuration::Configuration) -> Result<models::GetMiningPubCoinListV1Resp, Error<GetMiningPubCoinListV1Error>> {
983
984 let uri_str = format!("{}/sapi/v1/mining/pub/coinList", configuration.base_path);
985 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
986
987 let mut query_params: Vec<(String, String)> = Vec::new();
989
990
991 let mut header_params = std::collections::HashMap::new();
993
994 if let Some(ref binance_auth) = configuration.binance_auth {
996 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
998
999 let body_string: Option<Vec<u8>> = None;
1001
1002 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1004 Ok(sig) => sig,
1005 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1006 };
1007
1008 query_params.push(("signature".to_string(), signature));
1010 }
1011
1012 if !query_params.is_empty() {
1014 req_builder = req_builder.query(&query_params);
1015 }
1016
1017
1018 if let Some(ref user_agent) = configuration.user_agent {
1020 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1021 }
1022
1023 for (header_name, header_value) in header_params {
1025 req_builder = req_builder.header(&header_name, &header_value);
1026 }
1027
1028
1029 let req = req_builder.build()?;
1030 let resp = configuration.client.execute(req).await?;
1031
1032 let status = resp.status();
1033 let content_type = resp
1034 .headers()
1035 .get("content-type")
1036 .and_then(|v| v.to_str().ok())
1037 .unwrap_or("application/octet-stream");
1038 let content_type = super::ContentType::from(content_type);
1039
1040 if !status.is_client_error() && !status.is_server_error() {
1041 let content = resp.text().await?;
1042 match content_type {
1043 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1044 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningPubCoinListV1Resp`"))),
1045 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::GetMiningPubCoinListV1Resp`")))),
1046 }
1047 } else {
1048 let content = resp.text().await?;
1049 let entity: Option<GetMiningPubCoinListV1Error> = serde_json::from_str(&content).ok();
1050 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1051 }
1052}
1053
1054pub async fn get_mining_statistics_user_list_v1(configuration: &configuration::Configuration, params: GetMiningStatisticsUserListV1Params) -> Result<models::GetMiningStatisticsUserListV1Resp, Error<GetMiningStatisticsUserListV1Error>> {
1056
1057 let uri_str = format!("{}/sapi/v1/mining/statistics/user/list", configuration.base_path);
1058 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1059
1060 let mut query_params: Vec<(String, String)> = Vec::new();
1062
1063 query_params.push(("algo".to_string(), params.algo.to_string()));
1064 query_params.push(("userName".to_string(), params.user_name.to_string()));
1065 if let Some(ref param_value) = params.recv_window {
1066 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1067 }
1068 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1069
1070 let mut header_params = std::collections::HashMap::new();
1072
1073 if let Some(ref binance_auth) = configuration.binance_auth {
1075 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1077
1078 let body_string: Option<Vec<u8>> = None;
1080
1081 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1083 Ok(sig) => sig,
1084 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1085 };
1086
1087 query_params.push(("signature".to_string(), signature));
1089 }
1090
1091 if !query_params.is_empty() {
1093 req_builder = req_builder.query(&query_params);
1094 }
1095
1096
1097 if let Some(ref user_agent) = configuration.user_agent {
1099 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1100 }
1101
1102 for (header_name, header_value) in header_params {
1104 req_builder = req_builder.header(&header_name, &header_value);
1105 }
1106
1107
1108 let req = req_builder.build()?;
1109 let resp = configuration.client.execute(req).await?;
1110
1111 let status = resp.status();
1112 let content_type = resp
1113 .headers()
1114 .get("content-type")
1115 .and_then(|v| v.to_str().ok())
1116 .unwrap_or("application/octet-stream");
1117 let content_type = super::ContentType::from(content_type);
1118
1119 if !status.is_client_error() && !status.is_server_error() {
1120 let content = resp.text().await?;
1121 match content_type {
1122 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1123 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningStatisticsUserListV1Resp`"))),
1124 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::GetMiningStatisticsUserListV1Resp`")))),
1125 }
1126 } else {
1127 let content = resp.text().await?;
1128 let entity: Option<GetMiningStatisticsUserListV1Error> = serde_json::from_str(&content).ok();
1129 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1130 }
1131}
1132
1133pub async fn get_mining_statistics_user_status_v1(configuration: &configuration::Configuration, params: GetMiningStatisticsUserStatusV1Params) -> Result<models::GetMiningStatisticsUserStatusV1Resp, Error<GetMiningStatisticsUserStatusV1Error>> {
1135
1136 let uri_str = format!("{}/sapi/v1/mining/statistics/user/status", configuration.base_path);
1137 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1138
1139 let mut query_params: Vec<(String, String)> = Vec::new();
1141
1142 query_params.push(("algo".to_string(), params.algo.to_string()));
1143 query_params.push(("userName".to_string(), params.user_name.to_string()));
1144 if let Some(ref param_value) = params.recv_window {
1145 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1146 }
1147 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1148
1149 let mut header_params = std::collections::HashMap::new();
1151
1152 if let Some(ref binance_auth) = configuration.binance_auth {
1154 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1156
1157 let body_string: Option<Vec<u8>> = None;
1159
1160 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1162 Ok(sig) => sig,
1163 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1164 };
1165
1166 query_params.push(("signature".to_string(), signature));
1168 }
1169
1170 if !query_params.is_empty() {
1172 req_builder = req_builder.query(&query_params);
1173 }
1174
1175
1176 if let Some(ref user_agent) = configuration.user_agent {
1178 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1179 }
1180
1181 for (header_name, header_value) in header_params {
1183 req_builder = req_builder.header(&header_name, &header_value);
1184 }
1185
1186
1187 let req = req_builder.build()?;
1188 let resp = configuration.client.execute(req).await?;
1189
1190 let status = resp.status();
1191 let content_type = resp
1192 .headers()
1193 .get("content-type")
1194 .and_then(|v| v.to_str().ok())
1195 .unwrap_or("application/octet-stream");
1196 let content_type = super::ContentType::from(content_type);
1197
1198 if !status.is_client_error() && !status.is_server_error() {
1199 let content = resp.text().await?;
1200 match content_type {
1201 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1202 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningStatisticsUserStatusV1Resp`"))),
1203 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::GetMiningStatisticsUserStatusV1Resp`")))),
1204 }
1205 } else {
1206 let content = resp.text().await?;
1207 let entity: Option<GetMiningStatisticsUserStatusV1Error> = serde_json::from_str(&content).ok();
1208 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1209 }
1210}
1211
1212pub async fn get_mining_worker_detail_v1(configuration: &configuration::Configuration, params: GetMiningWorkerDetailV1Params) -> Result<models::GetMiningWorkerDetailV1Resp, Error<GetMiningWorkerDetailV1Error>> {
1214
1215 let uri_str = format!("{}/sapi/v1/mining/worker/detail", configuration.base_path);
1216 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1217
1218 let mut query_params: Vec<(String, String)> = Vec::new();
1220
1221 query_params.push(("algo".to_string(), params.algo.to_string()));
1222 query_params.push(("userName".to_string(), params.user_name.to_string()));
1223 query_params.push(("workerName".to_string(), params.worker_name.to_string()));
1224 if let Some(ref param_value) = params.recv_window {
1225 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1226 }
1227 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1228
1229 let mut header_params = std::collections::HashMap::new();
1231
1232 if let Some(ref binance_auth) = configuration.binance_auth {
1234 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1236
1237 let body_string: Option<Vec<u8>> = None;
1239
1240 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1242 Ok(sig) => sig,
1243 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1244 };
1245
1246 query_params.push(("signature".to_string(), signature));
1248 }
1249
1250 if !query_params.is_empty() {
1252 req_builder = req_builder.query(&query_params);
1253 }
1254
1255
1256 if let Some(ref user_agent) = configuration.user_agent {
1258 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1259 }
1260
1261 for (header_name, header_value) in header_params {
1263 req_builder = req_builder.header(&header_name, &header_value);
1264 }
1265
1266
1267 let req = req_builder.build()?;
1268 let resp = configuration.client.execute(req).await?;
1269
1270 let status = resp.status();
1271 let content_type = resp
1272 .headers()
1273 .get("content-type")
1274 .and_then(|v| v.to_str().ok())
1275 .unwrap_or("application/octet-stream");
1276 let content_type = super::ContentType::from(content_type);
1277
1278 if !status.is_client_error() && !status.is_server_error() {
1279 let content = resp.text().await?;
1280 match content_type {
1281 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1282 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningWorkerDetailV1Resp`"))),
1283 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::GetMiningWorkerDetailV1Resp`")))),
1284 }
1285 } else {
1286 let content = resp.text().await?;
1287 let entity: Option<GetMiningWorkerDetailV1Error> = serde_json::from_str(&content).ok();
1288 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1289 }
1290}
1291
1292pub async fn get_mining_worker_list_v1(configuration: &configuration::Configuration, params: GetMiningWorkerListV1Params) -> Result<models::GetMiningWorkerListV1Resp, Error<GetMiningWorkerListV1Error>> {
1294
1295 let uri_str = format!("{}/sapi/v1/mining/worker/list", configuration.base_path);
1296 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1297
1298 let mut query_params: Vec<(String, String)> = Vec::new();
1300
1301 query_params.push(("algo".to_string(), params.algo.to_string()));
1302 query_params.push(("userName".to_string(), params.user_name.to_string()));
1303 if let Some(ref param_value) = params.page_index {
1304 query_params.push(("pageIndex".to_string(), param_value.to_string()));
1305 }
1306 if let Some(ref param_value) = params.sort {
1307 query_params.push(("sort".to_string(), param_value.to_string()));
1308 }
1309 if let Some(ref param_value) = params.sort_column {
1310 query_params.push(("sortColumn".to_string(), param_value.to_string()));
1311 }
1312 if let Some(ref param_value) = params.worker_status {
1313 query_params.push(("workerStatus".to_string(), param_value.to_string()));
1314 }
1315 if let Some(ref param_value) = params.recv_window {
1316 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1317 }
1318 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1319
1320 let mut header_params = std::collections::HashMap::new();
1322
1323 if let Some(ref binance_auth) = configuration.binance_auth {
1325 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1327
1328 let body_string: Option<Vec<u8>> = None;
1330
1331 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1333 Ok(sig) => sig,
1334 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1335 };
1336
1337 query_params.push(("signature".to_string(), signature));
1339 }
1340
1341 if !query_params.is_empty() {
1343 req_builder = req_builder.query(&query_params);
1344 }
1345
1346
1347 if let Some(ref user_agent) = configuration.user_agent {
1349 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1350 }
1351
1352 for (header_name, header_value) in header_params {
1354 req_builder = req_builder.header(&header_name, &header_value);
1355 }
1356
1357
1358 let req = req_builder.build()?;
1359 let resp = configuration.client.execute(req).await?;
1360
1361 let status = resp.status();
1362 let content_type = resp
1363 .headers()
1364 .get("content-type")
1365 .and_then(|v| v.to_str().ok())
1366 .unwrap_or("application/octet-stream");
1367 let content_type = super::ContentType::from(content_type);
1368
1369 if !status.is_client_error() && !status.is_server_error() {
1370 let content = resp.text().await?;
1371 match content_type {
1372 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1373 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMiningWorkerListV1Resp`"))),
1374 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::GetMiningWorkerListV1Resp`")))),
1375 }
1376 } else {
1377 let content = resp.text().await?;
1378 let entity: Option<GetMiningWorkerListV1Error> = serde_json::from_str(&content).ok();
1379 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1380 }
1381}
1382