bluefin_api 1.8.0

Bluefin API
Documentation
/*
 * Bluefin API
 *
 * Bluefin API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// AccountPositionUpdate : Details about an account position update.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountPositionUpdate {
    /// The symbol of the market.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The average entry price for the position.
    #[serde(rename = "avgEntryPriceE9")]
    pub avg_entry_price_e9: String,
    /// The leverage applied to the position.
    #[serde(rename = "clientSetLeverageE9")]
    pub client_set_leverage_e9: String,
    /// The liquidation price of the position.
    #[serde(rename = "liquidationPriceE9")]
    pub liquidation_price_e9: String,
    /// The current mark price of the position.
    #[serde(rename = "markPriceE9")]
    pub mark_price_e9: String,
    /// The notional value of the position.
    #[serde(rename = "notionalValueE9")]
    pub notional_value_e9: String,
    /// The size of the position.
    #[serde(rename = "sizeE9")]
    pub size_e9: String,
    /// The unrealized profit and loss for the position.
    #[serde(rename = "unrealizedPnlE9")]
    pub unrealized_pnl_e9: String,
    #[serde(rename = "side")]
    pub side: models::PositionSide,
    /// The margin required for the position.
    #[serde(rename = "marginRequiredE9")]
    pub margin_required_e9: String,
    /// The maintenance margin required for the position.
    #[serde(rename = "maintenanceMarginE9")]
    pub maintenance_margin_e9: String,
    /// Indicates if the position is isolated.
    #[serde(rename = "isIsolated")]
    pub is_isolated: bool,
    /// The isolated margin applied to the position.
    #[serde(rename = "isolatedMarginE9")]
    pub isolated_margin_e9: String,
    /// The last update time for the position in milliseconds.
    #[serde(rename = "updatedAtMillis")]
    pub updated_at_millis: i64,
}

impl AccountPositionUpdate {
    /// Details about an account position update.
    pub fn new(symbol: String, avg_entry_price_e9: String, client_set_leverage_e9: String, liquidation_price_e9: String, mark_price_e9: String, notional_value_e9: String, size_e9: String, unrealized_pnl_e9: String, side: models::PositionSide, margin_required_e9: String, maintenance_margin_e9: String, is_isolated: bool, isolated_margin_e9: String, updated_at_millis: i64) -> AccountPositionUpdate {
        AccountPositionUpdate {
            symbol,
            avg_entry_price_e9,
            client_set_leverage_e9,
            liquidation_price_e9,
            mark_price_e9,
            notional_value_e9,
            size_e9,
            unrealized_pnl_e9,
            side,
            margin_required_e9,
            maintenance_margin_e9,
            is_isolated,
            isolated_margin_e9,
            updated_at_millis,
        }
    }
}