/*
 * photon-indexer
 *
 * Solana indexer for general compression
 *
 * The version of the OpenAPI document: 0.50.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenData {
    #[serde(rename = "amount")]
    pub amount: u64,
    /// A Solana public key represented as a base58 string.
    #[serde(rename = "delegate", skip_serializing_if = "Option::is_none")]
    pub delegate: Option<String>,
    /// A Solana public key represented as a base58 string.
    #[serde(rename = "mint")]
    pub mint: String,
    /// A Solana public key represented as a base58 string.
    #[serde(rename = "owner")]
    pub owner: String,
    #[serde(rename = "state")]
    pub state: models::AccountState,
    /// A base 64 encoded string.
    #[serde(rename = "tlv", skip_serializing_if = "Option::is_none")]
    pub tlv: Option<String>,
}

impl TokenData {
    pub fn new(amount: u64, mint: String, owner: String, state: models::AccountState) -> TokenData {
        TokenData {
            amount,
            delegate: None,
            mint,
            owner,
            state,
            tlv: None,
        }
    }
}
