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};

/// TransactionHeartbeat : A TransactionHeartbeat object is injected into the Transaction stream to ensure that the HTTP connection remains active.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionHeartbeat {
    /// The string \"HEARTBEAT\"
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// The ID of the most recent Transaction created for the Account
    #[serde(rename = "lastTransactionID", skip_serializing_if = "Option::is_none")]
    pub last_transaction_id: Option<String>,
    /// 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>,
}

impl TransactionHeartbeat {
    /// A TransactionHeartbeat object is injected into the Transaction stream to ensure that the HTTP connection remains active.
    pub fn new() -> TransactionHeartbeat {
        TransactionHeartbeat {
            r#type: None,
            last_transaction_id: None,
            time: None,
        }
    }
}
/// The string \"HEARTBEAT\"
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "HEARTBEAT")]
    Heartbeat,
}

impl Default for Type {
    fn default() -> Type {
        Self::Heartbeat
    }
}