lighter-rust 0.2.0

A comprehensive Rust SDK for the Lighter trading platform with async/await, WebSocket support, and Ethereum wallet integration
/*
 *
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document:
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReqGetPositionFunding {
    #[serde(rename = "auth", skip_serializing_if = "Option::is_none")]
    pub auth: Option<String>,
    #[serde(rename = "account_index")]
    pub account_index: i64,
    #[serde(rename = "market_id", skip_serializing_if = "Option::is_none")]
    pub market_id: Option<i32>,
    #[serde(rename = "cursor", skip_serializing_if = "Option::is_none")]
    pub cursor: Option<String>,
    #[serde(rename = "limit")]
    pub limit: i64,
    #[serde(rename = "side", skip_serializing_if = "Option::is_none")]
    pub side: Option<Side>,
}

impl ReqGetPositionFunding {
    pub fn new(account_index: i64, limit: i64) -> ReqGetPositionFunding {
        ReqGetPositionFunding {
            auth: None,
            account_index,
            market_id: None,
            cursor: None,
            limit,
            side: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Side {
    #[serde(rename = "long")]
    Long,
    #[serde(rename = "short")]
    Short,
    #[serde(rename = "all")]
    All,
}

impl Default for Side {
    fn default() -> Side {
        Self::Long
    }
}