algonaut_indexer 0.7.0

Algorand ledger analytics API.
Documentation
/*
 * Indexer
 *
 * Algorand ledger analytics API.
 *
 * The version of the OpenAPI document: 2.0
 *
 * Generated by: https://openapi-generator.tech
 */

use algonaut_encoding::Bytes;

/// ApplicationParams : Stores the global information associated with an application.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApplicationParams {
    /// \\[approv\\] approval program.
    #[serde(rename = "approval-program")]
    pub approval_program: Bytes,
    /// \\[clearp\\] approval program.
    #[serde(rename = "clear-state-program")]
    pub clear_state_program: Bytes,
    /// The address that created this application. This is the address where the parameters and global state for this application can be found.
    #[serde(rename = "creator", skip_serializing_if = "Option::is_none")]
    pub creator: Option<String>,
    /// \\[epp\\] the amount of extra program pages available to this app.
    #[serde(
        rename = "extra-program-pages",
        skip_serializing_if = "Option::is_none"
    )]
    pub extra_program_pages: Option<u64>,
    /// Represents a key-value store for use in an application.
    #[serde(rename = "global-state", skip_serializing_if = "Option::is_none")]
    pub global_state: Option<Vec<crate::models::TealKeyValue>>,
    #[serde(
        rename = "global-state-schema",
        skip_serializing_if = "Option::is_none"
    )]
    pub global_state_schema: Option<Box<crate::models::ApplicationStateSchema>>,
    #[serde(rename = "local-state-schema", skip_serializing_if = "Option::is_none")]
    pub local_state_schema: Option<Box<crate::models::ApplicationStateSchema>>,
}

impl ApplicationParams {
    /// Stores the global information associated with an application.
    pub fn new(approval_program: Bytes, clear_state_program: Bytes) -> ApplicationParams {
        ApplicationParams {
            approval_program,
            clear_state_program,
            creator: None,
            extra_program_pages: None,
            global_state: None,
            global_state_schema: None,
            local_state_schema: None,
        }
    }
}