oanda_v20_openapi/models/transaction.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/// Transaction : The base Transaction specification. Specifies properties that are common between all Transaction.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Transaction {
17 /// The Transaction's Identifier.
18 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19 pub id: Option<i32>,
20 /// 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).
21 #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
22 pub time: Option<String>,
23 /// The ID of the user that initiated the creation of the Transaction.
24 #[serde(rename = "userID", skip_serializing_if = "Option::is_none")]
25 pub user_id: Option<i32>,
26 /// The Account's identifier
27 #[serde(rename = "accountID", skip_serializing_if = "Option::is_none")]
28 pub account_id: Option<String>,
29 /// The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.
30 #[serde(rename = "batchID", skip_serializing_if = "Option::is_none")]
31 pub batch_id: Option<i32>,
32 /// The Request ID of the request which generated the transaction.
33 #[serde(rename = "requestID", skip_serializing_if = "Option::is_none")]
34 pub request_id: Option<String>,
35 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
36 pub r#type: Option<models::TransactionType>,
37}
38
39impl Transaction {
40 /// The base Transaction specification. Specifies properties that are common between all Transaction.
41 pub fn new() -> Transaction {
42 Transaction {
43 id: None,
44 time: None,
45 user_id: None,
46 account_id: None,
47 batch_id: None,
48 request_id: None,
49 r#type: None,
50 }
51 }
52}
53