fireblocks_sdk/apis/
trading_beta_api.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    super::{Error, configuration},
11    crate::{
12        apis::{ContentType, ResponseContent},
13        models,
14    },
15    async_trait::async_trait,
16    reqwest,
17    serde::{Deserialize, Serialize, de::Error as _},
18    std::sync::Arc,
19};
20
21#[async_trait]
22pub trait TradingBetaApi: Send + Sync {
23    /// POST /trading/orders
24    ///
25    /// Create an order to buy or sell an asset. If no source is given, an
26    /// external source will be use.  **Note:** These endpoints are currently in
27    /// beta and might be subject to changes. If you want to participate and
28    /// learn more about the Fireblocks Trading, please contact your Fireblocks
29    /// Customer Success Manager or send an email to CSM@fireblocks.com.
30    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin, Signer,
31    /// Editor.
32    async fn create_order(
33        &self,
34        params: CreateOrderParams,
35    ) -> Result<models::OrderDetails, Error<CreateOrderError>>;
36
37    /// POST /trading/quotes
38    ///
39    /// Generate a time-limited quote for asset conversion, providing exchange
40    /// rate and amount calculations.  **Note:** These endpoints are currently
41    /// in beta and might be subject to changes. If you want to participate and
42    /// learn more about the Fireblocks Trading, please contact your Fireblocks
43    /// Customer Success Manager or send an email to CSM@fireblocks.com.
44    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin, Signer,
45    /// Editor.
46    async fn create_quote(
47        &self,
48        params: CreateQuoteParams,
49    ) -> Result<models::QuotesResponse, Error<CreateQuoteError>>;
50
51    /// GET /trading/orders/{orderId}
52    ///
53    /// Retrieve detailed information about a specific order by its ID.
54    /// **Note:** These endpoints are currently in beta and might be subject to
55    /// changes. If you want to participate and learn more about the Fireblocks
56    /// Trading, please contact your Fireblocks Customer Success Manager or send
57    /// an email to CSM@fireblocks.com.  **Endpoint Permissions:** Owner, Admin,
58    /// Non-Signing Admin, Signer, Approver, Editor, Viewer.
59    async fn get_order(
60        &self,
61        params: GetOrderParams,
62    ) -> Result<models::OrderDetails, Error<GetOrderError>>;
63
64    /// GET /trading/orders
65    ///
66    /// Retrieve a paginated list of orders with optional filtering by account,
67    /// provider, status, and time range.  **Note:** These endpoints are
68    /// currently in beta and might be subject to changes. If you want to
69    /// participate and learn more about the Fireblocks Trading, please contact
70    /// your Fireblocks Customer Success Manager or send an email to
71    /// CSM@fireblocks.com.  **Endpoint Permissions:** Owner, Admin, Non-Signing
72    /// Admin, Signer, Approver, Editor, Viewer.
73    async fn get_orders(
74        &self,
75        params: GetOrdersParams,
76    ) -> Result<models::GetOrdersResponse, Error<GetOrdersError>>;
77
78    /// GET /trading/providers
79    ///
80    /// Retrieve a list of all available external providers supporting trading
81    /// activities through the platform.  **Note:** These endpoints are
82    /// currently in beta and might be subject to changes. If you want to
83    /// participate and learn more about the Fireblocks Trading, please contact
84    /// your Fireblocks Customer Success Manager or send an email to
85    /// CSM@fireblocks.com.  **Endpoint Permission:** Owner, Admin, Non-Signing
86    /// Admin, Signer, Approver, Editor, Viewer.
87    async fn get_trading_providers(
88        &self,
89        params: GetTradingProvidersParams,
90    ) -> Result<models::ProvidersListResponse, Error<GetTradingProvidersError>>;
91}
92
93pub struct TradingBetaApiClient {
94    configuration: Arc<configuration::Configuration>,
95}
96
97impl TradingBetaApiClient {
98    pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
99        Self { configuration }
100    }
101}
102
103/// struct for passing parameters to the method [`TradingBetaApi::create_order`]
104#[derive(Clone, Debug)]
105#[cfg_attr(feature = "bon", derive(::bon::Builder))]
106pub struct CreateOrderParams {
107    pub create_order_request: models::CreateOrderRequest,
108    /// A unique identifier for the request. If the request is sent multiple
109    /// times with the same idempotency key, the server will return the same
110    /// response as the first request. The idempotency key is valid for 24
111    /// hours.
112    pub idempotency_key: Option<String>,
113}
114
115/// struct for passing parameters to the method [`TradingBetaApi::create_quote`]
116#[derive(Clone, Debug)]
117#[cfg_attr(feature = "bon", derive(::bon::Builder))]
118pub struct CreateQuoteParams {
119    pub create_quote: models::CreateQuote,
120    /// A unique identifier for the request. If the request is sent multiple
121    /// times with the same idempotency key, the server will return the same
122    /// response as the first request. The idempotency key is valid for 24
123    /// hours.
124    pub idempotency_key: Option<String>,
125}
126
127/// struct for passing parameters to the method [`TradingBetaApi::get_order`]
128#[derive(Clone, Debug)]
129#[cfg_attr(feature = "bon", derive(::bon::Builder))]
130pub struct GetOrderParams {
131    /// The ID of the order to fetch.
132    pub order_id: String,
133}
134
135/// struct for passing parameters to the method [`TradingBetaApi::get_orders`]
136#[derive(Clone, Debug)]
137#[cfg_attr(feature = "bon", derive(::bon::Builder))]
138pub struct GetOrdersParams {
139    /// pageSize for pagination.
140    pub page_size: u8,
141    pub page_cursor: Option<String>,
142    /// ASC / DESC ordering (default DESC)
143    pub order: Option<String>,
144    /// Filter by accountId.
145    pub account_id: Option<Vec<String>>,
146    /// Filter by providerId.
147    pub provider_id: Option<Vec<String>>,
148    /// Filter by order status.
149    pub statuses: Option<Vec<models::OrderStatus>>,
150    pub start_time: Option<u32>,
151    pub end_time: Option<u32>,
152    pub asset_conversion_type: Option<String>,
153}
154
155/// struct for passing parameters to the method
156/// [`TradingBetaApi::get_trading_providers`]
157#[derive(Clone, Debug)]
158#[cfg_attr(feature = "bon", derive(::bon::Builder))]
159pub struct GetTradingProvidersParams {
160    /// Page size for pagination.
161    pub page_size: Option<u8>,
162    /// Page cursor for pagination.
163    pub page_cursor: Option<String>,
164}
165
166#[async_trait]
167impl TradingBetaApi for TradingBetaApiClient {
168    /// Create an order to buy or sell an asset. If no source is given, an
169    /// external source will be use.  **Note:** These endpoints are currently in
170    /// beta and might be subject to changes. If you want to participate and
171    /// learn more about the Fireblocks Trading, please contact your Fireblocks
172    /// Customer Success Manager or send an email to CSM@fireblocks.com.
173    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin, Signer,
174    /// Editor.
175    async fn create_order(
176        &self,
177        params: CreateOrderParams,
178    ) -> Result<models::OrderDetails, Error<CreateOrderError>> {
179        let CreateOrderParams {
180            create_order_request,
181            idempotency_key,
182        } = params;
183
184        let local_var_configuration = &self.configuration;
185
186        let local_var_client = &local_var_configuration.client;
187
188        let local_var_uri_str = format!("{}/trading/orders", local_var_configuration.base_path);
189        let mut local_var_req_builder =
190            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
191
192        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
193            local_var_req_builder = local_var_req_builder
194                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
195        }
196        if let Some(local_var_param_value) = idempotency_key {
197            local_var_req_builder =
198                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
199        }
200        local_var_req_builder = local_var_req_builder.json(&create_order_request);
201
202        let local_var_req = local_var_req_builder.build()?;
203        let local_var_resp = local_var_client.execute(local_var_req).await?;
204
205        let local_var_status = local_var_resp.status();
206        let local_var_content_type = local_var_resp
207            .headers()
208            .get("content-type")
209            .and_then(|v| v.to_str().ok())
210            .unwrap_or("application/octet-stream");
211        let local_var_content_type = super::ContentType::from(local_var_content_type);
212        let local_var_content = local_var_resp.text().await?;
213
214        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
215            match local_var_content_type {
216                ContentType::Json => {
217                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
218                }
219                ContentType::Text => {
220                    return Err(Error::from(serde_json::Error::custom(
221                        "Received `text/plain` content type response that cannot be converted to \
222                         `models::OrderDetails`",
223                    )));
224                }
225                ContentType::Unsupported(local_var_unknown_type) => {
226                    return Err(Error::from(serde_json::Error::custom(format!(
227                        "Received `{local_var_unknown_type}` content type response that cannot be \
228                         converted to `models::OrderDetails`"
229                    ))));
230                }
231            }
232        } else {
233            let local_var_entity: Option<CreateOrderError> =
234                serde_json::from_str(&local_var_content).ok();
235            let local_var_error = ResponseContent {
236                status: local_var_status,
237                content: local_var_content,
238                entity: local_var_entity,
239            };
240            Err(Error::ResponseError(local_var_error))
241        }
242    }
243
244    /// Generate a time-limited quote for asset conversion, providing exchange
245    /// rate and amount calculations.  **Note:** These endpoints are currently
246    /// in beta and might be subject to changes. If you want to participate and
247    /// learn more about the Fireblocks Trading, please contact your Fireblocks
248    /// Customer Success Manager or send an email to CSM@fireblocks.com.
249    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin, Signer,
250    /// Editor.
251    async fn create_quote(
252        &self,
253        params: CreateQuoteParams,
254    ) -> Result<models::QuotesResponse, Error<CreateQuoteError>> {
255        let CreateQuoteParams {
256            create_quote,
257            idempotency_key,
258        } = params;
259
260        let local_var_configuration = &self.configuration;
261
262        let local_var_client = &local_var_configuration.client;
263
264        let local_var_uri_str = format!("{}/trading/quotes", local_var_configuration.base_path);
265        let mut local_var_req_builder =
266            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
267
268        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
269            local_var_req_builder = local_var_req_builder
270                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
271        }
272        if let Some(local_var_param_value) = idempotency_key {
273            local_var_req_builder =
274                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
275        }
276        local_var_req_builder = local_var_req_builder.json(&create_quote);
277
278        let local_var_req = local_var_req_builder.build()?;
279        let local_var_resp = local_var_client.execute(local_var_req).await?;
280
281        let local_var_status = local_var_resp.status();
282        let local_var_content_type = local_var_resp
283            .headers()
284            .get("content-type")
285            .and_then(|v| v.to_str().ok())
286            .unwrap_or("application/octet-stream");
287        let local_var_content_type = super::ContentType::from(local_var_content_type);
288        let local_var_content = local_var_resp.text().await?;
289
290        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
291            match local_var_content_type {
292                ContentType::Json => {
293                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
294                }
295                ContentType::Text => {
296                    return Err(Error::from(serde_json::Error::custom(
297                        "Received `text/plain` content type response that cannot be converted to \
298                         `models::QuotesResponse`",
299                    )));
300                }
301                ContentType::Unsupported(local_var_unknown_type) => {
302                    return Err(Error::from(serde_json::Error::custom(format!(
303                        "Received `{local_var_unknown_type}` content type response that cannot be \
304                         converted to `models::QuotesResponse`"
305                    ))));
306                }
307            }
308        } else {
309            let local_var_entity: Option<CreateQuoteError> =
310                serde_json::from_str(&local_var_content).ok();
311            let local_var_error = ResponseContent {
312                status: local_var_status,
313                content: local_var_content,
314                entity: local_var_entity,
315            };
316            Err(Error::ResponseError(local_var_error))
317        }
318    }
319
320    /// Retrieve detailed information about a specific order by its ID.
321    /// **Note:** These endpoints are currently in beta and might be subject to
322    /// changes. If you want to participate and learn more about the Fireblocks
323    /// Trading, please contact your Fireblocks Customer Success Manager or send
324    /// an email to CSM@fireblocks.com.  **Endpoint Permissions:** Owner, Admin,
325    /// Non-Signing Admin, Signer, Approver, Editor, Viewer.
326    async fn get_order(
327        &self,
328        params: GetOrderParams,
329    ) -> Result<models::OrderDetails, Error<GetOrderError>> {
330        let GetOrderParams { order_id } = params;
331
332        let local_var_configuration = &self.configuration;
333
334        let local_var_client = &local_var_configuration.client;
335
336        let local_var_uri_str = format!(
337            "{}/trading/orders/{orderId}",
338            local_var_configuration.base_path,
339            orderId = crate::apis::urlencode(order_id)
340        );
341        let mut local_var_req_builder =
342            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
343
344        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
345            local_var_req_builder = local_var_req_builder
346                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
347        }
348
349        let local_var_req = local_var_req_builder.build()?;
350        let local_var_resp = local_var_client.execute(local_var_req).await?;
351
352        let local_var_status = local_var_resp.status();
353        let local_var_content_type = local_var_resp
354            .headers()
355            .get("content-type")
356            .and_then(|v| v.to_str().ok())
357            .unwrap_or("application/octet-stream");
358        let local_var_content_type = super::ContentType::from(local_var_content_type);
359        let local_var_content = local_var_resp.text().await?;
360
361        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
362            match local_var_content_type {
363                ContentType::Json => {
364                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
365                }
366                ContentType::Text => {
367                    return Err(Error::from(serde_json::Error::custom(
368                        "Received `text/plain` content type response that cannot be converted to \
369                         `models::OrderDetails`",
370                    )));
371                }
372                ContentType::Unsupported(local_var_unknown_type) => {
373                    return Err(Error::from(serde_json::Error::custom(format!(
374                        "Received `{local_var_unknown_type}` content type response that cannot be \
375                         converted to `models::OrderDetails`"
376                    ))));
377                }
378            }
379        } else {
380            let local_var_entity: Option<GetOrderError> =
381                serde_json::from_str(&local_var_content).ok();
382            let local_var_error = ResponseContent {
383                status: local_var_status,
384                content: local_var_content,
385                entity: local_var_entity,
386            };
387            Err(Error::ResponseError(local_var_error))
388        }
389    }
390
391    /// Retrieve a paginated list of orders with optional filtering by account,
392    /// provider, status, and time range.  **Note:** These endpoints are
393    /// currently in beta and might be subject to changes. If you want to
394    /// participate and learn more about the Fireblocks Trading, please contact
395    /// your Fireblocks Customer Success Manager or send an email to
396    /// CSM@fireblocks.com.  **Endpoint Permissions:** Owner, Admin, Non-Signing
397    /// Admin, Signer, Approver, Editor, Viewer.
398    async fn get_orders(
399        &self,
400        params: GetOrdersParams,
401    ) -> Result<models::GetOrdersResponse, Error<GetOrdersError>> {
402        let GetOrdersParams {
403            page_size,
404            page_cursor,
405            order,
406            account_id,
407            provider_id,
408            statuses,
409            start_time,
410            end_time,
411            asset_conversion_type,
412        } = params;
413
414        let local_var_configuration = &self.configuration;
415
416        let local_var_client = &local_var_configuration.client;
417
418        let local_var_uri_str = format!("{}/trading/orders", local_var_configuration.base_path);
419        let mut local_var_req_builder =
420            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
421
422        local_var_req_builder =
423            local_var_req_builder.query(&[("pageSize", &page_size.to_string())]);
424        if let Some(ref param_value) = page_cursor {
425            local_var_req_builder =
426                local_var_req_builder.query(&[("pageCursor", &param_value.to_string())]);
427        }
428        if let Some(ref param_value) = order {
429            local_var_req_builder =
430                local_var_req_builder.query(&[("order", &param_value.to_string())]);
431        }
432        if let Some(ref param_value) = account_id {
433            local_var_req_builder = match "multi" {
434                "multi" => local_var_req_builder.query(
435                    &param_value
436                        .into_iter()
437                        .map(|p| ("accountId".to_owned(), p.to_string()))
438                        .collect::<Vec<(std::string::String, std::string::String)>>(),
439                ),
440                _ => local_var_req_builder.query(&[(
441                    "accountId",
442                    &param_value
443                        .into_iter()
444                        .map(|p| p.to_string())
445                        .collect::<Vec<String>>()
446                        .join(",")
447                        .to_string(),
448                )]),
449            };
450        }
451        if let Some(ref param_value) = provider_id {
452            local_var_req_builder = match "multi" {
453                "multi" => local_var_req_builder.query(
454                    &param_value
455                        .into_iter()
456                        .map(|p| ("providerId".to_owned(), p.to_string()))
457                        .collect::<Vec<(std::string::String, std::string::String)>>(),
458                ),
459                _ => local_var_req_builder.query(&[(
460                    "providerId",
461                    &param_value
462                        .into_iter()
463                        .map(|p| p.to_string())
464                        .collect::<Vec<String>>()
465                        .join(",")
466                        .to_string(),
467                )]),
468            };
469        }
470        if let Some(ref param_value) = statuses {
471            local_var_req_builder = match "multi" {
472                "multi" => local_var_req_builder.query(
473                    &param_value
474                        .into_iter()
475                        .map(|p| ("statuses".to_owned(), p.to_string()))
476                        .collect::<Vec<(std::string::String, std::string::String)>>(),
477                ),
478                _ => local_var_req_builder.query(&[(
479                    "statuses",
480                    &param_value
481                        .into_iter()
482                        .map(|p| p.to_string())
483                        .collect::<Vec<String>>()
484                        .join(",")
485                        .to_string(),
486                )]),
487            };
488        }
489        if let Some(ref param_value) = start_time {
490            local_var_req_builder =
491                local_var_req_builder.query(&[("startTime", &param_value.to_string())]);
492        }
493        if let Some(ref param_value) = end_time {
494            local_var_req_builder =
495                local_var_req_builder.query(&[("endTime", &param_value.to_string())]);
496        }
497        if let Some(ref param_value) = asset_conversion_type {
498            local_var_req_builder =
499                local_var_req_builder.query(&[("assetConversionType", &param_value.to_string())]);
500        }
501        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
502            local_var_req_builder = local_var_req_builder
503                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
504        }
505
506        let local_var_req = local_var_req_builder.build()?;
507        let local_var_resp = local_var_client.execute(local_var_req).await?;
508
509        let local_var_status = local_var_resp.status();
510        let local_var_content_type = local_var_resp
511            .headers()
512            .get("content-type")
513            .and_then(|v| v.to_str().ok())
514            .unwrap_or("application/octet-stream");
515        let local_var_content_type = super::ContentType::from(local_var_content_type);
516        let local_var_content = local_var_resp.text().await?;
517
518        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
519            match local_var_content_type {
520                ContentType::Json => {
521                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
522                }
523                ContentType::Text => {
524                    return Err(Error::from(serde_json::Error::custom(
525                        "Received `text/plain` content type response that cannot be converted to \
526                         `models::GetOrdersResponse`",
527                    )));
528                }
529                ContentType::Unsupported(local_var_unknown_type) => {
530                    return Err(Error::from(serde_json::Error::custom(format!(
531                        "Received `{local_var_unknown_type}` content type response that cannot be \
532                         converted to `models::GetOrdersResponse`"
533                    ))));
534                }
535            }
536        } else {
537            let local_var_entity: Option<GetOrdersError> =
538                serde_json::from_str(&local_var_content).ok();
539            let local_var_error = ResponseContent {
540                status: local_var_status,
541                content: local_var_content,
542                entity: local_var_entity,
543            };
544            Err(Error::ResponseError(local_var_error))
545        }
546    }
547
548    /// Retrieve a list of all available external providers supporting trading
549    /// activities through the platform.  **Note:** These endpoints are
550    /// currently in beta and might be subject to changes. If you want to
551    /// participate and learn more about the Fireblocks Trading, please contact
552    /// your Fireblocks Customer Success Manager or send an email to
553    /// CSM@fireblocks.com.  **Endpoint Permission:** Owner, Admin, Non-Signing
554    /// Admin, Signer, Approver, Editor, Viewer.
555    async fn get_trading_providers(
556        &self,
557        params: GetTradingProvidersParams,
558    ) -> Result<models::ProvidersListResponse, Error<GetTradingProvidersError>> {
559        let GetTradingProvidersParams {
560            page_size,
561            page_cursor,
562        } = params;
563
564        let local_var_configuration = &self.configuration;
565
566        let local_var_client = &local_var_configuration.client;
567
568        let local_var_uri_str = format!("{}/trading/providers", local_var_configuration.base_path);
569        let mut local_var_req_builder =
570            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
571
572        if let Some(ref param_value) = page_size {
573            local_var_req_builder =
574                local_var_req_builder.query(&[("pageSize", &param_value.to_string())]);
575        }
576        if let Some(ref param_value) = page_cursor {
577            local_var_req_builder =
578                local_var_req_builder.query(&[("pageCursor", &param_value.to_string())]);
579        }
580        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
581            local_var_req_builder = local_var_req_builder
582                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
583        }
584
585        let local_var_req = local_var_req_builder.build()?;
586        let local_var_resp = local_var_client.execute(local_var_req).await?;
587
588        let local_var_status = local_var_resp.status();
589        let local_var_content_type = local_var_resp
590            .headers()
591            .get("content-type")
592            .and_then(|v| v.to_str().ok())
593            .unwrap_or("application/octet-stream");
594        let local_var_content_type = super::ContentType::from(local_var_content_type);
595        let local_var_content = local_var_resp.text().await?;
596
597        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
598            match local_var_content_type {
599                ContentType::Json => {
600                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
601                }
602                ContentType::Text => {
603                    return Err(Error::from(serde_json::Error::custom(
604                        "Received `text/plain` content type response that cannot be converted to \
605                         `models::ProvidersListResponse`",
606                    )));
607                }
608                ContentType::Unsupported(local_var_unknown_type) => {
609                    return Err(Error::from(serde_json::Error::custom(format!(
610                        "Received `{local_var_unknown_type}` content type response that cannot be \
611                         converted to `models::ProvidersListResponse`"
612                    ))));
613                }
614            }
615        } else {
616            let local_var_entity: Option<GetTradingProvidersError> =
617                serde_json::from_str(&local_var_content).ok();
618            let local_var_error = ResponseContent {
619                status: local_var_status,
620                content: local_var_content,
621                entity: local_var_entity,
622            };
623            Err(Error::ResponseError(local_var_error))
624        }
625    }
626}
627
628/// struct for typed errors of method [`TradingBetaApi::create_order`]
629#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum CreateOrderError {
632    Status404(models::TradingErrorResponse),
633    Status401(models::TradingErrorResponse),
634    Status5XX(models::TradingErrorResponse),
635    UnknownValue(serde_json::Value),
636}
637
638/// struct for typed errors of method [`TradingBetaApi::create_quote`]
639#[derive(Debug, Clone, Serialize, Deserialize)]
640#[serde(untagged)]
641pub enum CreateQuoteError {
642    Status404(models::TradingErrorResponse),
643    Status401(models::TradingErrorResponse),
644    Status5XX(models::TradingErrorResponse),
645    UnknownValue(serde_json::Value),
646}
647
648/// struct for typed errors of method [`TradingBetaApi::get_order`]
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[serde(untagged)]
651pub enum GetOrderError {
652    Status404(models::TradingErrorResponse),
653    Status401(models::TradingErrorResponse),
654    Status5XX(models::TradingErrorResponse),
655    UnknownValue(serde_json::Value),
656}
657
658/// struct for typed errors of method [`TradingBetaApi::get_orders`]
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum GetOrdersError {
662    Status404(models::TradingErrorResponse),
663    Status401(models::TradingErrorResponse),
664    Status5XX(models::TradingErrorResponse),
665    UnknownValue(serde_json::Value),
666}
667
668/// struct for typed errors of method [`TradingBetaApi::get_trading_providers`]
669#[derive(Debug, Clone, Serialize, Deserialize)]
670#[serde(untagged)]
671pub enum GetTradingProvidersError {
672    Status401(models::TradingErrorResponse),
673    Status5XX(models::TradingErrorResponse),
674    UnknownValue(serde_json::Value),
675}