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 PublicPoolMetadata {
    #[serde(rename = "code")]
    pub code: i32,
    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(rename = "account_index")]
    pub account_index: i64,
    #[serde(rename = "account_type")]
    pub account_type: i32,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "l1_address")]
    pub l1_address: String,
    #[serde(rename = "annual_percentage_yield")]
    pub annual_percentage_yield: f64,
    #[serde(rename = "status")]
    pub status: i32,
    #[serde(rename = "operator_fee")]
    pub operator_fee: String,
    #[serde(rename = "total_asset_value")]
    pub total_asset_value: String,
    #[serde(rename = "total_shares")]
    pub total_shares: i64,
    #[serde(rename = "account_share", skip_serializing_if = "Option::is_none")]
    pub account_share: Option<Box<models::PublicPoolShare>>,
}

impl PublicPoolMetadata {
    pub fn new(
        code: i32,
        account_index: i64,
        account_type: i32,
        name: String,
        l1_address: String,
        annual_percentage_yield: f64,
        status: i32,
        operator_fee: String,
        total_asset_value: String,
        total_shares: i64,
    ) -> PublicPoolMetadata {
        PublicPoolMetadata {
            code,
            message: None,
            account_index,
            account_type,
            name,
            l1_address,
            annual_percentage_yield,
            status,
            operator_fee,
            total_asset_value,
            total_shares,
            account_share: None,
        }
    }
}