/*
 * 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 GetCompressedAccountProofResponseValueV2 {
    /// A 32-byte hash represented as a base58 string.
    #[serde(rename = "hash")]
    pub hash: String,
    #[serde(rename = "leafIndex")]
    pub leaf_index: u32,
    #[serde(rename = "proof")]
    pub proof: Vec<String>,
    #[serde(rename = "proveByIndex")]
    pub prove_by_index: bool,
    /// A 32-byte hash represented as a base58 string.
    #[serde(rename = "root")]
    pub root: String,
    #[serde(rename = "rootSeq")]
    pub root_seq: u64,
    #[serde(rename = "treeContext")]
    pub tree_context: Box<models::TreeContextInfo>,
}

impl GetCompressedAccountProofResponseValueV2 {
    pub fn new(
        hash: String,
        leaf_index: u32,
        proof: Vec<String>,
        prove_by_index: bool,
        root: String,
        root_seq: u64,
        tree_context: models::TreeContextInfo,
    ) -> GetCompressedAccountProofResponseValueV2 {
        GetCompressedAccountProofResponseValueV2 {
            hash,
            leaf_index,
            proof,
            prove_by_index,
            root,
            root_seq,
            tree_context: Box::new(tree_context),
        }
    }
}
