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
 */

/// ParticipationKey : Represents a participation key used by the node.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ParticipationKey {
    /// Address the key was generated for.
    #[serde(rename = "address")]
    pub address: String,
    /// When registered, this is the first round it may be used.
    #[serde(
        rename = "effective-first-valid",
        skip_serializing_if = "Option::is_none"
    )]
    pub effective_first_valid: Option<u64>,
    /// When registered, this is the last round it may be used.
    #[serde(
        rename = "effective-last-valid",
        skip_serializing_if = "Option::is_none"
    )]
    pub effective_last_valid: Option<u64>,
    /// The key's ParticipationID.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "key")]
    pub key: Box<crate::models::AccountParticipation>,
    /// Round when this key was last used to propose a block.
    #[serde(
        rename = "last-block-proposal",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_block_proposal: Option<u64>,
    /// Round when this key was last used to generate a state proof.
    #[serde(rename = "last-state-proof", skip_serializing_if = "Option::is_none")]
    pub last_state_proof: Option<u64>,
    /// Round when this key was last used to vote.
    #[serde(rename = "last-vote", skip_serializing_if = "Option::is_none")]
    pub last_vote: Option<u64>,
}

impl ParticipationKey {
    /// Represents a participation key used by the node.
    pub fn new(
        address: String,
        id: String,
        key: crate::models::AccountParticipation,
    ) -> ParticipationKey {
        ParticipationKey {
            address,
            effective_first_valid: None,
            effective_last_valid: None,
            id,
            key: Box::new(key),
            last_block_proposal: None,
            last_state_proof: None,
            last_vote: None,
        }
    }
}