blockfrost_openapi/models/
epoch_content.rs1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct EpochContent {
6 #[serde(rename = "epoch")]
8 pub epoch: i32,
9 #[serde(rename = "start_time")]
11 pub start_time: i32,
12 #[serde(rename = "end_time")]
14 pub end_time: i32,
15 #[serde(rename = "first_block_time")]
17 pub first_block_time: i32,
18 #[serde(rename = "last_block_time")]
20 pub last_block_time: i32,
21 #[serde(rename = "block_count")]
23 pub block_count: i32,
24 #[serde(rename = "tx_count")]
26 pub tx_count: i32,
27 #[serde(rename = "output")]
29 pub output: String,
30 #[serde(rename = "fees")]
32 pub fees: String,
33 #[serde(rename = "active_stake", deserialize_with = "Option::deserialize")]
35 pub active_stake: Option<String>,
36}
37
38impl EpochContent {
39 pub fn new(epoch: i32, start_time: i32, end_time: i32, first_block_time: i32, last_block_time: i32, block_count: i32, tx_count: i32, output: String, fees: String, active_stake: Option<String>) -> EpochContent {
40 EpochContent {
41 epoch,
42 start_time,
43 end_time,
44 first_block_time,
45 last_block_time,
46 block_count,
47 tx_count,
48 output,
49 fees,
50 active_stake,
51 }
52 }
53}
54