blockfrost_openapi/models/
drep.rs1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct Drep {
6 #[serde(rename = "drep_id")]
8 pub drep_id: String,
9 #[serde(rename = "hex")]
11 pub hex: String,
12 #[serde(rename = "amount")]
14 pub amount: String,
15 #[serde(rename = "active")]
17 pub active: bool,
18 #[serde(rename = "active_epoch", deserialize_with = "Option::deserialize")]
20 pub active_epoch: Option<i32>,
21 #[serde(rename = "has_script")]
23 pub has_script: bool,
24 #[serde(rename = "retired")]
26 pub retired: bool,
27 #[serde(rename = "expired")]
29 pub expired: bool,
30 #[serde(rename = "last_active_epoch", deserialize_with = "Option::deserialize")]
32 pub last_active_epoch: Option<i32>,
33}
34
35impl Drep {
36 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 {
37 Drep {
38 drep_id,
39 hex,
40 amount,
41 active,
42 active_epoch,
43 has_script,
44 retired,
45 expired,
46 last_active_epoch,
47 }
48 }
49}
50