use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Drep {
#[serde(rename = "drep_id")]
pub drep_id: String,
#[serde(rename = "hex")]
pub hex: String,
#[serde(rename = "amount")]
pub amount: String,
#[serde(rename = "active")]
pub active: bool,
#[serde(rename = "active_epoch", deserialize_with = "Option::deserialize")]
pub active_epoch: Option<i32>,
#[serde(rename = "has_script")]
pub has_script: bool,
#[serde(rename = "retired")]
pub retired: bool,
#[serde(rename = "expired")]
pub expired: bool,
#[serde(rename = "last_active_epoch", deserialize_with = "Option::deserialize")]
pub last_active_epoch: Option<i32>,
}
impl Drep {
pub fn new(drep_id: String, hex: String, amount: String, active: bool, active_epoch: Option<i32>, has_script: bool, retired: bool, expired: bool, last_active_epoch: Option<i32>) -> Drep {
Drep {
drep_id,
hex,
amount,
active,
active_epoch,
has_script,
retired,
expired,
last_active_epoch,
}
}
}