algonaut_algod 0.6.0

API endpoint for algod operations.
Documentation
/*
 * Algod REST API.
 *
 * API endpoint for algod operations.
 *
 * The version of the OpenAPI document: 0.0.1
 * Contact: contact@algorand.com
 * 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")]
    pub creator: 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,
        creator: String,
    ) -> ApplicationParams {
        ApplicationParams {
            approval_program,
            clear_state_program,
            creator,
            extra_program_pages: None,
            global_state: None,
            global_state_schema: None,
            local_state_schema: None,
        }
    }
}