oanda-v20-openapi 0.2.1

The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
Documentation
/*
 * OANDA v20 API
 *
 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * The version of the OpenAPI document: 0.2.1
 * Contact: jmicoud02@gmail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// OrderCancelTransaction : An OrderCancelTransaction represents the cancellation of an Order in the client's Account.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderCancelTransaction {
    /// The Transaction's Identifier.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// A date and time value using either RFC3339 or UNIX time representation. The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
    pub time: Option<String>,
    /// The ID of the user that initiated the creation of the Transaction.
    #[serde(rename = "userID", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<i32>,
    /// The Account's identifier
    #[serde(rename = "accountID", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.
    #[serde(rename = "batchID", skip_serializing_if = "Option::is_none")]
    pub batch_id: Option<i32>,
    /// The Request ID of the request which generated the transaction.
    #[serde(rename = "requestID", skip_serializing_if = "Option::is_none")]
    pub request_id: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<models::TransactionType>,
    /// The ID of the Order cancelled
    #[serde(rename = "orderID", skip_serializing_if = "Option::is_none")]
    pub order_id: Option<i32>,
    /// The client ID of the Order cancelled (only provided if the Order has a client Order ID).
    #[serde(rename = "clientOrderID", skip_serializing_if = "Option::is_none")]
    pub client_order_id: Option<String>,
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<models::OrderCancelReason>,
    /// The ID of the Order that replaced this Order (only provided if this Order was cancelled for replacement).
    #[serde(rename = "replacedByOrderID", skip_serializing_if = "Option::is_none")]
    pub replaced_by_order_id: Option<i32>,
}

impl OrderCancelTransaction {
    /// An OrderCancelTransaction represents the cancellation of an Order in the client's Account.
    pub fn new() -> OrderCancelTransaction {
        OrderCancelTransaction {
            id: None,
            time: None,
            user_id: None,
            account_id: None,
            batch_id: None,
            request_id: None,
            r#type: None,
            order_id: None,
            client_order_id: None,
            reason: None,
            replaced_by_order_id: None,
        }
    }
}