Skip to main content

oanda_v20_openapi/models/
create_order_response.rs

1/*
2 * OANDA v20 API
3 *
4 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
5 *
6 * The version of the OpenAPI document: 0.2.1
7 * Contact: jmicoud02@gmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateOrderResponse {
16    /// The code of the error that has occurred. This field may not be returned for some errors.
17    #[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")]
18    pub error_code: Option<String>,
19    /// The human-readable description of the error that has occurred.
20    #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")]
21    pub error_message: Option<String>,
22    /// The ID of the most recent Transaction created for the Account
23    #[serde(rename = "lastTransactionID", skip_serializing_if = "Option::is_none")]
24    pub last_transaction_id: Option<String>,
25    /// The IDs of all Transactions that were created while satisfying the request.
26    #[serde(rename = "relatedTransactionIDs", skip_serializing_if = "Option::is_none")]
27    pub related_transaction_ids: Option<Vec<i32>>,
28    #[serde(rename = "orderCreateTransaction", skip_serializing_if = "Option::is_none")]
29    pub order_create_transaction: Option<Box<models::Transaction>>,
30    #[serde(rename = "orderFillTransaction", skip_serializing_if = "Option::is_none")]
31    pub order_fill_transaction: Option<Box<models::OrderFillTransaction>>,
32    #[serde(rename = "orderCancelTransaction", skip_serializing_if = "Option::is_none")]
33    pub order_cancel_transaction: Option<Box<models::OrderCancelTransaction>>,
34    #[serde(rename = "orderReissueTransaction", skip_serializing_if = "Option::is_none")]
35    pub order_reissue_transaction: Option<Box<models::Transaction>>,
36    #[serde(rename = "orderReissueRejectTransaction", skip_serializing_if = "Option::is_none")]
37    pub order_reissue_reject_transaction: Option<Box<models::Transaction>>,
38}
39
40impl CreateOrderResponse {
41    pub fn new() -> CreateOrderResponse {
42        CreateOrderResponse {
43            error_code: None,
44            error_message: None,
45            last_transaction_id: None,
46            related_transaction_ids: None,
47            order_create_transaction: None,
48            order_fill_transaction: None,
49            order_cancel_transaction: None,
50            order_reissue_transaction: None,
51            order_reissue_reject_transaction: None,
52        }
53    }
54}
55